From ca8316ac54f4d4a9a88a9f273d93880ab82f1ae7 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 26 Nov 2014 15:30:35 -0500 Subject: [PATCH 1/9] Remove note about reusing the render widget. This is actually not possible due to how Qt manages child widgets... --- Source/Core/DolphinQt/MainWindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index e8fa97c8ba..7b17c5eaa4 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -65,7 +65,7 @@ private: QString ShowFileDialog(); void DoStartPause(); - std::unique_ptr m_render_widget; // TODO: just create this once and reuse it + std::unique_ptr m_render_widget; bool m_isStopping = false; }; From 9180257c4a021bac59b3a321c468b5152d8e350d Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 26 Nov 2014 15:31:30 -0500 Subject: [PATCH 2/9] "Gamelist view style" -> "List style" * Cleaner & more concise. * Also add some "Alt" shortcuts --- Source/Core/DolphinQt/MainWindow.ui | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/Core/DolphinQt/MainWindow.ui b/Source/Core/DolphinQt/MainWindow.ui index f0b65dee2e..3fee16ffe0 100644 --- a/Source/Core/DolphinQt/MainWindow.ui +++ b/Source/Core/DolphinQt/MainWindow.ui @@ -6,8 +6,8 @@ 0 0 - 992 - 592 + 990 + 590 @@ -31,8 +31,8 @@ 0 0 - 992 - 21 + 990 + 24 @@ -60,16 +60,16 @@ &View - + - Gamelist view style + &List style - + @@ -161,7 +161,7 @@ - About Qt + About &Qt QAction::AboutQtRole @@ -172,7 +172,7 @@ true - List view + &List view @@ -180,7 +180,7 @@ true - Tree view + &Tree view @@ -188,7 +188,7 @@ true - Grid view + &Grid view @@ -196,7 +196,7 @@ true - Icon view + &Icon view From 59c4ccfa75e54611eb7ef5d867bb30bf9036d25c Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 26 Nov 2014 15:37:12 -0500 Subject: [PATCH 3/9] GameGrid: enable uniform item sizes. Looks much nicer this way. --- Source/Core/DolphinQt/GameList/GameGrid.ui | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/GameList/GameGrid.ui b/Source/Core/DolphinQt/GameList/GameGrid.ui index 742435b22a..cc910ee63b 100644 --- a/Source/Core/DolphinQt/GameList/GameGrid.ui +++ b/Source/Core/DolphinQt/GameList/GameGrid.ui @@ -6,8 +6,8 @@ 0 0 - 256 - 192 + 254 + 190 @@ -16,6 +16,9 @@ QListView::Adjust + + true + From 74291017e5244f69123b5e983885e71334457e9e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 26 Nov 2014 15:40:38 -0500 Subject: [PATCH 4/9] SystemInfo: various cleanup. * Rename the copy slot to match naming convention elsewhere * Remove the Mac 10.7/10.8 detection as we don't support it now --- Source/Core/DolphinQt/SystemInfo.cpp | 6 ++---- Source/Core/DolphinQt/SystemInfo.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Core/DolphinQt/SystemInfo.cpp b/Source/Core/DolphinQt/SystemInfo.cpp index 5494886706..28445eded3 100644 --- a/Source/Core/DolphinQt/SystemInfo.cpp +++ b/Source/Core/DolphinQt/SystemInfo.cpp @@ -27,14 +27,14 @@ DSystemInfo::DSystemInfo(QWidget* parent_widget) : UpdateSystemInfo(); QPushButton* btn = m_ui->buttonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole); - connect(btn, SIGNAL(pressed()), this, SLOT(btnCopy_pressed())); + connect(btn, SIGNAL(pressed()), this, SLOT(CopyPressed())); } DSystemInfo::~DSystemInfo() { } -void DSystemInfo::btnCopy_pressed() +void DSystemInfo::CopyPressed() { QClipboard* clipboard = QApplication::clipboard(); clipboard->setText(m_ui->txtSysInfo->toPlainText()); @@ -75,8 +75,6 @@ QString DSystemInfo::GetOS() const #elif defined(Q_OS_MAC) ret += SL("Mac OS X "); switch (QSysInfo::MacintoshVersion) { - case QSysInfo::MV_10_7: ret += SL("10.7"); break; - case QSysInfo::MV_10_8: ret += SL("10.8"); break; case QSysInfo::MV_10_9: ret += SL("10.9"); break; default: ret += SL("(unknown)"); break; } diff --git a/Source/Core/DolphinQt/SystemInfo.h b/Source/Core/DolphinQt/SystemInfo.h index cdc1a93ce9..028d258eb5 100644 --- a/Source/Core/DolphinQt/SystemInfo.h +++ b/Source/Core/DolphinQt/SystemInfo.h @@ -21,7 +21,7 @@ public: ~DSystemInfo(); private slots: - void btnCopy_pressed(); + void CopyPressed(); private: std::unique_ptr m_ui; From 1d4b3a90eb9c716f6dfff8109257d8cc3b885f52 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 29 Nov 2014 09:30:35 -0500 Subject: [PATCH 5/9] Micro-optimize RenderWidgetHasFocus(). --- Source/Core/DolphinQt/MainWindow.cpp | 10 ---------- Source/Core/DolphinQt/MainWindow.h | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 4bb13e29e2..bd3b0e103b 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -261,16 +261,6 @@ void DMainWindow::OnCoreStateChanged(Core::EState state) m_game_tracker->setEnabled(is_not_initialized); } -bool DMainWindow::RenderWidgetHasFocus() -{ - if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) - return isActiveWindow(); - else if (m_render_widget != nullptr) - return m_render_widget->isActiveWindow(); - else - return false; -} - // Update all the icons used in DMainWindow with fresh ones from // "Resources". Call this function after changing the icon theme. void DMainWindow::UpdateIcons() diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 7b17c5eaa4..cee7743adb 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -27,7 +27,7 @@ public: ~DMainWindow(); // DRenderWidget - bool RenderWidgetHasFocus(); + bool RenderWidgetHasFocus() const { return m_render_widget->isActiveWindow(); } DRenderWidget* GetRenderWidget() { return m_render_widget.get(); } signals: From 43473e09d16c125a2bb833136525f4253eda8cb0 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 29 Nov 2014 09:32:37 -0500 Subject: [PATCH 6/9] Implement the "Rating" column. Looks like I forgot to do this... --- Source/Core/DolphinQt/GameList/GameTree.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/DolphinQt/GameList/GameTree.cpp b/Source/Core/DolphinQt/GameList/GameTree.cpp index fa3d5babe4..7cf0c874ca 100644 --- a/Source/Core/DolphinQt/GameList/GameTree.cpp +++ b/Source/Core/DolphinQt/GameList/GameTree.cpp @@ -114,6 +114,7 @@ void DGameTree::AddGame(GameFile* item) i->setText(COL_DESCRIPTION, item->GetDescription()); i->setIcon(COL_REGION, QIcon(Resources::GetRegionPixmap(item->GetCountry()))); i->setText(COL_SIZE, NiceSizeFormat(item->GetFileSize())); + i->setIcon(COL_STATE, QIcon(Resources::GetRatingPixmap(item->GetEmuState()))); if (item->IsCompressed()) { for (int col = 0; col < columnCount(); col++) From 320c5f254509feefc2e9a8c0c97310e0c9fbb8f1 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 29 Nov 2014 09:34:19 -0500 Subject: [PATCH 7/9] Cast the result of GetSize() to "unsigned long long". Squelches a warning on Mac OS X. --- Source/Core/DolphinQt/GameList/GameFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/GameList/GameFile.cpp b/Source/Core/DolphinQt/GameList/GameFile.cpp index 70cd91b64c..4cfe616e18 100644 --- a/Source/Core/DolphinQt/GameList/GameFile.cpp +++ b/Source/Core/DolphinQt/GameList/GameFile.cpp @@ -225,9 +225,9 @@ QString GameFile::CreateCacheFilename() // Filename.extension_HashOfFolderPath_Size.cache // Append hash to prevent ISO name-clashing in different folders. - filename.append(StringFromFormat("%s_%x_%lx.qcache", + filename.append(StringFromFormat("%s_%x_%llx.qcache", extension.c_str(), HashFletcher((const u8*)pathname.c_str(), pathname.size()), - File::GetSize(m_file_name.toStdString()))); + (unsigned long long)File::GetSize(m_file_name.toStdString()))); QString fullname = QString::fromStdString(File::GetUserPath(D_CACHE_IDX)); fullname += QString::fromStdString(filename); From a5cfe85c8d239795c2789b20272db40ec9981ec9 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 29 Nov 2014 13:00:26 -0500 Subject: [PATCH 8/9] Support HiDPI flags & rating images. There aren't any yet, it's up to up to Stevoisiak and MaJoR to create them :) --- Source/Core/DolphinQt/Utils/Resources.cpp | 54 +++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Source/Core/DolphinQt/Utils/Resources.cpp b/Source/Core/DolphinQt/Utils/Resources.cpp index d730a788b6..729e459a82 100644 --- a/Source/Core/DolphinQt/Utils/Resources.cpp +++ b/Source/Core/DolphinQt/Utils/Resources.cpp @@ -16,48 +16,48 @@ QVector Resources::m_regions; QVector Resources::m_ratings; QVector Resources::m_pixmaps; +// Wrapper for GetImageFilename() so you don't have to to call it directly +#define GIFN(file) GetImageFilename(SL(file), dir) + void Resources::Init() { QString dir = QString::fromStdString(File::GetSysDirectory() + "Resources/"); m_regions.resize(DiscIO::IVolume::NUMBER_OF_COUNTRIES); - m_regions[DiscIO::IVolume::COUNTRY_JAPAN].load(dir + SL("Flag_Japan.png")); - m_regions[DiscIO::IVolume::COUNTRY_EUROPE].load(dir + SL("Flag_Europe.png")); - m_regions[DiscIO::IVolume::COUNTRY_USA].load(dir + SL("Flag_USA.png")); + m_regions[DiscIO::IVolume::COUNTRY_JAPAN].load(GIFN("Flag_Japan")); + m_regions[DiscIO::IVolume::COUNTRY_EUROPE].load(GIFN("Flag_Europe")); + m_regions[DiscIO::IVolume::COUNTRY_USA].load(GIFN("Flag_USA")); - m_regions[DiscIO::IVolume::COUNTRY_AUSTRALIA].load(dir + SL("Flag_Australia.png")); - m_regions[DiscIO::IVolume::COUNTRY_FRANCE].load(dir + SL("Flag_France.png")); - m_regions[DiscIO::IVolume::COUNTRY_GERMANY].load(dir + SL("Flag_Germany.png")); - m_regions[DiscIO::IVolume::COUNTRY_INTERNATIONAL].load(dir + SL("Flag_Europe.png")); // Uses European flag as a placeholder - m_regions[DiscIO::IVolume::COUNTRY_ITALY].load(dir + SL("Flag_Italy.png")); - m_regions[DiscIO::IVolume::COUNTRY_KOREA].load(dir + SL("Flag_Korea.png")); - m_regions[DiscIO::IVolume::COUNTRY_NETHERLANDS].load(dir + SL("Flag_Netherlands.png")); - m_regions[DiscIO::IVolume::COUNTRY_RUSSIA].load(dir + SL("Flag_Russia.png")); - m_regions[DiscIO::IVolume::COUNTRY_SPAIN].load(dir + SL("Flag_Spain.png")); - m_regions[DiscIO::IVolume::COUNTRY_TAIWAN].load(dir + SL("Flag_Taiwan.png")); - m_regions[DiscIO::IVolume::COUNTRY_UNKNOWN].load(dir + SL("Flag_Unknown.png")); + m_regions[DiscIO::IVolume::COUNTRY_AUSTRALIA].load(GIFN("Flag_Australia")); + m_regions[DiscIO::IVolume::COUNTRY_FRANCE].load(GIFN("Flag_France")); + m_regions[DiscIO::IVolume::COUNTRY_GERMANY].load(GIFN("Flag_Germany")); + m_regions[DiscIO::IVolume::COUNTRY_INTERNATIONAL].load(GIFN("Flag_Europe")); // Uses European flag as a placeholder + m_regions[DiscIO::IVolume::COUNTRY_ITALY].load(GIFN("Flag_Italy")); + m_regions[DiscIO::IVolume::COUNTRY_KOREA].load(GIFN("Flag_Korea")); + m_regions[DiscIO::IVolume::COUNTRY_NETHERLANDS].load(GIFN("Flag_Netherlands")); + m_regions[DiscIO::IVolume::COUNTRY_RUSSIA].load(GIFN("Flag_Russia")); + m_regions[DiscIO::IVolume::COUNTRY_SPAIN].load(GIFN("Flag_Spain")); + m_regions[DiscIO::IVolume::COUNTRY_TAIWAN].load(GIFN("Flag_Taiwan")); + m_regions[DiscIO::IVolume::COUNTRY_UNKNOWN].load(GIFN("Flag_Unknown")); m_platforms.resize(3); - m_platforms[0].load(dir + SL("Platform_Gamecube.png")); - m_platforms[1].load(dir + SL("Platform_Wii.png")); - m_platforms[2].load(dir + SL("Platform_Wad.png")); + m_platforms[0].load(GIFN("Platform_Gamecube")); + m_platforms[1].load(GIFN("Platform_Wii")); + m_platforms[2].load(GIFN("Platform_Wad")); m_ratings.resize(6); - m_ratings[0].load(dir + SL("rating0.png")); - m_ratings[1].load(dir + SL("rating1.png")); - m_ratings[2].load(dir + SL("rating2.png")); - m_ratings[3].load(dir + SL("rating3.png")); - m_ratings[4].load(dir + SL("rating4.png")); - m_ratings[5].load(dir + SL("rating5.png")); + m_ratings[0].load(GIFN("rating0")); + m_ratings[1].load(GIFN("rating1")); + m_ratings[2].load(GIFN("rating2")); + m_ratings[3].load(GIFN("rating3")); + m_ratings[4].load(GIFN("rating4")); + m_ratings[5].load(GIFN("rating5")); m_pixmaps.resize(NUM_ICONS); - m_pixmaps[DOLPHIN_LOGO].load(dir + SL("Dolphin.png")); + m_pixmaps[DOLPHIN_LOGO].load(GIFN("Dolphin")); UpdatePixmaps(); } -// Wrapper for GetImageFilename() so you don't have to to call it directly -#define GIFN(file) GetImageFilename(SL(file), dir) - void Resources::UpdatePixmaps() { QString dir = QString::fromStdString(File::GetThemeDir(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name)); From 726b50e06e2419d6ea1d610d7f4c6346f0f82fab Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 2 Dec 2014 09:42:57 -0500 Subject: [PATCH 9/9] Fix HiDPI loading logic. --- Source/Core/DolphinQt/Utils/Resources.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/Utils/Resources.cpp b/Source/Core/DolphinQt/Utils/Resources.cpp index 729e459a82..04875f9f1e 100644 --- a/Source/Core/DolphinQt/Utils/Resources.cpp +++ b/Source/Core/DolphinQt/Utils/Resources.cpp @@ -84,7 +84,8 @@ QString Resources::GetImageFilename(QString name, QString dir) { if (qApp->devicePixelRatio() >= 2) { - QString fileName = name.prepend(dir).append(SL("@2x.png")); + QString fileName = name; + fileName.prepend(dir).append(SL("@2x.png")); if (QFile::exists(fileName)) return fileName; }