Merge pull request #8400 from sepalani/fix-mega

SignatureDB: Add missing selectors
This commit is contained in:
spycrab 2019-10-15 18:24:03 +02:00 committed by GitHub
commit 4425d05c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 15 deletions

View File

@ -57,6 +57,13 @@
QPointer<MenuBar> MenuBar::s_menu_bar; 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) MenuBar::MenuBar(QWidget* parent) : QMenuBar(parent)
{ {
s_menu_bar = this; s_menu_bar = this;
@ -1330,8 +1337,8 @@ void MenuBar::CreateSignatureFile()
const QString text = QInputDialog::getText( const QString text = QInputDialog::getText(
this, tr("Input"), tr("Only export symbols with prefix:\n(Blank for all symbols)")); this, tr("Input"), tr("Only export symbols with prefix:\n(Blank for all symbols)"));
const QString file = QFileDialog::getSaveFileName( const QString file = QFileDialog::getSaveFileName(this, tr("Save signature file"),
this, tr("Save signature file"), QDir::homePath(), tr("Function signature file (*.dsy)")); QDir::homePath(), GetSignatureSelector());
if (file.isEmpty()) if (file.isEmpty())
return; return;
@ -1354,8 +1361,8 @@ void MenuBar::AppendSignatureFile()
const QString text = QInputDialog::getText( const QString text = QInputDialog::getText(
this, tr("Input"), tr("Only append symbols with prefix:\n(Blank for all symbols)")); this, tr("Input"), tr("Only append symbols with prefix:\n(Blank for all symbols)"));
const QString file = QFileDialog::getSaveFileName( const QString file = QFileDialog::getSaveFileName(this, tr("Append signature to"),
this, tr("Append signature to"), QDir::homePath(), tr("Function signature file (*.dsy)")); QDir::homePath(), GetSignatureSelector());
if (file.isEmpty()) if (file.isEmpty())
return; return;
@ -1377,8 +1384,8 @@ void MenuBar::AppendSignatureFile()
void MenuBar::ApplySignatureFile() void MenuBar::ApplySignatureFile()
{ {
const QString file = QFileDialog::getOpenFileName( const QString file = QFileDialog::getOpenFileName(this, tr("Apply signature file"),
this, tr("Apply signature file"), QDir::homePath(), tr("Function signature file (*.dsy)")); QDir::homePath(), GetSignatureSelector());
if (file.isEmpty()) if (file.isEmpty())
return; return;
@ -1394,21 +1401,18 @@ void MenuBar::ApplySignatureFile()
void MenuBar::CombineSignatureFiles() void MenuBar::CombineSignatureFiles()
{ {
const QString priorityFile = const QString priorityFile = QFileDialog::getOpenFileName(
QFileDialog::getOpenFileName(this, tr("Choose priority input file"), QDir::homePath(), this, tr("Choose priority input file"), QDir::homePath(), GetSignatureSelector());
tr("Function signature file (*.dsy)"));
if (priorityFile.isEmpty()) if (priorityFile.isEmpty())
return; return;
const QString secondaryFile = const QString secondaryFile = QFileDialog::getOpenFileName(
QFileDialog::getOpenFileName(this, tr("Choose secondary input file"), QDir::homePath(), this, tr("Choose secondary input file"), QDir::homePath(), GetSignatureSelector());
tr("Function signature file (*.dsy)"));
if (secondaryFile.isEmpty()) if (secondaryFile.isEmpty())
return; return;
const QString saveFile = const QString saveFile = QFileDialog::getSaveFileName(this, tr("Save combined output file as"),
QFileDialog::getSaveFileName(this, tr("Save combined output file as"), QDir::homePath(), QDir::homePath(), GetSignatureSelector());
tr("Function signature file (*.dsy)"));
if (saveFile.isEmpty()) if (saveFile.isEmpty())
return; return;

View File

@ -175,6 +175,8 @@ private:
void OnReadOnlyModeChanged(bool read_only); void OnReadOnlyModeChanged(bool read_only);
void OnDebugModeToggled(bool enabled); void OnDebugModeToggled(bool enabled);
QString GetSignatureSelector() const;
static QPointer<MenuBar> s_menu_bar; static QPointer<MenuBar> s_menu_bar;
// File // File