mirror of
https://github.com/86Box/86Box.git
synced 2026-02-21 17:15:32 -07:00
Manager: Add a button to reset to the default VM directory
This commit is contained in:
@@ -29,6 +29,7 @@ extern WindowsDarkModeFilter *vmm_dark_mode_filter;
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/version.h>
|
||||
}
|
||||
|
||||
@@ -53,6 +54,7 @@ VMManagerPreferences::
|
||||
if (machinesRunning) {
|
||||
ui->systemDirectory->setEnabled(false);
|
||||
ui->dirSelectButton->setEnabled(false);
|
||||
ui->pushButtonDefaultSystemDir->setEnabled(false);
|
||||
ui->dirSelectButton->setToolTip(tr("To change the system directory, stop all running machines."));
|
||||
}
|
||||
|
||||
@@ -97,6 +99,14 @@ VMManagerPreferences::chooseDirectoryLocation()
|
||||
ui->systemDirectory->setText(QDir::toNativeSeparators(directory));
|
||||
}
|
||||
|
||||
void
|
||||
VMManagerPreferences::on_pushButtonDefaultSystemDir_released()
|
||||
{
|
||||
char temp[1024];
|
||||
plat_get_vmm_dir(temp, sizeof(temp));
|
||||
ui->systemDirectory->setText(QDir::toNativeSeparators(QDir(temp).path()));
|
||||
}
|
||||
|
||||
void
|
||||
VMManagerPreferences::on_pushButtonLanguage_released()
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ private:
|
||||
QString settingsFile;
|
||||
private slots:
|
||||
void chooseDirectoryLocation();
|
||||
void on_pushButtonDefaultSystemDir_released();
|
||||
void on_pushButtonLanguage_released();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -56,6 +56,36 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonDefaultSystemDir">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelLanguage">
|
||||
<property name="text">
|
||||
@@ -170,6 +200,7 @@
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>dirSelectButton</tabstop>
|
||||
<tabstop>pushButtonDefaultSystemDir</tabstop>
|
||||
<tabstop>comboBoxLanguage</tabstop>
|
||||
<tabstop>pushButtonLanguage</tabstop>
|
||||
<tabstop>rememberSizePositionCheckBox</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user