2014-09-14 19:03:07 +00:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2014-09-14 19:03:07 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2015-09-06 06:39:35 +00:00
|
|
|
#include <memory>
|
2014-11-11 02:41:17 +00:00
|
|
|
#include <QActionGroup>
|
2015-09-12 17:10:38 +00:00
|
|
|
#include <QCloseEvent>
|
2014-09-14 19:03:07 +00:00
|
|
|
#include <QDesktopServices>
|
2014-11-02 18:53:48 +00:00
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QMessageBox>
|
2014-09-14 19:03:07 +00:00
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
#include "ui_MainWindow.h"
|
2014-10-18 15:07:17 +00:00
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
#include "Core/BootManager.h"
|
|
|
|
#include "Core/ConfigManager.h"
|
2015-05-02 23:18:02 +00:00
|
|
|
#include "Core/HW/ProcessorInterface.h"
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2014-10-18 15:07:17 +00:00
|
|
|
#include "DolphinQt/AboutDialog.h"
|
2015-09-12 18:00:08 +00:00
|
|
|
#include "DolphinQt/Host.h"
|
2014-10-18 15:07:17 +00:00
|
|
|
#include "DolphinQt/MainWindow.h"
|
2014-10-25 13:21:05 +00:00
|
|
|
#include "DolphinQt/SystemInfo.h"
|
2014-10-18 15:07:17 +00:00
|
|
|
#include "DolphinQt/Utils/Resources.h"
|
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
#include "VideoCommon/VideoConfig.h"
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
// The "g_main_window" object as defined in MainWindow.h
|
|
|
|
DMainWindow* g_main_window = nullptr;
|
|
|
|
|
2014-10-18 15:07:17 +00:00
|
|
|
DMainWindow::DMainWindow(QWidget* parent_widget)
|
|
|
|
: QMainWindow(parent_widget)
|
2014-09-14 19:03:07 +00:00
|
|
|
{
|
2014-10-25 13:21:05 +00:00
|
|
|
m_ui = std::make_unique<Ui::DMainWindow>();
|
|
|
|
m_ui->setupUi(this);
|
2014-11-02 18:53:48 +00:00
|
|
|
|
|
|
|
Resources::Init();
|
|
|
|
UpdateIcons();
|
|
|
|
setWindowIcon(Resources::GetIcon(Resources::DOLPHIN_LOGO));
|
|
|
|
|
2014-11-11 02:41:17 +00:00
|
|
|
// Create the GameList
|
|
|
|
m_game_tracker = new DGameTracker(this);
|
|
|
|
m_ui->centralWidget->addWidget(m_game_tracker);
|
|
|
|
m_game_tracker->ScanForGames();
|
|
|
|
m_game_tracker->SelectLastBootedGame();
|
|
|
|
|
|
|
|
// Setup the GameList style switching actions
|
|
|
|
QActionGroup* gamelistGroup = new QActionGroup(this);
|
|
|
|
gamelistGroup->addAction(m_ui->actionListView);
|
|
|
|
gamelistGroup->addAction(m_ui->actionTreeView);
|
|
|
|
gamelistGroup->addAction(m_ui->actionGridView);
|
|
|
|
gamelistGroup->addAction(m_ui->actionIconView);
|
|
|
|
|
|
|
|
// TODO: save/load this from user prefs!
|
|
|
|
m_ui->actionListView->setChecked(true);
|
|
|
|
OnGameListStyleChanged();
|
|
|
|
|
2014-11-06 01:53:34 +00:00
|
|
|
// Connect all the signals/slots
|
2015-09-11 03:31:40 +00:00
|
|
|
connect(this, &DMainWindow::CoreStateChanged, this, &DMainWindow::OnCoreStateChanged);
|
|
|
|
|
|
|
|
connect(m_ui->actionOpen, &QAction::triggered, this, [&]() {
|
|
|
|
QString filename = ShowFileDialog();
|
|
|
|
if (!filename.isNull())
|
|
|
|
StartGame(filename);
|
|
|
|
});
|
|
|
|
connect(m_ui->actionBrowse, &QAction::triggered, this, &DMainWindow::OnBrowse);
|
2015-09-12 17:10:38 +00:00
|
|
|
connect(m_ui->actionExit, &QAction::triggered, this, [&]() {
|
|
|
|
close();
|
|
|
|
});
|
2015-09-11 03:31:40 +00:00
|
|
|
|
|
|
|
connect(m_ui->actionListView, &QAction::triggered, this, &DMainWindow::OnGameListStyleChanged);
|
|
|
|
connect(m_ui->actionTreeView, &QAction::triggered, this, &DMainWindow::OnGameListStyleChanged);
|
|
|
|
connect(m_ui->actionGridView, &QAction::triggered, this, &DMainWindow::OnGameListStyleChanged);
|
|
|
|
connect(m_ui->actionIconView, &QAction::triggered, this, &DMainWindow::OnGameListStyleChanged);
|
|
|
|
|
|
|
|
connect(m_ui->actionPlay, &QAction::triggered, this, &DMainWindow::OnPlay);
|
|
|
|
connect(m_game_tracker, &DGameTracker::StartGame, this, &DMainWindow::OnPlay);
|
|
|
|
connect(m_ui->actionStop, &QAction::triggered, this, &DMainWindow::OnStop);
|
|
|
|
connect(m_ui->actionReset, &QAction::triggered, this, &DMainWindow::OnReset);
|
2015-09-12 17:22:47 +00:00
|
|
|
connect(m_ui->actionScreenshot, &QAction::triggered, this, []() {
|
2015-09-12 17:20:45 +00:00
|
|
|
Core::SaveScreenShot();
|
|
|
|
});
|
2015-09-11 03:31:40 +00:00
|
|
|
|
2015-09-12 17:22:47 +00:00
|
|
|
connect(m_ui->actionWebsite, &QAction::triggered, this, []() {
|
2015-11-26 04:05:43 +00:00
|
|
|
QDesktopServices::openUrl(QUrl(QStringLiteral("https://dolphin-emu.org/")));
|
2015-09-11 03:31:40 +00:00
|
|
|
});
|
2015-09-12 17:22:47 +00:00
|
|
|
connect(m_ui->actionOnlineDocs, &QAction::triggered, this, []() {
|
2015-11-26 04:05:43 +00:00
|
|
|
QDesktopServices::openUrl(QUrl(QStringLiteral("https://dolphin-emu.org/docs/guides/")));
|
2015-09-11 03:31:40 +00:00
|
|
|
});
|
2015-09-12 17:22:47 +00:00
|
|
|
connect(m_ui->actionGitHub, &QAction::triggered, this, []() {
|
2015-11-26 04:05:43 +00:00
|
|
|
QDesktopServices::openUrl(QUrl(QStringLiteral("https://github.com/dolphin-emu/dolphin")));
|
2015-09-11 03:31:40 +00:00
|
|
|
});
|
|
|
|
connect(m_ui->actionSystemInfo, &QAction::triggered, this, [&]() {
|
|
|
|
DSystemInfo* dlg = new DSystemInfo(this);
|
|
|
|
dlg->open();
|
|
|
|
});
|
|
|
|
connect(m_ui->actionAbout, &QAction::triggered, this, [&]() {
|
|
|
|
DAboutDialog* dlg = new DAboutDialog(this);
|
|
|
|
dlg->open();
|
|
|
|
});
|
|
|
|
connect(m_ui->actionAboutQt, &QAction::triggered, this, [&]() {
|
|
|
|
QApplication::aboutQt();
|
|
|
|
});
|
2014-11-06 01:53:34 +00:00
|
|
|
|
|
|
|
// Update GUI items
|
|
|
|
emit CoreStateChanged(Core::CORE_UNINITIALIZED);
|
2014-11-11 02:41:17 +00:00
|
|
|
|
|
|
|
// Platform-specific stuff
|
|
|
|
#ifdef Q_OS_MACX
|
|
|
|
m_ui->toolbar->setMovable(false);
|
|
|
|
#endif
|
2014-09-14 19:03:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DMainWindow::~DMainWindow()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-09-12 18:00:08 +00:00
|
|
|
bool DMainWindow::event(QEvent* e)
|
|
|
|
{
|
|
|
|
if (e->type() == HostEvent::TitleEvent)
|
|
|
|
{
|
|
|
|
HostTitleEvent* htev = (HostTitleEvent*)e;
|
|
|
|
m_ui->statusbar->showMessage(QString::fromStdString(htev->m_title), 1500);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return QMainWindow::event(e);
|
|
|
|
}
|
|
|
|
|
2015-05-03 06:18:10 +00:00
|
|
|
void DMainWindow::closeEvent(QCloseEvent* ce)
|
|
|
|
{
|
2015-09-12 17:10:38 +00:00
|
|
|
if (!OnStop())
|
|
|
|
ce->ignore();
|
|
|
|
else
|
|
|
|
QMainWindow::closeEvent(ce);
|
2015-05-03 06:18:10 +00:00
|
|
|
}
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
// Emulation
|
|
|
|
|
|
|
|
void DMainWindow::StartGame(const QString filename)
|
|
|
|
{
|
|
|
|
m_render_widget = std::make_unique<DRenderWidget>();
|
|
|
|
m_render_widget->setWindowTitle(tr("Dolphin")); // TODO
|
|
|
|
m_render_widget->setWindowIcon(windowIcon());
|
|
|
|
|
2015-06-12 11:56:53 +00:00
|
|
|
if (SConfig::GetInstance().bFullscreen)
|
2014-11-02 18:53:48 +00:00
|
|
|
{
|
2014-12-12 19:29:48 +00:00
|
|
|
m_render_widget->setWindowFlags(m_render_widget->windowFlags() | Qt::BypassWindowManagerHint);
|
|
|
|
g_Config.bFullscreen = !g_Config.bBorderlessFullscreen;
|
|
|
|
m_render_widget->showFullScreen();
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_ui->centralWidget->addWidget(m_render_widget.get());
|
|
|
|
m_ui->centralWidget->setCurrentWidget(m_render_widget.get());
|
2014-12-12 19:29:48 +00:00
|
|
|
|
2015-06-12 11:56:53 +00:00
|
|
|
if (SConfig::GetInstance().bRenderWindowAutoSize)
|
2015-05-03 06:59:40 +00:00
|
|
|
{
|
|
|
|
// Resize main window to fit render
|
2015-06-12 11:56:53 +00:00
|
|
|
m_render_widget->setMinimumSize(SConfig::GetInstance().iRenderWindowWidth,
|
|
|
|
SConfig::GetInstance().iRenderWindowHeight);
|
2015-05-03 06:59:40 +00:00
|
|
|
qApp->processEvents(); // Force a redraw so the window has time to resize
|
|
|
|
m_render_widget->setMinimumSize(0, 0); // Allow the widget to scale down
|
|
|
|
}
|
|
|
|
m_render_widget->adjustSize();
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!BootManager::BootCore(filename.toStdString()))
|
|
|
|
{
|
|
|
|
QMessageBox::critical(this, tr("Fatal error"), tr("Failed to init Core"), QMessageBox::Ok);
|
2015-06-12 11:56:53 +00:00
|
|
|
if (SConfig::GetInstance().bFullscreen)
|
2014-11-02 18:53:48 +00:00
|
|
|
m_render_widget->close();
|
2014-12-12 19:29:48 +00:00
|
|
|
else
|
|
|
|
m_ui->centralWidget->removeWidget(m_render_widget.get());
|
2014-11-02 18:53:48 +00:00
|
|
|
m_render_widget.reset();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-09 00:20:36 +00:00
|
|
|
DisableScreensaver();
|
2014-11-02 18:53:48 +00:00
|
|
|
emit CoreStateChanged(Core::CORE_RUN);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-09 00:20:36 +00:00
|
|
|
void DMainWindow::DisableScreensaver()
|
|
|
|
{
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
// Prevents Windows from sleeping or turning off the display
|
|
|
|
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void DMainWindow::EnableScreensaver()
|
|
|
|
{
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
// Allows Windows to sleep and turn off the display
|
|
|
|
SetThreadExecutionState(ES_CONTINUOUS);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
QString DMainWindow::RequestBootFilename()
|
|
|
|
{
|
|
|
|
// If a game is already selected, just return the filename
|
2014-11-11 02:41:17 +00:00
|
|
|
if (m_game_tracker->SelectedGame() != nullptr)
|
2015-09-12 17:20:16 +00:00
|
|
|
return m_game_tracker->SelectedGame()->GetFileName();
|
2014-11-02 18:53:48 +00:00
|
|
|
|
|
|
|
return ShowFileDialog();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString DMainWindow::ShowFileDialog()
|
|
|
|
{
|
|
|
|
return QFileDialog::getOpenFileName(this, tr("Open File"), QString(),
|
|
|
|
tr("All supported ROMs (%1);;All files (*)")
|
2015-11-26 04:05:43 +00:00
|
|
|
.arg(QStringLiteral("*.gcm *.iso *.ciso *.gcz *.wbfs *.elf *.dol *.dff *.tmd *.wad")));
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
|
|
|
|
2015-05-02 20:29:56 +00:00
|
|
|
QString DMainWindow::ShowFolderDialog()
|
|
|
|
{
|
|
|
|
return QFileDialog::getExistingDirectory(this, tr("Browse for a directory to add"),
|
2015-09-12 17:20:16 +00:00
|
|
|
QDir::homePath(), QFileDialog::ShowDirsOnly);
|
2015-05-02 20:29:56 +00:00
|
|
|
}
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
void DMainWindow::DoStartPause()
|
|
|
|
{
|
|
|
|
if (Core::GetState() == Core::CORE_RUN)
|
|
|
|
{
|
|
|
|
Core::SetState(Core::CORE_PAUSE);
|
|
|
|
emit CoreStateChanged(Core::CORE_PAUSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Core::SetState(Core::CORE_RUN);
|
|
|
|
emit CoreStateChanged(Core::CORE_RUN);
|
|
|
|
}
|
2015-06-12 11:56:53 +00:00
|
|
|
if (SConfig::GetInstance().bHideCursor)
|
2014-11-02 18:53:48 +00:00
|
|
|
m_render_widget->setCursor(Qt::BlankCursor);
|
|
|
|
}
|
|
|
|
|
2015-05-02 20:29:56 +00:00
|
|
|
void DMainWindow::OnBrowse()
|
|
|
|
{
|
|
|
|
std::string path = ShowFolderDialog().toStdString();
|
|
|
|
std::vector<std::string>& iso_folder = SConfig::GetInstance().m_ISOFolder;
|
|
|
|
if (!path.empty())
|
|
|
|
{
|
|
|
|
auto itResult = std::find(iso_folder.begin(), iso_folder.end(), path);
|
|
|
|
|
|
|
|
if (itResult == iso_folder.end())
|
|
|
|
{
|
|
|
|
iso_folder.push_back(path);
|
|
|
|
SConfig::GetInstance().SaveSettings();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_game_tracker->ScanForGames();
|
|
|
|
}
|
|
|
|
|
2014-11-06 01:53:34 +00:00
|
|
|
void DMainWindow::OnPlay()
|
2014-11-02 18:53:48 +00:00
|
|
|
{
|
|
|
|
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
|
|
|
{
|
|
|
|
DoStartPause();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// initialize Core and boot the game
|
|
|
|
QString filename = RequestBootFilename();
|
|
|
|
if (!filename.isNull())
|
|
|
|
StartGame(filename);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
bool DMainWindow::OnStop()
|
2014-11-02 18:53:48 +00:00
|
|
|
{
|
2014-12-12 19:29:48 +00:00
|
|
|
if (Core::GetState() == Core::CORE_UNINITIALIZED || m_isStopping)
|
2015-05-02 09:36:54 +00:00
|
|
|
return true;
|
2014-12-12 19:29:48 +00:00
|
|
|
|
|
|
|
// Ask for confirmation in case the user accidentally clicked Stop / Escape
|
2015-06-12 11:56:53 +00:00
|
|
|
if (SConfig::GetInstance().bConfirmStop)
|
2014-11-02 18:53:48 +00:00
|
|
|
{
|
2015-09-12 17:10:38 +00:00
|
|
|
// Pause emulation if it isn't already
|
|
|
|
bool wasPaused = false;
|
|
|
|
if (Core::GetState() == Core::CORE_PAUSE)
|
|
|
|
{
|
|
|
|
wasPaused = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Core::SetState(Core::CORE_PAUSE);
|
|
|
|
emit CoreStateChanged(Core::CORE_PAUSE);
|
|
|
|
}
|
2014-12-12 19:29:48 +00:00
|
|
|
|
|
|
|
QMessageBox::StandardButton ret = QMessageBox::question(m_render_widget.get(), tr("Please confirm..."),
|
|
|
|
tr("Do you want to stop the current emulation?"),
|
|
|
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
if (ret == QMessageBox::No)
|
|
|
|
{
|
2015-09-12 17:10:38 +00:00
|
|
|
if (!wasPaused)
|
|
|
|
DoStartPause();
|
2014-12-12 19:29:48 +00:00
|
|
|
return false;
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
2014-12-12 19:29:48 +00:00
|
|
|
}
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2015-05-02 09:36:54 +00:00
|
|
|
return Stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DMainWindow::Stop()
|
|
|
|
{
|
2014-12-12 19:29:48 +00:00
|
|
|
m_isStopping = true;
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
// TODO: Movie stuff
|
|
|
|
// TODO: Show the author/description dialog here
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
BootManager::Stop();
|
2015-09-09 00:20:36 +00:00
|
|
|
EnableScreensaver();
|
2014-12-12 19:29:48 +00:00
|
|
|
// TODO: Restore original window title
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
// TODO:
|
|
|
|
// If batch mode was specified on the command-line, exit now.
|
|
|
|
//if (m_bBatchMode)
|
|
|
|
// Close(true);
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2015-06-12 11:56:53 +00:00
|
|
|
if (SConfig::GetInstance().bFullscreen)
|
2014-12-12 19:29:48 +00:00
|
|
|
m_render_widget->close();
|
|
|
|
else
|
|
|
|
m_ui->centralWidget->removeWidget(m_render_widget.get());
|
|
|
|
m_render_widget.reset();
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
emit CoreStateChanged(Core::CORE_UNINITIALIZED);
|
2014-11-02 18:53:48 +00:00
|
|
|
m_isStopping = false;
|
2014-12-12 19:29:48 +00:00
|
|
|
return true;
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
|
|
|
|
2015-05-02 23:18:02 +00:00
|
|
|
void DMainWindow::OnReset()
|
|
|
|
{
|
|
|
|
// TODO: Movie needs to be reset here
|
|
|
|
ProcessorInterface::ResetButton_Tap();
|
|
|
|
}
|
|
|
|
|
2014-11-11 02:41:17 +00:00
|
|
|
void DMainWindow::OnGameListStyleChanged()
|
|
|
|
{
|
|
|
|
if (m_ui->actionListView->isChecked())
|
|
|
|
m_game_tracker->SetViewStyle(STYLE_LIST);
|
|
|
|
else if (m_ui->actionTreeView->isChecked())
|
|
|
|
m_game_tracker->SetViewStyle(STYLE_TREE);
|
|
|
|
else if (m_ui->actionGridView->isChecked())
|
|
|
|
m_game_tracker->SetViewStyle(STYLE_GRID);
|
|
|
|
else if (m_ui->actionIconView->isChecked())
|
|
|
|
m_game_tracker->SetViewStyle(STYLE_ICON);
|
|
|
|
}
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
void DMainWindow::OnCoreStateChanged(Core::EState state)
|
|
|
|
{
|
|
|
|
bool is_not_initialized = (state == Core::CORE_UNINITIALIZED);
|
|
|
|
bool is_running = (state == Core::CORE_RUN);
|
|
|
|
bool is_paused = (state == Core::CORE_PAUSE);
|
|
|
|
|
|
|
|
// Update the toolbar
|
2014-11-06 01:53:34 +00:00
|
|
|
m_ui->actionPlay->setEnabled(is_not_initialized || is_running || is_paused);
|
2014-11-02 18:53:48 +00:00
|
|
|
if (is_running)
|
|
|
|
{
|
2014-11-06 01:53:34 +00:00
|
|
|
m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PAUSE));
|
|
|
|
m_ui->actionPlay->setText(tr("Pause"));
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
|
|
|
else if (is_paused || is_not_initialized)
|
|
|
|
{
|
2014-11-06 01:53:34 +00:00
|
|
|
m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PLAY));
|
|
|
|
m_ui->actionPlay->setText(tr("Play"));
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
|
|
|
|
2014-11-06 01:53:34 +00:00
|
|
|
m_ui->actionStop->setEnabled(!is_not_initialized);
|
|
|
|
m_ui->actionOpen->setEnabled(is_not_initialized);
|
2014-11-11 02:41:17 +00:00
|
|
|
m_game_tracker->setEnabled(is_not_initialized);
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Update all the icons used in DMainWindow with fresh ones from
|
|
|
|
// "Resources". Call this function after changing the icon theme.
|
|
|
|
void DMainWindow::UpdateIcons()
|
|
|
|
{
|
2014-11-06 01:53:34 +00:00
|
|
|
// Play/Pause is handled in OnCoreStateChanged().
|
|
|
|
m_ui->actionStop->setIcon(Resources::GetIcon(Resources::TOOLBAR_STOP));
|
2015-09-12 17:20:45 +00:00
|
|
|
m_ui->actionScreenshot->setIcon(Resources::GetIcon(Resources::TOOLBAR_SCREENSHOT));
|
2014-11-02 18:53:48 +00:00
|
|
|
}
|