equal
deleted
inserted
replaced
20 #include <QCheckBox> |
20 #include <QCheckBox> |
21 #include <QLineEdit> |
21 #include <QLineEdit> |
22 #include <QDesktopWidget> |
22 #include <QDesktopWidget> |
23 #include <QInputDialog> |
23 #include <QInputDialog> |
24 #include <QCryptographicHash> |
24 #include <QCryptographicHash> |
|
25 #include <QStandardItemModel> |
25 |
26 |
26 #include "gameuiconfig.h" |
27 #include "gameuiconfig.h" |
27 #include "hwform.h" |
28 #include "hwform.h" |
28 #include "pageoptions.h" |
29 #include "pageoptions.h" |
29 #include "pagenetserver.h" |
30 #include "pagenetserver.h" |
30 #include "hwconsts.h" |
31 #include "hwconsts.h" |
31 #include "fpsedit.h" |
32 #include "fpsedit.h" |
32 #include "HWApplication.h" |
33 #include "HWApplication.h" |
|
34 #include "DataManager.h" |
33 |
35 |
34 GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName) |
36 GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName) |
35 : QSettings(fileName, QSettings::IniFormat) |
37 : QSettings(fileName, QSettings::IniFormat) |
36 { |
38 { |
37 Form = FormWidgets; |
39 Form = FormWidgets; |
106 Form->ui.pageOptions->CBLanguage->setCurrentIndex(Form->ui.pageOptions->CBLanguage->findData(value("misc/locale", "").toString())); |
108 Form->ui.pageOptions->CBLanguage->setCurrentIndex(Form->ui.pageOptions->CBLanguage->findData(value("misc/locale", "").toString())); |
107 |
109 |
108 depth = HWApplication::desktop()->depth(); |
110 depth = HWApplication::desktop()->depth(); |
109 if (depth < 16) depth = 16; |
111 if (depth < 16) depth = 16; |
110 else if (depth > 16) depth = 32; |
112 else if (depth > 16) depth = 32; |
|
113 |
|
114 { // load colors |
|
115 QStandardItemModel * model = DataManager::instance().colorsModel(); |
|
116 for(int i = model->rowCount() - 1; i >= 0; --i) |
|
117 model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data().value<QColor>()).value<QColor>())); |
|
118 } |
111 } |
119 } |
112 |
120 |
113 QStringList GameUIConfig::GetTeamsList() |
121 QStringList GameUIConfig::GetTeamsList() |
114 { |
122 { |
115 QDir teamdir; |
123 QDir teamdir; |
180 setValue("misc/locale", language()); |
188 setValue("misc/locale", language()); |
181 |
189 |
182 #ifdef SPARKLE_ENABLED |
190 #ifdef SPARKLE_ENABLED |
183 setValue("misc/autoUpdate", isAutoUpdateEnabled()); |
191 setValue("misc/autoUpdate", isAutoUpdateEnabled()); |
184 #endif |
192 #endif |
|
193 |
|
194 { // save colors |
|
195 QStandardItemModel * model = DataManager::instance().colorsModel(); |
|
196 for(int i = model->rowCount() - 1; i >= 0; --i) |
|
197 setValue(QString("colors/color%1").arg(i), model->item(i)->data()); |
|
198 } |
|
199 |
185 Form->gameSettings->sync(); |
200 Form->gameSettings->sync(); |
186 } |
201 } |
187 |
202 |
188 QString GameUIConfig::language() |
203 QString GameUIConfig::language() |
189 { |
204 { |