source: tspsg/src/mainwindow.h @ caef58b531

0.1.3.145-beta1-symbian0.1.4.170-beta2-bb10appveyorimgbotreadme
Last change on this file since caef58b531 was caef58b531, checked in by Oleksii Serdiuk, 15 years ago

More code documentation.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*!
2 * \class MainWindow
3 * \brief Class for handling Main Window UI and logic.
4 * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
5 *
6 *  $Id$
7 *  $URL$
8 *
9 *  <b>TSPSG: TSP Solver and Generator</b>
10 *
11 *  This file is part of TSPSG.
12 *
13 *  TSPSG is free software: you can redistribute it and/or modify
14 *  it under the terms of the GNU General Public License as published by
15 *  the Free Software Foundation, either version 3 of the License, or
16 *  (at your option) any later version.
17 *
18 *  TSPSG is distributed in the hope that it will be useful,
19 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 *  GNU General Public License for more details.
22 *
23 *  You should have received a copy of the GNU General Public License
24 *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
25 */
26
27#ifndef MAINWINDOW_H
28#define MAINWINDOW_H
29
30#include "globals.h"
31
32#include "ui_mainwindow.h"
33#include "settingsdialog.h"
34
35#include "tspsolver.h"
36#include "tspmodel.h"
37
38class MainWindow: public QMainWindow, Ui::MainWindow
39{
40        Q_OBJECT
41
42public:
43        MainWindow(QWidget *parent = 0);
44        void closeEvent(QCloseEvent *);
45
46private slots:
47        void actionFileNewTriggered();
48        void actionFileOpenTriggered();
49        void actionFileSaveTriggered();
50        void actionFileSaveAsTaskTriggered();
51        void actionFileSaveAsSolutionTriggered();
52        void actionSettingsPreferencesTriggered();
53        void actionSettingsLanguageAutodetectTriggered(bool);
54        void groupSettingsLanguageListTriggered(QAction *);
55        void actionHelpAboutTriggered();
56        void dataChanged();
57        void dataChanged(const QModelIndex &, const QModelIndex &);
58#ifndef QT_NO_PRINTER
59        void printPreview(QPrinter *printer);
60        void actionFilePrintPreviewTriggered();
61        void actionFilePrintTriggered();
62#endif // QT_NO_PRINTER
63        void buttonSolveClicked();
64        void buttonRandomClicked();
65        void buttonBackToTaskClicked();
66        void spinCitiesValueChanged(int);
67        void numCitiesChanged(int);
68
69private:
70        QSettings *settings;
71#ifndef QT_NO_PRINTER
72        QPrinter *printer;
73#endif // QT_NO_PRINTER
74        CTSPModel *tspmodel;
75        QString fileName;
76        QActionGroup *groupSettingsLanguageList;
77        QStringList output;
78        void enableSolutionActions(bool enable = true);
79        void initDocStyleSheet();
80        bool loadLanguage(QString lang = "");
81        void loadLangList();
82        bool maybeSave();
83        void outputMatrix(tMatrix, QStringList &, int nRow = -1, int nCol = -1);
84        void setFileName(QString fileName = trUtf8("Untitled") + ".tspt");
85        bool saveTask();
86};
87
88#endif // MAINWINDOW_H
Note: See TracBrowser for help on using the repository browser.