[Qt] style adjustments 6

rename members and clean headers for gamelist and main window
adjust some more connects
This commit is contained in:
Megamouse 2017-09-08 19:53:29 +02:00 committed by Ani
parent 43bae9f9d7
commit be46c82aaa
4 changed files with 302 additions and 284 deletions

View File

@ -146,73 +146,74 @@ game_list_frame::game_list_frame(std::shared_ptr<gui_settings> settings, const R
m_Icon_Size = sizeFromSlider(m_icon_size_index);
m_xgrid = new game_list_grid(m_Icon_Size, m_Icon_Color, m_Margin_Factor, m_Text_Factor, showText);
gameList = new game_list();
gameList->setShowGrid(false);
gameList->setItemDelegate(new table_item_delegate(this));
gameList->setSelectionBehavior(QAbstractItemView::SelectRows);
gameList->setSelectionMode(QAbstractItemView::SingleSelection);
gameList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
gameList->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
gameList->verticalHeader()->setMinimumSectionSize(m_Icon_Size.height());
gameList->verticalHeader()->setMaximumSectionSize(m_Icon_Size.height());
gameList->verticalHeader()->setVisible(false);
gameList->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu);
gameList->horizontalHeader()->setHighlightSections(false);
gameList->horizontalHeader()->setSortIndicatorShown(true);
gameList->horizontalHeader()->setStretchLastSection(true);
gameList->horizontalHeader()->setDefaultSectionSize(150);
gameList->setContextMenuPolicy(Qt::CustomContextMenu);
gameList->setAlternatingRowColors(true);
m_gameList = new game_list();
m_gameList->setShowGrid(false);
m_gameList->setItemDelegate(new table_item_delegate(this));
m_gameList->setSelectionBehavior(QAbstractItemView::SelectRows);
m_gameList->setSelectionMode(QAbstractItemView::SingleSelection);
m_gameList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
m_gameList->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
m_gameList->verticalHeader()->setMinimumSectionSize(m_Icon_Size.height());
m_gameList->verticalHeader()->setMaximumSectionSize(m_Icon_Size.height());
m_gameList->verticalHeader()->setVisible(false);
m_gameList->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu);
m_gameList->horizontalHeader()->setHighlightSections(false);
m_gameList->horizontalHeader()->setSortIndicatorShown(true);
m_gameList->horizontalHeader()->setStretchLastSection(true);
m_gameList->horizontalHeader()->setDefaultSectionSize(150);
m_gameList->setContextMenuPolicy(Qt::CustomContextMenu);
m_gameList->setAlternatingRowColors(true);
gameList->setColumnCount(10);
gameList->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Icon")));
gameList->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Name")));
gameList->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Serial")));
gameList->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Firmware")));
gameList->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Version")));
gameList->setHorizontalHeaderItem(5, new QTableWidgetItem(tr("Category")));
gameList->setHorizontalHeaderItem(6, new QTableWidgetItem(tr("Path")));
gameList->setHorizontalHeaderItem(7, new QTableWidgetItem(tr("Supported Resolutions")));
gameList->setHorizontalHeaderItem(8, new QTableWidgetItem(tr("Sound Formats")));
gameList->setHorizontalHeaderItem(9, new QTableWidgetItem(tr("Parental Level")));
m_gameList->setColumnCount(10);
m_gameList->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Icon")));
m_gameList->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Name")));
m_gameList->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Serial")));
m_gameList->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Firmware")));
m_gameList->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Version")));
m_gameList->setHorizontalHeaderItem(5, new QTableWidgetItem(tr("Category")));
m_gameList->setHorizontalHeaderItem(6, new QTableWidgetItem(tr("Path")));
m_gameList->setHorizontalHeaderItem(7, new QTableWidgetItem(tr("Supported Resolutions")));
m_gameList->setHorizontalHeaderItem(8, new QTableWidgetItem(tr("Sound Formats")));
m_gameList->setHorizontalHeaderItem(9, new QTableWidgetItem(tr("Parental Level")));
// since this won't work somehow: gameList->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
for (int i = 0; i < gameList->horizontalHeader()->count(); i++)
for (int i = 0; i < m_gameList->horizontalHeader()->count(); i++)
{
gameList->horizontalHeaderItem(i)->setTextAlignment(Qt::AlignLeft);
m_gameList->horizontalHeaderItem(i)->setTextAlignment(Qt::AlignLeft);
}
m_Central_Widget = new QStackedWidget(this);
m_Central_Widget->addWidget(gameList);
m_Central_Widget->addWidget(m_gameList);
m_Central_Widget->addWidget(m_xgrid);
m_Central_Widget->setCurrentWidget(m_isListLayout ? gameList : m_xgrid);
m_Central_Widget->setCurrentWidget(m_isListLayout ? m_gameList : m_xgrid);
m_Game_Dock->setCentralWidget(m_Central_Widget);
// Actions
showIconColAct = new QAction(tr("Show Icons"), this);
showNameColAct = new QAction(tr("Show Names"), this);
showSerialColAct = new QAction(tr("Show Serials"), this);
showFWColAct = new QAction(tr("Show Firmwares"), this);
showAppVersionColAct = new QAction(tr("Show Versions"), this);
showCategoryColAct = new QAction(tr("Show Categories"), this);
showPathColAct = new QAction(tr("Show Paths"), this);
showResolutionColAct = new QAction(tr("Show Supported Resolutions"), this);
showSoundFormatColAct = new QAction(tr("Show Sound Formats"), this);
showParentalLevelColAct = new QAction(tr("Show Parental Levels"), this);
// Actions regarding showing/hiding columns
QAction* showIconColAct = new QAction(tr("Show Icons"), this);
QAction* showNameColAct = new QAction(tr("Show Names"), this);
QAction* showSerialColAct = new QAction(tr("Show Serials"), this);
QAction* showFWColAct = new QAction(tr("Show Firmwares"), this);
QAction* showAppVersionColAct = new QAction(tr("Show Versions"), this);
QAction* showCategoryColAct = new QAction(tr("Show Categories"), this);
QAction* showPathColAct = new QAction(tr("Show Paths"), this);
QAction* showResolutionColAct = new QAction(tr("Show Supported Resolutions"), this);
QAction* showSoundFormatColAct = new QAction(tr("Show Sound Formats"), this);
QAction* showParentalLevelColAct = new QAction(tr("Show Parental Levels"), this);
columnActs = { showIconColAct, showNameColAct, showSerialColAct, showFWColAct, showAppVersionColAct, showCategoryColAct, showPathColAct,
m_columnActs = { showIconColAct, showNameColAct, showSerialColAct, showFWColAct, showAppVersionColAct, showCategoryColAct, showPathColAct,
showResolutionColAct, showSoundFormatColAct, showParentalLevelColAct };
// Events
connect(gameList, &QTableWidget::customContextMenuRequested, this, &game_list_frame::ShowContextMenu);
connect(gameList->horizontalHeader(), &QHeaderView::customContextMenuRequested, [=](const QPoint& pos) {
connect(m_gameList, &QTableWidget::customContextMenuRequested, this, &game_list_frame::ShowContextMenu);
connect(m_gameList->horizontalHeader(), &QHeaderView::customContextMenuRequested, [=](const QPoint& pos)
{
QMenu* configure = new QMenu(this);
configure->addActions(columnActs);
configure->addActions(m_columnActs);
configure->exec(mapToGlobal(pos));
});
connect(gameList, &QTableWidget::doubleClicked, this, &game_list_frame::doubleClickedSlot);
connect(gameList->horizontalHeader(), &QHeaderView::sectionClicked, this, &game_list_frame::OnColClicked);
connect(m_gameList, &QTableWidget::doubleClicked, this, &game_list_frame::doubleClickedSlot);
connect(m_gameList->horizontalHeader(), &QHeaderView::sectionClicked, this, &game_list_frame::OnColClicked);
connect(m_xgrid, &QTableWidget::doubleClicked, this, &game_list_frame::doubleClickedSlot);
connect(m_xgrid, &QTableWidget::customContextMenuRequested, this, &game_list_frame::ShowContextMenu);
@ -239,29 +240,28 @@ game_list_frame::game_list_frame(std::shared_ptr<gui_settings> settings, const R
Q_EMIT RequestCategoryActSet(m_categoryActs->actions().indexOf(act));
});
for (int col = 0; col < columnActs.count(); ++col)
for (int col = 0; col < m_columnActs.count(); ++col)
{
columnActs[col]->setCheckable(true);
m_columnActs[col]->setCheckable(true);
auto l_CallBack = [this, col](bool val) {
connect(m_columnActs[col], &QAction::triggered, [this, col](bool val)
{
if (!val) // be sure to have at least one column left so you can call the context menu at all time
{
int c = 0;
for (int i = 0; i < columnActs.count(); ++i)
for (int i = 0; i < m_columnActs.count(); ++i)
{
if (xgui_settings->GetGamelistColVisibility(i)) { if (++c > 1) { break; } }
}
if (c < 2)
{
columnActs[col]->setChecked(true); // re-enable the checkbox if we don't change the actual state
m_columnActs[col]->setChecked(true); // re-enable the checkbox if we don't change the actual state
return;
}
}
gameList->setColumnHidden(col, !val); // Negate because it's a set col hidden and we have menu say show.
m_gameList->setColumnHidden(col, !val); // Negate because it's a set col hidden and we have menu say show.
xgui_settings->SetGamelistColVisibility(col, val);
};
connect(columnActs[col], &QAction::triggered, l_CallBack);
});
}
}
@ -271,27 +271,27 @@ void game_list_frame::LoadSettings()
if (state.isEmpty())
{ // If no settings exist, go to default.
if (gameList->rowCount() > 0)
if (m_gameList->rowCount() > 0)
{
gameList->verticalHeader()->resizeSections(QHeaderView::ResizeMode::ResizeToContents);
gameList->horizontalHeader()->resizeSections(QHeaderView::ResizeMode::ResizeToContents);
gameList->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
m_gameList->verticalHeader()->resizeSections(QHeaderView::ResizeMode::ResizeToContents);
m_gameList->horizontalHeader()->resizeSections(QHeaderView::ResizeMode::ResizeToContents);
m_gameList->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
}
}
else
{
gameList->horizontalHeader()->restoreState(state);
m_gameList->horizontalHeader()->restoreState(state);
}
for (int col = 0; col < columnActs.count(); ++col)
for (int col = 0; col < m_columnActs.count(); ++col)
{
bool vis = xgui_settings->GetGamelistColVisibility(col);
columnActs[col]->setChecked(vis);
gameList->setColumnHidden(col, !vis);
m_columnActs[col]->setChecked(vis);
m_gameList->setColumnHidden(col, !vis);
}
gameList->horizontalHeader()->restoreState(gameList->horizontalHeader()->saveState());
gameList->horizontalHeader()->stretchLastSection();
m_gameList->horizontalHeader()->restoreState(m_gameList->horizontalHeader()->saveState());
m_gameList->horizontalHeader()->stretchLastSection();
m_colSortOrder = xgui_settings->GetValue(GUI::gl_sortAsc).toBool() ? Qt::AscendingOrder : Qt::DescendingOrder;
@ -350,11 +350,11 @@ void game_list_frame::FilterData()
void game_list_frame::SortGameList()
{
gameList->sortByColumn(m_sortColumn, m_colSortOrder);
gameList->verticalHeader()->setMinimumSectionSize(m_Icon_Size.height());
gameList->verticalHeader()->setMaximumSectionSize(m_Icon_Size.height());
gameList->resizeRowsToContents();
gameList->resizeColumnToContents(0);
m_gameList->sortByColumn(m_sortColumn, m_colSortOrder);
m_gameList->verticalHeader()->setMinimumSectionSize(m_Icon_Size.height());
m_gameList->verticalHeader()->setMaximumSectionSize(m_Icon_Size.height());
m_gameList->resizeRowsToContents();
m_gameList->resizeColumnToContents(0);
}
void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
@ -475,12 +475,12 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
{
FilterData();
int row = PopulateGameList();
gameList->selectRow(row);
m_gameList->selectRow(row);
SortGameList();
if (scrollAfter)
{
gameList->scrollTo(gameList->currentIndex(), QAbstractItemView::PositionAtCenter);
m_gameList->scrollTo(m_gameList->currentIndex(), QAbstractItemView::PositionAtCenter);
}
}
else
@ -526,14 +526,14 @@ void game_list_frame::ToggleCategoryFilter(const QStringList& categories, bool s
void game_list_frame::SaveSettings()
{
for (int col = 0; col < columnActs.count(); ++col)
for (int col = 0; col < m_columnActs.count(); ++col)
{
xgui_settings->SetGamelistColVisibility(col, columnActs[col]->isChecked());
xgui_settings->SetGamelistColVisibility(col, m_columnActs[col]->isChecked());
}
xgui_settings->SetValue(GUI::gl_sortCol, m_sortColumn);
xgui_settings->SetValue(GUI::gl_sortAsc, m_colSortOrder == Qt::AscendingOrder);
xgui_settings->SetValue(GUI::gl_state, gameList->horizontalHeader()->saveState());
xgui_settings->SetValue(GUI::gl_state, m_gameList->horizontalHeader()->saveState());
}
static void open_dir(const std::string& spath)
@ -559,7 +559,7 @@ void game_list_frame::doubleClickedSlot(const QModelIndex& index)
if (m_isListLayout)
{
i = gameList->item(index.row(), 0)->data(Qt::UserRole).toInt();
i = m_gameList->item(index.row(), 0)->data(Qt::UserRole).toInt();
}
else
{
@ -585,8 +585,8 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
if (m_isListLayout)
{
int row = gameList->indexAt(pos).row();
QTableWidgetItem* item = gameList->item(row, 0);
int row = m_gameList->indexAt(pos).row();
QTableWidgetItem* item = m_gameList->item(row, 0);
if (item == nullptr) return; // null happens if you are double clicking in dockwidget area on nothing.
index = item->data(Qt::UserRole).toInt();
}
@ -613,7 +613,7 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row)
if (m_isListLayout)
{
globalPos = gameList->mapToGlobal(pos);
globalPos = m_gameList->mapToGlobal(pos);
}
else
{
@ -847,7 +847,7 @@ void game_list_frame::SetListMode(const bool& isList)
Refresh(true);
m_Central_Widget->setCurrentWidget(m_isListLayout ? gameList : m_xgrid);
m_Central_Widget->setCurrentWidget(m_isListLayout ? m_gameList : m_xgrid);
}
void game_list_frame::SetToolBarVisible(const bool& showToolBar)
@ -933,8 +933,8 @@ int game_list_frame::PopulateGameList()
std::string selected_item = CurrentSelectionIconPath();
gameList->clearContents();
gameList->setRowCount((int)m_game_data.size());
m_gameList->clearContents();
m_gameList->setRowCount((int)m_game_data.size());
auto l_GetItem = [](const std::string& text)
{
@ -967,23 +967,23 @@ int game_list_frame::PopulateGameList()
titleItem->setIcon(QIcon(":/Icons/cog_black.png"));
}
gameList->setItem(row, 0, iconItem);
gameList->setItem(row, 1, titleItem);
gameList->setItem(row, 2, l_GetItem(m_game_data[i].info.serial));
gameList->setItem(row, 3, l_GetItem(m_game_data[i].info.fw));
gameList->setItem(row, 4, l_GetItem(m_game_data[i].info.app_ver));
gameList->setItem(row, 5, l_GetItem(m_game_data[i].info.category));
gameList->setItem(row, 6, l_GetItem(m_game_data[i].info.path));
gameList->setItem(row, 7, l_GetItem(GetStringFromU32(m_game_data[i].info.resolution, resolution::mode, true)));
gameList->setItem(row, 8, l_GetItem(GetStringFromU32(m_game_data[i].info.sound_format, sound::format, true)));
gameList->setItem(row, 9, l_GetItem(GetStringFromU32(m_game_data[i].info.parental_lvl, parental::level)));
m_gameList->setItem(row, 0, iconItem);
m_gameList->setItem(row, 1, titleItem);
m_gameList->setItem(row, 2, l_GetItem(m_game_data[i].info.serial));
m_gameList->setItem(row, 3, l_GetItem(m_game_data[i].info.fw));
m_gameList->setItem(row, 4, l_GetItem(m_game_data[i].info.app_ver));
m_gameList->setItem(row, 5, l_GetItem(m_game_data[i].info.category));
m_gameList->setItem(row, 6, l_GetItem(m_game_data[i].info.path));
m_gameList->setItem(row, 7, l_GetItem(GetStringFromU32(m_game_data[i].info.resolution, resolution::mode, true)));
m_gameList->setItem(row, 8, l_GetItem(GetStringFromU32(m_game_data[i].info.sound_format, sound::format, true)));
m_gameList->setItem(row, 9, l_GetItem(GetStringFromU32(m_game_data[i].info.parental_lvl, parental::level)));
if (selected_item == m_game_data[i].info.icon_path) result = row;
row++;
}
gameList->setRowCount(row);
m_gameList->setRowCount(row);
return result;
}
@ -1102,9 +1102,9 @@ std::string game_list_frame::CurrentSelectionIconPath()
std::string selection = "";
// The index can be more than the size of m_game_data if you use the VFS to load a directory which has less games.
if (m_oldLayoutIsList && gameList->selectedItems().count() && gameList->currentRow() < m_game_data.size())
if (m_oldLayoutIsList && m_gameList->selectedItems().count() && m_gameList->currentRow() < m_game_data.size())
{
selection = m_game_data.at(gameList->item(gameList->currentRow(), 0)->data(Qt::UserRole).toInt()).info.icon_path;
selection = m_game_data.at(m_gameList->item(m_gameList->currentRow(), 0)->data(Qt::UserRole).toInt()).info.icon_path;
}
else if (!m_oldLayoutIsList && m_xgrid->selectedItems().count())
{

View File

@ -262,22 +262,10 @@ private:
QToolBar* m_Tool_Bar;
QLineEdit* m_Search_Bar;
QSlider* m_Slider_Size;
game_list* gameList;
game_list* m_gameList;
game_list_grid* m_xgrid;
// Actions regarding showing/hiding columns
QAction* showIconColAct;
QAction* showNameColAct;
QAction* showSerialColAct;
QAction* showFWColAct;
QAction* showAppVersionColAct;
QAction* showCategoryColAct;
QAction* showPathColAct;
QAction* showResolutionColAct;
QAction* showSoundFormatColAct;
QAction* showParentalLevelColAct;
QList<QAction*> columnActs;
QList<QAction*> m_columnActs;
// Actions regarding showing/hiding categories
Tool_Bar_Button m_catActHDD;

View File

@ -70,7 +70,7 @@ void main_window::Init()
{
ui->setupUi(this);
appIcon = QIcon(":/rpcs3.ico");
m_appIcon = QIcon(":/rpcs3.ico");
// hide utilities from the average user
ui->menuUtilities->menuAction()->setVisible(guiSettings->GetValue(GUI::m_showDebugTab).toBool());
@ -98,12 +98,12 @@ void main_window::Init()
CreateConnects();
setWindowTitle(QString::fromStdString("RPCS3 v" + rpcs3::version.to_string()));
!appIcon.isNull() ? setWindowIcon(appIcon) : LOG_WARNING(GENERAL, "AppImage could not be loaded!");
!m_appIcon.isNull() ? setWindowIcon(m_appIcon) : LOG_WARNING(GENERAL, "AppImage could not be loaded!");
Q_EMIT RequestGlobalStylesheetChange(guiSettings->GetCurrentStylesheetPath());
ConfigureGuiFromSettings(true);
RepaintToolBarIcons();
gameListFrame->RepaintToolBarIcons();
m_gameListFrame->RepaintToolBarIcons();
if (!utils::has_ssse3())
{
@ -127,7 +127,7 @@ void main_window::Init()
QMessageBox msg;
msg.setWindowTitle("Experimental Build Warning");
msg.setWindowIcon(appIcon);
msg.setWindowIcon(m_appIcon);
msg.setIcon(QMessageBox::Critical);
msg.setTextFormat(Qt::RichText);
msg.setText("Please understand that this build is not an official RPCS3 release.<br>This build contains changes that may break games, or even <b>damage</b> your data.<br>It's recommended to download and use the official build from <a href='https://rpcs3.net/download'>RPCS3 website</a>.<br><br>Build origin: " STRINGIZE(BRANCH) "<br>Do you wish to use this build anyway?");
@ -144,43 +144,43 @@ void main_window::Init()
void main_window::CreateThumbnailToolbar()
{
#ifdef _WIN32
icon_thumb_play = QIcon(":/Icons/play_blue.png");
icon_thumb_pause = QIcon(":/Icons/pause_blue.png");
icon_thumb_stop = QIcon(":/Icons/stop_blue.png");
icon_thumb_restart = QIcon(":/Icons/restart_blue.png");
m_icon_thumb_play = QIcon(":/Icons/play_blue.png");
m_icon_thumb_pause = QIcon(":/Icons/pause_blue.png");
m_icon_thumb_stop = QIcon(":/Icons/stop_blue.png");
m_icon_thumb_restart = QIcon(":/Icons/restart_blue.png");
thumb_bar = new QWinThumbnailToolBar(this);
thumb_bar->setWindow(windowHandle());
m_thumb_bar = new QWinThumbnailToolBar(this);
m_thumb_bar->setWindow(windowHandle());
thumb_playPause = new QWinThumbnailToolButton(thumb_bar);
thumb_playPause->setToolTip(tr("Pause"));
thumb_playPause->setIcon(icon_thumb_pause);
thumb_playPause->setEnabled(false);
m_thumb_playPause = new QWinThumbnailToolButton(m_thumb_bar);
m_thumb_playPause->setToolTip(tr("Pause"));
m_thumb_playPause->setIcon(m_icon_thumb_pause);
m_thumb_playPause->setEnabled(false);
thumb_stop = new QWinThumbnailToolButton(thumb_bar);
thumb_stop->setToolTip(tr("Stop"));
thumb_stop->setIcon(icon_thumb_stop);
thumb_stop->setEnabled(false);
m_thumb_stop = new QWinThumbnailToolButton(m_thumb_bar);
m_thumb_stop->setToolTip(tr("Stop"));
m_thumb_stop->setIcon(m_icon_thumb_stop);
m_thumb_stop->setEnabled(false);
thumb_restart = new QWinThumbnailToolButton(thumb_bar);
thumb_restart->setToolTip(tr("Restart"));
thumb_restart->setIcon(icon_thumb_restart);
thumb_restart->setEnabled(false);
m_thumb_restart = new QWinThumbnailToolButton(m_thumb_bar);
m_thumb_restart->setToolTip(tr("Restart"));
m_thumb_restart->setIcon(m_icon_thumb_restart);
m_thumb_restart->setEnabled(false);
thumb_bar->addButton(thumb_playPause);
thumb_bar->addButton(thumb_stop);
thumb_bar->addButton(thumb_restart);
m_thumb_bar->addButton(m_thumb_playPause);
m_thumb_bar->addButton(m_thumb_stop);
m_thumb_bar->addButton(m_thumb_restart);
connect(thumb_stop, &QWinThumbnailToolButton::clicked, [=]() { Emu.Stop(); });
connect(thumb_restart, &QWinThumbnailToolButton::clicked, [=]() { Emu.Stop(); Emu.Load(); });
connect(thumb_playPause, &QWinThumbnailToolButton::clicked, Pause);
connect(m_thumb_stop, &QWinThumbnailToolButton::clicked, [=]() { Emu.Stop(); });
connect(m_thumb_restart, &QWinThumbnailToolButton::clicked, [=]() { Emu.Stop(); Emu.Load(); });
connect(m_thumb_playPause, &QWinThumbnailToolButton::clicked, Pause);
#endif
}
// returns appIcon
QIcon main_window::GetAppIcon()
{
return appIcon;
return m_appIcon;
}
// loads the appIcon from path and embeds it centered into an empty square icon
@ -218,13 +218,13 @@ void main_window::SetAppIconFromPath(const std::string path)
painter.end();
// set Icon
appIcon = QIcon(QPixmap::fromImage(dest));
m_appIcon = QIcon(QPixmap::fromImage(dest));
return;
}
}
}
// if nothing was found reset the icon to default
appIcon = QIcon(":/rpcs3.ico");
m_appIcon = QIcon(":/rpcs3.ico");
}
void main_window::BootElf()
@ -274,7 +274,7 @@ void main_window::BootElf()
const std::string serial = Emu.GetTitleID().empty() ? "" : "[" + Emu.GetTitleID() + "] ";
AddRecentAction(GUI::Recent_Game(qstr(Emu.GetBoot()), qstr(serial + Emu.GetTitle())));
gameListFrame->Refresh(true);
m_gameListFrame->Refresh(true);
}
}
@ -311,7 +311,7 @@ void main_window::BootGame()
const std::string serial = Emu.GetTitleID().empty() ? "" : "[" + Emu.GetTitleID() + "] ";
AddRecentAction(GUI::Recent_Game(qstr(Emu.GetBoot()), qstr(serial + Emu.GetTitle())));
gameListFrame->Refresh(true);
m_gameListFrame->Refresh(true);
}
}
@ -435,7 +435,7 @@ void main_window::InstallPkg(const QString& dropPath)
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
{
fs::remove_all(local_path);
gameListFrame->Refresh(true);
m_gameListFrame->Refresh(true);
LOG_SUCCESS(LOADER, "PKG: removed incomplete installation in %s", local_path);
return;
}
@ -461,7 +461,7 @@ void main_window::InstallPkg(const QString& dropPath)
if (progress >= 1.)
{
gameListFrame->Refresh(true);
m_gameListFrame->Refresh(true);
LOG_SUCCESS(GENERAL, "Successfully installed %s.", fileName);
guiSettings->ShowInfoBox(GUI::ib_pkg_success, tr("Success!"), tr("Successfully installed software from package!"), this);
@ -695,9 +695,9 @@ void main_window::SaveWindowState()
guiSettings->SetValue(GUI::mw_mwState, m_mw->saveState());
// Save column settings
gameListFrame->SaveSettings();
m_gameListFrame->SaveSettings();
// Save splitter state
debuggerFrame->SaveSettings();
m_debuggerFrame->SaveSettings();
}
void main_window::RepaintToolBarIcons()
@ -713,12 +713,12 @@ void main_window::RepaintToolBarIcons()
newColor = GUI::get_Label_Color("toolbar_icon_color");
}
icon_play = gui_settings::colorizedIcon(QIcon(":/Icons/play.png"), GUI::mw_tool_icon_color, newColor);
icon_pause = gui_settings::colorizedIcon(QIcon(":/Icons/pause.png"), GUI::mw_tool_icon_color, newColor);
icon_stop = gui_settings::colorizedIcon(QIcon(":/Icons/stop.png"), GUI::mw_tool_icon_color, newColor);
icon_restart = gui_settings::colorizedIcon(QIcon(":/Icons/restart.png"), GUI::mw_tool_icon_color, newColor);
icon_fullscreen_on = gui_settings::colorizedIcon(QIcon(":/Icons/fullscreen.png"), GUI::mw_tool_icon_color, newColor);
icon_fullscreen_off = gui_settings::colorizedIcon(QIcon(":/Icons/fullscreen_invert.png"), GUI::mw_tool_icon_color, newColor);
m_icon_play = gui_settings::colorizedIcon(QIcon(":/Icons/play.png"), GUI::mw_tool_icon_color, newColor);
m_icon_pause = gui_settings::colorizedIcon(QIcon(":/Icons/pause.png"), GUI::mw_tool_icon_color, newColor);
m_icon_stop = gui_settings::colorizedIcon(QIcon(":/Icons/stop.png"), GUI::mw_tool_icon_color, newColor);
m_icon_restart = gui_settings::colorizedIcon(QIcon(":/Icons/restart.png"), GUI::mw_tool_icon_color, newColor);
m_icon_fullscreen_on = gui_settings::colorizedIcon(QIcon(":/Icons/fullscreen.png"), GUI::mw_tool_icon_color, newColor);
m_icon_fullscreen_off = gui_settings::colorizedIcon(QIcon(":/Icons/fullscreen_invert.png"), GUI::mw_tool_icon_color, newColor);
ui->toolbar_config->setIcon(gui_settings::colorizedIcon(QIcon(":/Icons/configure.png"), GUI::mw_tool_icon_color, newColor));
ui->toolbar_controls->setIcon(gui_settings::colorizedIcon(QIcon(":/Icons/controllers.png"), GUI::mw_tool_icon_color, newColor));
@ -732,24 +732,24 @@ void main_window::RepaintToolBarIcons()
if (Emu.IsRunning())
{
ui->toolbar_start->setIcon(icon_pause);
ui->toolbar_start->setIcon(m_icon_pause);
}
else if (Emu.IsStopped() && !Emu.GetPath().empty())
{
ui->toolbar_start->setIcon(icon_restart);
ui->toolbar_start->setIcon(m_icon_restart);
}
else
{
ui->toolbar_start->setIcon(icon_play);
ui->toolbar_start->setIcon(m_icon_play);
}
if (isFullScreen())
{
ui->toolbar_fullscreen->setIcon(icon_fullscreen_on);
ui->toolbar_fullscreen->setIcon(m_icon_fullscreen_on);
}
else
{
ui->toolbar_fullscreen->setIcon(icon_fullscreen_off);
ui->toolbar_fullscreen->setIcon(m_icon_fullscreen_off);
}
ui->sizeSlider->setStyleSheet(ui->sizeSlider->styleSheet().append("QSlider::handle:horizontal{ background: rgba(%1, %2, %3, %4); }")
@ -758,14 +758,14 @@ void main_window::RepaintToolBarIcons()
void main_window::OnEmuRun()
{
debuggerFrame->EnableButtons(true);
m_debuggerFrame->EnableButtons(true);
#ifdef _WIN32
thumb_playPause->setToolTip(tr("Pause emulation"));
thumb_playPause->setIcon(icon_thumb_pause);
m_thumb_playPause->setToolTip(tr("Pause emulation"));
m_thumb_playPause->setIcon(m_icon_thumb_pause);
#endif
ui->sysPauseAct->setText(tr("&Pause\tCtrl+P"));
ui->sysPauseAct->setIcon(icon_pause);
ui->toolbar_start->setIcon(icon_pause);
ui->sysPauseAct->setIcon(m_icon_pause);
ui->toolbar_start->setIcon(m_icon_pause);
ui->toolbar_start->setToolTip(tr("Pause emulation"));
EnableMenus(true);
}
@ -773,66 +773,66 @@ void main_window::OnEmuRun()
void main_window::OnEmuResume()
{
#ifdef _WIN32
thumb_playPause->setToolTip(tr("Pause emulation"));
thumb_playPause->setIcon(icon_thumb_pause);
m_thumb_playPause->setToolTip(tr("Pause emulation"));
m_thumb_playPause->setIcon(m_icon_thumb_pause);
#endif
ui->sysPauseAct->setText(tr("&Pause\tCtrl+P"));
ui->sysPauseAct->setIcon(icon_pause);
ui->toolbar_start->setIcon(icon_pause);
ui->sysPauseAct->setIcon(m_icon_pause);
ui->toolbar_start->setIcon(m_icon_pause);
ui->toolbar_start->setToolTip(tr("Pause emulation"));
}
void main_window::OnEmuPause()
{
#ifdef _WIN32
thumb_playPause->setToolTip(tr("Resume emulation"));
thumb_playPause->setIcon(icon_thumb_play);
m_thumb_playPause->setToolTip(tr("Resume emulation"));
m_thumb_playPause->setIcon(m_icon_thumb_play);
#endif
ui->sysPauseAct->setText(tr("&Resume\tCtrl+E"));
ui->sysPauseAct->setIcon(icon_play);
ui->toolbar_start->setIcon(icon_play);
ui->sysPauseAct->setIcon(m_icon_play);
ui->toolbar_start->setIcon(m_icon_play);
ui->toolbar_start->setToolTip(tr("Resume emulation"));
}
void main_window::OnEmuStop()
{
debuggerFrame->EnableButtons(false);
debuggerFrame->ClearBreakpoints();
m_debuggerFrame->EnableButtons(false);
m_debuggerFrame->ClearBreakpoints();
ui->sysPauseAct->setText(Emu.IsReady() ? tr("&Start\tCtrl+E") : tr("&Resume\tCtrl+E"));
ui->sysPauseAct->setIcon(icon_play);
ui->sysPauseAct->setIcon(m_icon_play);
#ifdef _WIN32
thumb_playPause->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
thumb_playPause->setIcon(icon_thumb_play);
m_thumb_playPause->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
m_thumb_playPause->setIcon(m_icon_thumb_play);
#endif
EnableMenus(false);
if (!Emu.GetPath().empty())
{
ui->toolbar_start->setEnabled(true);
ui->toolbar_start->setIcon(icon_restart);
ui->toolbar_start->setIcon(m_icon_restart);
ui->toolbar_start->setToolTip(tr("Restart emulation"));
ui->sysRebootAct->setEnabled(true);
#ifdef _WIN32
thumb_restart->setEnabled(true);
m_thumb_restart->setEnabled(true);
#endif
}
else
{
ui->toolbar_start->setIcon(icon_play);
ui->toolbar_start->setIcon(m_icon_play);
ui->toolbar_start->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
}
}
void main_window::OnEmuReady()
{
debuggerFrame->EnableButtons(true);
m_debuggerFrame->EnableButtons(true);
#ifdef _WIN32
thumb_playPause->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
thumb_playPause->setIcon(icon_thumb_play);
m_thumb_playPause->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
m_thumb_playPause->setIcon(m_icon_thumb_play);
#endif
ui->sysPauseAct->setText(Emu.IsReady() ? tr("&Start\tCtrl+E") : tr("&Resume\tCtrl+E"));
ui->sysPauseAct->setIcon(icon_play);
ui->toolbar_start->setIcon(icon_play);
ui->sysPauseAct->setIcon(m_icon_play);
ui->toolbar_start->setIcon(m_icon_play);
ui->toolbar_start->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
EnableMenus(true);
}
@ -841,9 +841,9 @@ void main_window::EnableMenus(bool enabled)
{
// Thumbnail Buttons
#ifdef _WIN32
thumb_playPause->setEnabled(enabled);
thumb_stop->setEnabled(enabled);
thumb_restart->setEnabled(enabled);
m_thumb_playPause->setEnabled(enabled);
m_thumb_stop->setEnabled(enabled);
m_thumb_restart->setEnabled(enabled);
#endif
// Toolbar
@ -937,7 +937,7 @@ void main_window::BootRecentAction(const QAction* act)
{
LOG_SUCCESS(LOADER, "Boot from Recent List: done");
AddRecentAction(GUI::Recent_Game(qstr(Emu.GetBoot()), nam));
gameListFrame->Refresh(true);
m_gameListFrame->Refresh(true);
}
};
@ -1043,8 +1043,8 @@ void main_window::AddRecentAction(const q_string_pair& entry)
void main_window::RepaintGui()
{
gameListFrame->RepaintIcons(true);
gameListFrame->RepaintToolBarIcons();
m_gameListFrame->RepaintIcons(true);
m_gameListFrame->RepaintToolBarIcons();
RepaintToolbar();
RepaintToolBarIcons();
}
@ -1077,25 +1077,25 @@ void main_window::CreateActions()
ui->toolbar_start->setEnabled(false);
ui->toolbar_stop->setEnabled(false);
categoryVisibleActGroup = new QActionGroup(this);
categoryVisibleActGroup->addAction(ui->showCatHDDGameAct);
categoryVisibleActGroup->addAction(ui->showCatDiscGameAct);
categoryVisibleActGroup->addAction(ui->showCatHomeAct);
categoryVisibleActGroup->addAction(ui->showCatAudioVideoAct);
categoryVisibleActGroup->addAction(ui->showCatGameDataAct);
categoryVisibleActGroup->addAction(ui->showCatUnknownAct);
categoryVisibleActGroup->addAction(ui->showCatOtherAct);
categoryVisibleActGroup->setExclusive(false);
m_categoryVisibleActGroup = new QActionGroup(this);
m_categoryVisibleActGroup->addAction(ui->showCatHDDGameAct);
m_categoryVisibleActGroup->addAction(ui->showCatDiscGameAct);
m_categoryVisibleActGroup->addAction(ui->showCatHomeAct);
m_categoryVisibleActGroup->addAction(ui->showCatAudioVideoAct);
m_categoryVisibleActGroup->addAction(ui->showCatGameDataAct);
m_categoryVisibleActGroup->addAction(ui->showCatUnknownAct);
m_categoryVisibleActGroup->addAction(ui->showCatOtherAct);
m_categoryVisibleActGroup->setExclusive(false);
iconSizeActGroup = new QActionGroup(this);
iconSizeActGroup->addAction(ui->setIconSizeTinyAct);
iconSizeActGroup->addAction(ui->setIconSizeSmallAct);
iconSizeActGroup->addAction(ui->setIconSizeMediumAct);
iconSizeActGroup->addAction(ui->setIconSizeLargeAct);
m_iconSizeActGroup = new QActionGroup(this);
m_iconSizeActGroup->addAction(ui->setIconSizeTinyAct);
m_iconSizeActGroup->addAction(ui->setIconSizeSmallAct);
m_iconSizeActGroup->addAction(ui->setIconSizeMediumAct);
m_iconSizeActGroup->addAction(ui->setIconSizeLargeAct);
listModeActGroup = new QActionGroup(this);
listModeActGroup->addAction(ui->setlistModeListAct);
listModeActGroup->addAction(ui->setlistModeGridAct);
m_listModeActGroup = new QActionGroup(this);
m_listModeActGroup->addAction(ui->setlistModeListAct);
m_listModeActGroup->addAction(ui->setlistModeGridAct);
}
void main_window::CreateConnects()
@ -1184,7 +1184,7 @@ void main_window::CreateConnects()
{
vfs_dialog dlg(this);
dlg.exec();
gameListFrame->Refresh(true); // dev-hdd0 may have changed. Refresh just in case.
m_gameListFrame->Refresh(true); // dev-hdd0 may have changed. Refresh just in case.
});
connect(ui->confSavedataManagerAct, &QAction::triggered, [=]
@ -1224,16 +1224,22 @@ void main_window::CreateConnects()
});
connect(ui->toolsDecryptSprxLibsAct, &QAction::triggered, this, &main_window::DecryptSPRXLibraries);
connect(ui->showDebuggerAct, &QAction::triggered, [=](bool checked){
checked ? debuggerFrame->show() : debuggerFrame->hide();
connect(ui->showDebuggerAct, &QAction::triggered, [=](bool checked)
{
checked ? m_debuggerFrame->show() : m_debuggerFrame->hide();
guiSettings->SetValue(GUI::mw_debugger, checked);
});
connect(ui->showLogAct, &QAction::triggered, [=](bool checked){
checked ? logFrame->show() : logFrame->hide();
connect(ui->showLogAct, &QAction::triggered, [=](bool checked)
{
checked ? m_logFrame->show() : m_logFrame->hide();
guiSettings->SetValue(GUI::mw_logger, checked);
});
connect(ui->showGameListAct, &QAction::triggered, [=](bool checked){
checked ? gameListFrame->show() : gameListFrame->hide();
connect(ui->showGameListAct, &QAction::triggered, [=](bool checked)
{
checked ? m_gameListFrame->show() : m_gameListFrame->hide();
guiSettings->SetValue(GUI::mw_gamelist, checked);
});
@ -1242,13 +1248,18 @@ void main_window::CreateConnects()
ui->toolBar->setVisible(checked);
guiSettings->SetValue(GUI::mw_toolBarVisible, checked);
});
connect(ui->showGameToolBarAct, &QAction::triggered, [=](bool checked) {
gameListFrame->SetToolBarVisible(checked);
connect(ui->showGameToolBarAct, &QAction::triggered, [=](bool checked)
{
m_gameListFrame->SetToolBarVisible(checked);
});
connect(ui->refreshGameListAct, &QAction::triggered, [=](){
gameListFrame->Refresh(true);
connect(ui->refreshGameListAct, &QAction::triggered, [=]
{
m_gameListFrame->Refresh(true);
});
connect(categoryVisibleActGroup, &QActionGroup::triggered, [=](QAction* act)
connect(m_categoryVisibleActGroup, &QActionGroup::triggered, [=](QAction* act)
{
QStringList categories;
int id;
@ -1263,8 +1274,8 @@ void main_window::CreateConnects()
else if (act == ui->showCatOtherAct) categories += category::others, id = Category::Others;
else LOG_WARNING(GENERAL, "categoryVisibleActGroup: category action not found");
gameListFrame->SetCategoryActIcon(categoryVisibleActGroup->actions().indexOf(act), checked);
gameListFrame->ToggleCategoryFilter(categories, checked);
m_gameListFrame->SetCategoryActIcon(m_categoryVisibleActGroup->actions().indexOf(act), checked);
m_gameListFrame->ToggleCategoryFilter(categories, checked);
guiSettings->SetCategoryVisibility(id, checked);
});
@ -1283,17 +1294,18 @@ void main_window::CreateConnects()
{
ui->sizeSlider->setSliderPosition(index);
}
if (val != gameListFrame->GetSliderValue())
if (val != m_gameListFrame->GetSliderValue())
{
if (m_save_slider_pos)
{
m_save_slider_pos = false;
guiSettings->SetValue(GUI::gl_iconSize, index);
}
gameListFrame->ResizeIcons(index);
m_gameListFrame->ResizeIcons(index);
}
};
connect(iconSizeActGroup, &QActionGroup::triggered, [=](QAction* act)
connect(m_iconSizeActGroup, &QActionGroup::triggered, [=](QAction* act)
{
int index;
@ -1304,7 +1316,8 @@ void main_window::CreateConnects()
resizeIcons(index);
});
connect (gameListFrame, &game_list_frame::RequestIconSizeActSet, [=](const int& idx)
connect (m_gameListFrame, &game_list_frame::RequestIconSizeActSet, [=](const int& idx)
{
if (idx < GUI::get_Index((GUI::gl_icon_size_small + GUI::gl_icon_size_min) / 2)) ui->setIconSizeTinyAct->setChecked(true);
else if (idx < GUI::get_Index((GUI::gl_icon_size_medium + GUI::gl_icon_size_small) / 2)) ui->setIconSizeSmallAct->setChecked(true);
@ -1313,24 +1326,32 @@ void main_window::CreateConnects()
resizeIcons(idx);
});
connect(gameListFrame, &game_list_frame::RequestSaveSliderPos, [=](const bool& save){ Q_UNUSED(save); m_save_slider_pos = true; });
connect(gameListFrame, &game_list_frame::RequestListModeActSet, [=](const bool& isList)
connect(m_gameListFrame, &game_list_frame::RequestSaveSliderPos, [=](const bool& save)
{
Q_UNUSED(save);
m_save_slider_pos = true;
});
connect(m_gameListFrame, &game_list_frame::RequestListModeActSet, [=](const bool& isList)
{
isList ? ui->setlistModeListAct->trigger() : ui->setlistModeGridAct->trigger();
});
connect(gameListFrame, &game_list_frame::RequestCategoryActSet, [=](const int& id)
connect(m_gameListFrame, &game_list_frame::RequestCategoryActSet, [=](const int& id)
{
categoryVisibleActGroup->actions().at(id)->trigger();
m_categoryVisibleActGroup->actions().at(id)->trigger();
});
connect(listModeActGroup, &QActionGroup::triggered, [=](QAction* act)
connect(m_listModeActGroup, &QActionGroup::triggered, [=](QAction* act)
{
bool isList = act == ui->setlistModeListAct;
gameListFrame->SetListMode(isList);
categoryVisibleActGroup->setEnabled(isList);
m_gameListFrame->SetListMode(isList);
m_categoryVisibleActGroup->setEnabled(isList);
});
connect(ui->toolbar_disc, &QAction::triggered, this, &main_window::BootGame);
connect(ui->toolbar_refresh, &QAction::triggered, [=]() { gameListFrame->Refresh(true); });
connect(ui->toolbar_refresh, &QAction::triggered, [=]() { m_gameListFrame->Refresh(true); });
connect(ui->toolbar_stop, &QAction::triggered, [=]() { Emu.Stop(); });
connect(ui->toolbar_start, &QAction::triggered, Pause);
@ -1339,14 +1360,15 @@ void main_window::CreateConnects()
if (isFullScreen())
{
showNormal();
ui->toolbar_fullscreen->setIcon(icon_fullscreen_on);
ui->toolbar_fullscreen->setIcon(m_icon_fullscreen_on);
}
else
{
showFullScreen();
ui->toolbar_fullscreen->setIcon(icon_fullscreen_off);
ui->toolbar_fullscreen->setIcon(m_icon_fullscreen_off);
}
});
connect(ui->toolbar_controls, &QAction::triggered, [=]() { pad_settings_dialog dlg(guiSettings, this); dlg.exec(); });
connect(ui->toolbar_config, &QAction::triggered, [=]() { openSettings(0); });
connect(ui->toolbar_list, &QAction::triggered, [=]() { ui->setlistModeListAct->trigger(); });
@ -1361,7 +1383,8 @@ void main_window::CreateConnects()
m_save_slider_pos = true; // actionTriggered happens before the value was changed
}
});
connect(ui->mw_searchbar, &QLineEdit::textChanged, gameListFrame, &game_list_frame::SetSearchText);
connect(ui->mw_searchbar, &QLineEdit::textChanged, m_gameListFrame, &game_list_frame::SetSearchText);
}
void main_window::CreateDockWindows()
@ -1369,20 +1392,20 @@ void main_window::CreateDockWindows()
// new mainwindow widget because existing seems to be bugged for now
m_mw = new QMainWindow();
gameListFrame = new game_list_frame(guiSettings, m_Render_Creator, m_mw);
gameListFrame->setObjectName("gamelist");
debuggerFrame = new debugger_frame(guiSettings, m_mw);
debuggerFrame->setObjectName("debugger");
logFrame = new log_frame(guiSettings, m_mw);
logFrame->setObjectName("logger");
m_gameListFrame = new game_list_frame(guiSettings, m_Render_Creator, m_mw);
m_gameListFrame->setObjectName("gamelist");
m_debuggerFrame = new debugger_frame(guiSettings, m_mw);
m_debuggerFrame->setObjectName("debugger");
m_logFrame = new log_frame(guiSettings, m_mw);
m_logFrame->setObjectName("logger");
m_mw->addDockWidget(Qt::LeftDockWidgetArea, gameListFrame);
m_mw->addDockWidget(Qt::LeftDockWidgetArea, logFrame);
m_mw->addDockWidget(Qt::RightDockWidgetArea, debuggerFrame);
m_mw->addDockWidget(Qt::LeftDockWidgetArea, m_gameListFrame);
m_mw->addDockWidget(Qt::LeftDockWidgetArea, m_logFrame);
m_mw->addDockWidget(Qt::RightDockWidgetArea, m_debuggerFrame);
m_mw->setDockNestingEnabled(true);
setCentralWidget(m_mw);
connect(logFrame, &log_frame::LogFrameClosed, [=]()
connect(m_logFrame, &log_frame::LogFrameClosed, [=]()
{
if (ui->showLogAct->isChecked())
{
@ -1390,14 +1413,17 @@ void main_window::CreateDockWindows()
guiSettings->SetValue(GUI::mw_logger, false);
}
});
connect(debuggerFrame, &debugger_frame::DebugFrameClosed, [=](){
connect(m_debuggerFrame, &debugger_frame::DebugFrameClosed, [=]()
{
if (ui->showDebuggerAct->isChecked())
{
ui->showDebuggerAct->setChecked(false);
guiSettings->SetValue(GUI::mw_debugger, false);
}
});
connect(gameListFrame, &game_list_frame::GameListFrameClosed, [=]()
connect(m_gameListFrame, &game_list_frame::GameListFrameClosed, [=]()
{
if (ui->showGameListAct->isChecked())
{
@ -1405,15 +1431,19 @@ void main_window::CreateDockWindows()
guiSettings->SetValue(GUI::mw_gamelist, false);
}
});
connect(gameListFrame, &game_list_frame::RequestIconPathSet, this, &main_window::SetAppIconFromPath);
connect(gameListFrame, &game_list_frame::RequestAddRecentGame, this, &main_window::AddRecentAction);
connect(gameListFrame, &game_list_frame::RequestPackageInstall, [this](const QStringList& paths){
connect(m_gameListFrame, &game_list_frame::RequestIconPathSet, this, &main_window::SetAppIconFromPath);
connect(m_gameListFrame, &game_list_frame::RequestAddRecentGame, this, &main_window::AddRecentAction);
connect(m_gameListFrame, &game_list_frame::RequestPackageInstall, [this](const QStringList& paths)
{
for (const auto& path : paths)
{
InstallPkg(path);
}
});
connect(gameListFrame, &game_list_frame::RequestFirmwareInstall, this, &main_window::InstallPup);
connect(m_gameListFrame, &game_list_frame::RequestFirmwareInstall, this, &main_window::InstallPup);
}
void main_window::ConfigureGuiFromSettings(bool configureAll)
@ -1426,7 +1456,7 @@ void main_window::ConfigureGuiFromSettings(bool configureAll)
}
else
{ // By default, set the window to 70% of the screen and the debugger frame is hidden.
debuggerFrame->hide();
m_debuggerFrame->hide();
QSize defaultSize = QDesktopWidget().availableGeometry().size() * 0.7;
resize(defaultSize);
@ -1471,10 +1501,10 @@ void main_window::ConfigureGuiFromSettings(bool configureAll)
ui->showToolBarAct->setChecked(guiSettings->GetValue(GUI::mw_toolBarVisible).toBool());
ui->showGameToolBarAct->setChecked(guiSettings->GetValue(GUI::gl_toolBarVisible).toBool());
debuggerFrame->setVisible(ui->showDebuggerAct->isChecked());
logFrame->setVisible(ui->showLogAct->isChecked());
gameListFrame->setVisible(ui->showGameListAct->isChecked());
gameListFrame->SetToolBarVisible(ui->showGameToolBarAct->isChecked());
m_debuggerFrame->setVisible(ui->showDebuggerAct->isChecked());
m_logFrame->setVisible(ui->showLogAct->isChecked());
m_gameListFrame->setVisible(ui->showGameListAct->isChecked());
m_gameListFrame->SetToolBarVisible(ui->showGameToolBarAct->isChecked());
ui->toolBar->setVisible(ui->showToolBarAct->isChecked());
RepaintToolbar();
@ -1497,15 +1527,15 @@ void main_window::ConfigureGuiFromSettings(bool configureAll)
bool isListMode = guiSettings->GetValue(GUI::gl_listMode).toBool();
if (isListMode) ui->setlistModeListAct->setChecked(true);
else ui->setlistModeGridAct->setChecked(true);
categoryVisibleActGroup->setEnabled(isListMode);
m_categoryVisibleActGroup->setEnabled(isListMode);
if (configureAll)
{
// Handle log settings
logFrame->LoadSettings();
m_logFrame->LoadSettings();
// Gamelist
gameListFrame->LoadSettings();
m_gameListFrame->LoadSettings();
}
}
@ -1535,7 +1565,7 @@ void main_window::mouseDoubleClickEvent(QMouseEvent *event)
if (event->button() == Qt::LeftButton)
{
showNormal();
ui->toolbar_fullscreen->setIcon(icon_fullscreen_on);
ui->toolbar_fullscreen->setIcon(m_icon_fullscreen_on);
}
}
}

View File

@ -34,23 +34,23 @@ class main_window : public QMainWindow
Render_Creator m_Render_Creator;
QIcon appIcon;
QIcon icon_play;
QIcon icon_pause;
QIcon icon_stop;
QIcon icon_restart;
QIcon icon_fullscreen_on;
QIcon icon_fullscreen_off;
QIcon m_appIcon;
QIcon m_icon_play;
QIcon m_icon_pause;
QIcon m_icon_stop;
QIcon m_icon_restart;
QIcon m_icon_fullscreen_on;
QIcon m_icon_fullscreen_off;
#ifdef _WIN32
QIcon icon_thumb_play;
QIcon icon_thumb_pause;
QIcon icon_thumb_stop;
QIcon icon_thumb_restart;
QWinThumbnailToolBar *thumb_bar;
QWinThumbnailToolButton *thumb_playPause;
QWinThumbnailToolButton *thumb_stop;
QWinThumbnailToolButton *thumb_restart;
QIcon m_icon_thumb_play;
QIcon m_icon_thumb_pause;
QIcon m_icon_thumb_stop;
QIcon m_icon_thumb_restart;
QWinThumbnailToolBar *m_thumb_bar;
QWinThumbnailToolButton *m_thumb_playPause;
QWinThumbnailToolButton *m_thumb_stop;
QWinThumbnailToolButton *m_thumb_restart;
QStringList m_vulkan_adapters;
#endif
#ifdef _MSC_VER
@ -106,14 +106,14 @@ private:
q_pair_list m_rg_entries;
QList<QAction*> m_recentGameActs;
QActionGroup* iconSizeActGroup;
QActionGroup* listModeActGroup;
QActionGroup* categoryVisibleActGroup;
QActionGroup* m_iconSizeActGroup;
QActionGroup* m_listModeActGroup;
QActionGroup* m_categoryVisibleActGroup;
// Dockable widget frames
QMainWindow *m_mw;
log_frame *logFrame;
debugger_frame *debuggerFrame;
game_list_frame *gameListFrame;
log_frame *m_logFrame;
debugger_frame *m_debuggerFrame;
game_list_frame *m_gameListFrame;
std::shared_ptr<gui_settings> guiSettings;
};