diff --git a/.gitignore b/.gitignore index 8a32e88..45460e9 100755 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,4 @@ compile/ source/**/ubl_settings_datetime source/**/main.o source/**/ubl_settings_datetime.o -reg/ -ubl-util-standard.h -ubl-util-standard.c \ No newline at end of file +reg/ \ No newline at end of file diff --git a/Makefile b/Makefile index 66c7629..3e7f1a4 100755 --- a/Makefile +++ b/Makefile @@ -21,12 +21,6 @@ all: init build init: @echo "Initialize ..."; \ - if [ ! -f source/ubl-util-standard.h ]; then \ - ln -s /usr/share/ubl-util-standard/ubl-util-standard.h source/ubl-util-standard.h; \ - fi; \ - if [ ! -f source/ubl-util-standard.c ]; then \ - ln -s /usr/share/ubl-util-standard/ubl-util-standard.c source/ubl-util-standard.c; \ - fi; \ echo "-- Build path: ${CMAKE_BUILD_DIR}" depend: diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc index d40ac05..4cdf835 100755 --- a/source/ubl-settings-datetime.cc +++ b/source/ubl-settings-datetime.cc @@ -1086,7 +1086,7 @@ void MainWindow::read_file(){ else if (key_zone.length()!=0 || key_zone!=" "){ zone.push_back(key_zone); path_reg_zone = key_reg + "/" + key_zone; - key_zone_local = this->zone_file_read(path_reg_zone) +_(key_zone.c_str()); + key_zone_local = this->zone_file_read(path_reg_zone) + _(key_zone.c_str()); zone_local.push_back(key_zone_local); } } diff --git a/source/ubl-util-standard.c b/source/ubl-util-standard.c new file mode 100644 index 0000000..8d7e9ee --- /dev/null +++ b/source/ubl-util-standard.c @@ -0,0 +1,70 @@ +#include "ubl-util-standard.h" +#ifndef __cplusplus +#ifndef UBL_GET_STANDARD_UI +#define UBL_GET_STANDARD_UI + + +inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id){ + returnstruct *ret=(returnstruct*)malloc(sizeof(returnstruct*)); + if (left_plug_id>0&&LeftWidget){ + GtkWidget *plug=gtk_plug_new(left_plug_id); + GtkWidget *toplug=LeftWidget; + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + ret->plugLeft=plug; + } + if (right_plug_id>0&&RightWidget){ + GtkWidget *plug=gtk_plug_new(right_plug_id); + GtkWidget *toplug=RightWidget; + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + ret->plugRight=plug; + } + return ret; +} + +#endif + +#else + + +inline void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id){ + if (left_plug_id>0&&LeftWidget){ + GtkWidget *plug=gtk_plug_new(left_plug_id); + GtkWidget *toplug=GTK_WIDGET(LeftWidget->gobj()); + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + } + if (right_plug_id>0&&RightWidget){ + GtkWidget *plug=gtk_plug_new(right_plug_id); + GtkWidget *toplug=GTK_WIDGET(RightWidget->gobj()); + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + } + return; +} +#endif \ No newline at end of file diff --git a/source/ubl-util-standard.h b/source/ubl-util-standard.h new file mode 100644 index 0000000..4c1ae22 --- /dev/null +++ b/source/ubl-util-standard.h @@ -0,0 +1,22 @@ +#define STANDARD_PATH "/usr/share/ubl-util-standard/ubl-util-standard.glade" +#define CSS_PATH "/usr/share/ubl-util-standard/ubl-util-standard.css" +#ifndef __cplusplus +#include +#include + +typedef struct { + GtkWidget *plugLeft; + GtkWidget *plugRight; + + +} returnstruct; +static returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id); +#else +#include +#include +#include +#include + + +static void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id); +#endif \ No newline at end of file diff --git a/ubl-settings-datetime_ru.po b/ubl-settings-datetime_ru.po index d2360a6..0f6c7f0 100755 --- a/ubl-settings-datetime_ru.po +++ b/ubl-settings-datetime_ru.po @@ -1712,7 +1712,10 @@ msgid "Vincennes" msgstr "Венсен" msgid "Winamac" -msgstr "Winamac" +msgstr "Винамаке" + +msgid "ComodRivadavia" +msgstr "Комодоро-Ривадавия" msgid "Monticello" msgstr "Монтиселло"