Dolphin[Qt|WX]: Miscellaneous cleanup.
DolphinQt: * Make the connect() calls explicit, not automatic * Follow better naming convention for the QActions * Remove the Open action from the toolbar. Dolphin[Qt|WX]: * Move the "Skip Bundle" option to the root CMakeLists so that both DolphinQt and DolphinWX can use it.
This commit is contained in:
parent
4cf8697957
commit
a96acea03c
|
@ -18,6 +18,10 @@ option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON)
|
||||||
option(FASTLOG "Enable all logs" OFF)
|
option(FASTLOG "Enable all logs" OFF)
|
||||||
option(OPROFILING "Enable profiling" OFF)
|
option(OPROFILING "Enable profiling" OFF)
|
||||||
option(GDBSTUB "Enable gdb stub for remote debugging." OFF)
|
option(GDBSTUB "Enable gdb stub for remote debugging." OFF)
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF)
|
||||||
|
endif()
|
||||||
########################################
|
########################################
|
||||||
# Optional Targets
|
# Optional Targets
|
||||||
# TODO: Add DSPSpy
|
# TODO: Add DSPSpy
|
||||||
|
|
|
@ -33,12 +33,25 @@ DMainWindow::DMainWindow(QWidget* parent_widget)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Resources::Init();
|
Resources::Init();
|
||||||
|
|
||||||
UpdateIcons();
|
UpdateIcons();
|
||||||
setWindowIcon(Resources::GetIcon(Resources::DOLPHIN_LOGO));
|
setWindowIcon(Resources::GetIcon(Resources::DOLPHIN_LOGO));
|
||||||
|
|
||||||
|
// Connect all the signals/slots
|
||||||
connect(this, SIGNAL(CoreStateChanged(Core::EState)), this, SLOT(OnCoreStateChanged(Core::EState)));
|
connect(this, SIGNAL(CoreStateChanged(Core::EState)), this, SLOT(OnCoreStateChanged(Core::EState)));
|
||||||
emit CoreStateChanged(Core::CORE_UNINITIALIZED); // update GUI items
|
|
||||||
|
connect(m_ui->actionOpen, SIGNAL(triggered()), this, SLOT(OnOpen()));
|
||||||
|
|
||||||
|
connect(m_ui->actionPlay, SIGNAL(triggered()), this, SLOT(OnPlay()));
|
||||||
|
connect(m_ui->actionStop, SIGNAL(triggered()), this, SLOT(OnStop()));
|
||||||
|
|
||||||
|
connect(m_ui->actionWebsite, SIGNAL(triggered()), this, SLOT(OnOpenWebsite()));
|
||||||
|
connect(m_ui->actionOnlineDocs, SIGNAL(triggered()), this, SLOT(OnOpenDocs()));
|
||||||
|
connect(m_ui->actionGitHub, SIGNAL(triggered()), this, SLOT(OnOpenGitHub()));
|
||||||
|
connect(m_ui->actionSystemInfo, SIGNAL(triggered()), this, SLOT(OnOpenSystemInfo()));
|
||||||
|
connect(m_ui->actionAbout, SIGNAL(triggered()), this, SLOT(OnOpenAbout()));
|
||||||
|
|
||||||
|
// Update GUI items
|
||||||
|
emit CoreStateChanged(Core::CORE_UNINITIALIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
DMainWindow::~DMainWindow()
|
DMainWindow::~DMainWindow()
|
||||||
|
@ -121,12 +134,12 @@ void DMainWindow::DoStartPause()
|
||||||
m_render_widget->setCursor(Qt::BlankCursor);
|
m_render_widget->setCursor(Qt::BlankCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMainWindow::on_actOpen_triggered()
|
void DMainWindow::OnOpen()
|
||||||
{
|
{
|
||||||
StartGame(ShowFileDialog());
|
StartGame(ShowFileDialog());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMainWindow::on_actPlay_triggered()
|
void DMainWindow::OnPlay()
|
||||||
{
|
{
|
||||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||||
{
|
{
|
||||||
|
@ -141,7 +154,7 @@ void DMainWindow::on_actPlay_triggered()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMainWindow::on_actStop_triggered()
|
void DMainWindow::OnStop()
|
||||||
{
|
{
|
||||||
if (Core::GetState() != Core::CORE_UNINITIALIZED && !m_isStopping)
|
if (Core::GetState() != Core::CORE_UNINITIALIZED && !m_isStopping)
|
||||||
{
|
{
|
||||||
|
@ -192,20 +205,20 @@ void DMainWindow::OnCoreStateChanged(Core::EState state)
|
||||||
bool is_paused = (state == Core::CORE_PAUSE);
|
bool is_paused = (state == Core::CORE_PAUSE);
|
||||||
|
|
||||||
// Update the toolbar
|
// Update the toolbar
|
||||||
m_ui->actPlay->setEnabled(is_not_initialized || is_running || is_paused);
|
m_ui->actionPlay->setEnabled(is_not_initialized || is_running || is_paused);
|
||||||
if (is_running)
|
if (is_running)
|
||||||
{
|
{
|
||||||
m_ui->actPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PAUSE));
|
m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PAUSE));
|
||||||
m_ui->actPlay->setText(tr("Pause"));
|
m_ui->actionPlay->setText(tr("Pause"));
|
||||||
}
|
}
|
||||||
else if (is_paused || is_not_initialized)
|
else if (is_paused || is_not_initialized)
|
||||||
{
|
{
|
||||||
m_ui->actPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PLAY));
|
m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PLAY));
|
||||||
m_ui->actPlay->setText(tr("Play"));
|
m_ui->actionPlay->setText(tr("Play"));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->actStop->setEnabled(!is_not_initialized);
|
m_ui->actionStop->setEnabled(!is_not_initialized);
|
||||||
m_ui->actOpen->setEnabled(is_not_initialized);
|
m_ui->actionOpen->setEnabled(is_not_initialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DRenderWidget
|
// DRenderWidget
|
||||||
|
@ -239,33 +252,33 @@ bool DMainWindow::RenderWidgetHasFocus()
|
||||||
// "Resources". Call this function after changing the icon theme.
|
// "Resources". Call this function after changing the icon theme.
|
||||||
void DMainWindow::UpdateIcons()
|
void DMainWindow::UpdateIcons()
|
||||||
{
|
{
|
||||||
m_ui->actOpen->setIcon(Resources::GetIcon(Resources::TOOLBAR_OPEN));
|
// Play/Pause is handled in OnCoreStateChanged().
|
||||||
m_ui->actStop->setIcon(Resources::GetIcon(Resources::TOOLBAR_STOP));
|
m_ui->actionStop->setIcon(Resources::GetIcon(Resources::TOOLBAR_STOP));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Help menu
|
// Help menu
|
||||||
void DMainWindow::on_actWebsite_triggered()
|
void DMainWindow::OnOpenWebsite()
|
||||||
{
|
{
|
||||||
QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/")));
|
QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMainWindow::on_actOnlineDocs_triggered()
|
void DMainWindow::OnOpenDocs()
|
||||||
{
|
{
|
||||||
QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/docs/guides/")));
|
QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/docs/guides/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMainWindow::on_actGitHub_triggered()
|
void DMainWindow::OnOpenGitHub()
|
||||||
{
|
{
|
||||||
QDesktopServices::openUrl(QUrl(SL("https://github.com/dolphin-emu/dolphin/")));
|
QDesktopServices::openUrl(QUrl(SL("https://github.com/dolphin-emu/dolphin/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMainWindow::on_actSystemInfo_triggered()
|
void DMainWindow::OnOpenSystemInfo()
|
||||||
{
|
{
|
||||||
DSystemInfo* dlg = new DSystemInfo(this);
|
DSystemInfo* dlg = new DSystemInfo(this);
|
||||||
dlg->open();
|
dlg->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMainWindow::on_actAbout_triggered()
|
void DMainWindow::OnOpenAbout()
|
||||||
{
|
{
|
||||||
DAboutDialog* dlg = new DAboutDialog(this);
|
DAboutDialog* dlg = new DAboutDialog(this);
|
||||||
dlg->open();
|
dlg->open();
|
||||||
|
|
|
@ -39,16 +39,16 @@ private slots:
|
||||||
void OnCoreStateChanged(Core::EState state);
|
void OnCoreStateChanged(Core::EState state);
|
||||||
|
|
||||||
// Main toolbar
|
// Main toolbar
|
||||||
void on_actOpen_triggered();
|
void OnOpen();
|
||||||
void on_actPlay_triggered();
|
void OnPlay();
|
||||||
void on_actStop_triggered();
|
void OnStop();
|
||||||
|
|
||||||
// Help menu
|
// Help menu
|
||||||
void on_actWebsite_triggered();
|
void OnOpenWebsite();
|
||||||
void on_actOnlineDocs_triggered();
|
void OnOpenDocs();
|
||||||
void on_actGitHub_triggered();
|
void OnOpenGitHub();
|
||||||
void on_actSystemInfo_triggered();
|
void OnOpenSystemInfo();
|
||||||
void on_actAbout_triggered();
|
void OnOpenAbout();
|
||||||
|
|
||||||
// Misc.
|
// Misc.
|
||||||
void UpdateIcons();
|
void UpdateIcons();
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Fi&le</string>
|
<string>Fi&le</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actOpen"/>
|
<addaction name="actionOpen"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="mnuEmulation">
|
<widget class="QMenu" name="mnuEmulation">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -65,12 +65,13 @@
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Help</string>
|
<string>Help</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actWebsite"/>
|
<addaction name="actionWebsite"/>
|
||||||
<addaction name="actOnlineDocs"/>
|
<addaction name="actionOnlineDocs"/>
|
||||||
<addaction name="actGitHub"/>
|
<addaction name="actionGitHub"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actSystemInfo"/>
|
<addaction name="actionSystemInfo"/>
|
||||||
<addaction name="actAbout"/>
|
<addaction name="actionAbout"/>
|
||||||
|
<addaction name="actionAboutQt"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="mnuMovie">
|
<widget class="QMenu" name="mnuMovie">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -96,34 +97,35 @@
|
||||||
<attribute name="toolBarBreak">
|
<attribute name="toolBarBreak">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="actOpen"/>
|
<addaction name="actionPlay"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="actionStop"/>
|
||||||
<addaction name="actPlay"/>
|
|
||||||
<addaction name="actStop"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<action name="actWebsite">
|
<action name="actionWebsite">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Website</string>
|
<string>&Website</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actOnlineDocs">
|
<action name="actionOnlineDocs">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Online Documentation</string>
|
<string>&Online Documentation</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actGitHub">
|
<action name="actionGitHub">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Dolphin at GitHub</string>
|
<string>&Dolphin at GitHub</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actAbout">
|
<action name="actionAbout">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&About</string>
|
<string>&About</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="menuRole">
|
||||||
|
<enum>QAction::AboutRole</enum>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actOpen">
|
<action name="actionOpen">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Open</string>
|
<string>&Open...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Open file...</string>
|
<string>Open file...</string>
|
||||||
|
@ -132,21 +134,29 @@
|
||||||
<string>Ctrl+O</string>
|
<string>Ctrl+O</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actSystemInfo">
|
<action name="actionSystemInfo">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&System Information</string>
|
<string>&System Information</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actPlay">
|
<action name="actionPlay">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Play</string>
|
<string>Play</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actStop">
|
<action name="actionStop">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Stop</string>
|
<string>Stop</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionAboutQt">
|
||||||
|
<property name="text">
|
||||||
|
<string>About Qt</string>
|
||||||
|
</property>
|
||||||
|
<property name="menuRole">
|
||||||
|
<enum>QAction::AboutQtRole</enum>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
||||||
option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(LIBS core
|
set(LIBS core
|
||||||
uicommon
|
uicommon
|
||||||
${LZO}
|
${LZO}
|
||||||
|
|
Loading…
Reference in New Issue