Remove the Machine menu (broken), also make sure buttons are not improperly enabled (#4)
This commit is contained in:
@@ -114,19 +114,25 @@ VMManagerDetails::VMManagerDetails(QWidget *parent) :
|
||||
startPauseButton = new QToolButton();
|
||||
startPauseButton->setIcon(QIcon(":/menuicons/qt/icons/run.ico"));
|
||||
startPauseButton->setAutoRaise(true);
|
||||
startPauseButton->setEnabled(false);
|
||||
ui->toolButtonHolder->setStyleSheet(toolButtonStyleSheet);
|
||||
resetButton = new QToolButton();
|
||||
resetButton->setIcon(QIcon(":/menuicons/qt/icons/hard_reset.ico"));
|
||||
resetButton->setEnabled(false);
|
||||
stopButton = new QToolButton();
|
||||
stopButton->setIcon(QIcon(":/menuicons/qt/icons/acpi_shutdown.ico"));
|
||||
stopButton->setEnabled(false);
|
||||
configureButton = new QToolButton();
|
||||
configureButton->setIcon(QIcon(":/menuicons/qt/icons/settings.ico"));
|
||||
configureButton->setEnabled(false);
|
||||
|
||||
ui->toolButtonHolder->layout()->addWidget(configureButton);
|
||||
ui->toolButtonHolder->layout()->addWidget(resetButton);
|
||||
ui->toolButtonHolder->layout()->addWidget(stopButton);
|
||||
ui->toolButtonHolder->layout()->addWidget(startPauseButton);
|
||||
|
||||
ui->notesTextEdit->setEnabled(false);
|
||||
|
||||
sysconfig = new VMManagerSystem();
|
||||
}
|
||||
|
||||
@@ -175,6 +181,8 @@ VMManagerDetails::updateData(VMManagerSystem *passed_sysconfig) {
|
||||
startPauseButton->setIcon(QIcon(":/menuicons/qt/icons/run.ico"));
|
||||
connect(startPauseButton, &QToolButton::clicked, sysconfig, &VMManagerSystem::startButtonPressed);
|
||||
}
|
||||
startPauseButton->setEnabled(true);
|
||||
configureButton->setEnabled(true);
|
||||
|
||||
// Each detail section here has its own VMManagerDetailSection.
|
||||
// When a system is selected in the list view it is updated here, through this object:
|
||||
@@ -237,6 +245,9 @@ VMManagerDetails::updateData(VMManagerSystem *passed_sysconfig) {
|
||||
ui->screenshotNextTB->setEnabled(true);
|
||||
ui->screenshotPreviousTB->setEnabled(true);
|
||||
}
|
||||
#ifdef Q_OS_WINDOWS
|
||||
ui->screenshot->setStyleSheet("");
|
||||
#endif
|
||||
if(QFileInfo::exists(screenshots.last().filePath())) {
|
||||
screenshotIndex = screenshots.size() - 1;
|
||||
const QPixmap pic(screenshots.at(screenshotIndex).filePath());
|
||||
@@ -253,6 +264,13 @@ VMManagerDetails::updateData(VMManagerSystem *passed_sysconfig) {
|
||||
ui->screenshot->setText(tr("No screenshot"));
|
||||
ui->screenshot->setEnabled(false);
|
||||
ui->screenshot->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
#ifdef Q_OS_WINDOWS
|
||||
if (!windows_is_light_theme()) {
|
||||
ui->screenshot->setStyleSheet("QLabel { border: 1px solid gray }");
|
||||
} else {
|
||||
ui->screenshot->setStyleSheet("");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ui->systemLabel->setText(passed_sysconfig->displayName);
|
||||
@@ -260,6 +278,7 @@ VMManagerDetails::updateData(VMManagerSystem *passed_sysconfig) {
|
||||
tr("Not running") :
|
||||
QString("%1: PID %2").arg(tr("Running"), QString::number(sysconfig->process->processId())));
|
||||
ui->notesTextEdit->setPlainText(passed_sysconfig->notes);
|
||||
ui->notesTextEdit->setEnabled(true);
|
||||
|
||||
disconnect(sysconfig->process, &QProcess::stateChanged, this, &VMManagerDetails::updateProcessStatus);
|
||||
connect(sysconfig->process, &QProcess::stateChanged, this, &VMManagerDetails::updateProcessStatus);
|
||||
|
||||
@@ -72,6 +72,7 @@ VMManagerDetailSection(const QString §ionName)
|
||||
ui->collapseButtonHolder->layout()->addItem(hSpacer);
|
||||
// collapseButton->setContent(frame);
|
||||
// ui->sectionName->setVisible(false);
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
VMManagerDetailSection::
|
||||
@@ -227,11 +228,14 @@ VMManagerDetailSection::setSections()
|
||||
}
|
||||
}
|
||||
collapseButton->setContent(ui->detailFrame);
|
||||
if (sections.size())
|
||||
setVisible(true);
|
||||
}
|
||||
void
|
||||
VMManagerDetailSection::clear()
|
||||
{
|
||||
sections.clear();
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
// QT for Linux and Windows doesn't have the same default margins as QT on MacOS.
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>900</width>
|
||||
<height>24</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuTools">
|
||||
@@ -30,17 +30,6 @@
|
||||
<addaction name="actionPreferences"/>
|
||||
<addaction name="actionCheck_for_updates"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuMachine">
|
||||
<property name="title">
|
||||
<string>Machine</string>
|
||||
</property>
|
||||
<addaction name="actionStartPause"/>
|
||||
<addaction name="actionForce_Shutdown"/>
|
||||
<addaction name="actionHard_Reset"/>
|
||||
<addaction name="actionCtrl_Alt_Del"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSettings"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
@@ -48,7 +37,6 @@
|
||||
<addaction name="actionNew_Machine"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuMachine"/>
|
||||
<addaction name="menuTools"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
@@ -66,7 +54,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
<enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
@@ -167,7 +155,7 @@
|
||||
<string>&Settings...</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
<property name="iconVisibleInMenu">
|
||||
<bool>false</bool>
|
||||
@@ -193,7 +181,7 @@
|
||||
<string>Preferences</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::PreferencesRole</enum>
|
||||
<enum>QAction::MenuRole::PreferencesRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionStart">
|
||||
|
||||
Reference in New Issue
Block a user