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