equal
deleted
inserted
replaced
89 { |
89 { |
90 QDir tmpdir; |
90 QDir tmpdir; |
91 if (!tmpdir.exists(dir)) |
91 if (!tmpdir.exists(dir)) |
92 if (!tmpdir.mkdir(dir)) |
92 if (!tmpdir.mkdir(dir)) |
93 { |
93 { |
94 QMessageBox::critical(0, |
94 QMessageBox directoryMsg(QApplication::activeWindow()); |
95 QObject::tr("Error"), |
95 directoryMsg.setIcon(QMessageBox::Warning); |
96 QObject::tr("Cannot create directory %1").arg(dir), |
96 directoryMsg.setWindowTitle(QMessageBox::tr("Main - Error")); |
97 QObject::tr("OK")); |
97 directoryMsg.setText(QMessageBox::tr("Cannot create directory %1").arg(dir)); |
|
98 directoryMsg.setWindowModality(Qt::WindowModal); |
|
99 directoryMsg.exec(); |
98 return false; |
100 return false; |
99 } |
101 } |
100 return true; |
102 return true; |
101 } |
103 } |
102 |
104 |
203 |
205 |
204 datadir->cd(bindir->absolutePath()); |
206 datadir->cd(bindir->absolutePath()); |
205 datadir->cd(*cDataDir); |
207 datadir->cd(*cDataDir); |
206 if(!datadir->cd("hedgewars/Data")) |
208 if(!datadir->cd("hedgewars/Data")) |
207 { |
209 { |
208 QMessageBox::critical(0, QMessageBox::tr("Error"), |
210 QMessageBox missingMsg(QApplication::activeWindow()); |
209 QMessageBox::tr("Failed to open data directory:\n%1\n" |
211 missingMsg.setIcon(QMessageBox::Critical); |
210 "Please check your installation"). |
212 missingMsg.setWindowTitle(QMessageBox::tr("Main - Error")); |
211 arg(datadir->absolutePath()+"/hedgewars/Data")); |
213 missingMsg.setText(QMessageBox::tr("Failed to open data directory:\n%1\n\n" |
|
214 "Please check your installation!"). |
|
215 arg(datadir->absolutePath()+"/hedgewars/Data")); |
|
216 missingMsg.setWindowModality(Qt::WindowModal); |
|
217 missingMsg.exec(); |
212 return 1; |
218 return 1; |
213 } |
219 } |
214 |
220 |
215 DataManager & dataMgr = DataManager::instance(); |
221 DataManager & dataMgr = DataManager::instance(); |
216 |
222 |