Commit 568aed7d authored by Melroy van den Berg's avatar Melroy van den Berg

Finally close #3, settings window is done enough for now

parent a9d73e8e
Pipeline #1760 failed with stages
in 47 seconds
......@@ -76,6 +76,7 @@ public:
static string GetWineGUID(const string prefix_path, const string application_name);
static bool GetDLLOverride(const string prefix_path, const string dll_name, DLLOverride::LoadOrder load_order = DLLOverride::LoadOrder::Native);
static string GetUninstaller(const string prefix_path, const string uninstallerKey);
static string GetFontFilename(const string prefix_path, BottleTypes::Bit bit, const string fontName);
private:
Helper();
~Helper();
......
......@@ -37,6 +37,7 @@ public:
// Signals
sigc::signal<void, Gtk::Window&, Glib::ustring&> directx9; /*!< Install d3dx9 for Direct3D 9 signal */
sigc::signal<void, Gtk::Window&, Glib::ustring&> vulkan; /*!< Install DXVK for Direct3D 9/10/11 using Vulkan signal */
sigc::signal<void, Gtk::Window&> liberation_fonts; /*!< Install Liberation fonts signal */
sigc::signal<void, Gtk::Window&> corefonts; /*!< Install Core fonts signal */
sigc::signal<void, Gtk::Window&, Glib::ustring&> visual_cpp_package; /*!< Install Visual C++ package signal */
sigc::signal<void, Gtk::Window&, Glib::ustring&> dotnet; /*!< Install .NET signal */
......@@ -95,6 +96,9 @@ private:
bool IsD3DX9Installed();
bool IsDXVKInstalled();
bool IsLiberationInstalled();
bool IsCoreFontsInstalled();
bool isVisualCppInstalled();
bool isDotnet4Installed();
bool isDotnet452Installed();
};
......@@ -837,7 +837,7 @@ bool Helper::GetDLLOverride(const string prefix_path, const string dll_name, DLL
* \brief Retrieve the uninstaller from GUID (if available)
* \param[in] prefix_path - Bottle prefix
* \param[in] uninstallerKey - GUID or application name of the uninstaller (can also be found by running: wine uninstaller --list)
* \return True Uninstaller display name or empty string if not found
* \return Uninstaller display name or empty string if not found
*/
string Helper::GetUninstaller(const string prefix_path, const string uninstallerKey)
{
......@@ -846,6 +846,29 @@ string Helper::GetUninstaller(const string prefix_path, const string uninstaller
return Helper::GetRegValue(filename, keyName, "DisplayName");
}
/**
* \brief Retrieve a font filename from the system registery
* \param[in] prefix_path - Bottle prefix
* \param[in] bit - Bottle bit (32 or 64) enum
* \param[in] fontName - Font name
* \return Font filename (or empty string if not found)
*/
string Helper::GetFontFilename(const string prefix_path, BottleTypes::Bit bit, const string fontName)
{
string filename = Glib::build_filename(prefix_path, SYSTEM_REG);
string keyName = "";
switch (bit) {
case BottleTypes::Bit::win32:
keyName = "[Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Fonts]";
break;
case BottleTypes::Bit::win64:
keyName = "[Software\\\\Wow6432Node\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Fonts]";
break;
}
return Helper::GetRegValue(filename, keyName, fontName);
}
/****************************************************************************
* Private methods *
****************************************************************************/
......@@ -974,6 +997,7 @@ string Helper::GetRegValue(const string& filename, const string& keyName, const
throw std::runtime_error("File could not be opened");
}
bool match = false;
// TODO: Change to fstream, since the buffer has a limit (therefor the strstr as well), causing issues with longer strings
while (fgets(buffer, sizeof(buffer), f)) {
// It returns the pointer to the first occurrence until the null character (end of line)
if (!match) {
......
This diff is collapsed.
......@@ -133,6 +133,7 @@ void SignalDispatcher::DispatchSignals()
settingsWindow.vulkan.connect(sigc::mem_fun(manager, &BottleManager::InstallDXVK));
// Settings additional package buttons
settingsWindow.liberation_fonts.connect(sigc::mem_fun(manager, &BottleManager::InstallLiberation));
settingsWindow.corefonts.connect(sigc::mem_fun(manager, &BottleManager::InstallCoreFonts));
settingsWindow.dotnet.connect(sigc::mem_fun(manager, &BottleManager::InstallDotNet));
settingsWindow.visual_cpp_package.connect(sigc::mem_fun(manager, &BottleManager::InstallVisualCppPackage));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment