Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Dec 1, 2024
1 parent 0e3f8d2 commit 0665ab8
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions src/panda_qt/config_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,50 +77,14 @@ ConfigWindow::ConfigWindow(Emulator* emu, QWidget* parent) : QDialog(parent), em
});
guiLayout->addRow(rememberPosition);

QSpinBox *windowPosX = new QSpinBox;
windowPosX->setMinimum(0);
windowPosX->setValue(config.windowSettings.x);
connect(windowPosX, &QSpinBox::valueChanged, this, [&](int value) {
config.windowSettings.x = static_cast<int>(value);
config.save();
});
guiLayout->addRow(tr("Window X position"), windowPosX);

QSpinBox *windowPosY = new QSpinBox;
windowPosY->setMinimum(0);
windowPosY->setValue(config.windowSettings.y);
connect(windowPosY, &QSpinBox::valueChanged, this, [&](int value) {
config.windowSettings.y = static_cast<int>(value);
config.save();
});
guiLayout->addRow(tr("Window Y position"), windowPosY);

QSpinBox *windowWidth = new QSpinBox;
windowWidth->setMinimum(0);
windowWidth->setValue(config.windowSettings.width);
connect(windowWidth, &QSpinBox::valueChanged, this, [&](int value) {
config.windowSettings.width = static_cast<int>(value);
config.save();
});
guiLayout->addRow(tr("Window width"), windowWidth);

QSpinBox *windowHeight = new QSpinBox;
windowHeight->setMinimum(0);
windowHeight->setValue(config.windowSettings.height);
connect(windowHeight, &QSpinBox::valueChanged, this, [&](int value) {
config.windowSettings.height = static_cast<int>(value);
config.save();
});
guiLayout->addRow(tr("Window height"), windowHeight);

// General settings
QGroupBox *genGroupBox = new QGroupBox(tr("General Settings"), this);
QFormLayout *genLayout = new QFormLayout(genGroupBox);
genLayout->setHorizontalSpacing(20);
genLayout->setVerticalSpacing(10);

QLineEdit *defaultRomPath = new QLineEdit;
defaultRomPath->setText(config.defaultRomPath.c_str());
defaultRomPath->setText(QString::fromStdU16String(config.defaultRomPath.u16string()));
connect(defaultRomPath, &QLineEdit::textChanged, this, [&](const QString &text) {
config.defaultRomPath = text.toStdString();
config.save();
Expand All @@ -129,7 +93,7 @@ ConfigWindow::ConfigWindow(Emulator* emu, QWidget* parent) : QDialog(parent), em
browseRomPath->setAutoDefault(false);
connect(browseRomPath, &QPushButton::pressed, this, [&, defaultRomPath]() {
QString newPath = QFileDialog::getExistingDirectory(
this, tr("Select Directory"), config.defaultRomPath.c_str(),
this, tr("Select Directory"), QString::fromStdU16String(config.defaultRomPath.u16string()),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
);
if (!newPath.isEmpty()) {
Expand Down

0 comments on commit 0665ab8

Please sign in to comment.