Changeset 5587b87fac in tspsg for src
- Timestamp:
- Jun 23, 2009, 7:56:29 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 78282ec778
- Parents:
- 0621172ec1
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/defines.h
r0621172ec1 r5587b87fac 33 33 #define DEF_FONT_COLOR Qt::black 34 34 35 // Decided, that static array with 100 of cities maximum hard limit 36 // will be enough for most cases, but the code will be simplier than 37 // when using dynamic lists. If you need more, just change this value 38 // and recompile the program ;-) 39 #define MAX_CITIES 100 40 // This value means infinity :-) 41 #ifndef INFINITY 42 #define INFINITY 1.7E+308 43 #endif 44 // This is string, which represents infinite value in table 45 #define INFSTR "-----" 46 35 47 #endif // DEFINES_H -
src/main.cpp
r0621172ec1 r5587b87fac 33 33 app.setOrganizationDomain("www.leppsville.com"); 34 34 app.setApplicationName("TSPSG"); 35 /*/ i18n 36 // TODO: Make English as program's "native" language 35 // i18n 36 // TODO: Language selection in application. 37 // TODO: Saving and restoring selected language. 37 38 QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8")); 38 39 QString locale = QLocale::languageToString(QLocale::system().language()); 39 40 QTranslator translator; 40 // Getting current locale langu ge name and trying to load it41 if ( translator.load(locale,"i18n"))41 // Getting current locale language name and trying to load it, if it's not English 42 if (locale.compare("English") && translator.load(locale,"i18n")) 42 43 app.installTranslator(&translator); 43 // If language loading failed and locale language is not44 // application's "native" we're trying to load English45 else if (locale.compare("Russian") && translator.load("English","i18n"))46 app.installTranslator(&translator);47 //*/48 44 MainWindow mainwindow; 49 45 mainwindow.show(); -
src/mainwindow.cpp
r0621172ec1 r5587b87fac 26 26 #include <QPrintDialog> 27 27 #endif // Q_OS_WINCE 28 #include "defines.h"29 28 #include "mainwindow.h" 30 29 … … 124 123 row[c] = tspmodel->index(r,c).data(Qt::UserRole).toDouble(&ok); 125 124 if (!ok) { 126 QMessageBox(QMessageBox::Critical,trUtf8(" Ошибка в данных"),QString(trUtf8("Ошибка в ячейке [Строка %1; Колонка %2]: Неверный формат данных.")).arg(r + 1).arg(c + 1),QMessageBox::Ok,this).exec();125 QMessageBox(QMessageBox::Critical,trUtf8("Data error"),QString(trUtf8("Error in cell [Row %1; Column %2]: Invalid data format.")).arg(r + 1).arg(c + 1),QMessageBox::Ok,this).exec(); 127 126 return; 128 127 } … … 133 132 sStep *root = solver.solve(spinCities->value(),matrix); 134 133 if (!root) 135 QMessageBox(QMessageBox::Critical,trUtf8(" Ошибка при решении"),trUtf8("Во время решения задачи возникла ошибка"),QMessageBox::Ok,this).exec();134 QMessageBox(QMessageBox::Critical,trUtf8("Solution error"),trUtf8("There was an error while solving the task."),QMessageBox::Ok,this).exec(); 136 135 // tabWidget->setCurrentIndex(1); 137 136 } … … 147 146 \n\ 148 147 TSPSG is licensed under the terms of the GNU General Public License. You should have received a copy of the GNU General Public License along with TSPSG.").arg(QDate().toString("%Y"),QT_VERSION_STR,qVersion()); 149 QMessageBox(QMessageBox::Information,"About",about ).exec();148 QMessageBox(QMessageBox::Information,"About",about,QMessageBox::Ok,this).exec(); 150 149 } 151 150 -
src/tspmodel.cpp
r0621172ec1 r5587b87fac 23 23 24 24 #include <QtGui> 25 #include "defines.h"26 25 #include "tspmodel.h" 27 26 … … 51 50 if (role == Qt::DisplayRole) 52 51 if (orientation == Qt::Vertical) 53 return trUtf8(" Город%1").arg(section + 1);52 return trUtf8("City %1").arg(section + 1); 54 53 else 55 54 return trUtf8("%1").arg(section + 1); -
src/tspmodel.h
r0621172ec1 r5587b87fac 25 25 #define TSPMODEL_H 26 26 27 // Decided, that static array with 100 of cities maximum hard limit28 // will be enough for most cases, but the code will be simplier than29 // when using dynamic lists. If you need more, just change this value30 // and recompile the program ;-)31 #define MAX_CITIES 10032 // This value means infinity :-)33 #ifndef INFINITY34 #define INFINITY 1.7E+30835 #endif36 // This is string, which represents infinite value in table37 #define INFSTR "---"38 39 27 #include <QAbstractTableModel> 40 28 #include <QSettings> 29 #include "defines.h" 41 30 42 31 class CTSPModel: public QAbstractTableModel
Note: See TracChangeset
for help on using the changeset viewer.