The VApplication class reimplamentation QApplication class. More...
#include <vapplication.h>
Public Member Functions | |
VApplication (int &argc, char **argv) | |
VApplication constructor. More... | |
virtual | ~VApplication () Q_DECL_OVERRIDE |
virtual bool | notify (QObject *receiver, QEvent *event) Q_DECL_OVERRIDE |
notify Reimplemented from QApplication::notify(). More... | |
void | InitOptions () |
QString | SeamlyMeFilePath () const |
QTimer * | getAutoSaveTimer () const |
void | setAutoSaveTimer (QTimer *value) |
void | StartLogging () |
QTextStream * | LogFile () |
virtual const VTranslateVars * | TrVars () Q_DECL_OVERRIDE |
virtual bool | IsAppInGUIMode () const Q_DECL_OVERRIDE |
IsAppInGUIMode little hack that allow to have access to application state from VAbstractApplication class. More... | |
virtual void | OpenSettings () Q_DECL_OVERRIDE |
OpenSettings get acsses to application settings. More... | |
VSettings * | Seamly2DSettings () |
const VCommandLinePtr | CommandLine () const |
Public Member Functions inherited from VAbstractApplication | |
VAbstractApplication (int &argc, char **argv) | |
virtual | ~VAbstractApplication () Q_DECL_OVERRIDE |
QString | translationsPath (const QString &locale=QString()) const |
translationsPath return path to the root directory that contains QM files. More... | |
void | loadTranslations (const QString &locale) |
Unit | patternUnit () const |
const Unit * | patternUnitP () const |
void | setPatternUnit (const Unit &patternUnit) |
MeasurementsType | patternType () const |
void | setPatternType (const MeasurementsType &patternType) |
VCommonSettings * | Settings () |
getSettings hide settings constructor. More... | |
template<typename T > | |
QString | LocaleToString (const T &value) |
QGraphicsScene * | getCurrentScene () const |
void | setCurrentScene (QGraphicsScene **value) |
VMainGraphicsView * | getSceneView () const |
void | setSceneView (VMainGraphicsView *value) |
double | toPixel (double val) const |
double | fromPixel (double pix) const |
void | setCurrentDocument (VAbstractPattern *doc) |
VAbstractPattern * | getCurrentDocument () const |
void | setCurrentData (VContainer *data) |
VContainer * | getCurrentData () const |
bool | getOpeningPattern () const |
void | setOpeningPattern () |
QWidget * | getMainWindow () const |
void | setMainWindow (QWidget *value) |
QUndoStack * | getUndoStack () const |
QString | getFilePath () const |
void | setFilePath (const QString &value) |
Static Public Member Functions | |
static void | NewSeamly2D (const QString &fileName=QString()) |
NewSeamly2D start Seamly2D in new process, send path to pattern file in argument. More... | |
static QStringList | LabelLanguages () |
static bool | IsGUIMode () |
Protected Member Functions | |
virtual void | InitTrVars () Q_DECL_OVERRIDE |
virtual bool | event (QEvent *e) Q_DECL_OVERRIDE |
Private Member Functions | |
QString | LogDirPath () const |
QString | LogPath () const |
bool | CreateLogDir () const |
void | BeginLogging () |
void | ClearOldLogs () const |
Private Attributes | |
VTranslateVars * | trVars |
QTimer * | autoSaveTimer |
std::shared_ptr< VLockGuard< QFile > > | lockLog |
std::shared_ptr< QTextStream > | out |
Additional Inherited Members | |
Protected Attributes inherited from VAbstractApplication | |
QUndoStack * | undoStack |
QWidget * | mainWindow |
mainWindow pointer to main window. Usefull if need create modal dialog. Without pointer to main window modality doesn't work. More... | |
VCommonSettings * | settings |
settings pointer to settings. Help hide constructor creation settings. Make make code more readable. More... | |
QPointer< QTranslator > | qtTranslator |
QPointer< QTranslator > | qtxmlTranslator |
QPointer< QTranslator > | qtBaseTranslator |
QPointer< QTranslator > | appTranslator |
QPointer< QTranslator > | pmsTranslator |
The VApplication class reimplamentation QApplication class.
Definition at line 72 of file vapplication.h.
VApplication::VApplication | ( | int & | argc, |
char ** | argv | ||
) |
VApplication constructor.
argc | number arguments. |
argv | command line. |
Definition at line 275 of file vapplication.cpp.
References APP_VERSION_STR, VCommandLine::Get(), VAbstractApplication::loadTranslations(), OpenSettings(), VCommandLine::Reset(), VAbstractApplication::undoStack, VER_COMPANYDOMAIN_STR, VER_COMPANYNAME_STR, and VER_INTERNALNAME_STR.
|
virtual |
Definition at line 299 of file vapplication.cpp.
References VCommandLine::Reset(), and trVars.
|
private |
Definition at line 503 of file vapplication.cpp.
References lockLog, LogPath(), noisyFailureMsgHandler(), out, and VlpCreateLock().
Referenced by StartLogging().
|
private |
Definition at line 528 of file vapplication.cpp.
References DAYS_TO_KEEP_LOGS, VLockGuard< Guarded >::GetProtected(), and LogDirPath().
Referenced by StartLogging().
const VCommandLinePtr VApplication::CommandLine | ( | ) | const |
Definition at line 734 of file vapplication.cpp.
References VCommandLine::instance.
|
private |
Definition at line 492 of file vapplication.cpp.
References LogDirPath().
Referenced by StartLogging().
|
protectedvirtual |
Definition at line 662 of file vapplication.cpp.
References MainWindow::LoadPattern(), and VAbstractApplication::mainWindow.
Referenced by notify().
|
inline |
Definition at line 145 of file vapplication.h.
References autoSaveTimer.
void VApplication::InitOptions | ( | ) |
Definition at line 570 of file vapplication.cpp.
References APP_VERSION_STR, buildCompatibilityString(), VCommonSettings::GetDefPathIndividualMeasurements(), VCommonSettings::GetDefPathLabelTemplate(), VCommonSettings::GetDefPathMultisizeMeasurements(), VCommonSettings::GetDefPathTemplate(), IsGUIMode(), VAbstractApplication::loadTranslations(), OpenSettings(), Seamly2DSettings(), VAbstractApplication::settings, and StartLogging().
Referenced by main().
|
protectedvirtual |
Implements VAbstractApplication.
Definition at line 653 of file vapplication.cpp.
References trVars.
|
virtual |
IsAppInGUIMode little hack that allow to have access to application state from VAbstractApplication class.
Implements VAbstractApplication.
Definition at line 728 of file vapplication.cpp.
References IsGUIMode().
|
static |
Definition at line 719 of file vapplication.cpp.
References VCommandLine::instance.
Referenced by MainWindow::CheckPathToMeasurements(), ExportLayoutDialog::ExportLayoutDialog(), MainWindow::FullParseFile(), MainWindow::GlobalchangeDraftBlock(), MainWindow::IgnoreLocking(), InitOptions(), IsAppInGUIMode(), MainWindowsNoGUI::LayoutSettings(), VPattern::LiteParseTree(), MainWindow::LoadMeasurements(), MainWindow::LoadPattern(), main(), noisyFailureMsgHandler(), MainWindow::OpenMeasurementFile(), MainWindow::ProcessCMD(), MainWindow::setCurrentFile(), MainWindow::SetHeight(), MainWindow::SetSize(), and MainWindow::UpdateMeasurements().
|
static |
Definition at line 614 of file vapplication.cpp.
Referenced by VPattern::GetLabelBase(), and PreferencesConfigurationPage::PreferencesConfigurationPage().
|
private |
Definition at line 472 of file vapplication.cpp.
Referenced by ClearOldLogs(), CreateLogDir(), and LogPath().
QTextStream * VApplication::LogFile | ( | ) |
Definition at line 641 of file vapplication.cpp.
References out.
|
private |
Definition at line 486 of file vapplication.cpp.
References LogDirPath().
Referenced by BeginLogging().
|
static |
NewSeamly2D start Seamly2D in new process, send path to pattern file in argument.
fileName | path to pattern file. |
Definition at line 312 of file vapplication.cpp.
Referenced by MainWindow::OpenNewSeamly2D().
|
virtual |
notify Reimplemented from QApplication::notify().
receiver | receiver. |
event | event. |
Definition at line 353 of file vapplication.cpp.
References VExceptionObjectError::DetailedInformation(), VExceptionObjectError::ErrorMessage(), event(), V_EX_DATAERR, V_EX_SOFTWARE, and VException::what().
|
virtual |
OpenSettings get acsses to application settings.
Because we can create object in constructor we open file separately.
Implements VAbstractApplication.
Definition at line 705 of file vapplication.cpp.
References VAbstractApplication::settings.
Referenced by InitOptions(), and VApplication().
VSettings * VApplication::Seamly2DSettings | ( | ) |
Definition at line 712 of file vapplication.cpp.
References SCASSERT, and VAbstractApplication::settings.
Referenced by InitOptions().
QString VApplication::SeamlyMeFilePath | ( | ) | const |
Definition at line 419 of file vapplication.cpp.
|
inline |
Definition at line 151 of file vapplication.h.
References autoSaveTimer.
void VApplication::StartLogging | ( | ) |
Definition at line 628 of file vapplication.cpp.
References BeginLogging(), ClearOldLogs(), and CreateLogDir().
Referenced by InitOptions().
|
virtual |
Implements VAbstractApplication.
Definition at line 647 of file vapplication.cpp.
References trVars.
|
private |
Definition at line 118 of file vapplication.h.
Referenced by getAutoSaveTimer(), and setAutoSaveTimer().
|
private |
Definition at line 120 of file vapplication.h.
Referenced by BeginLogging().
|
private |
Definition at line 121 of file vapplication.h.
Referenced by BeginLogging(), and LogFile().
|
private |
Definition at line 117 of file vapplication.h.
Referenced by InitTrVars(), TrVars(), and ~VApplication().