Qt: implement remainder of 'Options' menu

This commit is contained in:
Michael Maltese 2017-07-16 14:11:11 -07:00
parent 2b712bdbaa
commit e1554c04a1
6 changed files with 30 additions and 2 deletions

View File

@ -41,7 +41,7 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
AddTab(m_tabs, tr("General"), new GeneralPane(), "config");
AddTab(m_tabs, tr("Interface"), new InterfacePane(), "browse");
auto* audio_pane = new AudioPane;
AddTab(m_tabs, tr("Audio"), audio_pane, "play");
m_audio_pane_index = AddTab(m_tabs, tr("Audio"), audio_pane, "play");
AddTab(m_tabs, tr("Paths"), new PathPane(), "browse");
connect(this, &SettingsWindow::EmulationStarted,
@ -56,3 +56,8 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
setLayout(layout);
}
void SettingsWindow::SelectAudioPane()
{
m_tabs->setCurrentIndex(m_audio_pane_index);
}

View File

@ -13,10 +13,13 @@ class SettingsWindow final : public QDialog
Q_OBJECT
public:
explicit SettingsWindow(QWidget* parent = nullptr);
void SelectAudioPane();
signals:
void EmulationStarted();
void EmulationStopped();
private:
ListTabWidget* m_tabs;
int m_audio_pane_index = -1;
};

View File

@ -184,6 +184,10 @@ void MainWindow::ConnectMenuBar()
connect(m_menu_bar, &MenuBar::SetStateSlot, this, &MainWindow::SetStateSlot);
// Options
connect(m_menu_bar, &MenuBar::Configure, this, &MainWindow::ShowSettingsWindow);
connect(m_menu_bar, &MenuBar::ConfigureGraphics, this, &MainWindow::ShowGraphicsWindow);
connect(m_menu_bar, &MenuBar::ConfigureAudio, this, &MainWindow::ShowAudioWindow);
connect(m_menu_bar, &MenuBar::ConfigureControllers, this, &MainWindow::ShowControllersWindow);
connect(m_menu_bar, &MenuBar::ConfigureHotkeys, this, &MainWindow::ShowHotkeyDialog);
// Tools
@ -505,6 +509,12 @@ void MainWindow::ShowSettingsWindow()
m_settings_window->activateWindow();
}
void MainWindow::ShowAudioWindow()
{
m_settings_window->SelectAudioPane();
ShowSettingsWindow();
}
void MainWindow::ShowAboutDialog()
{
AboutDialog* about = new AboutDialog(this);

View File

@ -83,6 +83,7 @@ private:
void HideRenderWidget();
void ShowSettingsWindow();
void ShowAudioWindow();
void ShowControllersWindow();
void ShowGraphicsWindow();
void ShowAboutDialog();

View File

@ -197,7 +197,12 @@ void MenuBar::AddViewMenu()
void MenuBar::AddOptionsMenu()
{
QMenu* options_menu = addMenu(tr("Options"));
options_menu->addAction(tr("Hotkey Settings"), this, &MenuBar::ConfigureHotkeys);
options_menu->addAction(tr("Co&nfiguration..."), this, &MenuBar::Configure);
options_menu->addSeparator();
options_menu->addAction(tr("&Graphics Settings..."), this, &MenuBar::ConfigureGraphics);
options_menu->addAction(tr("&Audio Settings..."), this, &MenuBar::ConfigureAudio);
options_menu->addAction(tr("&Controller Settings..."), this, &MenuBar::ConfigureControllers);
options_menu->addAction(tr("&Hotkey Settings..."), this, &MenuBar::ConfigureHotkeys);
}
void MenuBar::AddHelpMenu()

View File

@ -44,6 +44,10 @@ signals:
void PerformOnlineUpdate(const std::string& region);
// Options
void Configure();
void ConfigureGraphics();
void ConfigureAudio();
void ConfigureControllers();
void ConfigureHotkeys();
// View