Skip to content
Permalink
Browse files

SignatureDB: Add missing selectors

  • Loading branch information...
sepalani committed Oct 12, 2019
1 parent 5be061e commit 8dc55579953bc22650a9f7c28c3fca0937bc0fb9
Showing with 21 additions and 15 deletions.
  1. +19 −15 Source/Core/DolphinQt/MenuBar.cpp
  2. +2 −0 Source/Core/DolphinQt/MenuBar.h
@@ -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;
@@ -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;

@@ -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;

@@ -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;
@@ -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;

@@ -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

0 comments on commit 8dc5557

Please sign in to comment.
You can’t perform that action at this time.