mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-03 01:38:36 +00:00
Merge #15
This commit is contained in:
parent
7d8fe0f105
commit
871da4e307
275 changed files with 33002 additions and 27474 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "DolphinQt/Config/ARCodeWidget.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include <QCursor>
|
||||
|
@ -113,6 +114,8 @@ void ARCodeWidget::OnContextMenuRequested()
|
|||
QMenu menu;
|
||||
|
||||
menu.addAction(tr("Sort Alphabetically"), this, &ARCodeWidget::SortAlphabetically);
|
||||
menu.addAction(tr("Show Enabled Codes First"), this, &ARCodeWidget::SortEnabledCodesFirst);
|
||||
menu.addAction(tr("Show Disabled Codes First"), this, &ARCodeWidget::SortDisabledCodesFirst);
|
||||
|
||||
menu.exec(QCursor::pos());
|
||||
}
|
||||
|
@ -123,6 +126,26 @@ void ARCodeWidget::SortAlphabetically()
|
|||
OnListReordered();
|
||||
}
|
||||
|
||||
void ARCodeWidget::SortEnabledCodesFirst()
|
||||
{
|
||||
std::stable_sort(m_ar_codes.begin(), m_ar_codes.end(), [](const auto& a, const auto& b) {
|
||||
return a.enabled && a.enabled != b.enabled;
|
||||
});
|
||||
|
||||
UpdateList();
|
||||
SaveCodes();
|
||||
}
|
||||
|
||||
void ARCodeWidget::SortDisabledCodesFirst()
|
||||
{
|
||||
std::stable_sort(m_ar_codes.begin(), m_ar_codes.end(), [](const auto& a, const auto& b) {
|
||||
return !a.enabled && a.enabled != b.enabled;
|
||||
});
|
||||
|
||||
UpdateList();
|
||||
SaveCodes();
|
||||
}
|
||||
|
||||
void ARCodeWidget::OnListReordered()
|
||||
{
|
||||
// Reorder codes based on the indices of table item
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue