Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8400 from sepalani/fix-mega
SignatureDB: Add missing selectors
  • Loading branch information
spycrab committed Oct 15, 2019
2 parents c634bc8 + 8dc5557 commit 4425d05
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
34 changes: 19 additions & 15 deletions Source/Core/DolphinQt/MenuBar.cpp
Expand Up @@ -57,6 +57,13 @@

QPointer<MenuBar> MenuBar::s_menu_bar;

QString MenuBar::GetSignatureSelector() const
{
return QStringLiteral("%1 (*.dsy);; %2 (*.csv);; %3 (*.mega)")
.arg(tr("Dolphin Signature File"), tr("Dolphin Signature CSV File"),
tr("WiiTools Signature MEGA File"));
}

MenuBar::MenuBar(QWidget* parent) : QMenuBar(parent)
{
s_menu_bar = this;
Expand Down Expand Up @@ -1330,8 +1337,8 @@ void MenuBar::CreateSignatureFile()
const QString text = QInputDialog::getText(
this, tr("Input"), tr("Only export symbols with prefix:\n(Blank for all symbols)"));

const QString file = QFileDialog::getSaveFileName(
this, tr("Save signature file"), QDir::homePath(), tr("Function signature file (*.dsy)"));
const QString file = QFileDialog::getSaveFileName(this, tr("Save signature file"),
QDir::homePath(), GetSignatureSelector());
if (file.isEmpty())
return;

Expand All @@ -1354,8 +1361,8 @@ void MenuBar::AppendSignatureFile()
const QString text = QInputDialog::getText(
this, tr("Input"), tr("Only append symbols with prefix:\n(Blank for all symbols)"));

const QString file = QFileDialog::getSaveFileName(
this, tr("Append signature to"), QDir::homePath(), tr("Function signature file (*.dsy)"));
const QString file = QFileDialog::getSaveFileName(this, tr("Append signature to"),
QDir::homePath(), GetSignatureSelector());
if (file.isEmpty())
return;

Expand All @@ -1377,8 +1384,8 @@ void MenuBar::AppendSignatureFile()

void MenuBar::ApplySignatureFile()
{
const QString file = QFileDialog::getOpenFileName(
this, tr("Apply signature file"), QDir::homePath(), tr("Function signature file (*.dsy)"));
const QString file = QFileDialog::getOpenFileName(this, tr("Apply signature file"),
QDir::homePath(), GetSignatureSelector());

if (file.isEmpty())
return;
Expand All @@ -1394,21 +1401,18 @@ void MenuBar::ApplySignatureFile()

void MenuBar::CombineSignatureFiles()
{
const QString priorityFile =
QFileDialog::getOpenFileName(this, tr("Choose priority input file"), QDir::homePath(),
tr("Function signature file (*.dsy)"));
const QString priorityFile = QFileDialog::getOpenFileName(
this, tr("Choose priority input file"), QDir::homePath(), GetSignatureSelector());
if (priorityFile.isEmpty())
return;

const QString secondaryFile =
QFileDialog::getOpenFileName(this, tr("Choose secondary input file"), QDir::homePath(),
tr("Function signature file (*.dsy)"));
const QString secondaryFile = QFileDialog::getOpenFileName(
this, tr("Choose secondary input file"), QDir::homePath(), GetSignatureSelector());
if (secondaryFile.isEmpty())
return;

const QString saveFile =
QFileDialog::getSaveFileName(this, tr("Save combined output file as"), QDir::homePath(),
tr("Function signature file (*.dsy)"));
const QString saveFile = QFileDialog::getSaveFileName(this, tr("Save combined output file as"),
QDir::homePath(), GetSignatureSelector());
if (saveFile.isEmpty())
return;

Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt/MenuBar.h
Expand Up @@ -175,6 +175,8 @@ class MenuBar final : public QMenuBar
void OnReadOnlyModeChanged(bool read_only);
void OnDebugModeToggled(bool enabled);

QString GetSignatureSelector() const;

static QPointer<MenuBar> s_menu_bar;

// File
Expand Down

0 comments on commit 4425d05

Please sign in to comment.