2013-11-15 13:41:26 +01:00
|
|
|
/************************************************************************
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:50:05 +01:00
|
|
|
** @file mainwindow.h
|
2014-04-30 07:38:52 +02:00
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
** @date November 15, 2013
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2013 Valentina project
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-18 21:16:19 +02:00
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-18 21:16:19 +02:00
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
*************************************************************************/
|
2013-09-18 21:16:19 +02:00
|
|
|
|
2013-06-20 16:09:50 +02:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2013-07-03 14:29:26 +02:00
|
|
|
#include "widgets/vmaingraphicsscene.h"
|
2013-08-13 18:48:36 +02:00
|
|
|
#include "widgets/vmaingraphicsview.h"
|
2013-09-10 14:29:06 +02:00
|
|
|
#include "widgets/vitem.h"
|
|
|
|
#include "dialogs/dialogs.h"
|
2013-10-27 12:56:05 +01:00
|
|
|
#include "tools/vtooldetail.h"
|
2013-12-29 17:48:57 +01:00
|
|
|
#include "tools/vtooluniondetails.h"
|
2013-09-10 14:29:06 +02:00
|
|
|
#include "tools/drawTools/drawtools.h"
|
2013-07-13 12:51:31 +02:00
|
|
|
#include "xml/vdomdocument.h"
|
2013-06-20 16:09:50 +02:00
|
|
|
|
2013-11-04 21:35:15 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class MainWindow;
|
2013-06-20 16:09:50 +02:00
|
|
|
}
|
|
|
|
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief The MainWindow class main windows.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-11-04 21:35:15 +01:00
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-06-20 16:09:50 +02:00
|
|
|
public:
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief MainWindow constructor.
|
|
|
|
* @param parent parent widget.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-26 10:22:05 +01:00
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
2013-09-10 14:29:06 +02:00
|
|
|
~MainWindow();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-02-10 17:10:20 +01:00
|
|
|
* @brief LoadPattern open pattern file.
|
2014-01-23 11:11:42 +01:00
|
|
|
* @param fileName name of file.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
void LoadPattern(const QString &curFile);
|
2013-07-03 14:29:26 +02:00
|
|
|
public slots:
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief mouseMove save mouse position and show user.
|
|
|
|
* @param scenePos position mouse.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-11-06 22:11:12 +01:00
|
|
|
void mouseMove(const QPointF &scenePos);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ActionAroowTool set arrow tool. Cansel tool what was before.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ActionAroowTool();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ActionDraw show draw scene.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ActionDraw(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ActionDetails show details scene.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ActionDetails(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ActionNewDraw add to scene new pattern peace.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ActionNewDraw();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-02-10 17:10:20 +01:00
|
|
|
* @brief SaveAs save as pattern file.
|
|
|
|
* @return true for successes saving.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
bool SaveAs();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-02-10 17:10:20 +01:00
|
|
|
* @brief Save save pattern file.
|
|
|
|
* @return true for successes saving.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
bool Save();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-02-10 17:10:20 +01:00
|
|
|
* @brief Open ask user select pattern file.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
void Open();
|
2014-02-14 12:29:04 +01:00
|
|
|
/**
|
|
|
|
* @brief Options config dialog.
|
|
|
|
*/
|
|
|
|
void Options();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-02-10 17:10:20 +01:00
|
|
|
* @brief NewPattern create new empty pattern.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
void NewPattern();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ActionTable show table with variables.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ActionTable(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ActionHistory show tool history.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ActionHistory(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ActionLayout begin creation layout.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ActionLayout(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief currentDrawChanged change active pattern peace.
|
|
|
|
* @param index index in combobox.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void currentDrawChanged( int index );
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief OptionDraw help change name of pattern peace.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void OptionDraw();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief haveChange enable action save if we have unsaved change.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
void PatternWasModified();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ChangedSize change new size value.
|
|
|
|
* @param text value size.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ChangedSize(const QString &text);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ChangedGrowth change new height value.
|
|
|
|
* @param text value height.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-05 15:03:26 +01:00
|
|
|
void ChangedHeight(const QString & text);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedActionTable actions after closing table with variables.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedActionTable();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedActionHistory actions after closing history window with variables.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedActionHistory();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolEndLine handler tool endLine.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolEndLine(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolLine handler tool line.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolLine(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolAlongLine handler tool alongLine.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolAlongLine(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolShoulderPoint handler tool shoulderPoint.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolShoulderPoint(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolNormal handler tool normal.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolNormal(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolBisector handler tool bisector.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolBisector(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolLineIntersect handler tool lineIntersect.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolLineIntersect(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolSpline handler tool spline.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolSpline(bool checked);
|
2013-12-18 12:13:32 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolCutSpline handler tool CutSpline.
|
2013-12-18 12:13:32 +01:00
|
|
|
* @param checked true - button is checked
|
|
|
|
*/
|
|
|
|
void ToolCutSpline(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolArc handler tool arc.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolArc(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolSplinePath handler tool splinePath.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolSplinePath(bool checked);
|
2013-12-18 12:13:32 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolCutSplinePath handler tool CutSplinePath.
|
2013-12-18 12:13:32 +01:00
|
|
|
* @param checked true - button is checked
|
|
|
|
*/
|
|
|
|
void ToolCutSplinePath(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolPointOfContact handler tool pointOfContact.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolPointOfContact(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolDetail handler tool detail.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolDetail(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolHeight handler tool height.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-18 12:03:01 +02:00
|
|
|
void ToolHeight(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolTriangle handler tool triangle.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-18 20:20:54 +02:00
|
|
|
void ToolTriangle(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolPointOfIntersection handler tool pointOfIntersection.
|
|
|
|
* @param checked true - button checked.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-21 16:09:05 +02:00
|
|
|
void ToolPointOfIntersection(bool checked);
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief ToolUnionDetails handler tool unionDetails.
|
|
|
|
* @param checked true - button checked.
|
|
|
|
*/
|
2013-12-29 17:48:57 +01:00
|
|
|
void ToolUnionDetails(bool checked);
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief ToolCutArc handler tool cutArc.
|
|
|
|
* @param checked true - button checked.
|
|
|
|
*/
|
2014-01-08 15:05:32 +01:00
|
|
|
void ToolCutArc(bool checked);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogEndLine actions after closing DialogEndLine.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogEndLine(int result);
|
2014-05-25 23:50:21 +02:00
|
|
|
/** // TODO ISSUE 79 : copy
|
|
|
|
* @brief ApplyDialogEndLine actions after apply in DialogEndLine.
|
|
|
|
*/
|
|
|
|
void ApplyDialogEndLine();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogLine actions after closing DialogLine.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogLine(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogAlongLine actions after closing DialogAlongLine.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogAlongLine(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogShoulderPoint actions after closing DialogShoulderPoint.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogShoulderPoint(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogNormal actions after closing DialogNormal.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogNormal(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogBisector actions after closing DialogBisector.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogBisector(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogLineIntersect actions after closing DialogLineIntersect.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogLineIntersect(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogSpline actions after closing DialogSpline.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogSpline(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogArc actions after closing DialogArc.
|
|
|
|
* @param result result of dialog working..
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogArc(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogSplinePath actions after closing DialogSplinePath.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogSplinePath(int result);
|
2013-12-18 12:13:32 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogCutSplinePath actions after closing DialogCutSplinePath.
|
|
|
|
* @param result result of dialog working.
|
2013-12-18 12:13:32 +01:00
|
|
|
*/
|
|
|
|
void ClosedDialogCutSplinePath(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogPointOfContact actions after closing DialogPointOfContact.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogPointOfContact(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogDetail actions after closing DialogDetail.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ClosedDialogDetail(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogHeight actions after closing DialogHeight.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-18 12:03:01 +02:00
|
|
|
void ClosedDialogHeight(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogTriangle actions after closing DialogTriangle.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-18 20:20:54 +02:00
|
|
|
void ClosedDialogTriangle(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogPointOfIntersection actions after closing DialogPointOfIntersection.
|
|
|
|
* @param result result of dialog working.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-21 16:09:05 +02:00
|
|
|
void ClosedDialogPointOfIntersection(int result);
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief ClosedDialogUnionDetails actions after closing DialogUnionDetails.
|
|
|
|
* @param result result of dialog working.
|
|
|
|
*/
|
2013-12-29 17:48:57 +01:00
|
|
|
void ClosedDialogUnionDetails(int result);
|
2013-12-18 12:13:32 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ClosedDialogCutSpline actions after closing DialogCutSpline.
|
|
|
|
* @param result result of dialog working.
|
2013-12-18 12:13:32 +01:00
|
|
|
*/
|
|
|
|
void ClosedDialogCutSpline(int result);
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief ClosedDialogCutArc actions after closing DialogCutArc.
|
|
|
|
* @param result result of dialog working.
|
|
|
|
*/
|
2014-01-08 15:05:32 +01:00
|
|
|
void ClosedDialogCutArc(int result);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief About show widows about.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-05 14:07:04 +02:00
|
|
|
void About();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief AboutQt show widows aboutQt.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-05 14:07:04 +02:00
|
|
|
void AboutQt();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-24 16:56:41 +01:00
|
|
|
* @brief ShowTool highlight tool.Tip show tools tooltip.
|
2014-01-23 11:11:42 +01:00
|
|
|
* @param toolTip tooltip text.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-07 13:11:56 +02:00
|
|
|
void ShowToolTip(const QString &toolTip);
|
2013-08-29 12:31:50 +02:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief tableClosed handle after close layout window.
|
2013-08-29 12:31:50 +02:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void tableClosed();
|
2014-02-10 20:31:22 +01:00
|
|
|
void OpenRecentFile();
|
2014-02-19 14:32:02 +01:00
|
|
|
void PatternProperties();
|
2013-08-29 12:31:50 +02:00
|
|
|
signals:
|
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ModelChosen emit after calculation all details.
|
|
|
|
* @param listDetails list of details.
|
2014-02-19 14:50:43 +01:00
|
|
|
* @param description pattern description.
|
2013-08-29 12:31:50 +02:00
|
|
|
*/
|
2014-02-19 14:50:43 +01:00
|
|
|
void ModelChosen(QVector<VItem*> listDetails, const QString &curFile, const QString &description);
|
2013-07-13 12:51:31 +02:00
|
|
|
protected:
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief keyPressEvent handle key press events.
|
|
|
|
* @param event key event.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
virtual void keyPressEvent ( QKeyEvent * event );
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief showEvent handle after show window.
|
|
|
|
* @param event show event.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
virtual void showEvent( QShowEvent *event );
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief closeEvent handle after close window.
|
|
|
|
* @param event close event.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-26 15:47:46 +02:00
|
|
|
virtual void closeEvent( QCloseEvent * event );
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief Clear reset to default window.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-23 15:17:15 +02:00
|
|
|
void Clear();
|
2013-06-20 16:09:50 +02:00
|
|
|
private:
|
2013-09-26 20:50:52 +02:00
|
|
|
Q_DISABLE_COPY(MainWindow)
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
|
|
|
* @brief ui keeps information about user interface
|
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
Ui::MainWindow *ui;
|
2013-12-29 17:48:57 +01:00
|
|
|
/**
|
|
|
|
* @brief pattern container with data (points, arcs, splines, spline paths, variables)
|
|
|
|
*/
|
|
|
|
VContainer *pattern;
|
|
|
|
/**
|
|
|
|
* @brief doc dom document container
|
|
|
|
*/
|
2014-02-25 15:02:09 +01:00
|
|
|
VPattern *doc;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief tool current tool
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-03-11 12:43:24 +01:00
|
|
|
Valentina::Tools tool;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief currentScene pointer to current scene.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
VMainGraphicsScene *currentScene;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief sceneDraw draw scene.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
VMainGraphicsScene *sceneDraw;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief sceneDetails details scene.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
VMainGraphicsScene *sceneDetails;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief mouseCoordinate pointer to label who show mouse coordinate.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
QLabel *mouseCoordinate;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief helpLabel help show tooltip.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
QLabel *helpLabel;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief view show current scene.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
VMainGraphicsView *view;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief isInitialized true after first show window.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
bool isInitialized;
|
|
|
|
DialogIncrements *dialogTable;
|
2014-02-06 14:57:23 +01:00
|
|
|
DialogTool *dialogTool;
|
2013-12-29 17:48:57 +01:00
|
|
|
DialogHistory *dialogHistory;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief comboBoxDraws comboc who show name of pattern peaces.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
QComboBox *comboBoxDraws;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief fileName name current pattern file.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
QString curFile;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief mode keep current draw mode.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-03-11 12:43:24 +01:00
|
|
|
Valentina::Draws mode;
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief currentDrawIndex save current selected pattern peace.
|
|
|
|
*/
|
2014-01-02 16:50:01 +01:00
|
|
|
qint32 currentDrawIndex;
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief currentToolBoxIndex save current set of tools.
|
|
|
|
*/
|
2014-01-08 21:45:42 +01:00
|
|
|
qint32 currentToolBoxIndex;
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief drawMode true if we current draw scene.
|
|
|
|
*/
|
2014-01-12 20:23:44 +01:00
|
|
|
bool drawMode;
|
2014-02-10 20:31:22 +01:00
|
|
|
enum { MaxRecentFiles = 5 };
|
|
|
|
QAction *recentFileActs[MaxRecentFiles];
|
|
|
|
QAction *separatorAct;
|
2014-02-14 12:29:04 +01:00
|
|
|
QTimer *autoSaveTimer;
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolBarOption enable option toolbar.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolBarOption();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ToolBarDraws enable draw toolbar.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ToolBarDraws();
|
2014-03-26 05:39:07 +01:00
|
|
|
void InitToolButtons();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief CanselTool cansel tool.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-01-16 14:54:01 +01:00
|
|
|
void CancelTool();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief ArrowTool enable arrow tool.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void ArrowTool();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief SetEnableWidgets enable action button.
|
|
|
|
* @param enable enable value.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void SetEnableWidgets(bool enable);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief SetEnableTool enable button.
|
|
|
|
* @param enable enable value.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void SetEnableTool(bool enable);
|
2014-01-23 11:11:42 +01:00
|
|
|
/**
|
|
|
|
* @brief SaveCurrentScene save scene options before set another.
|
|
|
|
*/
|
2014-01-11 15:09:44 +01:00
|
|
|
void SaveCurrentScene();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief RestoreCurrentScene restore scene options after change.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-01-23 11:11:42 +01:00
|
|
|
void RestoreCurrentScene();
|
2013-08-13 18:48:36 +02:00
|
|
|
template <typename Dialog, typename Func>
|
2014-05-25 23:50:21 +02:00
|
|
|
/** // TODO ISSUE 79 : delete
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief SetToolButton set tool and show dialog.
|
|
|
|
* @param checked true if tool button checked.
|
|
|
|
* @param t tool type.
|
|
|
|
* @param cursor path tool cursor icon.
|
|
|
|
* @param toolTip first tooltipe.
|
|
|
|
* @param closeDialogSlot function what handle after close dialog.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-03-11 12:43:24 +01:00
|
|
|
void SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
2014-02-06 14:57:23 +01:00
|
|
|
Func closeDialogSlot);
|
2014-05-25 23:50:21 +02:00
|
|
|
/** // TODO ISSUE 79 : copy
|
|
|
|
* @brief SetToolButton set tool and show dialog.
|
|
|
|
* @param checked true if tool button checked.
|
|
|
|
* @param t tool type.
|
|
|
|
* @param cursor path tool cursor icon.
|
|
|
|
* @param toolTip first tooltipe.
|
|
|
|
* @param closeDialogSlot function to handle close of dialog.
|
|
|
|
* @param applyDialogSlot function to handle apply in dialog.
|
|
|
|
*/
|
|
|
|
template <typename Dialog, typename Func, typename Func2>
|
|
|
|
void SetToolButton2(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
|
|
|
Func closeDialogSlot, Func2 applyDialogSlot);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief MinimumScrollBar set scroll bar to minimum.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
void MinimumScrollBar();
|
2014-02-06 14:57:23 +01:00
|
|
|
template <typename DrawTool>
|
2014-05-26 13:48:42 +02:00
|
|
|
/** // TODO ISSUE 79 : delete
|
2014-02-06 14:57:23 +01:00
|
|
|
* @brief ClosedDialog handle close dialog
|
|
|
|
* @param result result working dialog.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-06 14:57:23 +01:00
|
|
|
void ClosedDialog(int result);
|
2014-05-26 13:48:42 +02:00
|
|
|
template <typename DrawTool>
|
|
|
|
/** // TODO ISSUE 79 : rename
|
|
|
|
* @brief ClosedDialog handle close dialog
|
|
|
|
* @param result result working dialog.
|
|
|
|
*/
|
|
|
|
void ClosedDialog2(int result);
|
2014-05-25 23:50:21 +02:00
|
|
|
/** // TODO ISSUE 79 : copy
|
|
|
|
* @brief ApplyDialog handle apply in dialog
|
|
|
|
*/
|
|
|
|
template <typename DrawTool>
|
|
|
|
void ApplyDialog();
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-02-10 17:10:20 +01:00
|
|
|
* @brief SavePattern save pattern file.
|
2014-01-23 11:11:42 +01:00
|
|
|
* @param fileName pattern file name.
|
2014-02-10 17:10:20 +01:00
|
|
|
* @return true if all is good.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2014-02-10 17:10:20 +01:00
|
|
|
bool SavePattern(const QString &curFile);
|
2013-11-19 21:56:49 +01:00
|
|
|
/**
|
2014-01-23 11:11:42 +01:00
|
|
|
* @brief AutoSavePattern start safe saving.
|
2013-11-19 21:56:49 +01:00
|
|
|
*/
|
2013-10-04 16:00:19 +02:00
|
|
|
void AutoSavePattern();
|
2014-02-10 17:10:20 +01:00
|
|
|
/**
|
|
|
|
* @brief setCurrentFile the function is called to reset the state of a few variables when a file
|
|
|
|
* is loaded or saved, or when the user starts editing a new file (in which case fileName is empty).
|
|
|
|
* @param fileName file name.
|
|
|
|
*/
|
|
|
|
void setCurrentFile(const QString &fileName);
|
|
|
|
/**
|
|
|
|
* @brief strippedName the function call around curFile to exclude the path to the file.
|
|
|
|
* @param fullFileName full path to the file.
|
|
|
|
* @return file name.
|
|
|
|
*/
|
|
|
|
QString strippedName(const QString &fullFileName);
|
|
|
|
/**
|
|
|
|
* @brief ReadSettings read setting for app.
|
|
|
|
*/
|
|
|
|
void ReadSettings();
|
|
|
|
/**
|
|
|
|
* @brief WriteSettings save setting for app.
|
|
|
|
*/
|
|
|
|
void WriteSettings();
|
|
|
|
/**
|
|
|
|
* @brief MaybeSave The function is called to save pending changes.
|
|
|
|
* @return returns true in all cases, except when the user clicks Cancel.
|
|
|
|
*/
|
|
|
|
bool MaybeSave();
|
2014-02-10 20:31:22 +01:00
|
|
|
void UpdateRecentFileActions();
|
|
|
|
void CreateMenus();
|
|
|
|
void CreateActions();
|
2014-02-14 12:29:04 +01:00
|
|
|
void InitAutoSave();
|
2014-03-03 16:30:04 +01:00
|
|
|
QString PatternPieceName(const QString &text);
|
2014-03-24 16:02:57 +01:00
|
|
|
QString CheckPathToMeasurements(const QString &path, const Pattern::Measurements &patternType);
|
2013-06-20 16:09:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|