mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
Merge pull request #6717 from lemondrops/manager-misc
Manager: Various improvements
This commit is contained in:
@@ -93,21 +93,12 @@ VMManagerDetails::VMManagerDetails(QWidget *parent)
|
||||
// Set the icons for the screenshot navigation buttons
|
||||
ui->screenshotNext->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowRight));
|
||||
ui->screenshotPrevious->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowLeft));
|
||||
ui->screenshotNextTB->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowRight));
|
||||
ui->screenshotPreviousTB->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowLeft));
|
||||
// Disabled by default
|
||||
ui->screenshotNext->setEnabled(false);
|
||||
ui->screenshotPrevious->setEnabled(false);
|
||||
ui->screenshotNextTB->setEnabled(false);
|
||||
ui->screenshotPreviousTB->setEnabled(false);
|
||||
// Connect their signals
|
||||
connect(ui->screenshotNext, &QPushButton::clicked, this, &VMManagerDetails::nextScreenshot);
|
||||
connect(ui->screenshotNextTB, &QToolButton::clicked, this, &VMManagerDetails::nextScreenshot);
|
||||
connect(ui->screenshotPreviousTB, &QToolButton::clicked, this, &VMManagerDetails::previousScreenshot);
|
||||
connect(ui->screenshotPrevious, &QPushButton::clicked, this, &VMManagerDetails::previousScreenshot);
|
||||
// These push buttons can be taken out if the tool buttons stay
|
||||
ui->screenshotNext->setVisible(false);
|
||||
ui->screenshotPrevious->setVisible(false);
|
||||
connect(ui->screenshotNext, &QToolButton::clicked, this, &VMManagerDetails::nextScreenshot);
|
||||
connect(ui->screenshotPrevious, &QToolButton::clicked, this, &VMManagerDetails::previousScreenshot);
|
||||
QString toolButtonStyleSheet;
|
||||
// Simple method to try and determine if light mode is enabled
|
||||
#ifdef Q_OS_WINDOWS
|
||||
@@ -207,8 +198,6 @@ VMManagerDetails::reset()
|
||||
|
||||
ui->screenshotNext->setEnabled(false);
|
||||
ui->screenshotPrevious->setEnabled(false);
|
||||
ui->screenshotNextTB->setEnabled(false);
|
||||
ui->screenshotPreviousTB->setEnabled(false);
|
||||
ui->screenshot->setPixmap(QString());
|
||||
ui->screenshot->setFixedSize(240, 160);
|
||||
ui->screenshot->setFrameStyle(QFrame::Box | QFrame::Sunken);
|
||||
@@ -384,8 +373,6 @@ VMManagerDetails::updateScreenshots(VMManagerSystem *passed_sysconfig)
|
||||
// Disable screenshot navigation buttons by default
|
||||
ui->screenshotNext->setEnabled(false);
|
||||
ui->screenshotPrevious->setEnabled(false);
|
||||
ui->screenshotNextTB->setEnabled(false);
|
||||
ui->screenshotPreviousTB->setEnabled(false);
|
||||
|
||||
// Different actions are taken depending on the existence and number of screenshots
|
||||
screenshots = passed_sysconfig->getScreenshots();
|
||||
@@ -395,8 +382,6 @@ VMManagerDetails::updateScreenshots(VMManagerSystem *passed_sysconfig)
|
||||
if (screenshots.size() > 1) {
|
||||
ui->screenshotNext->setEnabled(true);
|
||||
ui->screenshotPrevious->setEnabled(true);
|
||||
ui->screenshotNextTB->setEnabled(true);
|
||||
ui->screenshotPreviousTB->setEnabled(true);
|
||||
}
|
||||
#ifdef Q_OS_WINDOWS
|
||||
ui->screenshot->setStyleSheet("");
|
||||
@@ -409,8 +394,6 @@ VMManagerDetails::updateScreenshots(VMManagerSystem *passed_sysconfig)
|
||||
} else {
|
||||
ui->screenshotNext->setEnabled(false);
|
||||
ui->screenshotPrevious->setEnabled(false);
|
||||
ui->screenshotNextTB->setEnabled(false);
|
||||
ui->screenshotPreviousTB->setEnabled(false);
|
||||
ui->screenshot->setPixmap(QString());
|
||||
ui->screenshot->setFixedSize(240, 160);
|
||||
ui->screenshot->setFrameStyle(QFrame::Box | QFrame::Sunken);
|
||||
|
||||
@@ -146,22 +146,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="screenshotPrevious">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="ssNavTBHolder" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
@@ -178,14 +162,14 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="screenshotPreviousTB">
|
||||
<widget class="QToolButton" name="screenshotPrevious">
|
||||
<property name="text">
|
||||
<string>…</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="screenshotNextTB">
|
||||
<widget class="QToolButton" name="screenshotNext">
|
||||
<property name="text">
|
||||
<string>…</string>
|
||||
</property>
|
||||
@@ -197,19 +181,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="screenshotNext">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
|
||||
@@ -288,6 +288,7 @@ illegal_chars:
|
||||
// Get the index of the newly-created system and select it
|
||||
const QModelIndex mapped_index = proxy_model->mapFromSource(created_object);
|
||||
ui->listView->setCurrentIndex(mapped_index);
|
||||
modelDataChange();
|
||||
} else {
|
||||
QDir(dstPath).removeRecursively();
|
||||
QMessageBox::critical(this, tr("Clone"), tr("Failed to clone VM."), QMessageBox::Ok);
|
||||
@@ -764,6 +765,7 @@ VMManagerMain::addNewSystem(const QString &name, const QString &dir, const QStri
|
||||
const QModelIndex mapped_index = proxy_model->mapFromSource(created_object);
|
||||
ui->listView->setCurrentIndex(mapped_index);
|
||||
delete new_system;
|
||||
modelDataChange();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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