equal
deleted
inserted
replaced
18 |
18 |
19 #include "HWApplication.h" |
19 #include "HWApplication.h" |
20 |
20 |
21 #include <QTranslator> |
21 #include <QTranslator> |
22 #include <QLocale> |
22 #include <QLocale> |
23 #include <QMessageBox> |
|
24 #include <QPlastiqueStyle> |
23 #include <QPlastiqueStyle> |
25 #include <QRegExp> |
24 #include <QRegExp> |
26 #include <QMap> |
25 #include <QMap> |
27 #include <QSettings> |
26 #include <QSettings> |
28 #include <QStringListModel> |
27 #include <QStringListModel> |
34 #include "hwconsts.h" |
33 #include "hwconsts.h" |
35 #include "newnetclient.h" |
34 #include "newnetclient.h" |
36 |
35 |
37 #include "DataManager.h" |
36 #include "DataManager.h" |
38 #include "FileEngine.h" |
37 #include "FileEngine.h" |
|
38 #include "MessageDialog.h" |
39 |
39 |
40 #ifdef _WIN32 |
40 #ifdef _WIN32 |
41 #include <Shlobj.h> |
41 #include <Shlobj.h> |
42 #elif defined __APPLE__ |
42 #elif defined __APPLE__ |
43 #include "CocoaInitializer.h" |
43 #include "CocoaInitializer.h" |
97 { |
97 { |
98 QDir tmpdir(dir); |
98 QDir tmpdir(dir); |
99 if (!tmpdir.exists()) |
99 if (!tmpdir.exists()) |
100 if (!tmpdir.mkpath(dir)) |
100 if (!tmpdir.mkpath(dir)) |
101 { |
101 { |
102 QMessageBox directoryMsg(QApplication::activeWindow()); |
102 MessageDialog::ShowErrorMessage(HWApplication::tr("Cannot create directory %1").arg(dir)); |
103 directoryMsg.setIcon(QMessageBox::Warning); |
|
104 directoryMsg.setWindowTitle(QMessageBox::tr("Main - Error")); |
|
105 directoryMsg.setText(QMessageBox::tr("Cannot create directory %1").arg(dir)); |
|
106 directoryMsg.setWindowModality(Qt::WindowModal); |
|
107 directoryMsg.exec(); |
|
108 return false; |
103 return false; |
109 } |
104 } |
110 return true; |
105 return true; |
111 } |
106 } |
112 |
107 |
142 QLabel *splash = NULL; |
137 QLabel *splash = NULL; |
143 #if defined Q_WS_WIN |
138 #if defined Q_WS_WIN |
144 QPixmap pixmap(":res/splash.png"); |
139 QPixmap pixmap(":res/splash.png"); |
145 splash = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); |
140 splash = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); |
146 splash->setAttribute(Qt::WA_TranslucentBackground); |
141 splash->setAttribute(Qt::WA_TranslucentBackground); |
147 const QRect deskSize = QApplication::desktop()->screenGeometry(-1); |
142 const QRect deskSize = HWApplication::desktop()->screenGeometry(-1); |
148 QPoint splashCenter = QPoint( (deskSize.width() - pixmap.width())/2, |
143 QPoint splashCenter = QPoint( (deskSize.width() - pixmap.width())/2, |
149 (deskSize.height() - pixmap.height())/2 ); |
144 (deskSize.height() - pixmap.height())/2 ); |
150 splash->move(splashCenter); |
145 splash->move(splashCenter); |
151 splash->setPixmap(pixmap); |
146 splash->setPixmap(pixmap); |
152 splash->show(); |
147 splash->show(); |
251 checkForDir(cfgdir->absolutePath() + "/VideoTemp"); |
246 checkForDir(cfgdir->absolutePath() + "/VideoTemp"); |
252 } |
247 } |
253 |
248 |
254 datadir->cd(bindir->absolutePath()); |
249 datadir->cd(bindir->absolutePath()); |
255 datadir->cd(*cDataDir); |
250 datadir->cd(*cDataDir); |
256 if(!datadir->cd("Data")) |
251 if (!datadir->cd("Data")) |
257 { |
252 { |
258 QMessageBox missingMsg(QApplication::activeWindow()); |
253 MessageDialog::ShowFatalMessage(HWApplication::tr("Failed to open data directory:\n%1\n\nPlease check your installation!").arg(datadir->absolutePath()+"/Data")); |
259 missingMsg.setIcon(QMessageBox::Critical); |
|
260 missingMsg.setWindowTitle(QMessageBox::tr("Main - Error")); |
|
261 missingMsg.setText(QMessageBox::tr("Failed to open data directory:\n%1\n\n" |
|
262 "Please check your installation!"). |
|
263 arg(datadir->absolutePath()+"/Data")); |
|
264 missingMsg.setWindowModality(Qt::WindowModal); |
|
265 missingMsg.exec(); |
|
266 return 1; |
254 return 1; |
267 } |
255 } |
268 |
256 |
269 // setup PhysFS |
257 // setup PhysFS |
270 engine->mount(datadir->absolutePath()); |
258 engine->mount(datadir->absolutePath()); |