mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-03-13 08:10:52 +03:00
Lay the groundwork for a QMenuBar
This commit is contained in:
@@ -83,8 +83,8 @@ void MainWindow::onPrevButtonClicked()
|
||||
|
||||
void MainWindow::updateNavigationButtons(int currentIndex)
|
||||
{
|
||||
prevButton->setVisible(currentIndex > 0);
|
||||
nextButton->setVisible(currentIndex < buttonGroup->buttons().size() - 1);
|
||||
prevButton->setEnabled(currentIndex > 0); // We can use setVisible if we want to mimic CrystalDiskInfo
|
||||
nextButton->setEnabled(currentIndex < buttonGroup->buttons().size() - 1);
|
||||
}
|
||||
|
||||
void MainWindow::scanDevices()
|
||||
@@ -667,3 +667,9 @@ QString MainWindow::toTitleCase(const QString& sentence) {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExit_triggered()
|
||||
{
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private slots:
|
||||
void on_actionExit_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QButtonGroup *buttonGroup;
|
||||
|
||||
111
mainwindow.ui
111
mainwindow.ui
@@ -320,6 +320,117 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionSave_JSON"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Function</string>
|
||||
</property>
|
||||
<addaction name="actionRescan_Refresh"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionIgnore_C4_Reallocation_Event_Count"/>
|
||||
<addaction name="actionDon"/>
|
||||
<addaction name="actionUse_Fahrenheit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuFunction">
|
||||
<property name="title">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
<addaction name="actionGitHub"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuHelp"/>
|
||||
<addaction name="menuFunction"/>
|
||||
</widget>
|
||||
<action name="actionSave_JSON">
|
||||
<property name="icon">
|
||||
<iconset theme="document-save"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Save JSON</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExit">
|
||||
<property name="icon">
|
||||
<iconset theme="application-exit"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Exit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Alt+F4</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::QuitRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRescan_Refresh">
|
||||
<property name="icon">
|
||||
<iconset theme="view-refresh"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Rescan and Refresh</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGitHub">
|
||||
<property name="text">
|
||||
<string>&GitHub</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset theme="help-about"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&About</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::AboutRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionIgnore_C4_Reallocation_Event_Count">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Ignore C4 (Reallocated Event Count)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDon">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Decimal Raw Values</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUse_Fahrenheit">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use Fahrenheit</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Reference in New Issue
Block a user