implemented settings window
This commit is contained in:
1 parent
19006fac6c
commit
a24876cf79
7 files changed
+582
-1
No files matched your search
@@ -0,0 +1,349 @@
|
||||
// This file is part of c-evo-evo.
|
||||
//
|
||||
// This software is governed by the CeCILL license under French law and
|
||||
// abiding by the rules of distribution of free software. You can use,
|
||||
// modify and/or redistribute the software under the terms of the CeCILL
|
||||
// license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
// "http://www.cecill.info".
|
||||
//
|
||||
// As a counterpart to the access to the source code and rights to copy,
|
||||
// modify and redistribute granted by the license, users are provided only
|
||||
// with a limited warranty and the software's author, the holder of the
|
||||
// economic rights, and the successive licensors have only limited
|
||||
// liability.
|
||||
//
|
||||
// In this respect, the user's attention is drawn to the risks associated
|
||||
// with loading, using, modifying and/or developing or reproducing the
|
||||
// software by the user in light of its specific status of free software,
|
||||
// that may mean that it is complicated to manipulate, and that also
|
||||
// therefore means that it is reserved for developers and experienced
|
||||
// professionals having in-depth computer knowledge. Users are therefore
|
||||
// encouraged to load and test the software's suitability as regards their
|
||||
// requirements in conditions enabling the security of their systems and/or
|
||||
// data to be ensured and, more generally, to use and operate it in the
|
||||
// same conditions as regards security.
|
||||
//
|
||||
// The fact that you are presently reading this means that you have had
|
||||
// knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
#include "Settings.h"
|
||||
#include "ui_Settings.h"
|
||||
|
||||
#include "Cevo/CevoButtonA.h"
|
||||
#include "Cevo/CevoButtonC.h"
|
||||
#include "Cevo/CevoListBoxEx.h"
|
||||
#include "Cevo/CevoScreenTools.h"
|
||||
#include "Cevo/CevoTexture.h"
|
||||
#include "Global.h"
|
||||
#include "Messg.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QPainter>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int MusicVolumeMin = 0;
|
||||
constexpr int MusicVolumeMax = 100;
|
||||
constexpr int MusicVolumeStep = 10;
|
||||
constexpr int GammaMin = 50;
|
||||
constexpr int GammaMax = 150;
|
||||
|
||||
QString settingsText(int index)
|
||||
{
|
||||
return phrases.lookup(QStringLiteral("SETTINGS"), index);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
SettingsDlg::SettingsDlg(Languages &languages, QWidget *parent)
|
||||
: DrawDlg(parent), m_languages(languages), ui(new Ui::SettingsDlg)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
// A modal window of its own, even though it has a parent (the window it is transient for).
|
||||
setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
||||
|
||||
ui->buttonOk->setCaption(phrases.lookup(QStringLiteral("BTN_OK")));
|
||||
ui->buttonCancel->setCaption(phrases.lookup(QStringLiteral("BTN_CANCEL")));
|
||||
ui->buttonReset->setCaption(phrases.lookup(QStringLiteral("BTN_RESET")));
|
||||
ui->buttonFullscreen->setButtonIndex(0);
|
||||
ui->buttonMusic->setButtonIndex(0);
|
||||
ui->buttonGammaUp->setButtonIndex(1);
|
||||
ui->buttonGammaDown->setButtonIndex(0);
|
||||
ui->buttonMusicVolumeUp->setButtonIndex(1);
|
||||
ui->buttonMusicVolumeDown->setButtonIndex(0);
|
||||
initButtons();
|
||||
|
||||
ui->buttonOk->onClick = [this] {
|
||||
saveData();
|
||||
setModalResult(Dpi::ModalResult::Ok);
|
||||
close();
|
||||
};
|
||||
ui->buttonCancel->onClick = [this] {
|
||||
setModalResult(Dpi::ModalResult::Cancel);
|
||||
close();
|
||||
};
|
||||
ui->buttonReset->onClick = [this] { resetClicked(); };
|
||||
ui->buttonFullscreen->onClick = [this] {
|
||||
ui->buttonFullscreen->setButtonIndex(ui->buttonFullscreen->buttonIndex() ^ 1);
|
||||
};
|
||||
ui->buttonMusic->onClick = [this] {
|
||||
ui->buttonMusic->setButtonIndex(ui->buttonMusic->buttonIndex() ^ 1);
|
||||
updateInterface();
|
||||
};
|
||||
ui->buttonMusicVolumeDown->onClick = [this] {
|
||||
m_localMusicVolume = std::max(m_localMusicVolume - MusicVolumeStep, MusicVolumeMin);
|
||||
update();
|
||||
};
|
||||
ui->buttonMusicVolumeUp->onClick = [this] {
|
||||
m_localMusicVolume = std::min(m_localMusicVolume + MusicVolumeStep, MusicVolumeMax);
|
||||
update();
|
||||
};
|
||||
ui->buttonGammaDown->onClick = [this] {
|
||||
if (m_localGamma > GammaMin) {
|
||||
--m_localGamma;
|
||||
update();
|
||||
}
|
||||
};
|
||||
ui->buttonGammaUp->onClick = [this] {
|
||||
if (m_localGamma < GammaMax) {
|
||||
++m_localGamma;
|
||||
update();
|
||||
}
|
||||
};
|
||||
|
||||
ui->editShortCutPrimary->installEventFilter(this);
|
||||
ui->editShortCutSecondary->installEventFilter(this);
|
||||
connect(ui->listKeyBindings, &QListWidget::currentRowChanged, this, [this] { keyBindingSelectionChanged(); });
|
||||
|
||||
onShow = [this] {
|
||||
centerToScreen();
|
||||
setWindowTitle(phrases2.lookup(QStringLiteral("ACTIONHEADER_CONFIG")));
|
||||
m_fullScreenText = settingsText(0);
|
||||
m_gammaText = settingsText(1);
|
||||
m_restartText = settingsText(2);
|
||||
m_primaryText = settingsText(3);
|
||||
m_secondaryText = settingsText(4);
|
||||
m_languagesText = settingsText(5);
|
||||
m_keyBindingsText = settingsText(6);
|
||||
m_musicText = settingsText(9);
|
||||
m_musicVolumeText = settingsText(10);
|
||||
|
||||
m_languages.detectAvailable();
|
||||
ui->listLanguages->clear();
|
||||
for (int i = 0; i < m_languages.count(); ++i) {
|
||||
const Language &language = m_languages[i];
|
||||
if (!language.available)
|
||||
continue;
|
||||
QString text = language.name;
|
||||
if (!language.code.isEmpty())
|
||||
text += QStringLiteral(" (") + language.code + QLatin1Char(')');
|
||||
auto *item = new QListWidgetItem(text, ui->listLanguages);
|
||||
item->setData(Qt::UserRole, language.code);
|
||||
}
|
||||
loadData();
|
||||
for (QLineEdit *edit : {ui->editShortCutPrimary, ui->editShortCutSecondary}) {
|
||||
QPalette pal = edit->palette();
|
||||
pal.setColor(QPalette::Base, Qt::black);
|
||||
pal.setColor(QPalette::Text, MainTexture->colorMark);
|
||||
edit->setPalette(pal);
|
||||
}
|
||||
updateInterface();
|
||||
};
|
||||
onClose = [this] { ui->listKeyBindings->setCurrentRow(-1); };
|
||||
}
|
||||
|
||||
SettingsDlg::~SettingsDlg()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool SettingsDlg::localMusicEnabled() const
|
||||
{
|
||||
return (ui->buttonMusic->buttonIndex() & 1) == 1;
|
||||
}
|
||||
|
||||
void SettingsDlg::updateInterface()
|
||||
{
|
||||
ui->buttonMusicVolumeDown->setEnabled(localMusicEnabled());
|
||||
ui->buttonMusicVolumeUp->setEnabled(localMusicEnabled());
|
||||
}
|
||||
|
||||
void SettingsDlg::loadData()
|
||||
{
|
||||
int languageRow = 0;
|
||||
for (int i = 0; i < ui->listLanguages->count(); ++i) {
|
||||
if (ui->listLanguages->item(i)->data(Qt::UserRole).toString() == localeCode)
|
||||
languageRow = i;
|
||||
}
|
||||
ui->listLanguages->setCurrentRow(languageRow);
|
||||
ui->buttonFullscreen->setButtonIndex(fullScreen ? 3 : 2);
|
||||
ui->buttonMusic->setButtonIndex(musicEnabled ? 3 : 2);
|
||||
m_localMusicVolume = qRound(musicVolume * 100);
|
||||
m_localGamma = gamma;
|
||||
m_localKeyBindings.assign(KeyBindings::keyBindings);
|
||||
m_currentKeyBinding = nullptr;
|
||||
reloadKeyBindingList();
|
||||
keyBindingSelectionChanged();
|
||||
}
|
||||
|
||||
void SettingsDlg::saveData()
|
||||
{
|
||||
const bool needRestart = gamma != m_localGamma;
|
||||
if (ui->listLanguages->currentRow() >= 0)
|
||||
localeCode = ui->listLanguages->currentItem()->data(Qt::UserRole).toString();
|
||||
else
|
||||
localeCode.clear();
|
||||
fullScreen = (ui->buttonFullscreen->buttonIndex() & 1) == 1;
|
||||
musicEnabled = localMusicEnabled();
|
||||
musicVolume = static_cast<float>(m_localMusicVolume) / 100.0f;
|
||||
gamma = m_localGamma;
|
||||
if (needRestart)
|
||||
simpleMessage(m_restartText);
|
||||
// Take over a shortcut still being edited.
|
||||
keyBindingSelectionChanged();
|
||||
KeyBindings::keyBindings.assign(m_localKeyBindings);
|
||||
}
|
||||
|
||||
void SettingsDlg::resetClicked()
|
||||
{
|
||||
// TODO (as in the original): the default values should live in one place.
|
||||
ui->listLanguages->setCurrentRow(0);
|
||||
ui->buttonFullscreen->setButtonIndex(3);
|
||||
ui->buttonMusic->setButtonIndex(3);
|
||||
m_localMusicVolume = 50;
|
||||
m_localGamma = 100;
|
||||
ui->listKeyBindings->setCurrentRow(-1);
|
||||
m_currentKeyBinding = nullptr;
|
||||
keyBindingSelectionChanged();
|
||||
m_localKeyBindings.resetToDefault();
|
||||
reloadKeyBindingList();
|
||||
updateInterface();
|
||||
update();
|
||||
}
|
||||
|
||||
void SettingsDlg::reloadKeyBindingList()
|
||||
{
|
||||
const int row = ui->listKeyBindings->currentRow();
|
||||
ui->listKeyBindings->blockSignals(true);
|
||||
ui->listKeyBindings->clear();
|
||||
ui->listKeyBindings->addItems(m_localKeyBindings.toDisplayStrings());
|
||||
ui->listKeyBindings->setCurrentRow(row);
|
||||
ui->listKeyBindings->blockSignals(false);
|
||||
}
|
||||
|
||||
void SettingsDlg::keyBindingSelectionChanged()
|
||||
{
|
||||
if (m_currentKeyBinding) {
|
||||
m_currentKeyBinding->shortCut = KeyBindings::textToShortCut(ui->editShortCutPrimary->text());
|
||||
m_currentKeyBinding->shortCut2 = KeyBindings::textToShortCut(ui->editShortCutSecondary->text());
|
||||
}
|
||||
const int row = ui->listKeyBindings->currentRow();
|
||||
m_currentKeyBinding = row >= 0 && row < m_localKeyBindings.count() ? &m_localKeyBindings[row] : nullptr;
|
||||
if (m_currentKeyBinding) {
|
||||
ui->editShortCutPrimary->setText(m_currentKeyBinding->shortCut.isEmpty()
|
||||
? QString()
|
||||
: KeyBindings::shortCutToText(m_currentKeyBinding->shortCut));
|
||||
ui->editShortCutSecondary->setText(m_currentKeyBinding->shortCut2.isEmpty()
|
||||
? QString()
|
||||
: KeyBindings::shortCutToText(m_currentKeyBinding->shortCut2));
|
||||
} else {
|
||||
ui->editShortCutPrimary->clear();
|
||||
ui->editShortCutSecondary->clear();
|
||||
}
|
||||
ui->editShortCutPrimary->setEnabled(m_currentKeyBinding != nullptr);
|
||||
ui->editShortCutSecondary->setEnabled(m_currentKeyBinding != nullptr);
|
||||
}
|
||||
|
||||
void SettingsDlg::updateShortCutItem()
|
||||
{
|
||||
if (!m_currentKeyBinding)
|
||||
return;
|
||||
if (!m_currentKeyBinding->shortCut.isEmpty())
|
||||
m_localKeyBindings.removeShortCut(m_currentKeyBinding->shortCut);
|
||||
if (!m_currentKeyBinding->shortCut2.isEmpty())
|
||||
m_localKeyBindings.removeShortCut(m_currentKeyBinding->shortCut2);
|
||||
m_currentKeyBinding->shortCut = KeyBindings::textToShortCut(ui->editShortCutPrimary->text());
|
||||
m_currentKeyBinding->shortCut2 = KeyBindings::textToShortCut(ui->editShortCutSecondary->text());
|
||||
reloadKeyBindingList();
|
||||
}
|
||||
|
||||
bool SettingsDlg::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
const bool primary = watched == ui->editShortCutPrimary;
|
||||
if ((primary || watched == ui->editShortCutSecondary) && m_currentKeyBinding &&
|
||||
(event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)) {
|
||||
// The edit shows the pressed combination instead of receiving text.
|
||||
if (event->type() == QEvent::KeyRelease) {
|
||||
auto *keyEvent = static_cast<QKeyEvent *>(event);
|
||||
const int key = keyEvent->key();
|
||||
if (key != Qt::Key_Shift && key != Qt::Key_Control && key != Qt::Key_Alt && key != Qt::Key_Meta &&
|
||||
key != Qt::Key_AltGr) {
|
||||
const QKeySequence shortcut(keyEvent->modifiers() | key);
|
||||
if (primary) {
|
||||
m_currentKeyBinding->shortCut = shortcut;
|
||||
ui->editShortCutPrimary->setText(KeyBindings::shortCutToText(shortcut));
|
||||
} else {
|
||||
m_currentKeyBinding->shortCut2 = shortcut;
|
||||
ui->editShortCutSecondary->setText(KeyBindings::shortCutToText(shortcut));
|
||||
}
|
||||
updateShortCutItem();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return DrawDlg::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void SettingsDlg::paintEvent(QPaintEvent *)
|
||||
{
|
||||
constexpr int TextDistanceX = 20;
|
||||
constexpr int UpDownTextWidth = 120;
|
||||
QPainter painter(this);
|
||||
Dpi::Canvas canvas;
|
||||
canvas.bind(&painter);
|
||||
canvas.font().assign(UniFont[static_cast<std::size_t>(FontType::Normal)]);
|
||||
canvas.brush().setStyle(Qt::NoBrush);
|
||||
const QColor light = MainTexture->colorBevelLight;
|
||||
const QColor shade = MainTexture->colorBevelShade;
|
||||
|
||||
paintBackground(canvas, 3, 3, width() - 6, height() - 6, width(), height());
|
||||
frame(canvas, 0, 0, width() - 1, height() - 1, Qt::black, Qt::black);
|
||||
frame(canvas, 1, 1, width() - 2, height() - 2, light, shade);
|
||||
frame(canvas, 2, 2, width() - 3, height() - 3, light, shade);
|
||||
editFrame(canvas, ui->editShortCutPrimary->geometry(), *MainTexture);
|
||||
editFrame(canvas, ui->editShortCutSecondary->geometry(), *MainTexture);
|
||||
editFrame(canvas, ui->listLanguages->geometry(), *MainTexture);
|
||||
btnFrame(canvas, ui->buttonOk->geometry(), *MainTexture);
|
||||
btnFrame(canvas, ui->buttonCancel->geometry(), *MainTexture);
|
||||
|
||||
const auto checkFrame = [&](const QWidget *button) {
|
||||
rframe(canvas, button->x() - 1, button->y() - 1, button->x() + 12, button->y() + 12, shade, light);
|
||||
};
|
||||
checkFrame(ui->buttonFullscreen);
|
||||
checkFrame(ui->buttonMusic);
|
||||
loweredTextOut(canvas, -2, *MainTexture, ui->buttonMusic->x() + TextDistanceX, ui->buttonMusic->y() - 4,
|
||||
m_musicText);
|
||||
underlinedTitleValue(canvas, m_musicVolumeText, QString::number(m_localMusicVolume) + QLatin1Char('%'),
|
||||
ui->buttonMusicVolumeUp->x() - UpDownTextWidth - 4, ui->buttonMusicVolumeUp->y() + 2,
|
||||
UpDownTextWidth);
|
||||
|
||||
loweredTextOut(canvas, -2, *MainTexture, ui->listLanguages->x(), ui->listLanguages->y() - 26, m_languagesText);
|
||||
loweredTextOut(canvas, -2, *MainTexture, ui->listKeyBindings->x(), ui->listKeyBindings->y() - 26,
|
||||
m_keyBindingsText);
|
||||
loweredTextOut(canvas, -2, *MainTexture, ui->buttonFullscreen->x() + TextDistanceX, ui->buttonFullscreen->y() - 4,
|
||||
m_fullScreenText);
|
||||
underlinedTitleValue(canvas, m_gammaText, QString::number(m_localGamma) + QLatin1Char('%'),
|
||||
ui->buttonGammaUp->x() - UpDownTextWidth - 4, ui->buttonGammaUp->y() + 2, UpDownTextWidth);
|
||||
loweredTextOut(canvas, -2, *MainTexture, ui->editShortCutPrimary->x(), ui->editShortCutPrimary->y() - 26,
|
||||
m_primaryText);
|
||||
loweredTextOut(canvas, -2, *MainTexture, ui->editShortCutSecondary->x(), ui->editShortCutSecondary->y() - 26,
|
||||
m_secondaryText);
|
||||
canvas.unbind();
|
||||
}
|
||||
|
||||
} // namespace Cevo
|
||||
@@ -0,0 +1,78 @@
|
||||
// This file is part of c-evo-evo.
|
||||
//
|
||||
// This software is governed by the CeCILL license under French law and
|
||||
// abiding by the rules of distribution of free software. You can use,
|
||||
// modify and/or redistribute the software under the terms of the CeCILL
|
||||
// license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
// "http://www.cecill.info".
|
||||
//
|
||||
// As a counterpart to the access to the source code and rights to copy,
|
||||
// modify and redistribute granted by the license, users are provided only
|
||||
// with a limited warranty and the software's author, the holder of the
|
||||
// economic rights, and the successive licensors have only limited
|
||||
// liability.
|
||||
//
|
||||
// In this respect, the user's attention is drawn to the risks associated
|
||||
// with loading, using, modifying and/or developing or reproducing the
|
||||
// software by the user in light of its specific status of free software,
|
||||
// that may mean that it is complicated to manipulate, and that also
|
||||
// therefore means that it is reserved for developers and experienced
|
||||
// professionals having in-depth computer knowledge. Users are therefore
|
||||
// encouraged to load and test the software's suitability as regards their
|
||||
// requirements in conditions enabling the security of their systems and/or
|
||||
// data to be ensured and, more generally, to use and operate it in the
|
||||
// same conditions as regards security.
|
||||
//
|
||||
// The fact that you are presently reading this means that you have had
|
||||
// knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Cevo/CevoDrawDlg.h"
|
||||
#include "Languages.h"
|
||||
#include "localplayer/KeyBindings.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class SettingsDlg;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
// Equivalent of Settings.pas's TSettingsDlg: language, full screen, music,
|
||||
// gamma and key binding settings. Editing happens on local copies; OK
|
||||
// applies them to the global settings. The original's custom DPI controls
|
||||
// (DPI builds only) are not ported: Qt scales the interface by itself.
|
||||
class SettingsDlg : public DrawDlg {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SettingsDlg(Languages &languages, QWidget *parent = nullptr);
|
||||
~SettingsDlg() override;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
|
||||
private:
|
||||
void loadData();
|
||||
void saveData();
|
||||
void updateInterface();
|
||||
void updateShortCutItem();
|
||||
void reloadKeyBindingList();
|
||||
void keyBindingSelectionChanged();
|
||||
void resetClicked();
|
||||
bool localMusicEnabled() const;
|
||||
|
||||
Languages &m_languages;
|
||||
int m_localGamma = 100;
|
||||
int m_localMusicVolume = 50;
|
||||
KeyBindings::KeyBindingList m_localKeyBindings;
|
||||
KeyBindings::KeyBinding *m_currentKeyBinding = nullptr;
|
||||
// Phrases['SETTINGS', n], loaded when the dialog is shown.
|
||||
QString m_fullScreenText, m_gammaText, m_restartText, m_primaryText, m_secondaryText, m_languagesText,
|
||||
m_keyBindingsText, m_musicText, m_musicVolumeText;
|
||||
Ui::SettingsDlg *ui;
|
||||
};
|
||||
|
||||
} // namespace Cevo
|
||||
Vendored
+135
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This file is part of c-evo-evo.
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can use,
|
||||
modify and/or redistribute the software under the terms of the CeCILL
|
||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
"http://www.cecill.info".
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited
|
||||
liability.
|
||||
|
||||
In this respect, the user's attention is drawn to the risks associated
|
||||
with loading, using, modifying and/or developing or reproducing the
|
||||
software by the user in light of its specific status of free software,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
systems and/or data to be ensured and, more generally, to use and operate
|
||||
it in the same conditions as regards security.
|
||||
|
||||
The fact that you are presently reading this means that you have had
|
||||
knowledge of the CeCILL license and that you accept its terms.
|
||||
-->
|
||||
<ui version="4.0">
|
||||
<class>SettingsDlg</class>
|
||||
<widget class="QWidget" name="SettingsDlg">
|
||||
<property name="geometry">
|
||||
<rect><x>0</x><y>0</y><width>483</width><height>448</height></rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<widget class="Cevo::ListBoxEx" name="listLanguages">
|
||||
<property name="geometry">
|
||||
<rect><x>16</x><y>32</y><width>144</width><height>280</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonA" name="buttonOk">
|
||||
<property name="geometry">
|
||||
<rect><x>364</x><y>400</y><width>100</width><height>25</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonA" name="buttonCancel">
|
||||
<property name="geometry">
|
||||
<rect><x>244</x><y>400</y><width>100</width><height>25</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonC" name="buttonFullscreen">
|
||||
<property name="geometry">
|
||||
<rect><x>176</x><y>366</y><width>18</width><height>18</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonC" name="buttonGammaUp">
|
||||
<property name="geometry">
|
||||
<rect><x>452</x><y>360</y><width>12</width><height>12</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonC" name="buttonGammaDown">
|
||||
<property name="geometry">
|
||||
<rect><x>452</x><y>372</y><width>12</width><height>12</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ListBoxEx" name="listKeyBindings">
|
||||
<property name="geometry">
|
||||
<rect><x>176</x><y>32</y><width>288</width><height>232</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonA" name="buttonReset">
|
||||
<property name="geometry">
|
||||
<rect><x>16</x><y>400</y><width>100</width><height>25</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonC" name="buttonMusicVolumeDown">
|
||||
<property name="geometry">
|
||||
<rect><x>144</x><y>372</y><width>12</width><height>12</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonC" name="buttonMusicVolumeUp">
|
||||
<property name="geometry">
|
||||
<rect><x>144</x><y>360</y><width>12</width><height>12</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Cevo::ButtonC" name="buttonMusic">
|
||||
<property name="geometry">
|
||||
<rect><x>16</x><y>334</y><width>18</width><height>18</height></rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="editShortCutPrimary">
|
||||
<property name="geometry">
|
||||
<rect><x>176</x><y>296</y><width>136</width><height>27</height></rect>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="editShortCutSecondary">
|
||||
<property name="geometry">
|
||||
<rect><x>328</x><y>296</y><width>136</width><height>27</height></rect>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Cevo::ButtonA</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Cevo/CevoButtonA.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Cevo::ButtonC</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Cevo/CevoButtonC.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Cevo::ListBoxEx</class>
|
||||
<extends>QListWidget</extends>
|
||||
<header>Cevo/CevoListBoxEx.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
</ui>
|
||||
+9
-1
@@ -47,6 +47,7 @@
|
||||
#include "Global.h"
|
||||
#include "Inp.h"
|
||||
#include "Messg.h"
|
||||
#include "Settings.h"
|
||||
#include "StartLayout.h"
|
||||
#include "localplayer/KeyBindings.h"
|
||||
#include "localplayer/Term.h"
|
||||
@@ -393,7 +394,14 @@ void StartDlg::updateInterface()
|
||||
|
||||
void StartDlg::showSettings()
|
||||
{
|
||||
// TODO: Settings.pas (the configuration dialog) isn't ported yet.
|
||||
SettingsDlg settingsDlg(m_languages, this);
|
||||
if (settingsDlg.showModal() == Dpi::ModalResult::Ok) {
|
||||
loadAssets();
|
||||
changePage(m_page); // texts of the (possibly new) language
|
||||
updateInterface();
|
||||
updateMusic();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void StartDlg::updateMusic()
|
||||
|
||||
Reference in new issue
Block a user