Qt: Use global Appicon instead of setting it in every Dialog

This commit is contained in:
Unknown 2017-11-18 13:20:32 +01:00 committed by Ani
parent 222c0e0fc5
commit 61ca9df45c
8 changed files with 7 additions and 15 deletions

View File

@ -63,6 +63,9 @@ rpcs3_app::rpcs3_app(int& argc, char** argv) : QApplication(argc, argv)
void rpcs3_app::Init()
{
setApplicationName("RPCS3");
setWindowIcon(QIcon(":/rpcs3.ico"));
Emu.Init();
guiSettings.reset(new gui_settings());
@ -79,7 +82,6 @@ void rpcs3_app::Init()
RPCS3MainWin->Init();
setApplicationName("RPCS3");
RPCS3MainWin->show();
// Create the thumbnail toolbar after the main_window is created

View File

@ -76,8 +76,6 @@ void main_window::Init()
setAcceptDrops(true);
m_appIcon = QIcon(":/rpcs3.ico");
// hide utilities from the average user
ui->menuUtilities->menuAction()->setVisible(guiSettings->GetValue(GUI::m_showDebugTab).toBool());
@ -107,7 +105,6 @@ void main_window::Init()
setMinimumSize(350, minimumSizeHint().height()); // seems fine on win 10
setWindowTitle(QString::fromStdString("RPCS3 v" + rpcs3::version.to_string()));
!m_appIcon.isNull() ? setWindowIcon(m_appIcon) : LOG_WARNING(GENERAL, "AppImage could not be loaded!");
Q_EMIT RequestGlobalStylesheetChange(guiSettings->GetCurrentStylesheetPath());
ConfigureGuiFromSettings(true);
@ -131,7 +128,6 @@ void main_window::Init()
QMessageBox msg;
msg.setWindowTitle("Experimental Build Warning");
msg.setWindowIcon(m_appIcon);
msg.setIcon(QMessageBox::Critical);
msg.setTextFormat(Qt::RichText);
msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
@ -196,7 +192,7 @@ QIcon main_window::GetAppIcon()
}
// loads the appIcon from path and embeds it centered into an empty square icon
void main_window::SetAppIconFromPath(const std::string path)
void main_window::SetAppIconFromPath(const std::string& path)
{
// get Icon for the gs_frame from path. this handles presumably all possible use cases
QString qpath = qstr(path);
@ -236,7 +232,7 @@ void main_window::SetAppIconFromPath(const std::string path)
}
}
// if nothing was found reset the icon to default
m_appIcon = QIcon(":/rpcs3.ico");
m_appIcon = QApplication::windowIcon();
}
void main_window::BootElf()

View File

@ -100,7 +100,7 @@ protected:
void dragEnterEvent(QDragEnterEvent* event) override;
void dragMoveEvent(QDragMoveEvent* event) override;
void dragLeaveEvent(QDragLeaveEvent* event) override;
void SetAppIconFromPath(const std::string path);
void SetAppIconFromPath(const std::string& path);
private:
void RepaintToolbar();
void RepaintToolBarIcons();

View File

@ -81,8 +81,6 @@ public:
explicit custom_dialog(bool disableCancel, QWidget* parent = 0)
: QDialog(parent), m_disable_cancel(disableCancel)
{
setWindowIcon(QIcon(":/rpcs3.ico"));
if (m_disable_cancel)
{
setWindowFlags(windowFlags() & ~Qt::WindowCloseButtonHint);

View File

@ -11,7 +11,6 @@ save_data_info_dialog::save_data_info_dialog(const SaveDataEntry& save, QWidget*
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Save Data Information"));
setWindowIcon(QIcon(":/rpcs3.ico"));
// Table
m_list = new QTableWidget(this);

View File

@ -32,7 +32,6 @@ save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& e
setWindowTitle(tr("Save Data Interface (Save)"));
}
setWindowIcon(QIcon(":/rpcs3.ico"));
setMinimumSize(QSize(400, 400));
// Table

View File

@ -85,7 +85,6 @@ save_manager_dialog::save_manager_dialog(std::string dir, QWidget* parent) : QDi
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Save Manager"));
setWindowIcon(QIcon(":/rpcs3.ico"));
setMinimumSize(QSize(400, 400));
Init(dir);

View File

@ -43,7 +43,6 @@ trophy_manager_dialog::trophy_manager_dialog() : QWidget(), m_sort_column(0), m_
// Nonspecific widget settings
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Trophy Manager"));
setWindowIcon(QIcon(":/rpcs3.ico"));
// HACK: dev_hdd0 must be mounted for vfs to work for loading trophies.
const std::string emu_dir_ = g_cfg.vfs.emulator_dir;