source: tspsg/src/mainwindow.h @ 85ad815b0b

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

Some documentation updates.

  • 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/*!
31 * \file mainwindow.h
32 * \brief Defines MainWindow class.
33 */
34
35#include "globals.h"
36
37#include "ui_mainwindow.h"
38#include "settingsdialog.h"
39
40#include "tspsolver.h"
41#include "tspmodel.h"
42
43class MainWindow: public QMainWindow, Ui::MainWindow
44{
45        Q_OBJECT
46
47public:
48        MainWindow(QWidget *parent = 0);
49        void closeEvent(QCloseEvent *);
50
51private slots:
52        void actionFileNewTriggered();
53        void actionFileOpenTriggered();
54        void actionFileSaveTriggered();
55        void actionFileSaveAsTaskTriggered();
56        void actionFileSaveAsSolutionTriggered();
57        void actionSettingsPreferencesTriggered();
58        void actionSettingsLanguageAutodetectTriggered(bool);
59        void groupSettingsLanguageListTriggered(QAction *);
60        void actionHelpAboutTriggered();
61        void dataChanged();
62        void dataChanged(const QModelIndex &, const QModelIndex &);
63#ifndef QT_NO_PRINTER
64        void printPreview(QPrinter *printer);
65        void actionFilePrintPreviewTriggered();
66        void actionFilePrintTriggered();
67#endif // QT_NO_PRINTER
68        void buttonSolveClicked();
69        void buttonRandomClicked();
70        void buttonBackToTaskClicked();
71        void spinCitiesValueChanged(int);
72        void numCitiesChanged(int);
73
74private:
75        QSettings *settings;
76#ifndef QT_NO_PRINTER
77        QPrinter *printer;
78#endif // QT_NO_PRINTER
79        CTSPModel *tspmodel;
80        QString fileName;
81        QActionGroup *groupSettingsLanguageList;
82        QStringList output;
83        void enableSolutionActions(bool enable = true);
84        void initDocStyleSheet();
85        bool loadLanguage(QString lang = "");
86        void loadLangList();
87        bool maybeSave();
88        void outputMatrix(tMatrix, QStringList &, int nRow = -1, int nCol = -1);
89        void setFileName(QString fileName = trUtf8("Untitled") + ".tspt");
90        bool saveTask();
91};
92
93#endif // MAINWINDOW_H
Note: See TracBrowser for help on using the repository browser.