1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

Complete translation initialization

This commit is contained in:
Eduardo P. Gomez 2023-10-08 01:51:42 -03:00
parent 48cf3bfaae
commit 1b4776e236
9 changed files with 145 additions and 72 deletions

View File

@ -55,6 +55,8 @@
"streambuf": "cpp", "streambuf": "cpp",
"cinttypes": "cpp", "cinttypes": "cpp",
"typeinfo": "cpp", "typeinfo": "cpp",
"*.ui": "cpp" "*.ui": "cpp",
"bitset": "cpp",
"regex": "cpp"
} }
} }

View File

@ -48,6 +48,9 @@ HWND CreateWindowExA(
gtk_widget_show(GTK_WIDGET(window)); gtk_widget_show(GTK_WIDGET(window));
} }
// TODO: find a no-signal way
// g_signal_connect(window, "destroy", G_CALLBACK(on_window_destroy), NULL);
return window; return window;
} }
@ -79,7 +82,6 @@ BOOL GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
BOOL PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) { BOOL PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) {
BOOL r = g_main_context_pending(NULL); BOOL r = g_main_context_pending(NULL);
//i know this is wrong, but i need to get the sample working
if (r) { if (r) {
g_main_context_iteration(NULL, true); g_main_context_iteration(NULL, true);
} else { } else {

View File

@ -34,7 +34,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
MSG msg; MSG msg;
//ZeroMemory(&msg, sizeof(msg)); //ZeroMemory(&msg, sizeof(msg));
while (msg.message != WM_QUIT) { while (msg.message != WM_QUIT) {
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (PeekMessage(&msg, hWnd, 0, 0, PM_REMOVE)) {
//TranslateMessage(&msg); //TranslateMessage(&msg);
//DispatchMessage(&msg); //DispatchMessage(&msg);
} else { } else {

View File

@ -1,4 +1,4 @@
R"XXX(<?xml version="1.0" encoding="UTF-8"?> R"XML(<?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="GtkWindow" id="main_window"> <object class="GtkWindow" id="main_window">
@ -20,7 +20,7 @@ R"XXX(<?xml version="1.0" encoding="UTF-8"?>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_description">
<property name="label" translatable="1">This tool reports detailed information about the DirectX components and drivers installed on your system. <property name="label" translatable="1">This tool reports detailed information about the DirectX components and drivers installed on your system.
@ -49,7 +49,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
<property name="column-spacing">5</property> <property name="column-spacing">5</property>
<property name="column-homogeneous">1</property> <property name="column-homogeneous">1</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_currentDate">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">Current Date/Time:</property> <property name="label" translatable="1">Current Date/Time:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -72,7 +72,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_pcName">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">Computer Name:</property> <property name="label" translatable="1">Computer Name:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -95,7 +95,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_os">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">Operating System:</property> <property name="label" translatable="1">Operating System:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -118,7 +118,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_language">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">Language:</property> <property name="label" translatable="1">Language:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -141,7 +141,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_manufacturer">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">System Manufacturer:</property> <property name="label" translatable="1">System Manufacturer:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -164,7 +164,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_model">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">System Model:</property> <property name="label" translatable="1">System Model:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -187,7 +187,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_bios">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">BIOS:</property> <property name="label" translatable="1">BIOS:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -210,7 +210,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_processor">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">Processor:</property> <property name="label" translatable="1">Processor:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -233,7 +233,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_memory">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">Memory:</property> <property name="label" translatable="1">Memory:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -256,7 +256,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_pageFile">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">Page/Swap File:</property> <property name="label" translatable="1">Page/Swap File:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -279,7 +279,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_directxVersion">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">DirectX Version:</property> <property name="label" translatable="1">DirectX Version:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -302,7 +302,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_opendxVersion">
<property name="halign">end</property> <property name="halign">end</property>
<property name="label" translatable="1">OpenDX Version:</property> <property name="label" translatable="1">OpenDX Version:</property>
<property name="justify">right</property> <property name="justify">right</property>
@ -332,7 +332,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</property> </property>
<child type="label"> <child type="label">
<object class="GtkLabel"> <object class="GtkLabel" id="system_info_label">
<property name="label" translatable="1">System Information</property> <property name="label" translatable="1">System Information</property>
</object> </object>
</child> </child>
@ -341,7 +341,7 @@ If you know what area is causing the problem, click on the apropriate tab above.
</object> </object>
</property> </property>
<property name="tab"> <property name="tab">
<object class="GtkLabel"> <object class="GtkLabel" id="tab_system_txt">
<property name="label" translatable="1" context="tab_system">System</property> <property name="label" translatable="1" context="tab_system">System</property>
</object> </object>
</property> </property>
@ -398,4 +398,4 @@ If you know what area is causing the problem, click on the apropriate tab above.
</property> </property>
</object> </object>
</interface> </interface>
)XXX" )XML"

View File

@ -2,7 +2,7 @@
#include <types/Translation.hpp> #include <types/Translation.hpp>
/** /**
* TODO Complete with @see /include/types/Translation.hpp * TODO Complete with project://include/types/Translation.hpp
*/ */
Translation_t Translation_enUS() { Translation_t Translation_enUS() {
Translation_t r; Translation_t r;

View File

@ -1,11 +1,12 @@
#pragma once #pragma once
#include <types/Translation.hpp> #include <types/Translation.hpp>
#include "en_US.hpp"
/** /**
* TODO Complete with @see /include/types/Translation.hpp * TODO Complete with @see project://include/types/Translation.hpp
*/ */
Translation_t Translation_esES() { Translation_t Translation_esES() {
Translation_t r; Translation_t r = Translation_enUS();
//Common texts //Common texts
r.yes = (char*) ""; r.yes = (char*) "";

View File

@ -10,6 +10,21 @@ Translation_t Translation_ptBR() {
//Common texts //Common texts
r.yes = (char*) "Sim"; r.yes = (char*) "Sim";
r.no = (char*) "Não";
r.not_available = (char*) "Indisponível";
r.enabled = (char*) "Habilitado";
//Tab names
r.tab_system = (char*) "Sistema";
r.tab_display = (char*) "Exibição";
r.tab_sound = (char*) "Som";
r.tab_input = (char*) "Entrada";
//Buttons
r.btn_help = (char*) "Ajuda";
r.btn_next = (char*) "Próximo";
r.btn_save = (char*) "Salvar";
r.btn_exit = (char*) "Sair";
return r; return r;
} }

View File

@ -1,8 +1,8 @@
#pragma once #include <iostream>
#include <gtk/gtk.h> //GTK4
#include <config.hpp> #include <config.hpp>
#include <iostream>
#include <gtk/gtk.h> //GTK4
#include "layout/MainWindow.hpp" #include "layout/MainWindow.hpp"
#include "src/SystemTab.hpp" #include "src/SystemTab.hpp"
@ -22,7 +22,7 @@ int main(int argc, char *argv[])
GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "main_window")); GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "main_window"));
//setup events and show the screen: //setup events and show the screen:
SystemTab::setup(builder); new SystemTab(builder);
gtk_widget_show(GTK_WIDGET(window)); gtk_widget_show(GTK_WIDGET(window));
while (g_list_model_get_n_items (gtk_window_get_toplevels ()) > 0) while (g_list_model_get_n_items (gtk_window_get_toplevels ()) > 0)

View File

@ -1,23 +1,31 @@
#pragma once #pragma once
#include <gtk/gtk.h>
#include <unistd.h> #include <unistd.h>
#include <iostream> #include <iostream>
#include <locale>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstdio> #include <cstdio>
#include <regex>
#include <cstring> #include <cstring>
#include <iomanip> #include <iomanip>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
namespace SystemTab { #include <gtk/gtk.h>
#include <types/Translation.hpp>
#include "../locale/en_US.hpp"
#include "../locale/pt_BR.hpp"
#include "../locale/es_ES.hpp"
class SystemTab {
/** /**
* Set the text from "date_val"to the actual date/time. * Set the text from "date_val"to the actual date/time.
*/ */
gboolean updateTime(GtkLabel* label) { public:static gboolean updateTime(GtkLabel* label) {
time_t t = time(NULL); time_t t = time(NULL);
struct tm *time = localtime(&t); struct tm* time = localtime(&t);
gchar str_time[40]; gchar str_time[40];
strftime(str_time, sizeof(str_time), "%A, %b %d, %Y, %I:%M:%S %p", time); strftime(str_time, sizeof(str_time), "%A, %b %d, %Y, %I:%M:%S %p", time);
@ -33,7 +41,7 @@ namespace SystemTab {
/** /**
* set a timeout event every 500ms to set the actual date/time * set a timeout event every 500ms to set the actual date/time
*/ */
gboolean onRealizeTime(GtkLabel* label) { public:static gboolean onRealizeTime(GtkLabel* label) {
std::cout << "SystemTab::onRealizeTime()\n"; std::cout << "SystemTab::onRealizeTime()\n";
g_timeout_add (500, (GSourceFunc) SystemTab::updateTime, label); g_timeout_add (500, (GSourceFunc) SystemTab::updateTime, label);
@ -43,7 +51,7 @@ namespace SystemTab {
/** /**
* Set the text from "pc_val" to the unix hostname. * Set the text from "pc_val" to the unix hostname.
*/ */
gboolean setHostname(GtkLabel* label) { public:static gboolean setHostname(GtkLabel* label) {
char hostname[1024]; char hostname[1024];
gethostname(hostname, sizeof hostname); gethostname(hostname, sizeof hostname);
@ -57,7 +65,7 @@ namespace SystemTab {
return FALSE; return FALSE;
} }
std::string exec(const char* cmd) { public:static std::string exec(const char* cmd) {
std::vector<char> buffer(1024); std::vector<char> buffer(1024);
std::string result; std::string result;
FILE* pipe = popen(cmd, "r"); FILE* pipe = popen(cmd, "r");
@ -72,7 +80,7 @@ namespace SystemTab {
return result; return result;
} }
gboolean setOperatingSystem(GtkLabel* label) { public:static gboolean setOperatingSystem(GtkLabel* label) {
std::string distro = exec("lsb_release -i | awk '{print $3}'"); std::string distro = exec("lsb_release -i | awk '{print $3}'");
std::string distro_version = exec("lsb_release -r | awk '{print $2}'"); std::string distro_version = exec("lsb_release -r | awk '{print $2}'");
std::string kernel_version = exec("uname -r"); std::string kernel_version = exec("uname -r");
@ -85,6 +93,7 @@ namespace SystemTab {
//arch.erase(std::remove(arch.begin(), arch.end(), '\n'), arch.end()); //arch.erase(std::remove(arch.begin(), arch.end(), '\n'), arch.end());
std::string os_info = distro + " " + arch + " (" + distro_version + ", kernel " + kernel_version + ")"; std::string os_info = distro + " " + arch + " (" + distro_version + ", kernel " + kernel_version + ")";
os_info = std::regex_replace(os_info, std::regex("\n"), "");
// Convert the string to const gchar* // Convert the string to const gchar*
const gchar* text = os_info.c_str(); const gchar* text = os_info.c_str();
@ -97,25 +106,16 @@ namespace SystemTab {
return FALSE; return FALSE;
} }
gboolean setLanguage(GtkLabel* label) { public:static gboolean setLanguage(GtkLabel* label) {
char buffer[128]; char buffer[128];
std::string locale = setlocale(LC_CTYPE, NULL);
std::string lang, region; std::string lang, region;
// Get the LC_MESSAGES locale // get the language and region from the locale
std::FILE* fp = popen("locale | grep LC_MESSAGES | cut -d= -f2 | cut -d_ -f1", "r"); lang = locale.substr(0, locale.find("_"));
std::fgets(buffer, 128, fp); region = locale.substr(locale.find("_") + 1);
lang = buffer;
pclose(fp);
// Get the LC_CTYPE locale
fp = popen("locale | grep LC_CTYPE | cut -d= -f2 | cut -d_ -f2", "r");
std::fgets(buffer, 128, fp);
region = buffer;
pclose(fp);
// Remove newline characters
lang.erase(lang.size() - 1, 1);
region.erase(region.size() - 1, 1); region.erase(region.size() - 1, 1);
region = region.substr(0, region.find("."));
// Return the formatted string // Return the formatted string
std::string str = lang + " (Regional Setting: " + region + ")"; std::string str = lang + " (Regional Setting: " + region + ")";
@ -129,7 +129,7 @@ namespace SystemTab {
return FALSE; return FALSE;
} }
gboolean setManufacturer(GtkLabel* label) { public:static gboolean setManufacturer(GtkLabel* label) {
std::ifstream file("/sys/class/dmi/id/sys_vendor"); std::ifstream file("/sys/class/dmi/id/sys_vendor");
std::string manufacturer; std::string manufacturer;
@ -147,7 +147,7 @@ namespace SystemTab {
return FALSE; return FALSE;
} }
gboolean setModel(GtkLabel* label) { public:static gboolean setModel(GtkLabel* label) {
std::ifstream file("/sys/class/dmi/id/product_name"); std::ifstream file("/sys/class/dmi/id/product_name");
std::string model; std::string model;
@ -165,7 +165,7 @@ namespace SystemTab {
return FALSE; return FALSE;
} }
gboolean setBIOS(GtkLabel* label) { public:static gboolean setBIOS(GtkLabel* label) {
std::ifstream file("/sys/class/dmi/id/bios_version"); std::ifstream file("/sys/class/dmi/id/bios_version");
std::string bios; std::string bios;
@ -183,7 +183,7 @@ namespace SystemTab {
return FALSE; return FALSE;
} }
std::string getCpuModelName() { public:static std::string getCpuModelName() {
std::ifstream file("/proc/cpuinfo"); std::ifstream file("/proc/cpuinfo");
std::string line; std::string line;
@ -196,7 +196,7 @@ namespace SystemTab {
return "Unknown"; return "Unknown";
} }
int getCpuCoreCount() { public:static int getCpuCoreCount() {
std::ifstream file("/proc/cpuinfo"); std::ifstream file("/proc/cpuinfo");
std::string line; std::string line;
int core_count = 0; int core_count = 0;
@ -210,7 +210,7 @@ namespace SystemTab {
return core_count; return core_count;
} }
double getCpuFrequency() { public:static double getCpuFrequency() {
std::ifstream file("/proc/cpuinfo"); std::ifstream file("/proc/cpuinfo");
std::string line; std::string line;
double frequency = 0.0; double frequency = 0.0;
@ -224,10 +224,10 @@ namespace SystemTab {
return frequency; return frequency;
} }
std::string getCpuInfo() { public:static std::string getCpuInfo() {
int core_count = getCpuCoreCount(); int core_count = SystemTab::getCpuCoreCount();
double frequency = getCpuFrequency() / 1000; double frequency = SystemTab::getCpuFrequency() / 1000;
std::string model_name = getCpuModelName(); std::string model_name = SystemTab::getCpuModelName();
std::ostringstream frequency_stream; std::ostringstream frequency_stream;
frequency_stream << std::fixed << std::setprecision(2) << frequency / core_count; frequency_stream << std::fixed << std::setprecision(2) << frequency / core_count;
@ -236,19 +236,18 @@ namespace SystemTab {
return model_name + " (" + std::to_string(core_count) + " CPUs), ~" + formatted_frequency + "GHz"; return model_name + " (" + std::to_string(core_count) + " CPUs), ~" + formatted_frequency + "GHz";
} }
gboolean setCPU(GtkLabel* label) { public:static gboolean setCPU(GtkLabel* label) {
std::string cpu = SystemTab::getCpuInfo(); std::string cpu = SystemTab::getCpuInfo();
const gchar* text = cpu.c_str(); const gchar* text = cpu.c_str();
gtk_label_set_text(label, text); gtk_label_set_text(label, text);
gtk_widget_queue_draw(GTK_WIDGET(label)); gtk_widget_queue_draw(GTK_WIDGET(label));
gtk_widget_queue_draw(gtk_widget_get_parent(GTK_WIDGET(label))); gtk_widget_queue_draw(gtk_widget_get_parent(GTK_WIDGET(label)));
gtk_widget_show(GTK_WIDGET(label)); // gtk_widget_show(GTK_WIDGET(label));
return FALSE; return FALSE;
} }
gboolean setRAM(GtkLabel* label) { public:static gboolean setRAM(GtkLabel* label) {
std::ifstream file("/proc/meminfo"); std::ifstream file("/proc/meminfo");
std::string line; std::string line;
std::string ram = "0MB RAM"; std::string ram = "0MB RAM";
@ -270,8 +269,7 @@ namespace SystemTab {
return FALSE; return FALSE;
} }
gboolean updateSwap(GtkLabel* label) { public:static gboolean updateSwap(GtkLabel* label) {
struct sysinfo info; struct sysinfo info;
sysinfo(&info); sysinfo(&info);
@ -287,17 +285,72 @@ namespace SystemTab {
gtk_widget_show(GTK_WIDGET(label)); gtk_widget_show(GTK_WIDGET(label));
} }
gboolean setSwap(GtkLabel* label) { public:static gboolean setSwap(GtkLabel* label) {
g_timeout_add (500, (GSourceFunc) SystemTab::updateSwap, label); g_timeout_add(500, (GSourceFunc) SystemTab::updateSwap, label);
return FALSE; return FALSE;
} }
/** /**
* setup IDs and it's events * setup IDs and it's events
*/ */
void setup(GtkBuilder* builder) { public:SystemTab(GtkBuilder* builder) {
std::cout << "SystemTab::setup()\n"; std::cout << "SystemTab::setup()\n";
this->setupLang(builder);
this->setupSignals(builder);
}
private:void setupLang(GtkBuilder* builder) {
//get system locale
const char* locale = setlocale(LC_CTYPE, NULL);
Translation_t lang;
//instantiate Translation_{locale}() from tools/dxdiag/locale/{locale}.hpp
if (
strcmp(locale, "pt_BR.UTF-8") == 0 ||
strcmp(locale, "pt_PT.UTF-8") == 0
) {
lang = Translation_ptBR(); // >:)
} else if (strcmp(locale, "es_ES.UTF-8")) {
lang = Translation_esES();
} else {
lang = Translation_enUS();
}
//set texts
GtkLabel* tab_system = GTK_LABEL(gtk_builder_get_object(builder, "tab_system_txt"));
gtk_label_set_text(tab_system, lang.tab_system);
GtkLabel* system_description = GTK_LABEL(gtk_builder_get_object(builder, "system_description"));
gtk_label_set_text(system_description, lang.system_description);
GtkLabel* system_info_label = GTK_LABEL(gtk_builder_get_object(builder, "system_info_label"));
gtk_label_set_text(system_info_label, lang.system_info_label);
GtkLabel* system_info_currentDate = GTK_LABEL(gtk_builder_get_object(builder, "system_info_currentDate"));
gtk_label_set_text(system_info_currentDate, lang.system_info_currentDate);
GtkLabel* system_info_pcName = GTK_LABEL(gtk_builder_get_object(builder, "system_info_pcName"));
gtk_label_set_text(system_info_pcName, lang.system_info_pcName);
GtkLabel* system_info_os = GTK_LABEL(gtk_builder_get_object(builder, "system_info_os"));
gtk_label_set_text(system_info_os, lang.system_info_os);
GtkLabel* system_info_language = GTK_LABEL(gtk_builder_get_object(builder, "system_info_language"));
gtk_label_set_text(system_info_language, lang.system_info_language);
GtkLabel* system_info_manufacturer = GTK_LABEL(gtk_builder_get_object(builder, "system_info_manufacturer"));
gtk_label_set_text(system_info_manufacturer, lang.system_info_manufacturer);
GtkLabel* system_info_model = GTK_LABEL(gtk_builder_get_object(builder, "system_info_model"));
gtk_label_set_text(system_info_model, lang.system_info_model);
GtkLabel* system_info_bios = GTK_LABEL(gtk_builder_get_object(builder, "system_info_bios"));
gtk_label_set_text(system_info_bios, lang.system_info_bios);
GtkLabel* system_info_processor = GTK_LABEL(gtk_builder_get_object(builder, "system_info_processor"));
gtk_label_set_text(system_info_processor, lang.system_info_processor);
GtkLabel* system_info_memory = GTK_LABEL(gtk_builder_get_object(builder, "system_info_memory"));
gtk_label_set_text(system_info_memory, lang.system_info_memory);
GtkLabel* system_info_pageFile = GTK_LABEL(gtk_builder_get_object(builder, "system_info_pageFile"));
gtk_label_set_text(system_info_pageFile, lang.system_info_pageFile);
GtkLabel* system_info_directxVersion = GTK_LABEL(gtk_builder_get_object(builder, "system_info_directxVersion"));
gtk_label_set_text(system_info_directxVersion, lang.system_info_directxVersion);
GtkLabel* system_info_opendxVersion = GTK_LABEL(gtk_builder_get_object(builder, "system_info_opendxVersion"));
gtk_label_set_text(system_info_opendxVersion, lang.system_info_opendxVersion);
}
private:void setupSignals(GtkBuilder* builder) {
GtkLabel* date_val = GTK_LABEL(gtk_builder_get_object(builder, "date_val")); GtkLabel* date_val = GTK_LABEL(gtk_builder_get_object(builder, "date_val"));
g_signal_connect (date_val, "realize", G_CALLBACK (SystemTab::onRealizeTime), NULL); g_signal_connect (date_val, "realize", G_CALLBACK (SystemTab::onRealizeTime), NULL);
GtkLabel* pc_val = GTK_LABEL(gtk_builder_get_object(builder, "pc_val")); GtkLabel* pc_val = GTK_LABEL(gtk_builder_get_object(builder, "pc_val"));
@ -319,4 +372,4 @@ namespace SystemTab {
GtkLabel* swap_val = GTK_LABEL(gtk_builder_get_object(builder, "swap_val")); GtkLabel* swap_val = GTK_LABEL(gtk_builder_get_object(builder, "swap_val"));
g_signal_connect (swap_val, "realize", G_CALLBACK (SystemTab::setSwap), NULL); g_signal_connect (swap_val, "realize", G_CALLBACK (SystemTab::setSwap), NULL);
} }
} };