2015-07-10 13:14:55 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file mapplication.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 8 7, 2015
|
|
|
|
**
|
|
|
|
** @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) 2015 Valentina project
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** 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 MAPPLICATION_H
|
|
|
|
#define MAPPLICATION_H
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
#include "../vpatterndb/vtranslatevars.h"
|
|
|
|
#include "../vmisc/def.h"
|
|
|
|
#include "../vmisc/vtapesettings.h"
|
2015-07-24 14:06:53 +02:00
|
|
|
#include "../vmisc/vabstractapplication.h"
|
2015-08-01 15:56:37 +02:00
|
|
|
#include "dialogs/dialogmdatabase.h"
|
2015-07-15 09:16:59 +02:00
|
|
|
|
|
|
|
class MApplication;// use in define
|
2015-07-10 13:14:55 +02:00
|
|
|
class TMainWindow;
|
|
|
|
class QLocalServer;
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
#if defined(qApp)
|
|
|
|
#undef qApp
|
|
|
|
#endif
|
2015-07-24 14:06:53 +02:00
|
|
|
#define qApp (static_cast<MApplication*>(VAbstractApplication::instance()))
|
2015-07-15 09:16:59 +02:00
|
|
|
|
2015-07-24 14:06:53 +02:00
|
|
|
class MApplication : public VAbstractApplication
|
2015-07-10 13:14:55 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MApplication(int &argc, char **argv);
|
|
|
|
virtual ~MApplication() Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
bool IsTheOnly() const;
|
|
|
|
TMainWindow *MainWindow();
|
|
|
|
QList<TMainWindow*> MainWindows();
|
|
|
|
|
|
|
|
#if defined(Q_WS_MAC)
|
|
|
|
bool event(QEvent *event);
|
|
|
|
#endif
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
void InitOptions();
|
2015-08-02 17:27:18 +02:00
|
|
|
void LoadTranslation();
|
2015-07-15 09:16:59 +02:00
|
|
|
|
|
|
|
virtual const VTranslateVars *TrVars();
|
|
|
|
void InitTrVars();
|
|
|
|
|
2015-07-24 14:06:53 +02:00
|
|
|
virtual void OpenSettings() Q_DECL_OVERRIDE;
|
|
|
|
VTapeSettings *TapeSettings();
|
2015-07-15 09:16:59 +02:00
|
|
|
|
|
|
|
QString translationsPath() const;
|
2015-08-01 11:39:32 +02:00
|
|
|
QString diagramsPath() const;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
2015-08-01 15:56:37 +02:00
|
|
|
void ShowDataBase();
|
2015-08-08 16:33:37 +02:00
|
|
|
void RetranslateGroups();
|
|
|
|
void RetranslateTables();
|
2015-08-01 15:56:37 +02:00
|
|
|
|
2015-08-20 12:56:55 +02:00
|
|
|
void ParseCommandLine(const QStringList &arguments);
|
|
|
|
|
2015-07-10 13:14:55 +02:00
|
|
|
public slots:
|
|
|
|
TMainWindow *NewMainWindow();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void OpenFile(const QString &path);
|
|
|
|
void NewLocalSocketConnection();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(MApplication)
|
|
|
|
QList<QPointer<TMainWindow> > mainWindows;
|
|
|
|
QLocalServer *localServer;
|
2015-07-15 09:16:59 +02:00
|
|
|
VTranslateVars *trVars;
|
2015-08-01 15:56:37 +02:00
|
|
|
QPointer<DialogMDataBase> dataBase;
|
2015-08-08 16:33:37 +02:00
|
|
|
QTranslator *qtTranslator;
|
|
|
|
QTranslator *qtxmlTranslator;
|
|
|
|
QTranslator *appTranslator;
|
|
|
|
QTranslator *pmsTranslator;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
2015-07-10 13:14:55 +02:00
|
|
|
void Clean();
|
2015-08-08 16:33:37 +02:00
|
|
|
void ClearTranslation();
|
2015-07-10 13:14:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPPLICATION_H
|