@@ -437,11 +437,11 @@ std::string GetInfoStringOfSlot(int slot, bool translate)
{
std::string filename = MakeStateFilename(slot);
if (!File::Exists(filename))
return translate ? GetStringT("Empty") : "Empty";
return translate ? Common::GetStringT("Empty") : "Empty";

State::StateHeader header;
if (!ReadHeader(filename, header))
return translate ? GetStringT("Unknown") : "Unknown";
return translate ? Common::GetStringT("Unknown") : "Unknown";

return Common::Timer::GetDateTimeFormatted(header.time);
}
@@ -78,7 +78,7 @@ TitleDatabase::TitleDatabase()

// i18n: "Wii Menu" (or System Menu) refers to the Wii's main menu,
// which is (usually) the first thing users see when a Wii console starts.
m_base_map.emplace("0000000100000002", GetStringT("Wii Menu"));
m_base_map.emplace("0000000100000002", Common::GetStringT("Wii Menu"));
for (const auto& id : {"HAXX", "00010001af1bf516"})
m_base_map.emplace(id, "The Homebrew Channel");
}
@@ -200,7 +200,7 @@ bool CompressFileToBlob(const std::string& infile_path, const std::string& outfi
if (deflateInit(&z, 9) != Z_OK)
return false;

callback(GetStringT("Files opened, ready to compress."), 0, arg);
callback(Common::GetStringT("Files opened, ready to compress."), 0, arg);

CompressedBlobHeader header;
header.magic_cookie = GCZ_MAGIC;
@@ -239,8 +239,8 @@ bool CompressFileToBlob(const std::string& infile_path, const std::string& outfi
if (inpos != 0)
ratio = (int)(100 * position / inpos);

std::string temp =
StringFromFormat(GetStringT("%i of %i blocks. Compression ratio %i%%").c_str(), i,
const std::string temp =
StringFromFormat(Common::GetStringT("%i of %i blocks. Compression ratio %i%%").c_str(), i,
header.num_blocks, ratio);
bool was_cancelled = !callback(temp, (float)i / (float)header.num_blocks, arg);
if (was_cancelled)
@@ -332,7 +332,7 @@ bool CompressFileToBlob(const std::string& infile_path, const std::string& outfi

if (success)
{
callback(GetStringT("Done compressing disc image."), 1.0f, arg);
callback(Common::GetStringT("Done compressing disc image."), 1.0f, arg);
}
return success;
}
@@ -381,7 +381,8 @@ bool DecompressBlobToFile(const std::string& infile_path, const std::string& out
{
if (i % progress_monitor == 0)
{
bool was_cancelled = !callback(GetStringT("Unpacking"), (float)i / (float)num_buffers, arg);
const bool was_cancelled =
!callback(Common::GetStringT("Unpacking"), (float)i / (float)num_buffers, arg);
if (was_cancelled)
{
success = false;
@@ -64,7 +64,7 @@ std::string GetName(Country country, bool translate)
break;
}

return translate ? GetStringT(name.c_str()) : name;
return translate ? Common::GetStringT(name.c_str()) : name;
}

std::string GetName(Language language, bool translate)
@@ -108,7 +108,7 @@ std::string GetName(Language language, bool translate)
break;
}

return translate ? GetStringT(name.c_str()) : name;
return translate ? Common::GetStringT(name.c_str()) : name;
}

bool IsDisc(Platform volume_type)

Large diffs are not rendered by default.

@@ -35,27 +35,28 @@
#include "UICommon/CommandLineParse.h"
#include "UICommon/UICommon.h"

static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no, MsgType style)
static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no,
Common::MsgType style)
{
std::optional<bool> r = RunOnObject(QApplication::instance(), [&] {
ModalMessageBox message_box(QApplication::activeWindow());
message_box.setWindowTitle(QString::fromUtf8(caption));
message_box.setText(QString::fromUtf8(text));

message_box.setStandardButtons(yes_no ? QMessageBox::Yes | QMessageBox::No : QMessageBox::Ok);
if (style == MsgType::Warning)
if (style == Common::MsgType::Warning)
message_box.addButton(QMessageBox::Ignore)->setText(QObject::tr("Ignore for this session"));

message_box.setIcon([&] {
switch (style)
{
case MsgType::Information:
case Common::MsgType::Information:
return QMessageBox::Information;
case MsgType::Question:
case Common::MsgType::Question:
return QMessageBox::Question;
case MsgType::Warning:
case Common::MsgType::Warning:
return QMessageBox::Warning;
case MsgType::Critical:
case Common::MsgType::Critical:
return QMessageBox::Critical;
}
// appease MSVC
@@ -67,7 +68,7 @@ static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no
return true;

if (button == QMessageBox::Ignore)
SetEnableAlert(false);
Common::SetEnableAlert(false);

return false;
});
@@ -137,7 +138,7 @@ int main(int argc, char* argv[])
Settings::Instance().SetBatchModeEnabled(options.is_set("batch"));

// Hook up alerts from core
RegisterMsgAlertHandler(QtMsgAlertHandler);
Common::RegisterMsgAlertHandler(QtMsgAlertHandler);

// Hook up translations
Translation::Initialize();
@@ -263,7 +263,7 @@ void InterfacePane::OnSaveConfig()
settings.m_show_active_title = m_checkbox_show_active_title->isChecked();
settings.m_PauseOnFocusLost = m_checkbox_pause_on_focus_lost->isChecked();

SetEnableAlert(settings.bUsePanicHandlers);
Common::SetEnableAlert(settings.bUsePanicHandlers);

auto new_language = m_combobox_language->currentData().toString().toStdString();
if (new_language != SConfig::GetInstance().m_InterfaceLanguage)
@@ -292,7 +292,8 @@ static bool TryInstallTranslator(const QString& exact_language_code)
void Translation::Initialize()
{
// Hook up Dolphin internal translation
RegisterStringTranslator([](const char* text) { return QObject::tr(text).toStdString(); });
Common::RegisterStringTranslator(
[](const char* text) { return QObject::tr(text).toStdString(); });

// Hook up Qt translations
auto& configured_language = SConfig::GetInstance().m_InterfaceLanguage;
@@ -84,7 +84,7 @@ void Init()
GCAdapter::Init();
VideoBackendBase::ActivateBackend(SConfig::GetInstance().m_strVideoBackend);

SetEnableAlert(SConfig::GetInstance().bUsePanicHandlers);
Common::SetEnableAlert(SConfig::GetInstance().bUsePanicHandlers);
}

void Shutdown()
@@ -440,7 +440,7 @@ std::string FormatSize(u64 bytes)
const double unit_size = std::pow(2, unit * 10);
std::stringstream ss;
ss << std::fixed << std::setprecision(2);
ss << bytes / unit_size << ' ' << GetStringT(unit_symbols[unit]);
ss << bytes / unit_size << ' ' << Common::GetStringT(unit_symbols[unit]);
return ss.str();
}

@@ -157,7 +157,7 @@ void ShaderCache::WaitForAsyncCompiler()

ImGui::SetNextWindowSize(ImVec2(400.0f * scale, 50.0f * scale), ImGuiCond_Always);
ImGui::SetNextWindowPosCenter(ImGuiCond_Always);
if (ImGui::Begin(GetStringT("Compiling Shaders").c_str(), nullptr,
if (ImGui::Begin(Common::GetStringT("Compiling Shaders").c_str(), nullptr,
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs |
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoNav |