/* * TSPSG: TSP Solver and Generator * Copyright (C) 2007-2009 Lёppa * * $Id: mainwindow.h 47 2009-08-02 19:47:45Z laleppa $ * $URL: https://tspsg.svn.sourceforge.net/svnroot/tspsg/trunk/src/mainwindow.h $ * * This file is part of TSPSG. * * TSPSG is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * TSPSG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with TSPSG. If not, see . */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include "globals.h" #ifdef Q_OS_WINCE #include "ui_mainwindow.ce.h" #else #include "ui_mainwindow.h" #endif // Q_OS_WINCE #include "settingsdialog.h" #include "tspsolver.h" #include "tspmodel.h" class MainWindow: public QMainWindow, Ui::MainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); void closeEvent(QCloseEvent *); private slots: void actionFileNewTriggered(); void actionFileOpenTriggered(); void actionFileSaveAsTaskTriggered(); void actionFileSaveAsSolutionTriggered(); void actionSettingsPreferencesTriggered(); void actionSettingsLanguageAutodetectTriggered(bool); void groupSettingsLanguageListTriggered(QAction *); void actionHelpAboutTriggered(); void dataChanged(); #ifndef Q_OS_WINCE void actionFilePrintSetupTriggered(); #endif // Q_OS_WINCE void buttonSolveClicked(); void buttonRandomClicked(); void spinCitiesValueChanged(int); void numCitiesChanged(int); private: QSettings *settings; QPrinter *printer; CTSPModel *tspmodel; QString fileName; QActionGroup *groupSettingsLanguageList; QStringList output; void enableSolutionActions(bool enable = true); void initDocStyleSheet(); bool loadLanguage(QString lang = ""); void loadLangList(); bool maybeSave(); void outputMatrix(tMatrix, QStringList &, int nRow = -1, int nCol = -1); void setFileName(QString fileName = trUtf8("Untitled") + ".tspt"); bool saveTask(); }; #endif // MAINWINDOW_H