source: tspsg-svn/trunk/src/mainwindow.h @ 99

Last change on this file since 99 was 99, checked in by laleppa, 14 years ago
  • Fixed a bug when a solution couldn't be found for some tasks while the task had at least one solution (mostly, tasks with a lot of restrictions).
  • Fixed a bug when Save As dialog always appeared (even for non-Untitled files) when selecting Save in Unsaved Changes dialog.
  • Improved the solution algorithm.
  • Moved progress dialog from CTSPSolver to MainWindow?. CTSPSolver doesn't contain any GUI related code now.

+ Added routePartFound() signal to CTSPSolver which is emitted once every time a part of the route is found.
+ Added cancel() slot and wasCanceled() public function to CTSPSolver to be able to cancel a solution process and to know whether it was canceled.
+ Progress is now shown when generating a solution output.
+ Check for updates functionality (only in Windows version at this moment).

  • Property svn:keywords set to Id URL
File size: 3.3 KB
RevLine 
[65]1/*!
[67]2 * \file mainwindow.h
[87]3 * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
[1]4 *
[6]5 *  $Id: mainwindow.h 99 2010-03-22 20:45:16Z laleppa $
6 *  $URL: https://tspsg.svn.sourceforge.net/svnroot/tspsg/trunk/src/mainwindow.h $
[4]7 *
[67]8 * \brief Defines MainWindow class.
9 *
[65]10 *  <b>TSPSG: TSP Solver and Generator</b>
11 *
[6]12 *  This file is part of TSPSG.
[1]13 *
[6]14 *  TSPSG is free software: you can redistribute it and/or modify
15 *  it under the terms of the GNU General Public License as published by
16 *  the Free Software Foundation, either version 3 of the License, or
17 *  (at your option) any later version.
[1]18 *
[6]19 *  TSPSG is distributed in the hope that it will be useful,
20 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 *  GNU General Public License for more details.
[1]23 *
[6]24 *  You should have received a copy of the GNU General Public License
25 *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
[1]26 */
27
28#ifndef MAINWINDOW_H
29#define MAINWINDOW_H
30
[31]31#include "globals.h"
[64]32
[54]33#include "ui_mainwindow.h"
[1]34#include "settingsdialog.h"
[64]35
[12]36#include "tspsolver.h"
[15]37#include "tspmodel.h"
[1]38
[67]39/*!
40 * \brief Class for handling Main Window UI and logic.
[87]41 * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
[67]42 */
[1]43class MainWindow: public QMainWindow, Ui::MainWindow
44{
45        Q_OBJECT
[47]46
[1]47public:
48        MainWindow(QWidget *parent = 0);
[80]49        ~MainWindow();
[47]50
[1]51private slots:
[67]52// Actions
[29]53        void actionFileNewTriggered();
[31]54        void actionFileOpenTriggered();
[99]55        bool actionFileSaveTriggered();
[42]56        void actionFileSaveAsTaskTriggered();
57        void actionFileSaveAsSolutionTriggered();
[67]58#ifndef QT_NO_PRINTER
59        void actionFilePrintPreviewTriggered();
60        void actionFilePrintTriggered();
61#endif // QT_NO_PRINTER
[29]62        void actionSettingsPreferencesTriggered();
[71]63        void actionSettingsLanguageAutodetectTriggered(bool checked);
64        void groupSettingsLanguageListTriggered(QAction *action);
[99]65#ifdef Q_OS_WIN32
66        void actionHelpCheck4UpdatesTriggered();
67#endif // Q_OS_WIN32
[29]68        void actionHelpAboutTriggered();
[67]69// Buttons
70        void buttonBackToTaskClicked();
71        void buttonRandomClicked();
72        void buttonSolveClicked();
73
[37]74        void dataChanged();
[71]75        void dataChanged(const QModelIndex &tl, const QModelIndex &br);
[94]76#ifdef Q_OS_WINCE
[95]77        void changeEvent(QEvent *ev);
[94]78        void desktopResized(int screen);
79#endif // Q_OS_WINCE
[71]80        void numCitiesChanged(int nCities);
[54]81#ifndef QT_NO_PRINTER
[65]82        void printPreview(QPrinter *printer);
[54]83#endif // QT_NO_PRINTER
[71]84        void spinCitiesValueChanged(int nCities);
[47]85
[6]86private:
[67]87        QString fileName;
88        QActionGroup *groupSettingsLanguageList;
[54]89#ifndef QT_NO_PRINTER
[29]90        QPrinter *printer;
[80]91        QAction *actionFilePrintPreview;
92        QAction *actionFilePrint;
[54]93#endif // QT_NO_PRINTER
[99]94#ifdef Q_OS_WIN32
95        QAction *actionHelpCheck4Updates;
96#endif // Q_OS_WIN32
[67]97        QSettings *settings;
[15]98        CTSPModel *tspmodel;
[94]99#ifdef Q_OS_WINCE
100        QRect currentGeometry;
101#endif // Q_OS_WINCE
[67]102
[71]103        void closeEvent(QCloseEvent *ev);
[99]104        bool hasUpdater() const;
[47]105        void initDocStyleSheet();
[67]106        void loadLangList();
[71]107        bool loadLanguage(const QString &lang = QString());
[47]108        bool maybeSave();
[99]109        QString outputMatrix(const TMatrix &matrix) const;
110        QString outputMatrix(const SStep &step) const;
[80]111        void retranslateUi(bool all = true);
[67]112        bool saveTask();
[87]113        void setFileName(const QString &fileName = tr("Untitled") + ".tspt");
[80]114        void setupUi();
[78]115        void toggleSolutionActions(bool enable = true);
[92]116        void toggleTranclucency(bool enable);
[1]117};
118
119#endif // MAINWINDOW_H
Note: See TracBrowser for help on using the repository browser.