2016-07-25 18:23:00 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file
|
|
|
|
** @author Valentina Zhuravska <zhuravska19(at)gmail.com>
|
|
|
|
** @date 19 7, 2016
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2016-07-25 18:23:00 +02:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2016 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2016-07-25 18:23:00 +02:00
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** 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.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** 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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VABSTRACTMAINWINDOW_H
|
|
|
|
#define VABSTRACTMAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
|
2017-09-28 20:20:32 +02:00
|
|
|
struct VFinalMeasurement;
|
2017-05-12 14:09:19 +02:00
|
|
|
|
2021-09-25 11:57:15 +02:00
|
|
|
QT_WARNING_PUSH
|
|
|
|
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
2021-09-25 16:18:33 +02:00
|
|
|
QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
2021-09-25 11:57:15 +02:00
|
|
|
|
2016-07-25 18:23:00 +02:00
|
|
|
class VAbstractMainWindow : public QMainWindow
|
|
|
|
{
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_OBJECT // NOLINT
|
2023-07-13 16:49:20 +02:00
|
|
|
|
2016-07-25 18:23:00 +02:00
|
|
|
public:
|
|
|
|
explicit VAbstractMainWindow(QWidget *parent = nullptr);
|
2023-07-13 16:49:20 +02:00
|
|
|
~VAbstractMainWindow() override = default;
|
2016-07-25 18:23:00 +02:00
|
|
|
|
|
|
|
public slots:
|
2021-05-20 17:33:53 +02:00
|
|
|
virtual void ShowToolTip(const QString &toolTip);
|
2018-04-07 13:11:44 +02:00
|
|
|
virtual void UpdateVisibilityGroups();
|
|
|
|
virtual void UpdateDetailsList();
|
2018-04-17 08:56:41 +02:00
|
|
|
virtual void ZoomFitBestCurrent();
|
2023-11-07 10:20:31 +01:00
|
|
|
void WindowsLocale();
|
2017-04-12 08:49:05 +02:00
|
|
|
|
2017-04-12 14:50:48 +02:00
|
|
|
protected slots:
|
2017-09-27 12:25:18 +02:00
|
|
|
void ExportDataToCSV();
|
2023-11-15 08:04:50 +01:00
|
|
|
void AlwaysOnTop(bool state);
|
2017-04-12 14:50:48 +02:00
|
|
|
|
2017-04-12 08:49:05 +02:00
|
|
|
protected:
|
2021-09-14 18:47:41 +02:00
|
|
|
unsigned m_curFileFormatVersion;
|
2017-04-12 08:49:05 +02:00
|
|
|
QString m_curFileFormatVersionStr;
|
2023-07-13 16:49:20 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MaxRecentFiles = 5
|
|
|
|
};
|
2019-09-06 21:18:18 +02:00
|
|
|
QVector<QAction *> m_recentFileActs{QVector<QAction *>(MaxRecentFiles)};
|
|
|
|
QAction *m_separatorAct{nullptr};
|
2017-04-12 08:49:05 +02:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto ContinueFormatRewrite(const QString ¤tFormatVersion, const QString &maxFormatVersion) -> bool;
|
2020-10-25 14:25:57 +01:00
|
|
|
virtual void ToolBarStyle(QToolBar *bar) const;
|
2017-05-12 14:09:19 +02:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto CSVFilePath() -> QString;
|
2017-09-27 13:47:05 +02:00
|
|
|
|
2021-05-20 17:33:53 +02:00
|
|
|
virtual void ExportToCSVData(const QString &fileName, bool withHeader, int mib, const QChar &separator);
|
2017-09-27 13:47:05 +02:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
virtual auto RecentFileList() const -> QStringList = 0;
|
2019-09-06 21:18:18 +02:00
|
|
|
void UpdateRecentFileActions();
|
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
static auto CheckFilePermissions(const QString &path, QWidget *messageBoxParent = nullptr) -> bool;
|
2021-05-21 17:08:37 +02:00
|
|
|
|
2023-05-03 13:07:02 +02:00
|
|
|
auto IgnoreLocking(int error, const QString &path, bool guiMode) -> bool;
|
2021-05-21 16:17:22 +02:00
|
|
|
|
2017-04-12 08:49:05 +02:00
|
|
|
private:
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_DISABLE_COPY_MOVE(VAbstractMainWindow) // NOLINT
|
2016-07-25 18:23:00 +02:00
|
|
|
};
|
|
|
|
|
2021-09-25 11:57:15 +02:00
|
|
|
QT_WARNING_POP
|
|
|
|
|
2016-07-25 18:23:00 +02:00
|
|
|
#endif // VABSTRACTMAINWINDOW_H
|