GeckoCodeWidget: Add a Sort button
This commit is contained in:
parent
fc525bdf8f
commit
c7f0c7484d
|
@ -66,6 +66,7 @@ void GeckoCodeWidget::CreateWidgets()
|
||||||
m_edit_code = new QPushButton(tr("&Edit Code..."));
|
m_edit_code = new QPushButton(tr("&Edit Code..."));
|
||||||
m_remove_code = new QPushButton(tr("&Remove Code"));
|
m_remove_code = new QPushButton(tr("&Remove Code"));
|
||||||
m_download_codes = new QPushButton(tr("Download Codes"));
|
m_download_codes = new QPushButton(tr("Download Codes"));
|
||||||
|
m_sort_codes = new QPushButton(tr("Sort Codes"));
|
||||||
|
|
||||||
m_download_codes->setToolTip(tr("Download Codes from the WiiRD Database"));
|
m_download_codes->setToolTip(tr("Download Codes from the WiiRD Database"));
|
||||||
|
|
||||||
|
@ -102,6 +103,7 @@ void GeckoCodeWidget::CreateWidgets()
|
||||||
btn_layout->addWidget(m_edit_code);
|
btn_layout->addWidget(m_edit_code);
|
||||||
btn_layout->addWidget(m_remove_code);
|
btn_layout->addWidget(m_remove_code);
|
||||||
btn_layout->addWidget(m_download_codes);
|
btn_layout->addWidget(m_download_codes);
|
||||||
|
btn_layout->addWidget(m_sort_codes);
|
||||||
|
|
||||||
layout->addLayout(btn_layout);
|
layout->addLayout(btn_layout);
|
||||||
|
|
||||||
|
@ -118,6 +120,7 @@ void GeckoCodeWidget::ConnectWidgets()
|
||||||
connect(m_remove_code, &QPushButton::pressed, this, &GeckoCodeWidget::RemoveCode);
|
connect(m_remove_code, &QPushButton::pressed, this, &GeckoCodeWidget::RemoveCode);
|
||||||
connect(m_edit_code, &QPushButton::pressed, this, &GeckoCodeWidget::EditCode);
|
connect(m_edit_code, &QPushButton::pressed, this, &GeckoCodeWidget::EditCode);
|
||||||
connect(m_download_codes, &QPushButton::pressed, this, &GeckoCodeWidget::DownloadCodes);
|
connect(m_download_codes, &QPushButton::pressed, this, &GeckoCodeWidget::DownloadCodes);
|
||||||
|
connect(m_sort_codes, &QPushButton::pressed, this, &GeckoCodeWidget::SortCodesLexicographically);
|
||||||
|
|
||||||
connect(m_warning, &CheatWarningWidget::OpenCheatEnableSettings, this,
|
connect(m_warning, &CheatWarningWidget::OpenCheatEnableSettings, this,
|
||||||
&GeckoCodeWidget::OpenGeneralSettings);
|
&GeckoCodeWidget::OpenGeneralSettings);
|
||||||
|
@ -221,6 +224,12 @@ void GeckoCodeWidget::SaveCodes()
|
||||||
game_ini_local.Save(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + ".ini");
|
game_ini_local.Save(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + ".ini");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeckoCodeWidget::SortCodesLexicographically()
|
||||||
|
{
|
||||||
|
m_code_list->setSortingEnabled(!m_code_list->isSortingEnabled());
|
||||||
|
GeckoCodeWidget::UpdateList();
|
||||||
|
}
|
||||||
|
|
||||||
void GeckoCodeWidget::UpdateList()
|
void GeckoCodeWidget::UpdateList()
|
||||||
{
|
{
|
||||||
m_code_list->clear();
|
m_code_list->clear();
|
||||||
|
|
|
@ -46,6 +46,7 @@ private:
|
||||||
void RemoveCode();
|
void RemoveCode();
|
||||||
void DownloadCodes();
|
void DownloadCodes();
|
||||||
void SaveCodes();
|
void SaveCodes();
|
||||||
|
void SortCodesLexicographically();
|
||||||
|
|
||||||
const UICommon::GameFile& m_game;
|
const UICommon::GameFile& m_game;
|
||||||
std::string m_game_id;
|
std::string m_game_id;
|
||||||
|
@ -61,6 +62,7 @@ private:
|
||||||
QPushButton* m_edit_code;
|
QPushButton* m_edit_code;
|
||||||
QPushButton* m_remove_code;
|
QPushButton* m_remove_code;
|
||||||
QPushButton* m_download_codes;
|
QPushButton* m_download_codes;
|
||||||
|
QPushButton* m_sort_codes;
|
||||||
std::vector<Gecko::GeckoCode> m_gecko_codes;
|
std::vector<Gecko::GeckoCode> m_gecko_codes;
|
||||||
bool m_restart_required;
|
bool m_restart_required;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue