equal
deleted
inserted
replaced
36 |
36 |
37 Form->ui.pageNet->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString()); |
37 Form->ui.pageNet->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString()); |
38 Form->ui.pageNet->editIP->setText(value("net/ip", "").toString()); |
38 Form->ui.pageNet->editIP->setText(value("net/ip", "").toString()); |
39 Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool()); |
39 Form->ui.pageOptions->CBShowFPS->setChecked(value("fps/show", false).toBool()); |
40 Form->ui.pageOptions->fpsedit->setValue(value("fps/interval", 27).toUInt()); |
40 Form->ui.pageOptions->fpsedit->setValue(value("fps/interval", 27).toUInt()); |
41 |
|
42 QFile themesfile(datadir->absolutePath() + "/Themes/themes.cfg"); |
|
43 if (themesfile.open(QIODevice::ReadOnly)) { |
|
44 QTextStream stream(&themesfile); |
|
45 QString str; |
|
46 while (!stream.atEnd()) |
|
47 { |
|
48 Themes << stream.readLine(); |
|
49 } |
|
50 themesfile.close(); |
|
51 } else { |
|
52 QMessageBox::critical(FormWidgets, "Error", "Cannot access themes.cfg", "OK"); |
|
53 } |
|
54 } |
41 } |
55 |
42 |
56 QStringList GameUIConfig::GetTeamsList() |
43 QStringList GameUIConfig::GetTeamsList() |
57 { |
44 { |
58 QStringList teamslist = cfgdir->entryList(QStringList("*.cfg")); |
45 QStringList teamslist = cfgdir->entryList(QStringList("*.cfg")); |
100 |
87 |
101 quint8 GameUIConfig::timerInterval() |
88 quint8 GameUIConfig::timerInterval() |
102 { |
89 { |
103 return 35 - Form->ui.pageOptions->fpsedit->value(); |
90 return 35 - Form->ui.pageOptions->fpsedit->value(); |
104 } |
91 } |
105 |
|
106 QString GameUIConfig::GetRandomTheme() |
|
107 { |
|
108 return (Themes.size() > 0) ? Themes[rand() % Themes.size()] : QString("steel"); |
|
109 } |
|