QTfrontend/main.cpp
author unc0rr
Mon, 12 Oct 2009 16:44:30 +0000
changeset 2428 6800f8aa0184
parent 2418 538a777f90c4
child 2517 6ed1fba6da18
permissions -rw-r--r--
Huge Smaxx patch with some fixes by me: - support for non power of two textures - modelview matrix calculation optimizations - health effect when picking up health crates or using vampirism - rc plane training time trial - fix visual gear drawing position (might require recheck) - gamepad support - reordered options in frontend - updated binding options (subcaptions, descriptions and localizable names) - cfg-dir parameter for frontend (allows teams/settings to sit on a usb flash drive for example) - icons for chatroom user list
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 579
diff changeset
     2
 * Hedgewars, a free turn based strategy game
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     3
 * Copyright (c) 2005-2007 Andrey Korotaev <unC0Rr@gmail.com>
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     4
 *
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     8
 *
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    12
 * GNU General Public License for more details.
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    13
 *
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    17
 */
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    18
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    19
#include <QApplication>
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    20
#include <QTranslator>
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    21
#include <QLocale>
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    22
#include <QMessageBox>
1416
60b86d6fe9ae Force plastique style, as others don't fully support stylesheets
unc0rr
parents: 1415
diff changeset
    23
#include <QPlastiqueStyle>
2034
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    24
#include <QRegExp>
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    25
#include <QMap>
1146
0bc17a69b3d8 Background for Hedgewars is ready
displacer
parents: 1066
diff changeset
    26
2418
538a777f90c4 fix build and partially moves messages to errlib
koda
parents: 2377
diff changeset
    27
char *programname;
2261
57e99c908e7c a lot of stuff:
koda
parents: 2077
diff changeset
    28
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    29
#include "hwform.h"
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    30
#include "hwconsts.h"
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    31
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    32
bool checkForDir(const QString & dir)
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    33
{
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    34
	QDir tmpdir;
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    35
	if (!tmpdir.exists(dir))
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    36
		if (!tmpdir.mkdir(dir))
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    37
		{
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    38
			QMessageBox::critical(0,
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    39
					QObject::tr("Error"),
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    40
					QObject::tr("Cannot create directory %1").arg(dir),
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    41
					QObject::tr("OK"));
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    42
			return false;
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    43
		}
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    44
	return true;
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    45
}
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    46
2418
538a777f90c4 fix build and partially moves messages to errlib
koda
parents: 2377
diff changeset
    47
int main(int argc, char *argv[]) {
538a777f90c4 fix build and partially moves messages to errlib
koda
parents: 2377
diff changeset
    48
        
538a777f90c4 fix build and partially moves messages to errlib
koda
parents: 2377
diff changeset
    49
       programname = argv[0];
538a777f90c4 fix build and partially moves messages to errlib
koda
parents: 2377
diff changeset
    50
        
2261
57e99c908e7c a lot of stuff:
koda
parents: 2077
diff changeset
    51
    QApplication app(argc, argv);
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    52
2034
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    53
    QStringList arguments = app.arguments();
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    54
    QMap<QString, QString> parsedArgs;
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    55
    {
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    56
        QList<QString>::iterator i = arguments.begin();
2035
70734c4f52a7 patch to prior checkin
nemo
parents: 2034
diff changeset
    57
        while(i != arguments.end()) {
2034
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    58
            QString arg = *i;
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    59
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    60
            QRegExp opt("--(\\S+)=(.+)");
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    61
            if(opt.exactMatch(arg)) {
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    62
                parsedArgs[opt.cap(1)] = opt.cap(2);
2035
70734c4f52a7 patch to prior checkin
nemo
parents: 2034
diff changeset
    63
                i = arguments.erase(i);
70734c4f52a7 patch to prior checkin
nemo
parents: 2034
diff changeset
    64
            } else {
70734c4f52a7 patch to prior checkin
nemo
parents: 2034
diff changeset
    65
              ++i;
2034
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    66
            }
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    67
        }
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    68
    }
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    69
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    70
    if(parsedArgs.contains("data-dir")) {
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    71
        QFileInfo f(parsedArgs["data-dir"]);
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    72
        if(!f.exists()) {
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    73
            qWarning() << "WARNING: Cannot open DATA_PATH=" << f.absoluteFilePath();
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    74
        }
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    75
        *cDataDir = f.absoluteFilePath();
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    76
    }
decdf48cffd7 david_ac adding a commandline parameter for the data dir, as requested by svenstaro
nemo
parents: 1969
diff changeset
    77
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
    78
    if(parsedArgs.contains("config-dir")) {
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
    79
        QFileInfo f(parsedArgs["config-dir"]);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
    80
        *cConfigDir = f.absoluteFilePath();
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
    81
    }
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
    82
1416
60b86d6fe9ae Force plastique style, as others don't fully support stylesheets
unc0rr
parents: 1415
diff changeset
    83
	app.setStyle(new QPlastiqueStyle);
2377
f3fab2b09e0c And in frontend
nemo
parents: 2261
diff changeset
    84
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    85
	QDateTime now = QDateTime::currentDateTime();
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
    86
	srand(now.toTime_t());
1215
0c1c294c0f7e Themes list now works
unc0rr
parents: 1214
diff changeset
    87
	rand();
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    88
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    89
	Q_INIT_RESOURCE(hedgewars);
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
    90
1146
0bc17a69b3d8 Background for Hedgewars is ready
displacer
parents: 1066
diff changeset
    91
	qApp->setStyleSheet
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    92
		(QString(
1219
89babaafe99d Make dialogs and messageboxes be customized like main form
unc0rr
parents: 1217
diff changeset
    93
			"HWForm,QDialog{"
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    94
				"background-image: url(\":/res/Background.png\");"
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    95
				"background-position: bottom center;"
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    96
				"background-repeat: repeat-x;"
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    97
				"background-color: #870c8f;"
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
    98
				"}"
1154
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
    99
1897
e9dcb47013c7 - Some style changes by nemo
unc0rr
parents: 1894
diff changeset
   100
			"* {"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   101
				"color: #ffcc00;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   102
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   103
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   104
			"QLineEdit, QListWidget, QTableView, QTextBrowser, QSpinBox, QComboBox, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   105
            "QComboBox QAbstractItemView, QMenu::item {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   106
				"background-color: #0d0544;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   107
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   108
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   109
			"QPushButton, QListWidget, QTableView, QLineEdit, QHeaderView, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   110
			"QTextBrowser, QSpinBox, QToolBox, QComboBox, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   111
            "QComboBox QAbstractItemView, IconedGroupBox, "
1897
e9dcb47013c7 - Some style changes by nemo
unc0rr
parents: 1894
diff changeset
   112
			".QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget, "
e9dcb47013c7 - Some style changes by nemo
unc0rr
parents: 1894
diff changeset
   113
            "QTabWidget::pane, QTabBar::tab {"
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
   114
				"border: solid;"
1214
090f94cd663e - Make border 3px width
unc0rr
parents: 1211
diff changeset
   115
				"border-width: 3px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   116
				"border-color: #ffcc00;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   117
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   118
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   119
			"QPushButton:hover, QLineEdit:hover, QListWidget:hover, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   120
			"QSpinBox:hover, QToolBox:hover, QComboBox:hover {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   121
			    "border-color: yellow;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   122
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   123
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   124
			"QLineEdit, QListWidget,QTableView, QTextBrowser, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   125
			"QSpinBox, QToolBox { "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   126
				"border-radius: 12px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   127
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   128
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   129
			"QLineEdit, QLabel, QHeaderView, QListWidget, QTableView, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   130
			"QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   131
			"IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget, "
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   132
            "SelWeaponWidget, QCheckBox, QRadioButton {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   133
				"font: bold 14px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   134
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   135
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   136
			".QGroupBox,GameCFGWidget,TeamSelWidget,SelWeaponWidget {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   137
				"background-image: url(\":/res/panelbg.png\");"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   138
				"background-position: bottom center;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   139
				"background-repeat: repeat-x;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   140
				"border-radius: 16px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   141
				"background-color: #040200;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   142
				"padding: 6px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   143
			"}"
2072
6e0fcbcc3f60 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents: 2035
diff changeset
   144
/*  Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well
6e0fcbcc3f60 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents: 2035
diff changeset
   145
			"IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit, "
6e0fcbcc3f60 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents: 2035
diff changeset
   146
            "IconedGroupBox QSpinBox {"
6e0fcbcc3f60 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents: 2035
diff changeset
   147
				"border-radius: 0;"
2077
7320931f12a0 Remove setting of background-color on iconed group box children just in case that was causing Tiy's problem. Is useless until PaintOnScreen + border-radius is resolved anyway.
nemo
parents: 2072
diff changeset
   148
			"}"
7320931f12a0 Remove setting of background-color on iconed group box children just in case that was causing Tiy's problem. Is useless until PaintOnScreen + border-radius is resolved anyway.
nemo
parents: 2072
diff changeset
   149
			"IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" */
7320931f12a0 Remove setting of background-color on iconed group box children just in case that was causing Tiy's problem. Is useless until PaintOnScreen + border-radius is resolved anyway.
nemo
parents: 2072
diff changeset
   150
			"IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   151
				"background-color: #130f2c;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   152
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   153
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   154
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   155
			"QPushButton {"
1157
c2e02c52dcad Try to modify QGroupBox view
unc0rr
parents: 1155
diff changeset
   156
				"border-radius: 10px;"
1168
f3c68684ef88 Finally fix save button look
unc0rr
parents: 1167
diff changeset
   157
				"background-origin: margin;"
f3c68684ef88 Finally fix save button look
unc0rr
parents: 1167
diff changeset
   158
				"background-position: top left;"
1167
2aa93ec4718b Set bg color for QPushButton
unc0rr
parents: 1161
diff changeset
   159
				"background-color: #00351d;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   160
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   161
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   162
			"QPushButton:pressed{"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   163
			    "border-color: white;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   164
			"}"
1154
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   165
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   166
			"QHeaderView {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   167
				"border-radius: 0;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   168
				"border-width: 0;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   169
				"border-bottom-width: 3px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   170
				"background-color: #00351d;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   171
			"}"
1894
ba54441631da Rooms list colourizing patch by TheXception
unc0rr
parents: 1893
diff changeset
   172
			"QTableView {"
ba54441631da Rooms list colourizing patch by TheXception
unc0rr
parents: 1893
diff changeset
   173
				"alternate-background-color: #2f213a;"
ba54441631da Rooms list colourizing patch by TheXception
unc0rr
parents: 1893
diff changeset
   174
			"}"
1172
8542fc1ff5cf Some more customizations
unc0rr
parents: 1171
diff changeset
   175
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   176
            "QTabBar::tab {"
1897
e9dcb47013c7 - Some style changes by nemo
unc0rr
parents: 1894
diff changeset
   177
                 "border-bottom-width: 0;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   178
                 "border-radius: 0;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   179
                 "border-top-left-radius: 6px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   180
                 "border-top-right-radius: 6px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   181
                 "padding: 3px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   182
            "}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   183
            "QTabBar::tab:!selected {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   184
                 "color: #0d0544;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   185
                 "background-color: #ffcc00;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   186
            "}"
1289
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   187
			"QSpinBox::up-button{"
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   188
				"background: transparent;"
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   189
				"width: 16px;"
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   190
				"height: 10px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   191
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   192
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   193
			"QSpinBox::up-arrow {"
1289
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   194
				"image: url(\":/res/spin_up.png\");"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   195
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   196
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   197
			"QSpinBox::down-arrow {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   198
				"image: url(\":/res/spin_down.png\");"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   199
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   200
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   201
			"QSpinBox::down-button {"
1289
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   202
				"background: transparent;"
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   203
				"width: 16px;"
789db262d90d - Customize spinbox arrows
unc0rr
parents: 1252
diff changeset
   204
				"height: 10px;"
1172
8542fc1ff5cf Some more customizations
unc0rr
parents: 1171
diff changeset
   205
			"}"
8542fc1ff5cf Some more customizations
unc0rr
parents: 1171
diff changeset
   206
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   207
			"QComboBox {"
1161
edf18b880beb Customize SpinBox look (not finished)
unc0rr
parents: 1160
diff changeset
   208
				"border-radius: 15px;"
1154
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   209
				"padding: 3px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   210
			"}"
1154
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   211
			"QComboBox:pressed{"
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   212
				"border-color: white;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   213
			"}"
1154
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   214
			"QComboBox::drop-down{"
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   215
				"border: transparent;"
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   216
				"width: 25px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   217
			"}"
1154
03cc0ab9c013 Customize comboboxes look
unc0rr
parents: 1153
diff changeset
   218
			"QComboBox::down-arrow {"
1155
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   219
				"image: url(\":/res/dropdown.png\");"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   220
			"}"
2377
f3fab2b09e0c And in frontend
nemo
parents: 2261
diff changeset
   221
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   222
			"VertScrArea {"
1425
7ee750565e2d Add background image to team select widget
unc0rr
parents: 1418
diff changeset
   223
				"background-image: url(\":/res/panelbg.png\");"
7ee750565e2d Add background image to team select widget
unc0rr
parents: 1418
diff changeset
   224
				"background-position: bottom center;"
7ee750565e2d Add background image to team select widget
unc0rr
parents: 1418
diff changeset
   225
				"background-repeat: repeat-x;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   226
			"}"
2377
f3fab2b09e0c And in frontend
nemo
parents: 2261
diff changeset
   227
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   228
			"IconedGroupBox {"
1198
b600b0d9408c Reorganize widgets on options page
unc0rr
parents: 1197
diff changeset
   229
				"border-radius: 16px;"
1228
8fa4a7055aff - Update copyrights
unc0rr
parents: 1219
diff changeset
   230
				"padding: 2px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   231
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   232
1201
4390e7343542 Move QGroupBox title a bit
unc0rr
parents: 1199
diff changeset
   233
			".QGroupBox::title{"
4390e7343542 Move QGroupBox title a bit
unc0rr
parents: 1199
diff changeset
   234
				"subcontrol-origin: margin;"
4390e7343542 Move QGroupBox title a bit
unc0rr
parents: 1199
diff changeset
   235
				"subcontrol-position: top left;"
4390e7343542 Move QGroupBox title a bit
unc0rr
parents: 1199
diff changeset
   236
				//"padding-left: 82px;"
4390e7343542 Move QGroupBox title a bit
unc0rr
parents: 1199
diff changeset
   237
				//"padding-top: 26px;"
4390e7343542 Move QGroupBox title a bit
unc0rr
parents: 1199
diff changeset
   238
				"text-align: left;"
1155
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   239
				"}"
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   240
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   241
			"QCheckBox::indicator:checked{"
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   242
				"image: url(\":/res/checked.png\");"
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   243
				"}"
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   244
			"QCheckBox::indicator:unchecked{"
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   245
				"image: url(\":/res/unchecked.png\");"
ffd0a34171f1 Customize checkboxes
unc0rr
parents: 1154
diff changeset
   246
				"}"
2377
f3fab2b09e0c And in frontend
nemo
parents: 2261
diff changeset
   247
1252
2e2719c0a397 - Reorganize headers according to Qt's style guide
unc0rr
parents: 1228
diff changeset
   248
			".QWidget{"
2e2719c0a397 - Reorganize headers according to Qt's style guide
unc0rr
parents: 1228
diff changeset
   249
				"background: transparent;"
2e2719c0a397 - Reorganize headers according to Qt's style guide
unc0rr
parents: 1228
diff changeset
   250
				"}"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   251
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   252
			"QTabWidget::pane {"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   253
                "border-top-width: 2px;"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   254
			"}"
1413
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   255
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   256
			"QMenu{"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   257
				"background-color: #ffcc00;"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   258
				"margin: 3px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   259
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   260
			"QMenu::item {"
1413
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   261
				"background-color: #0d0544;"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   262
				"border: 1px solid transparent;"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   263
				"font: bold;"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   264
				"padding: 2px 25px 2px 20px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   265
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   266
			"QMenu::item:selected {"
1413
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   267
				"background-color: #2d2564;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   268
			"}"
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   269
			"QMenu::indicator {"
1413
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   270
				"width: 16px;"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   271
				"height: 16px;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   272
			"}"
1413
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   273
			"QMenu::indicator:non-exclusive:checked{"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   274
				"image: url(\":/res/checked.png\");"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   275
			"}"
1413
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   276
			"QMenu::indicator:non-exclusive:unchecked{"
6393a1d5ac18 Customize menu look
unc0rr
parents: 1390
diff changeset
   277
				"image: url(\":/res/unchecked.png\");"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   278
			"}"
1450
f854866390a5 Add tooltips
unc0rr
parents: 1438
diff changeset
   279
f854866390a5 Add tooltips
unc0rr
parents: 1438
diff changeset
   280
			"QToolTip{"
f854866390a5 Add tooltips
unc0rr
parents: 1438
diff changeset
   281
				"background-color: #0d0544;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   282
			"}"
2377
f3fab2b09e0c And in frontend
nemo
parents: 2261
diff changeset
   283
1438
b1cb4381a1e0 - Make disbled controls look better
unc0rr
parents: 1425
diff changeset
   284
			":disabled{"
b1cb4381a1e0 - Make disbled controls look better
unc0rr
parents: 1425
diff changeset
   285
				"color: #a0a0a0;"
1893
85c61bc5e160 Style fixes by nemo
unc0rr
parents: 1577
diff changeset
   286
			"}"
2072
6e0fcbcc3f60 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents: 2035
diff changeset
   287
            "SquareLabel, ItemNum {"
6e0fcbcc3f60 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents: 2035
diff changeset
   288
				"background-color: #000000;"
6e0fcbcc3f60 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel
nemo
parents: 2035
diff changeset
   289
			"}"
1152
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
   290
			)
c72b939c00df Make buttons border have different colors when mouse is over or it is pressed
unc0rr
parents: 1150
diff changeset
   291
		);
1150
ae86e36dad2e - Make look better
unc0rr
parents: 1149
diff changeset
   292
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   293
	bindir->cd("bin"); // workaround over NSIS installer
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   294
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   295
	if(cConfigDir->length() == 0)
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   296
		cfgdir->setPath(cfgdir->homePath());
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   297
	else
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   298
		cfgdir->setPath(*cConfigDir);
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   299
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   300
	if(cConfigDir->length() == 0)
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   301
	{
1965
340bfd438ca5 - Apply koda's patch
unc0rr
parents: 1940
diff changeset
   302
#ifdef __APPLE__
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   303
		if (checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars"))
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   304
		{
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   305
			checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars/Demos");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   306
			checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars/Saves");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   307
		}
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   308
		cfgdir->cd("Library/Application Support/Hedgewars");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   309
#else
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   310
		if (checkForDir(cfgdir->absolutePath() + "/.hedgewars"))
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   311
		{
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   312
			checkForDir(cfgdir->absolutePath() + "/.hedgewars/Demos");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   313
			checkForDir(cfgdir->absolutePath() + "/.hedgewars/Saves");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   314
		}
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   315
		cfgdir->cd(".hedgewars");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   316
#endif
1965
340bfd438ca5 - Apply koda's patch
unc0rr
parents: 1940
diff changeset
   317
	}
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   318
	else
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   319
	{
2428
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   320
		if (checkForDir(cfgdir->absolutePath()))
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   321
		{
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   322
			checkForDir(cfgdir->absolutePath() + "/Demos");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   323
			checkForDir(cfgdir->absolutePath() + "/Saves");
6800f8aa0184 Huge Smaxx patch with some fixes by me:
unc0rr
parents: 2418
diff changeset
   324
		}
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   325
	}
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   326
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   327
	datadir->cd(bindir->absolutePath());
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   328
	datadir->cd(*cDataDir);
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   329
	if(!datadir->cd("hedgewars/Data")) {
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   330
		QMessageBox::critical(0, QMessageBox::tr("Error"),
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   331
			QMessageBox::tr("Failed to open data directory:\n%1\n"
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   332
					"Please check your installation").
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   333
					arg(datadir->absolutePath()+"/hedgewars/Data"));
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   334
		return 1;
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   335
	}
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   336
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   337
	QTranslator Translator;
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   338
	Translator.load(datadir->absolutePath() + "/Locale/hedgewars_" + QLocale::system().name());
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   339
	app.installTranslator(&Translator);
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   340
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   341
	Themes = new QStringList();
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   342
	QFile themesfile(datadir->absolutePath() + "/Themes/themes.cfg");
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   343
	if (themesfile.open(QIODevice::ReadOnly)) {
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   344
		QTextStream stream(&themesfile);
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   345
		QString str;
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   346
		while (!stream.atEnd())
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   347
		{
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   348
			Themes->append(stream.readLine());
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   349
		}
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   350
		themesfile.close();
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   351
	} else {
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   352
		QMessageBox::critical(0, "Error", "Cannot access themes.cfg", "OK");
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   353
	}
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   354
1210
bfed1b89bc85 Add themes list to map selection widget
unc0rr
parents: 1209
diff changeset
   355
	QDir tmpdir;
bfed1b89bc85 Add themes list to map selection widget
unc0rr
parents: 1209
diff changeset
   356
	tmpdir.cd(datadir->absolutePath());
bfed1b89bc85 Add themes list to map selection widget
unc0rr
parents: 1209
diff changeset
   357
	tmpdir.cd("Maps");
bfed1b89bc85 Add themes list to map selection widget
unc0rr
parents: 1209
diff changeset
   358
	tmpdir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
bfed1b89bc85 Add themes list to map selection widget
unc0rr
parents: 1209
diff changeset
   359
	mapList = new QStringList(tmpdir.entryList(QStringList("*")));
bfed1b89bc85 Add themes list to map selection widget
unc0rr
parents: 1209
diff changeset
   360
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   361
	HWForm *Form = new HWForm();
2377
f3fab2b09e0c And in frontend
nemo
parents: 2261
diff changeset
   362
2261
57e99c908e7c a lot of stuff:
koda
parents: 2077
diff changeset
   363
579
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   364
	Form->show();
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   365
	return app.exec();
94db15de0392 - Some changes to make build process clear
unc0rr
parents:
diff changeset
   366
}