mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 09:34:00 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cbb306ba8 |
@@ -46,7 +46,7 @@ MainDialog::MainDialog(QWidget* parent, Thread::SDLThread* sdlThread, bool romCo
|
||||
{
|
||||
Widget::ControllerWidget* widget = new Widget::ControllerWidget(this, this->eventFilter);
|
||||
widget->SetOnlyLoadGameProfile(romConfig);
|
||||
widget->SetSettingsSection("Player " + QString::number(i + 1), "Rosalie's Mupen GUI - Input Plugin Profile " + QString::number(i));
|
||||
widget->SetSettingsSection(tr("Player ") + QString::number(i + 1), "Rosalie's Mupen GUI - Input Plugin Profile " + QString::number(i));
|
||||
widget->LoadSettings();
|
||||
this->tabWidget->widget(i)->layout()->addWidget(widget);
|
||||
controllerWidgets.push_back(widget);
|
||||
@@ -69,12 +69,12 @@ MainDialog::MainDialog(QWidget* parent, Thread::SDLThread* sdlThread, bool romCo
|
||||
// so we only have to expose it there
|
||||
if (controllerWidget == this->controllerWidgets.last())
|
||||
{
|
||||
controllerWidget->AddInputDevice({"Voice Recognition Unit", "", "", (int)InputDeviceType::EmulateVRU});
|
||||
controllerWidget->AddInputDevice({tr("Voice Recognition Unit").toStdString(), "", "", (int)InputDeviceType::EmulateVRU});
|
||||
}
|
||||
#endif // VRU
|
||||
controllerWidget->AddInputDevice({"None", "", "", (int)InputDeviceType::None});
|
||||
controllerWidget->AddInputDevice({"Automatic", "", "", (int)InputDeviceType::Automatic});
|
||||
controllerWidget->AddInputDevice({"Keyboard", "", "", (int)InputDeviceType::Keyboard});
|
||||
controllerWidget->AddInputDevice({tr("None").toStdString(), "", "", (int)InputDeviceType::None});
|
||||
controllerWidget->AddInputDevice({tr("Automatic").toStdString(), "", "", (int)InputDeviceType::Automatic});
|
||||
controllerWidget->AddInputDevice({tr("Keyboard").toStdString(), "", "", (int)InputDeviceType::Keyboard});
|
||||
controllerWidget->SetInitialized(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ bool ControllerWidget::isCurrentDeviceKeyboard()
|
||||
bool ControllerWidget::isCurrentDeviceNotFound()
|
||||
{
|
||||
QString title = this->inputDeviceComboBox->currentText();
|
||||
return title.endsWith("(not found)");
|
||||
return title.endsWith(tr("(not found)"));
|
||||
}
|
||||
|
||||
void ControllerWidget::disableAllChildren()
|
||||
@@ -576,7 +576,7 @@ void ControllerWidget::CheckInputDeviceSettings(QString sectionQString)
|
||||
}
|
||||
|
||||
// clear (not found) devices first
|
||||
int notFoundIndex = this->inputDeviceComboBox->findText("(not found)", Qt::MatchFlag::MatchEndsWith);
|
||||
int notFoundIndex = this->inputDeviceComboBox->findText(tr("(not found)"), Qt::MatchFlag::MatchEndsWith);
|
||||
if (notFoundIndex != -1)
|
||||
{
|
||||
this->inputDeviceNameList.removeAt(notFoundIndex);
|
||||
@@ -638,7 +638,7 @@ void ControllerWidget::CheckInputDeviceSettings(QString sectionQString)
|
||||
else
|
||||
{ // no match
|
||||
QString title = QString::fromStdString(deviceName);
|
||||
title += " (not found)";
|
||||
title += tr(" (not found)");
|
||||
this->inputDeviceNameList.append(QString::fromStdString(deviceName));
|
||||
this->inputDeviceComboBox->addItem(title, QVariant::fromValue<SDLDevice>(device));
|
||||
this->inputDeviceComboBox->setCurrentIndex(this->inputDeviceNameList.count() - 1);
|
||||
@@ -672,7 +672,7 @@ void ControllerWidget::GetCurrentInputDevice(SDLDevice& device, bool ignoreDevic
|
||||
void ControllerWidget::on_deadZoneSlider_valueChanged(int value)
|
||||
{
|
||||
QString title;
|
||||
title = "Deadzone: ";
|
||||
title = tr("Deadzone: ");
|
||||
title += QString::number(value);
|
||||
title += "%";
|
||||
|
||||
@@ -752,7 +752,7 @@ void ControllerWidget::on_addProfileButton_clicked()
|
||||
|
||||
// ask user for a new profile name
|
||||
QString newProfile = QInputDialog::getText(this,
|
||||
"Create New Profile", "New profile name:",
|
||||
tr("Create New Profile"), tr("New profile name:"),
|
||||
QLineEdit::Normal, "",
|
||||
nullptr,
|
||||
Qt::WindowCloseButtonHint | Qt::WindowTitleHint);
|
||||
@@ -766,7 +766,7 @@ void ControllerWidget::on_addProfileButton_clicked()
|
||||
newProfile.contains('[') ||
|
||||
newProfile.contains(']'))
|
||||
{
|
||||
this->showErrorMessage("Profile name cannot contain ';','[' or ']'!");
|
||||
this->showErrorMessage(tr("Profile name cannot contain ';','[' or ']'!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -774,7 +774,7 @@ void ControllerWidget::on_addProfileButton_clicked()
|
||||
profilesIter = std::find(profiles.begin(), profiles.end(), newProfile.toStdString());
|
||||
if (profilesIter != profiles.end())
|
||||
{
|
||||
this->showErrorMessage("Profile with the same name already exists!");
|
||||
this->showErrorMessage(tr("Profile with the same name already exists!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -804,7 +804,7 @@ void ControllerWidget::on_removeProfileButton_clicked()
|
||||
{
|
||||
QMessageBox messageBox(this);
|
||||
messageBox.setIcon(QMessageBox::Icon::Warning);
|
||||
messageBox.setText("Are you sure you want to clear the main profile?");
|
||||
messageBox.setText(tr("Are you sure you want to clear the main profile?"));
|
||||
messageBox.addButton(QMessageBox::Yes);
|
||||
messageBox.addButton(QMessageBox::No);
|
||||
if (messageBox.exec() == QMessageBox::Yes)
|
||||
|
||||
@@ -5,7 +5,12 @@ set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
find_package(Qt6 COMPONENTS Gui Widgets Core REQUIRED)
|
||||
find_package(Qt6 COMPONENTS Gui Widgets Core OpenGL LinguistTools REQUIRED)
|
||||
|
||||
file(GLOB TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../Translations/*.ts")
|
||||
qt6_add_translations(RMG
|
||||
TS_FILES ${TS_FILES}
|
||||
)
|
||||
|
||||
if (PORTABLE_INSTALL)
|
||||
add_definitions(-DPORTABLE_INSTALL)
|
||||
|
||||
@@ -116,14 +116,14 @@ bool OnScreenDisplaySetDisplaySize(int width, int height)
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnScreenDisplaySetMessage(std::string message)
|
||||
void OnScreenDisplaySetMessage(QString message)
|
||||
{
|
||||
if (!l_Initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
l_Message = message;
|
||||
l_Message = message.toStdString();
|
||||
l_MessageTime = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef RMG_ONSCREENDISPLAY_HPP
|
||||
#define RMG_ONSCREENDISPLAY_HPP
|
||||
|
||||
#include <string>
|
||||
#include <QString>
|
||||
|
||||
// attempts to initialize the OSD
|
||||
bool OnScreenDisplayInit(void);
|
||||
@@ -25,7 +25,7 @@ void OnScreenDisplayLoadSettings(void);
|
||||
bool OnScreenDisplaySetDisplaySize(int width, int height);
|
||||
|
||||
// sets the current message to the OSD
|
||||
void OnScreenDisplaySetMessage(std::string message);
|
||||
void OnScreenDisplaySetMessage(QString message);
|
||||
|
||||
// renders the OSD
|
||||
void OnScreenDisplayRender(void);
|
||||
|
||||
@@ -258,7 +258,7 @@ bool AddCheatDialog::getCheat(CoreCheat& cheat)
|
||||
|
||||
if (!CoreParseCheat(lines, cheat))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreParseCheat() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreParseCheat() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ bool AddCheatDialog::addCheat(void)
|
||||
|
||||
if (!CoreAddCheat(cheat))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreAddCheat() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreAddCheat() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ bool AddCheatDialog::updateCheat(void)
|
||||
|
||||
if (!CoreUpdateCheat(this->oldCheat,cheat))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreUpdateCheat() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreUpdateCheat() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ void AddCheatDialog::accept(void)
|
||||
|
||||
if (!this->validate())
|
||||
{
|
||||
QtMessageBox::Error(this, "Validating Cheat Failed", "");
|
||||
QtMessageBox::Error(this, tr("Validating Cheat Failed"), "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void CheatsDialog::loadCheats(void)
|
||||
|
||||
if (!CoreGetCurrentCheats(cheats))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreGetCurrentCheats() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreGetCurrentCheats() Failed"), QString::fromStdString(CoreGetError()));
|
||||
this->failedToParseCheats = true;
|
||||
return;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void CheatsDialog::on_removeCheatButton_clicked(void)
|
||||
// try to remove cheat
|
||||
if (!CoreRemoveCheat(cheat))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreRemoveCheat() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreRemoveCheat() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ void CheatsDialog::accept(void)
|
||||
|
||||
if (!CoreApplyCheats())
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreApplyCheats() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreApplyCheats() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ CreateNetplaySessionDialog::CreateNetplaySessionDialog(QWidget *parent, QWebSock
|
||||
|
||||
// change ok button name
|
||||
QPushButton* createButton = this->buttonBox->button(QDialogButtonBox::Ok);
|
||||
createButton->setText("Create");
|
||||
createButton->setText(tr("Create"));
|
||||
createButton->setEnabled(false);
|
||||
|
||||
// set validator for nickname
|
||||
@@ -181,7 +181,7 @@ void CreateNetplaySessionDialog::on_webSocket_textMessageReceived(QString messag
|
||||
}
|
||||
else
|
||||
{
|
||||
QtMessageBox::Error(this, "Server Error", json.value("message").toString());
|
||||
QtMessageBox::Error(this, tr("Server Error"), json.value("message").toString());
|
||||
this->validateCreateButton();
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ void CreateNetplaySessionDialog::on_networkAccessManager_Finished(QNetworkReply*
|
||||
{
|
||||
if (reply->error())
|
||||
{
|
||||
QtMessageBox::Error(this, "Server Error", "Failed to retrieve server list json: " + reply->errorString());
|
||||
QtMessageBox::Error(this, tr("Server Error"), "Failed to retrieve server list json: " + reply->errorString());
|
||||
reply->deleteLater();
|
||||
return;
|
||||
}
|
||||
@@ -241,7 +241,7 @@ void CreateNetplaySessionDialog::on_serverComboBox_currentIndexChanged(int index
|
||||
return;
|
||||
}
|
||||
|
||||
this->pingLineEdit->setText("Calculating...");
|
||||
this->pingLineEdit->setText(tr("Calculating..."));
|
||||
|
||||
QString address = this->serverComboBox->itemData(index).toString();
|
||||
this->webSocket->open(QUrl(address));
|
||||
@@ -271,7 +271,7 @@ void CreateNetplaySessionDialog::accept()
|
||||
{
|
||||
if (!this->webSocket->isValid())
|
||||
{
|
||||
QtMessageBox::Error(this, "Server Error", "Connection Failed");
|
||||
QtMessageBox::Error(this, tr("Server Error"), "Connection Failed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ NetplaySessionBrowserDialog::NetplaySessionBrowserDialog(QWidget *parent, QWebSo
|
||||
|
||||
// change restore defaults button name
|
||||
QPushButton* refreshButton = this->buttonBox->button(QDialogButtonBox::RestoreDefaults);
|
||||
refreshButton->setText("Refresh");
|
||||
refreshButton->setText(tr("Refresh"));
|
||||
refreshButton->setIcon(QIcon::fromTheme("refresh-line"));
|
||||
refreshButton->setEnabled(false);
|
||||
|
||||
|
||||
@@ -64,11 +64,11 @@ NetplaySessionDialog::NetplaySessionDialog(QWidget *parent, QWebSocket* webSocke
|
||||
webSocket->sendTextMessage(QJsonDocument(json).toJson());
|
||||
|
||||
QPushButton* startButton = this->buttonBox->button(QDialogButtonBox::Ok);
|
||||
startButton->setText("Start");
|
||||
startButton->setText(tr("Start"));
|
||||
startButton->setEnabled(false);
|
||||
|
||||
QPushButton* cheatsButton = this->buttonBox->button(QDialogButtonBox::RestoreDefaults);
|
||||
cheatsButton->setText("Cheats");
|
||||
cheatsButton->setText(tr("Cheats"));
|
||||
cheatsButton->setIcon(QIcon::fromTheme("code-box-line"));
|
||||
|
||||
this->updateCheatsTreeWidget();
|
||||
@@ -99,7 +99,7 @@ bool NetplaySessionDialog::getCheats(std::vector<CoreCheat>& cheats, QJsonArray&
|
||||
if (!CheatsCommon::ParseCheatJson(cheatsArray, cheats))
|
||||
{
|
||||
QString error = "Failed to parse cheats json: " + QString(cheatDocument.toJson());
|
||||
QtMessageBox::Error(this, "CheatsCommon::ParseCheatJson() Failed", error);
|
||||
QtMessageBox::Error(this, tr("CheatsCommon::ParseCheatJson() Failed"), error);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ bool NetplaySessionDialog::applyCheats(void)
|
||||
|
||||
if (!CoreSetNetplayCheats(cheats))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreSetNetplayCheats() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreSetNetplayCheats() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ void NetplaySessionDialog::on_webSocket_textMessageReceived(QString message)
|
||||
startButton->setEnabled(true);
|
||||
cheatsButton->setEnabled(true);
|
||||
|
||||
QtMessageBox::Error(this, "Server Error", json.value("message").toString());
|
||||
QtMessageBox::Error(this, tr("Server Error"), json.value("message").toString());
|
||||
}
|
||||
}
|
||||
else if (type == "reply_motd")
|
||||
@@ -219,7 +219,7 @@ void NetplaySessionDialog::on_webSocket_textMessageReceived(QString message)
|
||||
}
|
||||
else
|
||||
{
|
||||
QtMessageBox::Error(this, "Server Error", json.value("message").toString());
|
||||
QtMessageBox::Error(this, tr("Server Error"), json.value("message").toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,7 +257,7 @@ void NetplaySessionDialog::on_buttonBox_clicked(QAbstractButton* button)
|
||||
|
||||
if (!CoreOpenRom(this->sessionFile.toStdU32String()))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreOpenRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreOpenRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ void NetplaySessionDialog::on_buttonBox_clicked(QAbstractButton* button)
|
||||
|
||||
if (!CoreCloseRom())
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreCloseRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreCloseRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ void SettingsDialog::loadGamePluginSettings(void)
|
||||
for (QComboBox *comboBox : comboBoxArray)
|
||||
{
|
||||
comboBox->clear();
|
||||
comboBox->addItem("**Use Core Plugin Settings**");
|
||||
comboBox->addItem(tr("**Use Core Plugin Settings**"));
|
||||
}
|
||||
|
||||
for (const auto &p : this->pluginList)
|
||||
@@ -381,7 +381,7 @@ void SettingsDialog::loadGamePluginSettings(void)
|
||||
|
||||
if (!pluginFound[i])
|
||||
{
|
||||
pluginName = pluginFileNames[i] + " (not found)";
|
||||
pluginName = pluginFileNames[i] + tr(" (not found)");
|
||||
|
||||
comboBox->addItem(pluginName, pluginFileNames[i]);
|
||||
comboBox->setCurrentText(pluginName);
|
||||
@@ -1150,7 +1150,7 @@ void SettingsDialog::commonPluginSettings(SettingsDialogAction action)
|
||||
comboBox = comboBoxArray[i];
|
||||
if (!pluginFound[i])
|
||||
{
|
||||
pluginName = pluginFileNames[i] + " (not found)";
|
||||
pluginName = pluginFileNames[i] + tr(" (not found)");
|
||||
|
||||
comboBox->addItem(pluginName, pluginFileNames[i]);
|
||||
comboBox->setCurrentText(pluginName);
|
||||
@@ -1242,7 +1242,7 @@ void SettingsDialog::chooseFile(QLineEdit *lineEdit, QString filter, QString md5
|
||||
QFile qFile(file);
|
||||
if (!qFile.open(QFile::ReadOnly))
|
||||
{
|
||||
QtMessageBox::Error(this, "Failed to open file", "QFile::open() Failed");
|
||||
QtMessageBox::Error(this, tr("Failed to open file"), "QFile::open() Failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1252,7 +1252,7 @@ void SettingsDialog::chooseFile(QLineEdit *lineEdit, QString filter, QString md5
|
||||
QString md5Hash = QString(hash.result().toHex());
|
||||
if (md5Hash != md5)
|
||||
{
|
||||
QtMessageBox::Error(this, "MD5 mismatch", "Expected file with MD5: \"" + md5 + "\"");
|
||||
QtMessageBox::Error(this, tr("MD5 mismatch"), "Expected file with MD5: \"" + md5 + "\"");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1292,7 +1292,7 @@ bool SettingsDialog::applyPluginSettings(void)
|
||||
{
|
||||
if (!CoreApplyPluginSettings())
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreApplyPluginSettings() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreApplyPluginSettings() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1393,17 +1393,17 @@ void SettingsDialog::on_changeUserCacheDirButton_clicked(void)
|
||||
|
||||
void SettingsDialog::on_changeJapaneseIPLRomPathButton_clicked(void)
|
||||
{
|
||||
this->chooseFile(this->japaneseIPLRomLineEdit, "IPL ROMs (*.n64 *.v64 *.z64)");
|
||||
this->chooseFile(this->japaneseIPLRomLineEdit, tr("IPL ROMs (*.n64 *.v64 *.z64)"));
|
||||
}
|
||||
|
||||
void SettingsDialog::on_changeAmericanIPLRomPathButton_clicked(void)
|
||||
{
|
||||
this->chooseFile(this->americanIPLRomLineEdit, "IPL ROMs (*.n64 *.v64 *.z64)");
|
||||
this->chooseFile(this->americanIPLRomLineEdit, tr("IPL ROMs (*.n64 *.v64 *.z64)"));
|
||||
}
|
||||
|
||||
void SettingsDialog::on_changeDevelopmentIPLRomPathButton_clicked(void)
|
||||
{
|
||||
this->chooseFile(this->developmentIPLRomLineEdit, "IPL ROMs (*.n64 *.v64 *.z64)");
|
||||
this->chooseFile(this->developmentIPLRomLineEdit, tr("IPL ROMs (*.n64 *.v64 *.z64)"));
|
||||
}
|
||||
|
||||
void SettingsDialog::on_changeBackgroundColorButton_clicked(void)
|
||||
@@ -1564,10 +1564,10 @@ void SettingsDialog::on_coreCpuEmulatorComboBox_currentIndexChanged(int index)
|
||||
|
||||
void SettingsDialog::on_changeNTSCPifRomButton_clicked(void)
|
||||
{
|
||||
this->chooseFile(this->ntscPifRomLineEdit, "PIF ROMs (*.rom)", "5c124e7948ada85da603a522782940d0");
|
||||
this->chooseFile(this->ntscPifRomLineEdit, tr("PIF ROMs (*.rom)"), "5c124e7948ada85da603a522782940d0");
|
||||
}
|
||||
|
||||
void SettingsDialog::on_changePALPifRomButton_clicked(void)
|
||||
{
|
||||
this->chooseFile(this->palPifRomLineEdit, "PIF ROMs (*.rom)", "d4232dc935cad0650ac2664d52281f3a");
|
||||
this->chooseFile(this->palPifRomLineEdit, tr("PIF ROMs (*.rom)"), "d4232dc935cad0650ac2664d52281f3a");
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ DownloadUpdateDialog::DownloadUpdateDialog(QWidget *parent, QUrl url, QString fi
|
||||
this->setupUi(this);
|
||||
|
||||
this->filename = filename;
|
||||
this->label->setText("Downloading " + filename + "...");
|
||||
this->label->setText(tr("Downloading ") + filename + "...");
|
||||
|
||||
QNetworkAccessManager* networkAccessManager = new QNetworkAccessManager(this);
|
||||
QNetworkRequest request(url);
|
||||
@@ -64,7 +64,7 @@ void DownloadUpdateDialog::on_reply_finished(void)
|
||||
{
|
||||
if (this->reply->error())
|
||||
{
|
||||
QtMessageBox::Error(this, "Failed to download update file", this->reply->errorString());
|
||||
QtMessageBox::Error(this, tr("Failed to download update file"), this->reply->errorString());
|
||||
this->reply->deleteLater();
|
||||
this->reject();
|
||||
return;
|
||||
@@ -77,7 +77,7 @@ void DownloadUpdateDialog::on_reply_finished(void)
|
||||
temporaryDir.setAutoRemove(false);
|
||||
if (!temporaryDir.isValid())
|
||||
{
|
||||
QtMessageBox::Error(this, "Failed to create temporary directory", "");
|
||||
QtMessageBox::Error(this, tr("Failed to create temporary directory"), "");
|
||||
this->reply->deleteLater();
|
||||
this->reject();
|
||||
return;
|
||||
@@ -90,7 +90,7 @@ void DownloadUpdateDialog::on_reply_finished(void)
|
||||
if (appImageEnv == nullptr ||
|
||||
!QFile(appImageEnv).exists())
|
||||
{
|
||||
QtMessageBox::Error(this, "APPIMAGE variable is empty or invalid", "");
|
||||
QtMessageBox::Error(this, tr("APPIMAGE variable is empty or invalid"), "");
|
||||
this->reply->deleteLater();
|
||||
this->reject();
|
||||
return;
|
||||
@@ -103,7 +103,7 @@ void DownloadUpdateDialog::on_reply_finished(void)
|
||||
QFile file(filePath);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate))
|
||||
{
|
||||
QtMessageBox::Error(this, "QFile::open() Failed", "");
|
||||
QtMessageBox::Error(this, tr("QFile::open() Failed"), "");
|
||||
this->reply->deleteLater();
|
||||
this->reject();
|
||||
return;
|
||||
@@ -119,7 +119,7 @@ void DownloadUpdateDialog::on_reply_finished(void)
|
||||
int ret = std::rename(filePath.toStdString().c_str(), appImageEnv);
|
||||
if (ret != 0)
|
||||
{
|
||||
QtMessageBox::Error(this, "std::rename() Failed", QString(strerror(errno)));
|
||||
QtMessageBox::Error(this, tr("std::rename() Failed"), QString(strerror(errno)));
|
||||
this->reply->deleteLater();
|
||||
this->reject();
|
||||
return;
|
||||
|
||||
@@ -61,7 +61,7 @@ void InstallUpdateDialog::install(void)
|
||||
|
||||
if (this->filename.endsWith(".exe"))
|
||||
{
|
||||
this->label->setText("Executing " + this->filename + "...");
|
||||
this->label->setText(tr("Executing ") + this->filename + "...");
|
||||
QStringList scriptLines =
|
||||
{
|
||||
"@echo off",
|
||||
@@ -82,13 +82,13 @@ void InstallUpdateDialog::install(void)
|
||||
return;
|
||||
}
|
||||
|
||||
this->label->setText("Extracting " + this->filename + "...");
|
||||
this->label->setText(tr("Extracting ") + this->filename + "...");
|
||||
this->progressBar->setValue(50);
|
||||
|
||||
QDir dir(this->temporaryDirectory);
|
||||
if (!dir.mkdir("extract"))
|
||||
{
|
||||
QtMessageBox::Error(this, "QDir::mkdir() Failed", "");
|
||||
QtMessageBox::Error(this, tr("QDir::mkdir() Failed"), "");
|
||||
this->reject();
|
||||
return;
|
||||
}
|
||||
@@ -99,12 +99,12 @@ void InstallUpdateDialog::install(void)
|
||||
|
||||
if (!CoreUnzip(fullFilePath.toStdU32String(), extractDirectory.toStdU32String()))
|
||||
{
|
||||
QtMessageBox::Error(this, "CoreUnzip() Failed", QString::fromStdString(CoreGetError()));
|
||||
QtMessageBox::Error(this, tr("CoreUnzip() Failed"), QString::fromStdString(CoreGetError()));
|
||||
this->reject();
|
||||
return;
|
||||
}
|
||||
|
||||
this->label->setText("Executing update script...");
|
||||
this->label->setText(tr("Executing update script..."));
|
||||
this->progressBar->setValue(100);
|
||||
|
||||
extractDirectory = QDir::toNativeSeparators(extractDirectory);
|
||||
@@ -140,7 +140,7 @@ void InstallUpdateDialog::writeAndRunScript(QStringList stringList)
|
||||
QFile scriptFile(scriptPath);
|
||||
if (!scriptFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
QtMessageBox::Error(this, "QFile::open() Failed", "");
|
||||
QtMessageBox::Error(this, tr("QFile::open() Failed"), "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ UpdateDialog::UpdateDialog(QWidget *parent, QJsonObject jsonObject, bool forced)
|
||||
|
||||
this->jsonObject = jsonObject;
|
||||
|
||||
this->label->setText(jsonObject.value("tag_name").toString() + " Available");
|
||||
this->label->setText(jsonObject.value("tag_name").toString() + tr(" Available"));
|
||||
this->textEdit->setText(jsonObject.value("body").toString());
|
||||
|
||||
// change ok button text to 'Update'
|
||||
QPushButton* button = this->buttonBox->button(QDialogButtonBox::Ok);
|
||||
button->setText("Update");
|
||||
button->setText(tr("Update"));
|
||||
|
||||
// don't show the 'Don't check for updates again' checkbox,
|
||||
// when the user requested we check for updates
|
||||
@@ -117,7 +117,7 @@ void UpdateDialog::accept(void)
|
||||
|
||||
if (filenameToDownload.isEmpty())
|
||||
{
|
||||
QtMessageBox::Error(this, "Failed to find update file");
|
||||
QtMessageBox::Error(this, tr("Failed to find update file"));
|
||||
QDialog::reject();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ bool MainWindow::Init(QApplication* app, bool showUI, bool launchROM)
|
||||
{
|
||||
if (!CoreInit())
|
||||
{
|
||||
this->showErrorMessage("CoreInit() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreInit() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CoreApplyPluginSettings())
|
||||
{
|
||||
this->showErrorMessage("CoreApplyPluginSettings() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreApplyPluginSettings() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
|
||||
this->configureTheme(app);
|
||||
@@ -103,7 +103,7 @@ bool MainWindow::Init(QApplication* app, bool showUI, bool launchROM)
|
||||
|
||||
if (!SetupVidExt(this->emulationThread, this, &this->ui_Widget_OpenGL, &this->ui_Widget_Vulkan))
|
||||
{
|
||||
this->showErrorMessage("SetupVidExt() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("SetupVidExt() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ bool MainWindow::Init(QApplication* app, bool showUI, bool launchROM)
|
||||
|
||||
if (!this->coreCallBacks->Init())
|
||||
{
|
||||
this->showErrorMessage("CoreCallbacks::Init() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreCallbacks::Init() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ void MainWindow::showErrorMessage(QString text, QString details, bool force)
|
||||
|
||||
QMessageBox* msgBox = new QMessageBox(this);
|
||||
msgBox->setIcon(QMessageBox::Icon::Critical);
|
||||
msgBox->setWindowTitle("Error");
|
||||
msgBox->setWindowTitle(tr("Error"));
|
||||
msgBox->setText(text);
|
||||
msgBox->setDetailedText(details);
|
||||
msgBox->addButton(QMessageBox::Ok);
|
||||
@@ -627,7 +627,7 @@ void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool re
|
||||
#ifdef NETPLAY
|
||||
if (this->netplaySessionDialog != nullptr && !netplay)
|
||||
{
|
||||
this->showErrorMessage("EmulationThread::run Failed", "Cannot start emulation when netplay session is active");
|
||||
this->showErrorMessage(tr("EmulationThread::run Failed"), "Cannot start emulation when netplay session is active");
|
||||
return;
|
||||
}
|
||||
#endif // NETPLAY
|
||||
@@ -656,7 +656,7 @@ void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool re
|
||||
this->ui_NoSwitchToRomBrowser = false;
|
||||
this->updateUI(false, false);
|
||||
|
||||
this->showErrorMessage("CoreArePluginsReady() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreArePluginsReady() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -910,7 +910,7 @@ QString MainWindow::getSaveStateSlotText(QAction* action, int slot)
|
||||
QString filePath;
|
||||
|
||||
// base text
|
||||
saveStateSlotText = "Slot " + QString::number(slot);
|
||||
saveStateSlotText = tr("Slot ") + QString::number(slot);
|
||||
|
||||
// add date and time text when it isnt empty
|
||||
dateTimeText = this->getSaveStateSlotDateTimeText(action);
|
||||
@@ -1366,7 +1366,7 @@ void MainWindow::on_EventFilter_FileDropped(QDropEvent *event)
|
||||
if (inEmulation && confirmDragDrop)
|
||||
{
|
||||
QMessageBox::StandardButton reply = QMessageBox::question(this, "",
|
||||
"Are you sure you want to launch the drag & dropped ROM?",
|
||||
tr("Are you sure you want to launch the drag & dropped ROM?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (reply == QMessageBox::No)
|
||||
{
|
||||
@@ -1431,7 +1431,7 @@ void MainWindow::on_networkAccessManager_Finished(QNetworkReply* reply)
|
||||
{
|
||||
if (!this->ui_SilentUpdateCheck)
|
||||
{
|
||||
this->showErrorMessage("Failed to check for updates", reply->errorString());
|
||||
this->showErrorMessage(tr("Failed to check for updates"), reply->errorString());
|
||||
}
|
||||
reply->deleteLater();
|
||||
return;
|
||||
@@ -1450,7 +1450,7 @@ void MainWindow::on_networkAccessManager_Finished(QNetworkReply* reply)
|
||||
{
|
||||
if (!this->ui_SilentUpdateCheck)
|
||||
{
|
||||
this->showErrorMessage("You're already on the latest version");
|
||||
this->showErrorMessage(tr("You're already on the latest version"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1572,7 +1572,7 @@ void MainWindow::on_Action_System_Shutdown(void)
|
||||
|
||||
if (!CoreStopEmulation())
|
||||
{
|
||||
this->showErrorMessage("CoreStopEmulation() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreStopEmulation() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1585,7 +1585,7 @@ void MainWindow::on_Action_System_SoftReset(void)
|
||||
{
|
||||
if (!CoreResetEmulation(false))
|
||||
{
|
||||
this->showErrorMessage("CoreResetEmulation() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreResetEmulation() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1593,7 +1593,7 @@ void MainWindow::on_Action_System_HardReset(void)
|
||||
{
|
||||
if (!CoreResetEmulation(true))
|
||||
{
|
||||
this->showErrorMessage("CoreResetEmulation() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreResetEmulation() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
void MainWindow::on_Action_System_Pause(void)
|
||||
@@ -1611,12 +1611,12 @@ void MainWindow::on_Action_System_Pause(void)
|
||||
if (!isPaused)
|
||||
{
|
||||
ret = CorePauseEmulation();
|
||||
error = "CorePauseEmulation() Failed";
|
||||
error = tr("CorePauseEmulation() Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = CoreResumeEmulation();
|
||||
error = "CoreResumeEmulation() Failed";
|
||||
error = tr("CoreResumeEmulation() Failed");
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
@@ -1632,7 +1632,7 @@ void MainWindow::on_Action_System_Screenshot(void)
|
||||
{
|
||||
if (!CoreTakeScreenshot())
|
||||
{
|
||||
this->showErrorMessage("CoreTakeScreenshot() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreTakeScreenshot() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1646,7 +1646,7 @@ void MainWindow::on_Action_System_LimitFPS(void)
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
this->showErrorMessage("CoreSetSpeedLimiterState() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreSetSpeedLimiterState() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1654,7 +1654,7 @@ void MainWindow::on_Action_System_SpeedFactor(int factor)
|
||||
{
|
||||
if (!CoreSetSpeedFactor(factor))
|
||||
{
|
||||
this->showErrorMessage("CoreSetSpeedFactor() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreSetSpeedFactor() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1665,11 +1665,11 @@ void MainWindow::on_Action_System_SaveState(void)
|
||||
if (!CoreSaveState())
|
||||
{
|
||||
this->ui_ManuallySavedState = false;
|
||||
this->showErrorMessage("CoreSaveState() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreSaveState() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
else
|
||||
{
|
||||
OnScreenDisplaySetMessage("Saved state to slot: " + std::to_string(CoreGetSaveStateSlot()));
|
||||
OnScreenDisplaySetMessage(tr("Saved state to slot: ") + QString::number(CoreGetSaveStateSlot()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1696,11 +1696,11 @@ void MainWindow::on_Action_System_SaveAs(void)
|
||||
if (!CoreSaveState(fileName.toStdU32String(), type))
|
||||
{
|
||||
this->ui_ManuallySavedState = false;
|
||||
this->showErrorMessage("CoreSaveState() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreSaveState() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
else
|
||||
{
|
||||
OnScreenDisplaySetMessage("Saved state to: " + QDir::toNativeSeparators(fileName).toStdString());
|
||||
OnScreenDisplaySetMessage(tr("Saved state to: ") + QDir::toNativeSeparators(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1717,11 +1717,11 @@ void MainWindow::on_Action_System_LoadState(void)
|
||||
if (!CoreLoadSaveState())
|
||||
{
|
||||
this->ui_ManuallyLoadedState = false;
|
||||
this->showErrorMessage("CoreLoadSaveState() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreLoadSaveState() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
else
|
||||
{
|
||||
OnScreenDisplaySetMessage("State loaded from slot: " + std::to_string(CoreGetSaveStateSlot()));
|
||||
OnScreenDisplaySetMessage(tr("State loaded from slot: ") + QString::number(CoreGetSaveStateSlot()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1745,11 +1745,11 @@ void MainWindow::on_Action_System_Load(void)
|
||||
if (!CoreLoadSaveState(fileName.toStdU32String()))
|
||||
{
|
||||
this->ui_ManuallyLoadedState = false;
|
||||
this->showErrorMessage("CoreLoadSaveState() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreLoadSaveState() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
else
|
||||
{
|
||||
OnScreenDisplaySetMessage("State loaded from: " + QDir::toNativeSeparators(fileName).toStdString());
|
||||
OnScreenDisplaySetMessage(tr("State loaded from: ") + QDir::toNativeSeparators(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1763,7 +1763,7 @@ void MainWindow::on_Action_System_CurrentSaveState(int slot)
|
||||
{
|
||||
if (!CoreSetSaveStateSlot(slot))
|
||||
{
|
||||
this->showErrorMessage("CoreSetSaveStateSlot() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreSetSaveStateSlot() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1793,7 +1793,7 @@ void MainWindow::on_Action_System_GSButton(void)
|
||||
{
|
||||
if (!CorePressGamesharkButton(true))
|
||||
{
|
||||
this->showErrorMessage("CorePressGamesharkButton() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CorePressGamesharkButton() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1901,7 +1901,7 @@ void MainWindow::on_Action_View_Fullscreen(void)
|
||||
{
|
||||
if (!CoreToggleFullscreen())
|
||||
{
|
||||
this->showErrorMessage("CoreToggleFullscreen() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreToggleFullscreen() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1917,7 +1917,7 @@ void MainWindow::on_Action_View_ClearRomCache(void)
|
||||
{
|
||||
if (!CoreClearRomHeaderAndSettingsCache())
|
||||
{
|
||||
this->showErrorMessage("CoreClearRomHeaderAndSettingsCache() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreClearRomHeaderAndSettingsCache() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1986,7 +1986,7 @@ void MainWindow::on_Action_Audio_ToggleVolumeMute(void)
|
||||
{
|
||||
if (!CoreToggleMuteVolume())
|
||||
{
|
||||
this->showErrorMessage("CoreToggleMuteVolume() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreToggleMuteVolume() Failed"), QString::fromStdString(CoreGetError()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2052,7 +2052,7 @@ void MainWindow::on_Emulation_Finished(bool ret)
|
||||
// after switching back to the ROM browser
|
||||
if (!ret)
|
||||
{
|
||||
this->showErrorMessage("EmulationThread::run Failed", this->emulationThread->GetLastError());
|
||||
this->showErrorMessage(tr("EmulationThread::run Failed"), this->emulationThread->GetLastError());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2069,11 +2069,11 @@ void MainWindow::on_RomBrowser_PlayGameWith(CoreRomType type, QString file)
|
||||
if (type == CoreRomType::Cartridge)
|
||||
{ // cartridge
|
||||
mainRom = file;
|
||||
otherRom = QFileDialog::getOpenFileName(this, "", "", "N64DD Disk Image (*.ndd *.d64 *.zip *.7z)");
|
||||
otherRom = QFileDialog::getOpenFileName(this, "", "", tr("N64DD Disk Image (*.ndd *.d64 *.zip *.7z)"));
|
||||
}
|
||||
else
|
||||
{ // disk
|
||||
mainRom = QFileDialog::getOpenFileName(this, "", "", "N64 ROMs (*.n64 *.z64 *.v64 *.zip *.7z)");
|
||||
mainRom = QFileDialog::getOpenFileName(this, "", "", tr("N64 ROMs (*.n64 *.z64 *.v64 *.zip *.7z)"));
|
||||
otherRom = file;
|
||||
}
|
||||
|
||||
@@ -2122,25 +2122,25 @@ void MainWindow::on_RomBrowser_RomInformation(QString file)
|
||||
|
||||
if (!CoreOpenRom(file.toStdU32String()))
|
||||
{
|
||||
this->showErrorMessage("CoreOpenRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreOpenRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CoreGetCurrentRomHeader(romHeader))
|
||||
{
|
||||
this->showErrorMessage("CoreGetCurrentRomHeader() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreGetCurrentRomHeader() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CoreGetCurrentRomSettings(romSettings))
|
||||
{
|
||||
this->showErrorMessage("CoreGetCurrentRomSettings() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreGetCurrentRomSettings() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CoreCloseRom())
|
||||
{
|
||||
this->showErrorMessage("CoreCloseRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreCloseRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2163,7 +2163,7 @@ void MainWindow::on_RomBrowser_EditGameSettings(QString file)
|
||||
|
||||
if (!CoreOpenRom(file.toStdU32String()))
|
||||
{
|
||||
this->showErrorMessage("CoreOpenRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreOpenRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2176,7 +2176,7 @@ void MainWindow::on_RomBrowser_EditGameSettings(QString file)
|
||||
|
||||
if (!CoreCloseRom())
|
||||
{
|
||||
this->showErrorMessage("CoreCloseRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreCloseRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2196,7 +2196,7 @@ void MainWindow::on_RomBrowser_EditGameInputSettings(QString file)
|
||||
|
||||
if (!CoreOpenRom(file.toStdU32String()))
|
||||
{
|
||||
this->showErrorMessage("CoreOpenRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreOpenRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2204,7 +2204,7 @@ void MainWindow::on_RomBrowser_EditGameInputSettings(QString file)
|
||||
|
||||
if (!CoreCloseRom())
|
||||
{
|
||||
this->showErrorMessage("CoreCloseRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreCloseRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2224,7 +2224,7 @@ void MainWindow::on_RomBrowser_Cheats(QString file)
|
||||
|
||||
if (!CoreOpenRom(file.toStdU32String()))
|
||||
{
|
||||
this->showErrorMessage("CoreOpenRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreOpenRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2236,7 +2236,7 @@ void MainWindow::on_RomBrowser_Cheats(QString file)
|
||||
|
||||
if (!CoreCloseRom())
|
||||
{
|
||||
this->showErrorMessage("CoreCloseRom() Failed", QString::fromStdString(CoreGetError()));
|
||||
this->showErrorMessage(tr("CoreCloseRom() Failed"), QString::fromStdString(CoreGetError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2595,7 +2595,7 @@ void MainWindow::on_Core_DebugCallback(QList<CoreCallbackMessage> messages)
|
||||
// emulation run, we'll stop displaying it
|
||||
if (this->ui_DebugCallbackErrors.count(statusbarMessage.Message) < 50)
|
||||
{
|
||||
this->showErrorMessage("Core Error", statusbarMessage.Message, false);
|
||||
this->showErrorMessage(tr("Core Error"), statusbarMessage.Message, false);
|
||||
}
|
||||
this->ui_DebugCallbackErrors.append(statusbarMessage.Message);
|
||||
return;
|
||||
@@ -2640,7 +2640,7 @@ void MainWindow::on_Core_StateCallback(CoreStateCallbackType type, int value)
|
||||
{
|
||||
QAction* slotAction = this->ui_SlotActions[value];
|
||||
QString dateTimeText = this->getSaveStateSlotDateTimeText(slotAction);
|
||||
std::string message = "Selected save slot: " + std::to_string(value);
|
||||
QString message = tr("Selected save slot: ") + QString::number(value);
|
||||
|
||||
if (this->ui_LoadSaveStateSlotTimerId != -1)
|
||||
{
|
||||
@@ -2667,21 +2667,21 @@ void MainWindow::on_Core_StateCallback(CoreStateCallbackType type, int value)
|
||||
} break;
|
||||
case CoreStateCallbackType::SpeedFactor:
|
||||
{
|
||||
OnScreenDisplaySetMessage("Playback speed: " + std::to_string(value) + "%");
|
||||
OnScreenDisplaySetMessage(tr("Playback speed: ") + QString::number(value) + "%");
|
||||
} break;
|
||||
case CoreStateCallbackType::AudioVolume:
|
||||
{
|
||||
OnScreenDisplaySetMessage("Volume: " + std::to_string(value) + "%");
|
||||
OnScreenDisplaySetMessage(tr("Volume: ") + QString::number(value) + "%");
|
||||
} break;
|
||||
case CoreStateCallbackType::AudioMute:
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
OnScreenDisplaySetMessage("Volume unmuted");
|
||||
OnScreenDisplaySetMessage(tr("Volume unmuted"));
|
||||
}
|
||||
else
|
||||
{
|
||||
OnScreenDisplaySetMessage("Volume muted");
|
||||
OnScreenDisplaySetMessage(tr("Volume muted"));
|
||||
}
|
||||
} break;
|
||||
case CoreStateCallbackType::SaveStateLoaded:
|
||||
@@ -2691,7 +2691,7 @@ void MainWindow::on_Core_StateCallback(CoreStateCallbackType type, int value)
|
||||
this->ui_LoadSaveStateSlotCounter++;
|
||||
if (this->ui_LoadSaveStateSlotCounter >= 5)
|
||||
{ // give up after 5 attempts
|
||||
this->showErrorMessage("Failed to load save state");
|
||||
this->showErrorMessage(tr("Failed to load save state"));
|
||||
this->ui_LoadSaveStateSlotCounter = 0;
|
||||
this->ui_LoadSaveStateSlotTimerId = -1;
|
||||
this->ui_LoadSaveStateSlot = -1;
|
||||
@@ -2709,11 +2709,11 @@ void MainWindow::on_Core_StateCallback(CoreStateCallbackType type, int value)
|
||||
}
|
||||
else if (value == 0)
|
||||
{
|
||||
OnScreenDisplaySetMessage("Failed to load save state.");
|
||||
OnScreenDisplaySetMessage(tr("Failed to load save state."));
|
||||
}
|
||||
else if (!this->ui_ManuallyLoadedState)
|
||||
{
|
||||
OnScreenDisplaySetMessage("Loaded save state.");
|
||||
OnScreenDisplaySetMessage(tr("Loaded save state."));
|
||||
}
|
||||
|
||||
this->ui_ManuallyLoadedState = false;
|
||||
@@ -2722,11 +2722,11 @@ void MainWindow::on_Core_StateCallback(CoreStateCallbackType type, int value)
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
OnScreenDisplaySetMessage("Failed to save state.");
|
||||
OnScreenDisplaySetMessage(tr("Failed to save state."));
|
||||
}
|
||||
else if (!this->ui_ManuallySavedState)
|
||||
{
|
||||
OnScreenDisplaySetMessage("Saved state.");
|
||||
OnScreenDisplaySetMessage(tr("Saved state."));
|
||||
}
|
||||
|
||||
// refresh savestate slot times in 1 second,
|
||||
@@ -2744,11 +2744,11 @@ void MainWindow::on_Core_StateCallback(CoreStateCallbackType type, int value)
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
OnScreenDisplaySetMessage("Failed to capture screenshot.");
|
||||
OnScreenDisplaySetMessage(tr("Failed to capture screenshot."));
|
||||
}
|
||||
else
|
||||
{
|
||||
OnScreenDisplaySetMessage("Captured screenshot.");
|
||||
OnScreenDisplaySetMessage(tr("Captured screenshot."));
|
||||
}
|
||||
} break;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ void KeybindButton::SetSecondsLeft(int seconds)
|
||||
else
|
||||
{
|
||||
QString text;
|
||||
text = "Press key... [";
|
||||
text = tr("Press key... [");
|
||||
text += QString::number(seconds);
|
||||
text += "]";
|
||||
this->setText(text);
|
||||
|
||||
@@ -20,7 +20,7 @@ NetplaySessionBrowserLoadingWidget::NetplaySessionBrowserLoadingWidget(QWidget*
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
|
||||
this->loadingLabel = new QLabel(this);
|
||||
this->loadingLabel->setText("Loading");
|
||||
this->loadingLabel->setText(tr("Loading"));
|
||||
this->loadingLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
|
||||
layout->addWidget(loadingLabel);
|
||||
|
||||
@@ -59,10 +59,10 @@ NetplaySessionBrowserWidget::NetplaySessionBrowserWidget(QWidget* parent) : QSta
|
||||
|
||||
// set up table widget's columns
|
||||
QStringList labels;
|
||||
labels << "Name";
|
||||
labels << "Game";
|
||||
labels << "Game MD5";
|
||||
labels << "Password?";
|
||||
labels << tr("Name");
|
||||
labels << tr("Game");
|
||||
labels << tr("Game MD5");
|
||||
labels << tr("Password?");
|
||||
this->tableWidget->setColumnCount(labels.size());
|
||||
this->tableWidget->setHorizontalHeaderLabels(labels);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ RomBrowserLoadingWidget::RomBrowserLoadingWidget(QWidget* parent) : QWidget(pare
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
|
||||
this->loadingLabel = new QLabel(this);
|
||||
this->loadingLabel->setText("Loading");
|
||||
this->loadingLabel->setText(tr("Loading"));
|
||||
this->loadingLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
|
||||
layout->addWidget(loadingLabel);
|
||||
|
||||
@@ -110,15 +110,15 @@ RomBrowserWidget::RomBrowserWidget(QWidget *parent) : QStackedWidget(parent)
|
||||
|
||||
// set up list view's columns
|
||||
QStringList labels;
|
||||
labels << "Name";
|
||||
labels << "Internal Name";
|
||||
labels << "MD5";
|
||||
labels << "Format";
|
||||
labels << "File Name";
|
||||
labels << "File Ext.";
|
||||
labels << "File Size";
|
||||
labels << "I.D.";
|
||||
labels << "Region";
|
||||
labels << tr("Name");
|
||||
labels << tr("Internal Name");
|
||||
labels << tr("MD5");
|
||||
labels << tr("Format");
|
||||
labels << tr("File Name");
|
||||
labels << tr("File Ext.");
|
||||
labels << tr("File Size");
|
||||
labels << tr("I.D.");
|
||||
labels << tr("Region");
|
||||
this->listViewModel->setColumnCount(labels.size());
|
||||
this->listViewModel->setHorizontalHeaderLabels(labels);
|
||||
|
||||
@@ -126,12 +126,12 @@ RomBrowserWidget::RomBrowserWidget(QWidget *parent) : QStackedWidget(parent)
|
||||
this->columnNames << labels.at(0);
|
||||
this->columnNames << labels.at(1);
|
||||
this->columnNames << labels.at(2);
|
||||
this->columnNames << "Game Format";
|
||||
this->columnNames << tr("Game Format");
|
||||
this->columnNames << labels.at(4);
|
||||
this->columnNames << "File Extension";
|
||||
this->columnNames << tr("File Extension");
|
||||
this->columnNames << labels.at(6);
|
||||
this->columnNames << "Game I.D.";
|
||||
this->columnNames << "Game Region";
|
||||
this->columnNames << tr("Game I.D.");
|
||||
this->columnNames << tr("Game Region");
|
||||
|
||||
// configure grid view widget
|
||||
this->gridViewWidget = new Widget::RomBrowserGridViewWidget(this);
|
||||
@@ -192,21 +192,21 @@ RomBrowserWidget::RomBrowserWidget(QWidget *parent) : QStackedWidget(parent)
|
||||
this->action_ColumnsMenuEntry = new QAction(this);
|
||||
|
||||
// configure context menu contents
|
||||
this->action_PlayGame->setText("Play Game");
|
||||
this->action_PlayGameWith->setText("Play Game with Disk");
|
||||
this->menu_PlayGameWithDisk->menuAction()->setText("Play Game with Disk");
|
||||
this->menu_PlayGameWithSlot->menuAction()->setText("Play Game with State");
|
||||
this->action_RefreshRomList->setText("Refresh ROM List");
|
||||
this->action_OpenRomDirectory->setText("Open ROM Directory");
|
||||
this->action_ChangeRomDirectory->setText("Change ROM Directory...");
|
||||
this->action_RomInformation->setText("ROM Information");
|
||||
this->action_EditGameSettings->setText("Edit Game Settings");
|
||||
this->action_EditGameInputSettings->setText("Edit Game Input Settings");
|
||||
this->action_EditCheats->setText("Edit Cheats");
|
||||
this->action_ResetColumnSizes->setText("Reset Column Sizes");
|
||||
this->menu_Columns->menuAction()->setText("Show/Hide Columns");
|
||||
this->action_SetCoverImage->setText("Set Cover Image...");
|
||||
this->action_RemoveCoverImage->setText("Remove Cover Image");
|
||||
this->action_PlayGame->setText(tr("Play Game"));
|
||||
this->action_PlayGameWith->setText(tr("Play Game with Disk"));
|
||||
this->menu_PlayGameWithDisk->menuAction()->setText(tr("Play Game with Disk"));
|
||||
this->menu_PlayGameWithSlot->menuAction()->setText(tr("Play Game with State"));
|
||||
this->action_RefreshRomList->setText(tr("Refresh ROM List"));
|
||||
this->action_OpenRomDirectory->setText(tr("Open ROM Directory"));
|
||||
this->action_ChangeRomDirectory->setText(tr("Change ROM Directory..."));
|
||||
this->action_RomInformation->setText(tr("ROM Information"));
|
||||
this->action_EditGameSettings->setText(tr("Edit Game Settings"));
|
||||
this->action_EditGameInputSettings->setText(tr("Edit Game Input Settings"));
|
||||
this->action_EditCheats->setText(tr("Edit Cheats"));
|
||||
this->action_ResetColumnSizes->setText(tr("Reset Column Sizes"));
|
||||
this->menu_Columns->menuAction()->setText(tr("Show/Hide Columns"));
|
||||
this->action_SetCoverImage->setText(tr("Set Cover Image..."));
|
||||
this->action_RemoveCoverImage->setText(tr("Remove Cover Image"));
|
||||
connect(this->action_PlayGame, &QAction::triggered, this, &RomBrowserWidget::on_Action_PlayGame);
|
||||
connect(this->action_PlayGameWith, &QAction::triggered, this, &RomBrowserWidget::on_Action_PlayGameWith);
|
||||
connect(this->menu_PlayGameWithDisk, &QMenu::triggered, this, &RomBrowserWidget::on_Menu_PlayGameWithDisk);
|
||||
@@ -465,11 +465,11 @@ void RomBrowserWidget::addRomData(QString file, CoreRomType type, CoreRomHeader
|
||||
// generate game format to use in UI
|
||||
if (type == CoreRomType::Disk)
|
||||
{
|
||||
gameFormat = "Disk";
|
||||
gameFormat = tr("Disk");
|
||||
}
|
||||
else
|
||||
{
|
||||
gameFormat = "Cartridge";
|
||||
gameFormat = tr("Cartridge");
|
||||
}
|
||||
|
||||
// generate file size to use in UI
|
||||
@@ -662,11 +662,11 @@ void RomBrowserWidget::customContextMenuRequested(QPoint position)
|
||||
|
||||
if (hasSelection && data.type == CoreRomType::Disk)
|
||||
{ // disk selected
|
||||
this->action_PlayGameWith->setText("Play Game with Cartridge...");
|
||||
this->action_PlayGameWith->setText(tr("Play Game with Cartridge..."));
|
||||
}
|
||||
else
|
||||
{ // cartridge selected
|
||||
this->action_PlayGameWith->setText("Play Game with Disk...");
|
||||
this->action_PlayGameWith->setText(tr("Play Game with Disk..."));
|
||||
}
|
||||
|
||||
if (view == this->listViewWidget)
|
||||
@@ -678,11 +678,11 @@ void RomBrowserWidget::customContextMenuRequested(QPoint position)
|
||||
{ // grid view
|
||||
if (data.coverFile.isEmpty())
|
||||
{
|
||||
this->action_SetCoverImage->setText("Set Cover Image...");
|
||||
this->action_SetCoverImage->setText(tr("Set Cover Image..."));
|
||||
}
|
||||
else
|
||||
{
|
||||
this->action_SetCoverImage->setText("Change Cover Image...");
|
||||
this->action_SetCoverImage->setText(tr("Change Cover Image..."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ void RomBrowserWidget::generatePlayWithDiskMenu(void)
|
||||
{
|
||||
if (count == 0)
|
||||
{ // only add 'Browse...' action when there are disks
|
||||
this->menu_PlayGameWithDisk->addAction("Browse...");
|
||||
this->menu_PlayGameWithDisk->addAction(tr("Browse..."));
|
||||
this->menu_PlayGameWithDisk->addSeparator();
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ void RomBrowserWidget::generateStateMenu(void)
|
||||
QFileInfo saveStateFileInfo(QString::fromStdWString(saveStatePath.wstring()));
|
||||
if (!saveStatePath.empty() && saveStateFileInfo.exists())
|
||||
{
|
||||
saveStateSlotText = "Slot " + QString::number(i) + " - ";
|
||||
saveStateSlotText = tr("Slot ") + QString::number(i) + " - ";
|
||||
saveStateSlotText += saveStateFileInfo.lastModified().toString("dd/MM/yyyy hh:mm");
|
||||
|
||||
QAction* slotAction = this->menu_PlayGameWithSlot->addAction(saveStateSlotText);
|
||||
|
||||
+15
-1
@@ -9,8 +9,10 @@
|
||||
*/
|
||||
#include <UserInterface/MainWindow.hpp>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QApplication>
|
||||
#include <QLibraryInfo>
|
||||
#include <QTranslator>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
|
||||
@@ -105,6 +107,18 @@ int main(int argc, char **argv)
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QTranslator appTranslator;
|
||||
if (appTranslator.load(QLocale(), QLatin1String("RMG"), QLatin1String("_"), QLatin1String(":/i18n")))
|
||||
{
|
||||
QCoreApplication::installTranslator(&appTranslator);
|
||||
}
|
||||
|
||||
QTranslator qtTranslator;
|
||||
if (qtTranslator.load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::path(QLibraryInfo::LibraryPath::TranslationsPath)))
|
||||
{
|
||||
QCoreApplication::installTranslator(&qtTranslator);
|
||||
}
|
||||
|
||||
UserInterface::MainWindow window;
|
||||
|
||||
#ifdef PORTABLE_INSTALL
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user