source: tspsg/src/mainwindow.h @ bc1b8837b6

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

Started documenting the source code in doxygen format.

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