From 776ab2aacc3e486956e5894408ceafd42767a26d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 16 Sep 2024 17:11:38 +0600 Subject: [PATCH] Application remake with C - version 2.0 --- .gitignore | 20 +- Makefile | 26 +- gresource.xml | 1 + source/CMakeLists.txt | 61 +- source/main.cc | 115 -- source/ubl-cmake.in | 1 - source/ubl-settings-datetime.c | 417 +++++++ source/ubl-settings-datetime.cc | 1779 ---------------------------- source/ubl-settings-datetime.h | 511 +++----- source/ubl-settings-datetime.h.in | 1 - source/ubl-strings.h | 24 + source/ubl-util-standard.c | 91 -- source/ubl-util-standard.h | 20 - ubl-settings-datetime.glade | 1798 ++++++++--------------------- ubl-settings-datetime.pot | 588 ++-------- ubl-settings-datetime_ru.po | 603 ++-------- 16 files changed, 1264 insertions(+), 4792 deletions(-) delete mode 100644 source/main.cc delete mode 100644 source/ubl-cmake.in create mode 100644 source/ubl-settings-datetime.c delete mode 100644 source/ubl-settings-datetime.cc delete mode 100644 source/ubl-settings-datetime.h.in create mode 100644 source/ubl-strings.h delete mode 100644 source/ubl-util-standard.c delete mode 100644 source/ubl-util-standard.h diff --git a/.gitignore b/.gitignore index 2160adc..3f4555b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,12 @@ -main.cpp -ubl-settings-datetime.glade~ -test.cpp +.vscode/ ubl-settings-datetime -a.out +*~ +build/ compile/ -source/**/ubl_settings_datetime -source/**/main.o -source/**/ubl_settings_datetime.o -ubl-settings-datetime_ru.po~ -reg/ -.vscode/ +*# terminal-commands/ -*# \ No newline at end of file +source/ubl-cmake.h +vgcore* +.BUILD.md +.updatebuild.sh +.install.sh \ No newline at end of file diff --git a/Makefile b/Makefile index f2cc6a5..371bb65 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile DEPENDS = /bin/cmake PREFIX ?= /usr/local PKGNAME = $(MAKEFILE_DIR) -FILE_VER = source/${PKGNAME}.cc -PKGIDENT = $(subst /,-,$(subst /usr,,${PREFIX})) +FILE_VER = source/${PKGNAME}.h +PKGIDENT=$(subst /,-,${PREFIX}) default_target: all @@ -94,7 +94,6 @@ uninstall: done @$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}" @$(RM) "${DESTDIR}${PREFIX}/share/applications/${PKGNAME}.desktop" - @$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.svg" @$(RM) "${DESTDIR}/usr/share/polkit-1/actions/com.ublinux.${PKGNAME}${PKGIDENT}.policy" @if [ -z ${DESTDIR} ]; then \ [ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \ @@ -117,18 +116,19 @@ install: check uninstall install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \ rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \ done - @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg" - @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg" - @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg" - @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.alert.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg" + @cp ./com.ublinux.${PKGNAME}.policy ./compile/com.ublinux.${PKGNAME}${PKGIDENT}.policy + @sed -e 's+/usr/bin+${PREFIX}/bin+' -e 's+.run+${PKGIDENT}.run+g' ./compile/com.ublinux.${PKGNAME}${PKGIDENT}.policy -i @install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop" - @install -Dm644 "com.ublinux.${PKGNAME}.policy" "${DESTDIR}/usr/share/polkit-1/actions/com.ublinux.${PKGNAME}${PKGIDENT}.policy" - @sed -e '\|annotate key=|s|/usr/bin|${PREFIX}/bin|' -e '/action id=/s/\.run/${PKGIDENT}\.run/' -i ${DESTDIR}/usr/share/polkit-1/actions/com.ublinux.${PKGNAME}${PKGIDENT}.policy + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/polkit-1/actions/" "${CMAKE_BUILD_DIR}/com.ublinux.${PKGNAME}${PKGIDENT}.policy" + @ldconfig -n /usr/local/lib @if [ -z ${DESTDIR} ]; then \ - [ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \ + [ -d "${DESTDIR}/usr/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}/usr/share/icons/hicolor/" &>/dev/null || true; \ update-desktop-database --quiet &>/dev/null || true; \ - [ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true; \ + [ -d "${DESTDIR}/usr/share/applications" ] && touch "${DESTDIR}/usr/share/applications" &>/dev/null || true; \ fi @echo "Install: OK" @@ -147,7 +147,7 @@ help: echo "... init"; \ echo "... debug"; \ echo "... prepare"; \ - echo "... build"; \ + echo "... compile"; \ echo "... install"; \ echo "... uninstall"; \ - echo "... clean" + echo "... clean" \ No newline at end of file diff --git a/gresource.xml b/gresource.xml index 213b8b0..ddbefac 100644 --- a/gresource.xml +++ b/gresource.xml @@ -2,6 +2,7 @@ ubl-settings-datetime.glade + ubl-settings-datetime-error.glade ubl-settings-datetime.css diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index e8ea30b..1d9c69f 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -3,21 +3,15 @@ project(ubl-settings-datetime) find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK3 REQUIRED gtk+-3.0) -include_directories(${GTK3_INCLUDE_DIRS}) -link_directories(${GTK3_LIBRARY_DIRS}) -add_definitions(${GTK3_CFLAGS_OTHER}) - -pkg_check_modules(GTKMM30 REQUIRED gtkmm-3.0) -include_directories(${GTKMM30_INCLUDE_DIRS}) -link_directories(${GTKMM30_LIBRARY_DIRS}) -add_definitions(${GTKMM30_CFLAGS_OTHER}) - -#pkg_check_modules(VTE291 REQUIRED vte-2.91) -#include_directories(${VTE291_INCLUDE_DIRS}) -#link_directories(${VTE291_LIBRARY_DIRS}) -#add_definitions(${VTE291_CFLAGS_OTHER}) -find_package(ICU REQUIRED COMPONENTS uc dt in io) +pkg_check_modules(GTK REQUIRED gtk+-3.0) +include_directories(${GTK_INCLUDE_DIRS}) +link_directories(${GTK_LIBRARY_DIRS}) +add_definitions(${GTK_CFLAGS_OTHER}) + +pkg_check_modules(VTE291 REQUIRED vte-2.91) +include_directories(${VTE291_INCLUDE_DIRS}) +link_directories(${VTE291_LIBRARY_DIRS}) +add_definitions(${VTE291_CFLAGS_OTHER}) find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) @@ -30,10 +24,6 @@ if(WEBKIT_LIBRARIES_FOUND) add_definitions(${WEBKIT_CFLAGS_OTHER}) endif() -configure_file(ubl-cmake.in ubl-cmake.h) - -file(COPY ${CMAKE_CURRENT_BINARY_DIR}/ubl-cmake.h DESTINATION ./) - set(GRESOURCE_C resources.c) set(GRESOURCE_XML gresource.xml) @@ -42,6 +32,7 @@ add_custom_target(GLADE ubl-settings-datetime.glade) set(DEPENDFILES ../ubl-settings-datetime.glade + ../ubl-settings-datetime-error.glade ../gresource.xml ../ubl-settings-datetime-banner.png ../ubl-settings-datetime.css @@ -67,31 +58,34 @@ add_custom_target( DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C} ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ +add_definitions(-DVTE_INCLUDE) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ - -Wformat -Werror=format-security \ + -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection") string(FIND "${CMAKE_CXX_FLAGS}" "-D_FORTIFY_SOURCE" FORTIFY_FOUND) if(FORTIFY_FOUND EQUAL -1) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wp,-D_FORTIFY_SOURCE=2") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wp,-D_FORTIFY_SOURCE=2") endif() - + set(SOURCE_FILES - ubl-util-standard.h - ubl-util-standard.c - main.cc - ubl-settings-datetime.cc + ubl-settings-datetime.c ubl-settings-datetime.h - ${CMAKE_CURRENT_BINARY_DIR}/ubl-cmake.h) + ubl-strings.h + ) set(LIBRARIES - ${GTK3_LIBRARIES} - ${GTKMM30_LIBRARIES} + ${GTK_LIBRARIES} ${WEBKIT_LIBRARIES} - ${ICU_LIBRARIES} - pthread) + ${UTILS_LIBRARIES} + ${VTE291_LIBRARIES} + pthread + ublsettings + ublsettings-gtk3 + ublsettingsui-gtk3) add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}) @@ -102,5 +96,4 @@ set_source_files_properties( PROPERTIES GENERATED TRUE ) install(TARGETS ${PROJECT_NAME} DESTINATION bin) -add_dependencies(${PROJECT_NAME} dummy-resource) - +add_dependencies(${PROJECT_NAME} dummy-resource) \ No newline at end of file diff --git a/source/main.cc b/source/main.cc deleted file mode 100644 index 7272934..0000000 --- a/source/main.cc +++ /dev/null @@ -1,115 +0,0 @@ -#include "ubl-settings-datetime.h" - -void pars_flag(int index_start, int argc, char* argv[]); - -int main(int argc, char* argv[]) { - string str_argv= ""; - string str_cmd_argv = ""; - for (int i=1; i 1){ - str_argv = argv[1]; - } - - if (str_argv.find("--socket-id") != std::string::npos){ - pars_flag(3, argc, argv); - auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug"); - auto builder = Gtk::Builder::create_from_resource(path_glade); - builder->set_translation_domain(app_name); - Glib::init(); - Glib::OptionContext context; - - CmdArgParser parser{ - "Socket ID", - "Command line argument for socket ID communication.", - "No help available, sorry" - }; - - context.set_main_group(parser); - context.parse(argc, argv); - - ::Window socketID = parser.GetSocketID(); - - // Handle plug: - SettingsPlug plug{socketID, builder}; - plug.show(); - - app->run(plug); - return 0; - } - else if (str_argv.find("-") != std::string::npos || argc == 1){ - int len_argv = 1; - pars_flag(1, argc, argv); - auto app = Gtk::Application::create(len_argv, argv, "org.gtkmm.example.plug"); - auto builder = Gtk::Builder::create_from_resource(path_glade); - builder->set_translation_domain(app_name); - MainWindow* wnd = nullptr; - builder->get_widget_derived("window", wnd); - auto r = app->run(*wnd); - delete wnd; - return r; - } - else{ - cout << no_recognized; - return 0; - } -} - -void pars_flag(int index_start, int argc, char* argv[]){ - string str_argv = ""; - for (int i = index_start; iDHCPCombo)); + switch(mode){ + case 0:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"default"); + break; + case 1:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"stop"); + break; + case 2:yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,"dhcp"); + break; + case 3: + char *value = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->NTPEntry)); + if (yon_char_is_empty(value)) { + yon_ubl_status_box_render(EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(widgets->NTPEntry); + return; + } + yon_config_register(NTPSERVERS_parameter,NTPSERVERS_parameter_command,value); + break; + } + const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); + const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); + + if (!yon_char_is_empty(region)&&!yon_char_is_empty(zone)){ + char *zone_parameter = yon_char_unite(region,"/",zone,NULL); + yon_config_register(ZONE_parameter,ZONE_parameter_command,zone_parameter); + free(zone_parameter); + } + + if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo))==0){ + yon_config_register(HWCLOCK_SYNC_parameter,HWCLOCK_SYNC_parameter_command,"localtime"); + } else { + yon_config_register(HWCLOCK_SYNC_parameter,HWCLOCK_SYNC_parameter_command,"utc"); + } + +} + +void on_config_save(GtkWidget *, main_window *widgets){ + main_config.load_mode=3; + yon_save_parameters(widgets); + yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL); +} + +void on_config_save_global(GtkWidget *, main_window *widgets){ + main_config.load_mode=0; + yon_save_parameters(widgets); + yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL); +} + +void on_config_save_local(GtkWidget *, main_window *widgets){ + main_config.load_mode=1; + yon_save_parameters(widgets); + yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL); +} + +void on_config_save_custom(GtkWidget *, main_window *widgets){ + main_config.load_mode=3; + yon_save_parameters(widgets); + yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL); +} + +void on_config_load_global(){ + yon_load_proceed(YON_CONFIG_GLOBAL); + +} + +void on_config_load_local(){ + yon_load_proceed(YON_CONFIG_LOCAL); + +} + +void on_config_load_custom(){ + yon_load_proceed(YON_CONFIG_CUSTOM); +} + +void yon_load_proceed(YON_CONFIG_TYPE type){ + yon_config_clean(); + if (!yon_char_is_empty(config_get_default_command)) + yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); + if (type==YON_CONFIG_GLOBAL){ + yon_config_load_config(type,config_get_global_command,NULL); + } else if (type==YON_CONFIG_LOCAL){ + yon_config_load_config(type,config_get_local_command,NULL); + } else if (type==YON_CONFIG_CUSTOM){ + char *path=""; + textdomain(template_ui_LocaleName); + GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL); + textdomain(LocaleName); + gtk_window_set_icon_name(GTK_WINDOW(dialog),icon_name); + gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL); + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_file_filter_add_pattern(filter,"*.ini"); + gtk_file_filter_set_name(filter, "*.ini"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter); + gtk_widget_show(dialog); + int response = gtk_dialog_run(GTK_DIALOG(dialog)); + if (response == GTK_RESPONSE_ACCEPT){ + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + if (!yon_char_is_empty(file)){ + path=file; + } + gtk_widget_destroy(dialog); + } else { + gtk_widget_destroy(dialog); + } + char *command = yon_config_get_custom_command(path); + yon_config_load_config(type,command,NULL); + } +} + +void yon_interface_update(main_window *widgets){ + char *ntp = config(NTPSERVERS_parameter); + char *zone = config(ZONE_parameter); + if (!yon_char_is_empty(zone)&&strstr(zone,"/")){ + char *region = yon_char_divide_search(zone,"/",-1); + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); + while (gtk_events_pending()) gtk_main_iteration(); + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); + free(zone); + free(region); + } + if (!yon_char_is_empty(ntp)){ + if (!strcmp(ntp,"stop")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->DHCPCombo),1); + gtk_widget_set_sensitive(widgets->NTPEntry,0); + } else if (!strcmp(ntp,"default")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->DHCPCombo),0); + gtk_widget_set_sensitive(widgets->NTPEntry,0); + } else if (!strcmp(ntp,"dhcp")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->DHCPCombo),2); + gtk_widget_set_sensitive(widgets->NTPEntry,0); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->DHCPCombo),3); + gtk_widget_set_sensitive(widgets->NTPEntry,1); + gtk_entry_set_text(GTK_ENTRY(widgets->NTPEntry),ntp); + } + } else { + gtk_entry_set_text(GTK_ENTRY(widgets->NTPEntry),""); + } + + char *hwclock_sync = config(HWCLOCK_SYNC_parameter); + if (!yon_char_is_empty(hwclock_sync)){ + if (!strcmp(hwclock_sync,"utc")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo),1); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo),0); + } + } + + GDateTime *datetime = g_date_time_new_now_local(); + char *time = g_date_time_format(datetime,"%H %M"); + char *date = g_date_time_format(datetime,"%Y:%m:%d"); + gtk_calendar_select_month(GTK_CALENDAR(widgets->DateCalendar),g_date_time_get_month(datetime),g_date_time_get_year(datetime)); + gtk_calendar_select_day(GTK_CALENDAR(widgets->DateCalendar),g_date_time_get_day_of_month(datetime)); + + if (!yon_char_is_empty(time)){ + char *hour = yon_char_divide_search(time," ",-1); + double hours = atof(hour); + double minutes = atof(time); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->HourSpin),hours); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->MinuteSpin),minutes); + free(hour); + free(time); + } else { + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->HourSpin),0.0f); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->MinuteSpin),0.0f); + } + + if (!yon_char_is_empty(date)){ + gtk_entry_set_text(GTK_ENTRY(widgets->DateEntry),date); + } else { + gtk_entry_set_text(GTK_ENTRY(widgets->DateEntry),""); + } +} + +void on_date_clicked(GtkWidget *,main_window *widgets){ + gtk_popover_popup(GTK_POPOVER(widgets->DatePopover)); +} + +void on_region_changed(GtkComboBox *self, main_window *widgets){ + char *active = (char*)gtk_combo_box_get_active_id(self); + active = yon_char_append("/usr/share/zoneinfo/",active); + int size; + gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->ZoneCombo)); + if (yon_file_is_directory(active)){ + config_str parsed = yon_file_ls(active,&size); + for (int i=0;iZoneCombo),parsed[i],_(parsed[i])); + } + if (size) yon_char_parsed_free(parsed,size); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ZoneCombo),0); + } + free(active); +} + +struct datetime_arg { + char *time; + const char *date; +}; + +void *on_sync_error(void*){ + yon_ubl_status_box_render(SYNC_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + g_thread_exit(NULL); + return NULL; +} + +void *yon_sync_thread_start(void *arg){ + struct datetime_arg *data = (struct datetime_arg*)arg; + char *command_time = time_sync_command(data->time); + char *command_date = date_sync_command(data->date); + char *command = yon_char_unite(command_time,"; ",command_date,NULL); + free(command_time); + free(command_date); + if (system(yon_debug_output("%s\n",command))){ + g_thread_new("status_thread",(GThreadFunc)on_sync_error,NULL); + }; + pthread_exit(NULL); +} + +void on_sync_clicked(GtkWidget *, main_window *widgets){ + char *hour = yon_char_from_long((long)gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->HourSpin))); + char *minute = yon_char_from_long((long)gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->MinuteSpin))); + GDateTime *datetime = g_date_time_new_now_local(); + char *second = g_date_time_format(datetime, "%S"); + char *time = yon_char_unite(hour,":",minute,":",second,NULL); + + const char *date = gtk_entry_get_text(GTK_ENTRY(widgets->DateEntry)); + + struct datetime_arg *data = malloc(sizeof(struct datetime_arg)); + data->date=NULL; + data->time=time; + if (!yon_char_is_empty(date)){ + int size; + config_str parsed = yon_char_parse((char*)date,&size,":"); + data->date=yon_char_parsed_to_string(parsed,size,""); + yon_char_parsed_free(parsed,size); + } + free(hour); + free(minute); + free(second); + + pthread_t tid; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_create(&tid,&attr,yon_sync_thread_start,data); + +} + +void on_ntp_sync(GtkWidget *, main_window *widgets){ + int mode = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->DHCPCombo)); + switch(mode){ + case 0: + gtk_widget_set_sensitive(widgets->NTPEntry,0); + break; + case 1: + gtk_widget_set_sensitive(widgets->NTPEntry,0); + break; + case 2: + gtk_widget_set_sensitive(widgets->NTPEntry,0); + break; + case 3: + gtk_widget_set_sensitive(widgets->NTPEntry,1); + break; + } +} + +void *yon_sync_hardware_thread_start(void*){ + if (system(hardware_datetime_sync_command)){ + g_thread_new("status_thread",(GThreadFunc)on_sync_error,NULL); + } + pthread_exit(NULL); +} + +void on_sync_hardware_clicked(){ + pthread_t tid; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_create(&tid,&attr,yon_sync_hardware_thread_start,NULL); +} + +// standard functions + +void on_date_accept(GtkWidget *,main_window *widgets){ + guint year=0, month=0, day=0; + gtk_calendar_get_date(GTK_CALENDAR(widgets->DateCalendar),&year,&month,&day); + char *ye_str = yon_char_from_int(year); + char *mo_str = yon_char_from_int(++month); + char *da_str = yon_char_from_int(day); + char *date = yon_char_unite(ye_str,":",month<10?"0":"",mo_str,":",day<10?"0":"",da_str,NULL); + gtk_entry_set_text(GTK_ENTRY(widgets->DateEntry),date); + gtk_popover_popdown(GTK_POPOVER(widgets->DatePopover)); + free(date); +} + +void on_date_cancel(GtkWidget *, main_window *widgets){ + gtk_popover_popdown(GTK_POPOVER(widgets->DatePopover)); +} + +/**config_init() + * [EN] + * + * [RU] + * Функция инициализации всех параметров конфигурации +*/ +void config_init(){ + main_config.always_open_documentation=0; + main_config.socket_id=-1; + main_config.save_socket_id=-1; + main_config.load_socket_id=-1; + main_config.lock_help=0; + main_config.lock_help=0; + main_config.lock_load_global=0; + main_config.lock_save_global=0; + main_config.lock_save_local=0; + main_config.load_mode=1; +} + +/**yon_main_window_complete(main_window *widgets) + * [EN] + * + * [RU] + * Функция настройки основного окна приложения. [widgets] - структура со стандартным интерфейсом. +*/ +void yon_main_window_complete(main_window *widgets){ + widgets = yon_remalloc(widgets,sizeof(main_window)); + GtkBuilder *builder = gtk_builder_new_from_resource(glade_path); + gtk_box_pack_start(GTK_BOX(widgets->InterfaceBox),yon_gtk_builder_get_widget(builder,"BoxMain"),1,1,0); + + // Custom widgets configuration + { + widgets->HourSpin = yon_gtk_builder_get_widget(builder,"HourSpin"); + widgets->MinuteSpin = yon_gtk_builder_get_widget(builder,"MinuteSpin"); + widgets->DateEntry = yon_gtk_builder_get_widget(builder,"DateEntry"); + widgets->DateButton = yon_gtk_builder_get_widget(builder,"DateButton"); + widgets->SyncButton = yon_gtk_builder_get_widget(builder,"SyncButton"); + widgets->SyncHardwareButton = yon_gtk_builder_get_widget(builder,"SyncHardwareButton"); + widgets->DHCPCombo = yon_gtk_builder_get_widget(builder,"DHCPCombo"); + widgets->NTPEntry = yon_gtk_builder_get_widget(builder,"NTPEntry"); + widgets->TimeSyncTypeCombo = yon_gtk_builder_get_widget(builder,"TimeSyncTypeCombo"); + widgets->RegionCombo = yon_gtk_builder_get_widget(builder,"RegionCombo"); + widgets->ZoneCombo = yon_gtk_builder_get_widget(builder,"ZoneCombo"); + widgets->DatePopover = yon_gtk_builder_get_widget(builder,"DatePopover"); + widgets->DateCalendar = yon_gtk_builder_get_widget(builder,"DateCalendar"); + widgets->DateCancelButton = yon_gtk_builder_get_widget(builder,"DateCancelButton"); + widgets->DateAcceptButton = yon_gtk_builder_get_widget(builder,"DateAcceptButton"); + + widgets->zone_list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1")); + } + // Signal configuration + { + g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_save),widgets); + g_signal_connect(G_OBJECT(widgets->SaveGlobalMenuItem),"activate",G_CALLBACK(on_config_save_global),widgets); + g_signal_connect(G_OBJECT(widgets->SaveLocalMenuItem),"activate",G_CALLBACK(on_config_save_local),widgets); + g_signal_connect(G_OBJECT(widgets->SaveCustomMenuItem),"activate",G_CALLBACK(on_config_save_custom),widgets); + + g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(on_config_load_global),widgets); + g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_config_load_local),widgets); + g_signal_connect(G_OBJECT(widgets->LoadCustomMenuItem),"activate",G_CALLBACK(on_config_load_custom),widgets); + + g_signal_connect(G_OBJECT(widgets->DHCPCombo),"changed",G_CALLBACK(on_ntp_sync),widgets); + g_signal_connect(G_OBJECT(widgets->SyncButton),"clicked",G_CALLBACK(on_sync_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->SyncHardwareButton),"clicked",G_CALLBACK(on_sync_hardware_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->RegionCombo),"changed",G_CALLBACK(on_region_changed),widgets); + + g_signal_connect(G_OBJECT(widgets->DateButton),"clicked",G_CALLBACK(on_date_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->DateCancelButton),"clicked",G_CALLBACK(on_date_cancel),widgets); + g_signal_connect(G_OBJECT(widgets->DateAcceptButton),"clicked",G_CALLBACK(on_date_accept),widgets); + } + // Initial data loading + { + + int size; + config_str parsed = yon_dir_get_contents(zone_path,&size); + for (int i=0;iRegionCombo),parsed[i],_(parsed[i])); + } + free(path); + } + } + if (size) yon_char_parsed_free(parsed,size); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->RegionCombo),0); + } + + yon_load_proceed(YON_CONFIG_LOCAL); + yon_interface_update(widgets); +} + +int main(int argc, char *argv[]){ + local=setlocale(LC_ALL, ""); + textdomain (LocaleName); + config_init(); + + yon_ubl_connect_config((_template_config*)&main_config); + yon_ubl_window_init(TITLE_LABEL,TITLE_INFO_LABEL,LocaleName,CssPath,LocaleName,version_application,WIKI_LINK); + config_str unfound = NULL; + int size=0; + yon_ubl_setup_arguments(argc,argv,&unfound,&size,NULL); + gtk_init(&argc,&argv); + template_main_window *widgets = yon_ubl_window_setup(); + yon_main_window_complete((main_window*)widgets); + char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL); + yon_window_config_load(path); + if (getuid()!=0){ + textdomain(template_ui_LocaleName); + yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + textdomain(LocaleName); + } + gtk_main(); + return 0; +} \ No newline at end of file diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc deleted file mode 100644 index f96fb12..0000000 --- a/source/ubl-settings-datetime.cc +++ /dev/null @@ -1,1779 +0,0 @@ - -#include "ubl-settings-datetime.h" -using namespace std; - -bool flag_datetime = false; -bool flag_timezone = false; -bool flag_ntp_mode = false; -bool flag_ntp_edit = false; -bool flag_save = false; -bool flag_save_local = false; -bool flag_save_global = false; -bool flag_load_global = false; -bool flag_sync_hwclock = false; -int socket_ext_id_I = 0; -int socket_trd_id_I = 0; -string version_application; -MainWindow* obj_main; -void wrapper_help_show(GtkWidget *self, char* link, gpointer user_data) { - if (self && user_data) {} - obj_main->global_lick_doc = link; - obj_main->aboutWindows->hide(); - obj_main->temp_help_show(); -} - -CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help) -: Glib::OptionGroup{p_name, p_description, p_help} { - Glib::OptionEntry socketIDArg; - socketIDArg.set_long_name("socket-id"); - socketIDArg.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); - socketIDArg.set_description("Settings manager socket"); - Glib::OptionEntry socketExtId; - socketExtId.set_long_name("socket-ext-id"); - socketExtId.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); - socketExtId.set_description("Settings manager secondary socket"); - Glib::OptionEntry socketTrdId; - socketTrdId.set_long_name("socket-trd-id"); - socketTrdId.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); - socketTrdId.set_description("Settings manager secondary socket"); - add_entry(socketIDArg, m_socketID); - add_entry(socketExtId, socket_ext_id_I); - add_entry(socketTrdId, socket_trd_id_I); -} -::Window CmdArgParser::GetSocketID() const{ - return m_socketID; -} - -MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) - : Gtk::ApplicationWindow(obj), builder{builder} { - this->builder = builder; - this->settings(); -} - -MainWindow::MainWindow(Glib::RefPtr const& builder) { - this->builder = builder; - this->settings(); -} - -void MainWindow::settings() { - obj_main = this; - map_error[get_system_ZONE] = string(str_time_zone_flag); - map_error[set_hwclock] = string(str_hardware_time_flag); - map_error[get_system_NTPSERVERS] = string(str_NTP_flag); - map_error[get_system_HWCLOCK_SYNC] = string(str_hardware_time_flag); - map_error[get_global_NTPSERVERS] = string(str_NTP_flag); - map_error[get_global_ZONE] = string(str_time_zone_flag); - map_error[get_global_defalult_HWCLOCK_SYNC] = string(str_hardware_time_flag); - map_error[get_global_HWCLOCK_SYNC] = string(str_hardware_time_flag); - map_error[set_system_ZONE] = string(str_time_zone_flag); - map_error[set_system_NTPSERVERS_default] = string(str_NTP_flag); - map_error[set_system_NTPSERVERS_dhcp] = string(str_NTP_flag); - map_error[set_system_NTPSERVERS] = string(str_NTP_flag); - map_error[remove_system_NTPSERVERS] = string(str_NTP_flag); - map_error[set_system_HWCLOCK_SYNC_localtime] = string(str_hardware_time_flag); - map_error[set_system_HWCLOCK_SYNC_utc] = string(str_hardware_time_flag); - map_error[set_global_ZONE] = string(str_time_zone_flag); - map_error[set_global_NTPSERVERS_default] = string(str_NTP_flag); - map_error[set_global_NTPSERVERS_dhcp] = string(str_NTP_flag); - map_error[set_global_NTPSERVERS] = string(str_NTP_flag); - map_error[remove_global_NTPSERVERS] = string(str_NTP_flag); - map_error[set_global_HWCLOCK_SYNC_localtime] = string(str_hardware_time_flag); - map_error[set_global_HWCLOCK_SYNC_utc] = string(str_hardware_time_flag); - map_error[get_NTPSERVERS_DEFAULT] = string(str_NTP_flag); - map_error["date +%Y%m%d -s \""] = string(str_date_flag); - map_error["date +%T -s \""] = string(str_date_flag); - this->get_builder(); - this->add_CSS(); - Gtk::Widget *boxWidget; - builder->get_widget("boxColor", boxWidget); - overHead->add_overlay(*boxWidget); - - ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); - year = 0; - month = 0; - day = 0; - this->lacalization(); - btnBoxAboutDialog->set_visible(false); - if (geteuid() == 0) { - numTimeHrs->set_range(0, 23); - numTimeMin->set_range(0, 59); - numTimeHrs->set_increments(1.0, 1.0); - numTimeMin->set_increments(1.0, 1.0); - this->get_config(); - this->flag_block_gui(); - this->event(); - this->parse_text_date(); - this->load_globl_cfg(); - this->load_local_cfg(); - default_get_dhcp = this->get_ubconfig_value(get_NTPSERVERS_DEFAULT); - this->str_remove(default_get_dhcp, "\""); - } - else { - lblHW->set_sensitive(false); - boxWidgetFunc->set_sensitive(false); - boxButton->set_sensitive(false); - btnSave->set_sensitive(false); - this->event(); - imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); - info_status_app(info_box_error_css); - lblWarning->set_text(program_as_root); - } -} - -void MainWindow::lacalization() { - time_t now = time(0); - tm *ltm = localtime(&now); - unsigned int year = 1900+ ltm->tm_year; - string str_authors = string(copyright) + to_string(year); - aboutWindows->set_program_name(app_name); - aboutWindows->set_copyright(str_authors); - aboutWindows->set_comments(str_date_time); - aboutWindows->set_website(website); - aboutWindows->set_version(_(version_application.c_str())); - aboutWindows->set_website_label(home_page); - lblHeaderAboutTopic->set_label(str_about); - lblSave->set_label(str_save); - lblLoad->set_label(str_load); - txtDate->set_tooltip_text(data_format_d_m_y); - txtNtpServer->set_tooltip_text(enter_name_ntp_tooltip); - lblSynchronizebChkGLob->set_text(synchronize_ntp); - cbDhcp->append(str_default); - cbDhcp->append(str_DHCP); - cbDhcp->append(str_manual); - cbDhcp->append(str_disabled); - lblDateTimeSetting->set_text(current_date_time); - lblHead->set_text(str_date_time); - lblTime->set_text(str_time); - lblData->set_text(str_date); - lblTimeZone->set_text(str_time_zone); - lblReg->set_text(str_region); - lblZone->set_text(str_zone); - lblSynchronizeBtn->set_text(str_sync_by); - lblHeader->set_text(name_app); - lblHeadeWndWeb->set_text(name_app); - windowMessDchp->set_title(str_attention); - lblTimeBios->set_text(synchronize_hw); - headInfoLabel->set_text(setting_date_time); - lblHW->set_text(string(synchronize_hw) + ":"); - array_hw_local[0] = utc_time; - array_hw_local[1] = str_local_time; - array_hw[0] = "utc"; - array_hw[1] = "localtime"; - this->bubble_sort(array_hw, array_hw_local, 2); - cbHw->append(array_hw_local[0]); - cbHw->append(array_hw_local[1]); - set_title(str_date_time); - - lblhelpHeader->set_text(read_documentation_web); - lblhelpText->set_text(redirected_documentation); - btnReadHelp->set_label(read_online); - btnCancelHelp->set_label(cancel); - chkAlwaysOpenHelp->set_label(always_redirect); - lblwebHeaderName->set_label(name_app); - btnSaveLocalGlob->set_label(save_all); - btnSaveGlob->set_label(save_global); - btnSaveLocal->set_label(save_local); - btnLoadGlob->set_label(load_global); - btnLoadLocal->set_label(load_local); - btnhelp->set_label(str_help); - btnAbout->set_label(str_about_1); -} - -void MainWindow::bubble_sort(string arr[],string arr_local[], int len_arr) { - while(len_arr--) { - bool swapped = false; - for(int i = 0; i < len_arr; i++) { - if(arr_local[i] > arr_local[i + 1]) { - swap(arr[i], arr[i + 1]); - swap(arr_local[i], arr_local[i + 1]); - swapped = true; - } - } - if(swapped == false) - break; - } -} - -void MainWindow::flag_block_gui() { - if (flag_datetime == true) { - btnUpdateDateTime->set_sensitive(false); - numTimeHrs->set_sensitive(false); - numTimeMin->set_sensitive(false); - btnChooseDate->set_sensitive(false); - txtDate->set_sensitive(false); - lblTimeBios->set_sensitive(false); - btnHardwareTime->set_sensitive(false); - lblTime->set_sensitive(false); - lblData->set_sensitive(false); - } - if (flag_sync_hwclock == true) { - lblHW->set_sensitive(false); - cbHw->set_sensitive(false); - } - if (flag_timezone == true) { - cbRegion->set_sensitive(false); - cbZone->set_sensitive(false); - } - if (flag_ntp_mode == true) { - cbDhcp->set_sensitive(false); - txtNtpServer->set_sensitive(false); - flag_ntp_edit = true; - } - if (flag_ntp_edit == true) { - txtNtpServer->set_sensitive(false); - } - if (flag_load_global == true) { - btnLoadGlob->set_sensitive(false); - } - if (flag_save_local == true && flag_save_global == true) { - btnSave->set_sensitive(false); - } - if (flag_save == true) { - btnSave->set_sensitive(false); - } - if (flag_save_local == true) { - btnSaveLocal->set_sensitive(false); - btnSaveLocalGlob->set_sensitive(false); - } - if (flag_save_global == true) { - btnSaveGlob->set_sensitive(false); - btnSaveLocalGlob->set_sensitive(false); - } -} - -void MainWindow::add_CSS() { - Glib::RefPtr cssProvider = Gtk::CssProvider::create(); - cssProvider->load_from_resource(path_css); - Glib::RefPtr styleContext = Gtk::StyleContext::create(); - Glib::RefPtr screen = Gdk::Screen::get_default();//get default screen - styleContext->add_provider_for_screen(screen, cssProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);//add provider for screen in all application - imgHeadBackground->set_from_resource(path_img_head_background); - Glib::RefPtr lblHead_css = lblHead->get_style_context(); - Glib::RefPtr boxButton_css = boxButton->get_style_context(); - Glib::RefPtr boxSave_css = boxSave->get_style_context(); - Glib::RefPtr headerBar_css = headerBar->get_style_context(); - if (socket_trd_id_I == 0 && socket_ext_id_I == 0){ - boxButton_css->add_class("bkim_no_plug"); - boxSave_css->add_class("bkim_no_plug"); - } - - lblHead_css->add_class("textHead"); -} - - -void MainWindow::info_status_app(string stule) { - Glib::RefPtr boxInfo = boxInfoError->get_style_context(); - boxInfo->remove_class(info_box_ok_css); - boxInfo->remove_class(info_box_error_css); - boxInfo->add_class(stule); -} - - -void MainWindow::get_builder() { - builder->get_widget("boxColor", boxColor); - builder->get_widget("btnUpdateDateTime", btnUpdateDateTime); - builder->get_widget("btnChooseDate", btnChooseDate); - builder->get_widget("btnMessClose", btnMessClose); - builder->get_widget("numTimeHrs", numTimeHrs); - builder->get_widget("numTimeMin", numTimeMin); - builder->get_widget("cbDhcp", cbDhcp); - builder->get_widget("txtDate", txtDate); - builder->get_widget("cbRegion", cbRegion); - builder->get_widget("cbZone", cbZone); - builder->get_widget("txtNtpServer", txtNtpServer); - builder->get_widget("cldrDate", cldrDate); - builder->get_widget("windowMessDchp", windowMessDchp); - builder->get_widget("lblMessage", lblMessage); - builder->get_widget("lblDateTimeSetting", lblDateTimeSetting); - builder->get_widget("lblHead", lblHead); - builder->get_widget("lblTime", lblTime); - builder->get_widget("lblData", lblData); - builder->get_widget("lblTimeZone", lblTimeZone); - builder->get_widget("lblReg", lblReg); - builder->get_widget("lblZone", lblZone); - builder->get_widget("lblSynchronizebChkGLob", lblSynchronizebChkGLob); - builder->get_widget("lblSynchronizeBtn", lblSynchronizeBtn); - builder->get_widget("lblTimeBios", lblTimeBios); - builder->get_widget("btnHardwareTime",btnHardwareTime); - builder->get_widget("lblSave", lblSave); - builder->get_widget("lblLoad", lblLoad); - builder->get_widget("aboutWindows", aboutWindows); - builder->get_widget("btnBoxAboutDialog", btnBoxAboutDialog); - builder->get_widget("boxInfoError", boxInfoError); - builder->get_widget("lblWarning", lblWarning); - builder->get_widget("imgInfo", imgInfo); - builder->get_widget("btnSave", btnSave); - builder->get_widget("btnSettings", btnSettings); - builder->get_widget("btnLoad", btnLoad); - builder->get_widget("btnhelp", btnhelp); - builder->get_widget("btnAbout", btnAbout); - builder->get_widget("btnLoadLocal", btnLoadLocal); - builder->get_widget("btnLoadGlob", btnLoadGlob); - builder->get_widget("btnSaveLocalGlob", btnSaveLocalGlob); - builder->get_widget("btnSaveLocal", btnSaveLocal); - builder->get_widget("btnSaveGlob", btnSaveGlob); - builder->get_widget("headerBar", headerBar); - builder->get_widget("lblHeader", lblHeader); - builder->get_widget("lblHW", lblHW); - builder->get_widget("cbHw", cbHw); - builder->get_widget("popCalendar", popCalendar); - builder->get_widget("boxDateTime", boxDateTime); - builder->get_widget("boxButton", boxButton); - builder->get_widget("boxSave", boxSave); - builder->get_widget("standartHead", standartHead); - builder->get_widget("plugBox", plugBox); - builder->get_widget("window" ,window); - builder->get_widget("imgLoad", imgLoad); - builder->get_widget("imgSettings", imgSettings); - builder->get_widget("imgSave", imgSave); - builder->get_widget("boxWidgetFunc", boxWidgetFunc); - builder->get_widget("overHead", overHead); - builder->get_widget("imgHeadBackground", imgHeadBackground); - builder->get_widget("headInfoLabel", headInfoLabel); - #ifdef WEBKIT_FOUND - builder->get_widget("wndWeb", wndWeb); - #endif - builder->get_widget("lblHeadeWndWeb", lblHeadeWndWeb); - builder->get_widget("lblHeaderAboutTopic", lblHeaderAboutTopic); - builder->get_widget("lblwebHeaderName", lblwebHeaderName); - builder->get_widget("lblhelpText", lblhelpText); - builder->get_widget("lblhelpHeader", lblhelpHeader); - builder->get_widget("chkAlwaysOpenHelp", chkAlwaysOpenHelp); - builder->get_widget("btnReadHelp", btnReadHelp); - builder->get_widget("btnCancelHelp", btnCancelHelp); - builder->get_widget("wndShowWeb", wndShowWeb); - -} - -void MainWindow::event() { - g_signal_connect(G_OBJECT(aboutWindows->gobj()), "activate-link", G_CALLBACK(wrapper_help_show), this); - btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();}); - chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;}); - btnReadHelp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_browser)); - btnhelp->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::open_help)); - btnHardwareTime->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::hardware_clock)); - btnMessClose->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::gui_mess_close)); - //cldrDate->signal_day_selected().connect(sigc::mem_fun(*this, &MainWindow::get_calendar)); - btnUpdateDateTime->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::update_time_date)); - btnChooseDate->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::calendar_show)); - cbDhcp->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::event_entry_cbDhcp)); - cbRegion->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::append_zone)); - cldrDate->signal_day_selected_double_click().connect(sigc::mem_fun(*this, &MainWindow::get_calendar)); - btnAbout->signal_activate().connect([&]() {aboutWindows->show();}); - btnhelp->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::open_help)); - btnLoadLocal->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::load_local_cfg)); - btnLoadGlob->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::load_globl_cfg)); - btnSaveLocalGlob->signal_activate().connect([&]() {save_global_local_cfg();}); - btnSaveLocal->signal_activate().connect([&]() {save_local_cfg();}); - btnSaveGlob->signal_activate().connect([&]() {save_global_cfg();}); - cbZone->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::event_zone)); - cbHw->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::event_log_hw)); - txtNtpServer->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_ntp)); -} - -bool MainWindow::focus_ntp(GdkEventFocus* event) { - if (event!=NULL){ - } - if (flag_ntp_edit == false) { - this->focus_ntp_text(); - } - return true; -} - -void MainWindow::event_log_hw() { - string str_hw = cbHw->get_active_text(); - if (str_hw.length() > 0) { - int size_hw = sizeof(array_hw)/sizeof(array_hw[0]); - for (int i = 0; i < size_hw; i++) { - if (str_hw == array_hw_local[i]) { - this->write_config(array_hw[i], "hw"); - } - } - } -} - -void MainWindow::event_zone() { - int activ_index_reg = cbRegion->get_active_row_number(); - if (activ_index_reg == -1) { - this->write_config("error", "zone"); - return; - } - string reg_text = array_region[activ_index_reg]; - int activ_index = cbZone->get_active_row_number(); - if (activ_index == -1) { - this->write_config("error", "zone"); - return; - } - string zone_text = ""; - if (!(reg_text.empty())) { - int index= 0; - for (const auto &zone: time_reg_map.at(reg_text)) { - if (index == activ_index) { - zone_text = zone; - } - index+= 1; - } - } - this->write_config(zone_text, "zone"); -} - -void MainWindow::temp_help_show() { - if (flag_open_browser == true) { - this->open_browser(); - } - else { - wndShowWeb->show_all(); - } - -} - -void MainWindow::open_help() { - global_lick_doc = const_link_doc; - temp_help_show(); -} - -void MainWindow::open_browser() { - #ifdef WEBKIT_FOUND - if (my_web_kit) { - gtk_widget_destroy(GTK_WIDGET(my_web_kit)); - } - my_web_kit = WEBKIT_WEB_VIEW(webkit_web_view_new()); - three = Glib::wrap(GTK_WIDGET(my_web_kit)); - wndWeb->add(*three); - webkit_web_view_load_uri(my_web_kit, _(global_lick_doc.c_str())); - wndWeb->show_all(); - webkit_web_view_load_uri(my_web_kit, _(global_lick_doc.c_str())); - wndWeb->show_all(); - #else - this->template_open_browser(global_lick_doc); - #endif - wndShowWeb->hide(); -} - -void MainWindow::template_open_browser(string link_doc) { - string cmd = cmd_xdg + string(_(link_doc.c_str())) + " &"; - string buf = ""; - if (geteuid() == 0) { - string response_user = getlogin(); - int size_s = std::snprintf(nullptr, 0, cmd_execute, response_user.c_str(), cmd.c_str()) + 1; - auto size = static_cast(size_s); - std::unique_ptr buf(new char[ size ]); - std::snprintf(buf.get(), size, cmd_execute, response_user.c_str(), cmd.c_str()); - cmd = string(buf.get(), buf.get() + size - 1); - } - index_error = system(cmd.c_str()); -} - -void MainWindow::load_local_cfg() { - flag_local_global_load = 0; - flag_load = false; - this->fill_in_reg_zone(get_system_ZONE); - this->update_hour_minute(); - this->update_calendar(); - this->entry_dhcp_mess(get_system_NTPSERVERS, get_NTPSERVERS_DEFAULT); - this->get_hardware_clock(get_system_HWCLOCK_SYNC); - info_warning_error(0); - map_config_data_global_old = map_config_data_global; - map_config_data_local_old = map_config_data_local; - flag_local_global_load = 2; -} - -void MainWindow::load_globl_cfg() { - flag_local_global_load = 1; - flag_load = true; - this->entry_dhcp_mess(get_global_NTPSERVERS, get_NTPSERVERS_DEFAULT); - this->fill_in_reg_zone(get_global_ZONE); - this->get_hardware_clock(get_global_HWCLOCK_SYNC); - info_warning_error(1); - map_config_data_global_old = map_config_data_global; - map_config_data_local_old = map_config_data_local; - flag_local_global_load = 2; -} - -void MainWindow::save_local_cfg() { - if ((this->check_config("region", 0) && this->check_config("zone", 0) && - this->check_config("dhcp", 0) && this->check_config("hw", 0))) { - info_status_app(info_box_ok_css); - lblWarning->set_text(nothing_save); - } - else { - string cmd_zone = set_system_ZONE; - string cmd_default = set_system_NTPSERVERS_default; - string cmd_dhcp = set_system_NTPSERVERS_dhcp; - string cmd_set_ntp = set_system_NTPSERVERS; - string remove_ntp = remove_system_NTPSERVERS; - string local = set_system_HWCLOCK_SYNC_localtime; - string hw = set_system_HWCLOCK_SYNC_utc; - if ((this->check_config("region", 0) == false || this->check_config("zone", 0) == false)) { - this->enter_zone(cmd_zone); - } - if (this->check_config("dhcp", 0) == false) { - this->save_Dhcp(cmd_default, cmd_dhcp, remove_ntp, cmd_set_ntp); - } - if (this->check_config("hw", 0) == false) { - this->set_hardware_clock(local, hw); - } - info_warning_error(2); - map_config_data_local_old = map_config_data_local; - flag_local = true; - } -} - -void MainWindow::save_global_cfg() { - if ((this->check_config("region", 1) && this->check_config("zone", 1) && - this->check_config("dhcp", 1) && this->check_config("hw", 1))) { - info_status_app(info_box_ok_css); - lblWarning->set_text(nothing_save); - } - else { - string cmd = set_global_ZONE; - string cmd_default = set_global_NTPSERVERS_default; - string cmd_dhcp = set_global_NTPSERVERS_dhcp; - string cmd_set_ntp = set_global_NTPSERVERS; - string remove_ntp = remove_global_NTPSERVERS; - string local = set_global_HWCLOCK_SYNC_localtime; - string hw = set_global_HWCLOCK_SYNC_utc; - if ((this->check_config("region", 1) == false || this->check_config("zone", 1) == false)) { - this->enter_zone(cmd); - } - if (this->check_config("dhcp", 1) == false) { - this->save_Dhcp(cmd_default, cmd_dhcp, remove_ntp, cmd_set_ntp); - } - if (this->check_config("hw", 1) == false) { - this->set_hardware_clock(local, hw); - } - info_warning_error(3); - map_config_data_global_old = map_config_data_global; - flag_global = true; - } -} - -void MainWindow::save_global_local_cfg() { - if ((this->check_config("region", 0) && this->check_config("zone", 0) && - this->check_config("dhcp", 0) && this->check_config("hw", 0)) && - (this->check_config("region", 1) && this->check_config("zone", 1) && - this->check_config("dhcp", 1) && this->check_config("hw", 1))) { - info_status_app(info_box_ok_css); - lblWarning->set_text(nothing_save); - } - else { - string cmd = set_all_ZONE; - string cmd_default = set_all_NTPSERVERS_default; - string cmd_dhcp = set_all_NTPSERVERS_dhcp; - string cmd_set_ntp = set_all_NTPSERVERS; - string remove_ntp = remove_all_NTPSERVERS; - string local = set_all_HWCLOCK_SYNC_localtime; - string hw = set_all_HWCLOCK_SYNC_utc; - if ((this->check_config("region", 1) == false || this->check_config("zone", 1) == false)) { - this->enter_zone(cmd); - } - if (this->check_config("dhcp", 1) == false) { - this->save_Dhcp(cmd_default, cmd_dhcp, remove_ntp, cmd_set_ntp); - } - if (this->check_config("hw", 1) == false) { - this->set_hardware_clock(local, hw); - } - map_config_data_global_old = map_config_data_global; - map_config_data_local_old = map_config_data_local; - info_warning_error(4); - flag_global_local = true; - - } -} - -void MainWindow::write_config(string data, string key) { - std::map :: iterator it, it2, it3; - it2 = map_config_data_global.find(key); - it = map_config_data_local.find(key); - if (it != map_config_data_local.end() || it2 != map_config_data_global.end()) { - if (flag_local_global_load == 2) { - map_config_data_global[key] = data; - map_config_data_local[key] = data; - } - else if (flag_local_global_load == 1) { - map_config_data_global[key] = data; - } - else if (flag_local_global_load == 0) { - map_config_data_local[key] = data; - } - - flag_local = false; - flag_global = false; - flag_global_local = false; - - } - else if (it == map_config_data_local.end() || it2 == map_config_data_global.end()) { - if (flag_local_global_load == 2) { - map_config_data_global[key] = data; - map_config_data_local[key] = data; - } - else if (flag_local_global_load == 1) { - map_config_data_global[key] = data; - } - else if (flag_local_global_load == 0) { - map_config_data_local[key] = data; - } - flag_local = false; - flag_global = false; - flag_global_local = false; - } -} - -bool MainWindow::check_config(string key, int key_save) { - std::map :: iterator iter_map_config_data; - std::map :: iterator iter_map_config_data_old; - std::map map_config_data; - std::map map_config_data_old; - if (map_config_data_global.find(key) != map_config_data_global.end() && - map_config_data_local.find(key) != map_config_data_local.end() && - map_config_data_global_old.find(key) != map_config_data_global_old.end() && - map_config_data_local_old.find(key) != map_config_data_local_old.end()) { - if (map_config_data_global[key] != map_config_data_local_old[key] || - map_config_data_global_old[key] != map_config_data_local[key]) { - return false; - } - if (map_config_data_global[key] != map_config_data_local[key]) { - return false; - } - } - - - if ((key_save == 0 || key_save == 1) && flag_global_local == true) { - map_config_data_global_old = map_config_data_global; - map_config_data_local_old = map_config_data_local; - return true; - } - else if (key_save == 0 && flag_local == true) { - return true; - } - else if (key_save == 1 && flag_global == true) { - return true; - } - else if (key_save == 2 && flag_global == true && flag_local == true) { - return true; - } - else if (key_save == 2 && flag_global_local == true) { - return true; - } - if (key_save == 0) { - iter_map_config_data = map_config_data_local.find(key); - map_config_data = map_config_data_local; - map_config_data_old = map_config_data_local_old; - } - else if (key_save == 1) { - iter_map_config_data = map_config_data_global.find(key); - map_config_data = map_config_data_global; - map_config_data_old = map_config_data_global_old; - } - iter_map_config_data = map_config_data.find(key); - iter_map_config_data_old = map_config_data_old.find(key); - if (iter_map_config_data == map_config_data.end()) { - return false; - } - else if (iter_map_config_data_old == map_config_data_old.end()) { - return false; - } - else if (iter_map_config_data->second != iter_map_config_data_old->second) { - return false; - } - else if (iter_map_config_data->second.length() == 0 || iter_map_config_data_old->second.length() == 0) { - return true; - } - else if (iter_map_config_data->second == iter_map_config_data_old->second) { - return true; - } - else { - return false; - } - return false; -} - -string MainWindow::get_ubconfig_value(string cmd){ - struct Result obj_result = this->wrapper_call(cmd); - if (obj_result.error == 0) { - return obj_result.response; - } - else { - if (obj_result.error != 0) { - warning_info-= 1; - } - return ""; - } - -} - -void MainWindow::info_warning_error(int mess) { - if (error_info > 0 || warning_info > 0) { - info_status_app(info_box_error_css); - imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); - error_info = 0; - warning_info = 0; - string mess_error = ""; - if (mess == 0) { - mess_error = string(local_read_error) + cmd_error; - lblWarning->set_text(mess_error); - } - else if (mess == 1) { - mess_error = string(global_read_error) + cmd_error; - lblWarning->set_text(mess_error); - } - else if (mess == 2) { - mess_error = string(local_write_error) + cmd_error; - lblWarning->set_text(mess_error); - } - else if (mess == 3) { - mess_error = string(global_write_error) + cmd_error; - lblWarning->set_text(mess_error); - } - else if (mess == 4) { - mess_error = string(error_save_all) + cmd_error; - lblWarning->set_text(mess_error); - } - cmd_error = ""; - } - else { - info_status_app(info_box_ok_css); - imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);//Gtk::IconSize::INHERIT); - if (mess == 0) { - lblWarning->set_text(local_load_ok); - } - else if (mess == 1) { - lblWarning->set_text(global_load_ok); - } - else if (mess == 2) { - lblWarning->set_text(local_ok_written); - } - else if (mess == 3) { - lblWarning->set_text(global_ok_written); - } - else if (mess == 4) { - lblWarning->set_text(successfully_save_all); - } - } -} - - -void MainWindow::wrapper_system(string cmd, string thread_str = "") { - string cmd_new = cmd + " " + thread_str; - int response_cmd = system(cmd_new.c_str()); - if (response_cmd != 0) { - error_info += 1; - this->log_mess_error(cmd); - } -} - -void MainWindow::log_mess_error(string &cmd){ - string key = ""; - if (map_error.find(cmd) != map_error.end()){ - cmd_error = map_error[cmd]; - } - else { - for ( const auto &map_iter: map_error ) { - key = map_iter.first; - if (cmd.find(key) != std::string::npos){ - cmd_error = map_iter.second; - break; - } - } - } -} - -void MainWindow::set_hardware_clock(string &local, string &etc) { - string str_hw = cbHw->get_active_text(); - for (int index = 0; index < 2; index++) { - if (array_hw_local[index] == str_hw){ - if (array_hw[index] == "utc") { - wrapper_system(etc, "&"); - } - else{ - wrapper_system(local, "&"); - } - } - } -} - -void MainWindow::get_hardware_clock(string cmd) { - int error = warning_info; - struct Result obj_result = this->wrapper_call(cmd); - if (obj_result.error == 0) { - this->write_config(obj_result.response, "hw"); - if (obj_result.response.find("localtime") != string::npos) { - if (array_hw[0] == "localtime"){ - cbHw->set_active(0); - } - else{ - cbHw->set_active(1); - } - - } - else if (obj_result.response.find("utc") != string::npos) { - if (array_hw[0] == "utc"){ - cbHw->set_active(0); - } - else{ - cbHw->set_active(1); - } - } - else { - cbHw->set_active(-1); - } - } - else { - this->write_config("", "hw"); - cbHw->set_active(-1); - } - if (error != warning_info){ - warning_info = error; - } - -} - -void MainWindow::hardware_clock() { - int error_hw = error_info; - string cmd = set_hwclock; - wrapper_system(cmd); - if (error_hw != error_info){ - lblWarning->set_text(hardware_clock_error); - info_status_app(info_box_error_css); - } - else { - lblWarning->set_text(hardware_clock_ok); - info_status_app(info_box_ok_css); - } -} - -void MainWindow::gui_mess_close() { - windowMessDchp->hide(); -} - -bool MainWindow::focus_ntp_text() { - if (txtNtpServer->get_text() == "" || txtNtpServer->get_text() == " ") { - lblWarning->set_text(entry_list_ntp); - info_status_app(info_box_error_css); - btnSave->set_sensitive(false); - return false; - } - else { - string cmd = ""; - string array_simvol[] = { - "!", "\"", "#", "$", "%", "^", "'", "*", "(", ")", "+", ":", ";", "=", "<", ">", "?", - "@", "[", "]", "\\", "{", "}", "|", "~", " " - }; - bool flag_error = false; - bool flag_error_check_ntp = false; - string str_ntp = txtNtpServer->get_text(); - flag_error_check_ntp = this->wrapper_check_ntp(str_ntp); - for (const auto &simvol: array_simvol) { - if (str_ntp.find(simvol) != std::string::npos) { - flag_error= true; - break; - - } - } - if ((flag_error == false) && (flag_error_check_ntp == false)) { - this->write_config(str_ntp, "dhcp"); - lblWarning->set_text(ntp_server_ok); - info_status_app(info_box_ok_css); - btnSave->set_sensitive(true); - return true; - } - else { - if (flag_error == true) { - lblWarning->set_text(invalid_character_entry); - info_status_app(info_box_error_css); - btnSave->set_sensitive(false); - } - else if (flag_error_check_ntp == true) { - lblWarning->set_text(error_ntp_name); - info_status_app(info_box_error_css); - btnSave->set_sensitive(false); - } - return false; - } - } - btnSave->set_sensitive(true); - return true; -} - -vector MainWindow::find_all(string &str_ntp, string substr) { - size_t index = 0; - vector sub_index; - while ((index = str_ntp.find(substr, index)) != std::string::npos) { - index += substr.length(); - sub_index.push_back(index); - } - return sub_index; -} - -bool MainWindow::check_is_num_ntp(string &str_ntp) { - int code_ascii = 0; - bool flag_is_num = false; - for (size_t index = 0; index < str_ntp.length(); index++) { - code_ascii = static_cast(str_ntp[index]); - if (code_ascii >= 48 && code_ascii <= 57 ) { - flag_is_num = true; - break; - } - } - return flag_is_num; -} - -bool MainWindow::check_is_string_ntp(string &str_ntp) { - int code_ascii = 0; - bool flag_is_str = false; - for (size_t index = 0; index < str_ntp.length(); index++) { - code_ascii = static_cast(str_ntp[index]); - if ((code_ascii >= 65 && code_ascii <= 90) || (code_ascii >= 97 && code_ascii <= 122)) { - flag_is_str = true; - break; - } - } - return flag_is_str; -} - -bool MainWindow::validate_ip_address(string &str_ntp) { - vector sub_index = this->find_all(str_ntp, "."); - if (sub_index.size() == 3) { - int index_str_ntp = sub_index[0]; - int index_str_ntp_1 = sub_index[1]; - int index_str_ntp_2 = sub_index[2]; - if (((index_str_ntp>0) && (index_str_ntp<=4)) && - (index_str_ntp_1>(index_str_ntp+1)) && - ((index_str_ntp_1-index_str_ntp)<=4) && - (index_str_ntp_2>(index_str_ntp_1+1)) && - ((index_str_ntp_2-index_str_ntp_1)<=4) && - ((str_ntp.length()-index_str_ntp_2)<= 3)) { - string simvol; - bool flag_error = false; - char char_ntp[1] = {0}; - for (size_t i = 0; i < str_ntp.size(); i++) { - flag_error = false; - char_ntp[0] = str_ntp[i]; - for (int index = 0; index < 11; index++) { - if (index == 10) { - simvol = "."; - } - else { - simvol = to_string(index); - } - if (simvol == char_ntp) { - flag_error=false; - break; - } - else { - flag_error = true; - } - } - if (flag_error == true) { - return true; - } - } - } - else { - return true; - } - } - else { - return true; - } - return false; -} - -bool MainWindow::validate_domen(string &str_ntp) { - vector sub_index = this->find_all(str_ntp, "."); - if (sub_index.size() != 0) { - int index_point = sub_index[sub_index.size()-1]; - int len_str_ntp = str_ntp.length(); - if (((len_str_ntp-index_point) >= 2) && (index_point > 2)) { - return false; - } - else { - return true; - } - } - else { - return true; - } - return false; -} - -bool MainWindow::check_ntp(string &str_ntp) { - bool flag_is_str = this->check_is_string_ntp(str_ntp); - bool flag_is_num = this->check_is_num_ntp(str_ntp); - if (flag_is_str) { - return this->validate_domen(str_ntp); - } - else if (flag_is_str && flag_is_num == false) { - return this->validate_ip_address(str_ntp); - } - else { - return false; - } - return false; -} - -bool MainWindow::wrapper_check_ntp(string &str_ntp) { - bool flag_check_error_ntp = false; - if (str_ntp.find(",") != string::npos) { - vector vec_ntp = split(str_ntp, ','); - for (string& str_split_ntp: vec_ntp) { - if (str_split_ntp.length() == 0) { - return true; - } - flag_check_error_ntp = this->check_ntp(str_split_ntp); - if (flag_check_error_ntp) { - return flag_check_error_ntp; - } - } - return false; - } - else { - return this->check_ntp(str_ntp); - } - return false; -} - -struct MainWindow::Result MainWindow::wrapper_call(string cmd) { - struct Result obj_result; - string response = this->call(cmd); - if ((response.find("(null)") == std::string::npos) && (response.length() != 0 )) { - if (response.find("=") != std::string::npos) { - if (response.find("\n") != std::string::npos) { - response = response.substr(response.find("\"")+1,response.length()); - response = response.substr(0,response.find("\"")); - obj_result.response = response; - obj_result.error = 0; - } - else { - obj_result.response = response; - obj_result.error = 1; - warning_info += 1; - this->log_mess_error(cmd); - } - } - else { - obj_result.response = response; - obj_result.error = 2; - warning_info += 1; - cmd_error = cmd; - this->log_mess_error(cmd); - } - } - else { - obj_result.response = response; - obj_result.error = 3; - warning_info += 1; - cmd_error = cmd; - this->log_mess_error(cmd); - } - return obj_result; -} - - - -void MainWindow::event_entry_cbDhcp() { - btnSave->set_sensitive(true); - string str_dhcp = cbDhcp->get_active_text(); - string cmd = ""; - int activ_index = cbDhcp->get_active_row_number(); - if (str_dhcp.length() == 0) { - cbDhcp->set_active(0); - this->write_config("default", "dhcp"); - } - else if (activ_index == 0) { - txtNtpServer->set_text(default_get_dhcp); - txtNtpServer->set_sensitive(false); - this->write_config("default", "dhcp"); - } - else if (activ_index == 1) { - // btnUpdateDateTime->set_sensitive(false); - txtNtpServer->set_sensitive(false); - txtNtpServer->set_text(""); - this->write_config("dhcp", "dhcp"); - } - else if (activ_index == 2) { - txtNtpServer->set_text(""); - if (flag_ntp_edit == false) { - txtNtpServer->set_sensitive(true); - txtNtpServer->grab_focus(); - string cmd = ""; - if (flag_load == false) { - cmd = get_system_NTPSERVERS; - } - else{ - cmd = get_global_NTPSERVERS; - } - string response = this->get_ubconfig_value(cmd); - if (response != "dhcp" && response != "default") { - txtNtpServer->set_text(response); - } - this->write_config(response, "dhcp"); - } - else { - this->write_config("", "dhcp"); - } - } - else if (activ_index == 3) { - this->write_config("", "dhcp"); - txtNtpServer->set_text(""); - txtNtpServer->set_sensitive(false); - // btnUpdateDateTime->set_sensitive(true); - } -} - -void MainWindow::save_Dhcp(string &cmd_default, string &cmd_dhcp, string &remove, string &cmd_set_ntp) { - int activ_index = cbDhcp->get_active_row_number(); - string str_dhcp = cbDhcp->get_active_text(); - if (str_dhcp.length() == 0) { - } - else if (activ_index == 0) { - this->write_config("default", "dhcp"); - wrapper_system(cmd_default, "&"); - } - else if (activ_index == 1) { - this->write_config("dhcp", "dhcp"); - wrapper_system(cmd_dhcp, "&"); - } - else if (activ_index == 2) { - if (flag_ntp_edit == false) { - if (this->focus_ntp_text()){ - string str_ntp = txtNtpServer->get_text(); - string cmd = cmd_set_ntp + str_ntp + "\""; - this->write_config(str_ntp, "dhcp"); - wrapper_system(cmd, "&"); - } - } - - } - else if (activ_index== 3) { - int start_error = error_info; - wrapper_system(remove, "&"); - if (start_error != error_info) { - error_info=start_error; - } - this->write_config("", "dhcp"); - } -} - -void MainWindow::entry_dhcp_mess(string cmd_get_dhcp, string cmd_default_get_dhcp) { - string cmd = cmd_get_dhcp; - struct Result obj_result = this->wrapper_call(cmd); - if (obj_result.error == 0) { - string str_dhcp = obj_result.response; - // btnUpdateDateTime->set_sensitive(false); - str_dhcp = str_dhcp.substr(str_dhcp.find("=")+1, str_dhcp.length()); - str_dhcp = str_dhcp.substr(0, str_dhcp.find("\n")); - if (str_dhcp == "dhcp") { - this->write_config("dhcp", "dhcp"); - cbDhcp->set_active(1); - txtNtpServer->set_text(""); - txtNtpServer->set_sensitive(false); - } - else if (str_dhcp == "default") { - // btnUpdateDateTime->set_sensitive(false); - cbDhcp->set_active(0); - cmd = cmd_default_get_dhcp; - struct Result obj_result = this->wrapper_call(cmd); - this->write_config("default", "dhcp"); - txtNtpServer->set_sensitive(false); - if (obj_result.error== 0) { - txtNtpServer->set_text(obj_result.response); - } - else { - if (obj_result.error== 2) { - warning_info-= 1; - } - } - } else if (str_dhcp == "stop") { - this->write_config("stop", "dhcp"); - cbDhcp->set_active(3); - txtNtpServer->set_text(""); - txtNtpServer->set_sensitive(false); - } else { - // btnUpdateDateTime->set_sensitive(false); - if (str_dhcp == "") { - this->write_config("", "dhcp"); - lblWarning->set_text(entry_list_ntp); - info_status_app(info_box_error_css); - btnSave->set_sensitive(false); - } - else if (str_dhcp == "(null)") { - cbDhcp->set_active(0); - txtNtpServer->set_text(""); - this->write_config("", "dhcp"); - } - else { - cbDhcp->set_active(2); - this->write_config(str_dhcp, "dhcp"); - txtNtpServer->set_text(str_dhcp); - if (flag_ntp_edit ==false) { - txtNtpServer->set_sensitive(true); - } - } - } - } - else { - this->write_config("", "dhcp"); - cbDhcp->set_active(0); - txtNtpServer->set_text(""); - txtNtpServer->set_sensitive(false); - // btnUpdateDateTime->set_sensitive(true); - warning_info -= 1; - } -} - -string MainWindow::str_remove(std::string& source, const std::string to_remove) { - auto begin = source.find(to_remove); - if (begin!=std::string::npos) { - int len_to_remove = to_remove.length(); - source.erase(begin, begin+len_to_remove); - } - return source; -} - -void MainWindow::get_calendar() { - string str_month = ""; - string str_day = ""; - cldrDate->get_date(year, month, day); - if (month < 10) { - str_month = "0"+ to_string(month+1); - } - else { - str_month = to_string(month+1); - } - if (day < 10) { - str_day = "0"+to_string(day); - } - else { - str_day = to_string(day); - } - string date = str_day + '.' + str_month + '.' + to_string(year); - txtDate->set_text(date); - popCalendar->hide(); -} - -void MainWindow::calendar_show() { - if (year== 0) { - time_t now = time(0); - tm *ltm = localtime(&now); - unsigned int y= 1900+ ltm->tm_year; - unsigned int m=ltm->tm_mon; - unsigned int d=ltm->tm_mday; - cldrDate->select_month(m,y); - cldrDate->select_day(d); - } - else { - cldrDate->select_month(month,year); - cldrDate->select_day(day); - - } - popCalendar->show(); -} - -void MainWindow::fill_in_reg_zone(string cmd) { - int error = warning_info; - struct Result obj_result_1 = this->wrapper_call(cmd); - if (obj_result_1.error== 0) { - auto arr_reg_zone = this->split_region_zone(obj_result_1.response); - if (arr_reg_zone[0].length() != 0) { - this->append_region_zone(arr_reg_zone[0], arr_reg_zone[1], cbRegion, cbZone); - } - else { - this->append_region_zone("", "" ,cbRegion,cbZone); - } - } - else { - this->append_region_zone("", "", cbRegion, cbZone); - } - if (obj_result_1.error == 3) { - if (error != warning_info) { - warning_info = error; - } - } -} - -void MainWindow::get_config() { - this->read_file(); - this->update_hour_minute(); - this->update_calendar(); -} - -array MainWindow::split_region_zone(string &read_reg_zon_cfg) { - array arr; - if (read_reg_zon_cfg.find("/") !=std::string::npos) { - string str_filling_reg = read_reg_zon_cfg.substr(0,read_reg_zon_cfg.find("/")); - string str_filling_zon = read_reg_zon_cfg.substr(read_reg_zon_cfg.find("/")+1,read_reg_zon_cfg.length()); - - arr[0] = str_filling_reg; - arr[1] = str_filling_zon; - } - else if (read_reg_zon_cfg.length() != 0) { - arr[0] = read_reg_zon_cfg; - arr[1] = ""; - } - else { - arr[0] = ""; - arr[1] = ""; - } - return arr; -} - - -void MainWindow::enter_zone(string &cmd) { - int activ_index_reg = cbRegion->get_active_row_number(); - if (activ_index_reg == -1) { - return; - } - string reg_text = array_region[activ_index_reg]; - int activ_index = cbZone->get_active_row_number(); - if (activ_index == -1) { - return; - } - string zone_text = ""; - if(!(reg_text.empty())) { - int index= 0; - for (const auto &zone: time_reg_map.at(reg_text)) { - if (index == activ_index) { - zone_text = zone; - } - index+= 1; - } - if (!(zone_text.empty())) { - str_zone_buff = zone_text; - str_region_buff = reg_text; - cmd = cmd + str_region_buff + "/" + str_zone_buff; - wrapper_system(cmd, "&"); - } - else { - str_zone_buff = ""; - str_region_buff = ""; - } - } - else { - str_zone_buff = ""; - str_region_buff = ""; - } -} - -void MainWindow::parse_text_date() { - string data = txtDate->get_text(); - if (data.length() == 10) { - string day = data.substr(0, 2); - string month1 = data.substr(3, 2); - string year = data.substr(6,data.length()); - } -} - -void MainWindow::append_region_zone(string region, string zone, Gtk::ComboBoxText *tmpCbReg, Gtk::ComboBoxText *tmpCbZone) { - this->write_config(region, "region"); - this->write_config(zone, "zone"); - str_region_buff = region; - int index = 0; - Glib::ustring reg_local = ""; - int size_vec = array_region_local.size(); - if (size_vec== 0) { - for (auto& [key, value]: time_reg_map) { - array_region_local.push_back(string(_(key.c_str()))); - array_region.push_back(key); - index += 1; - } - } - // Cортировка пузырьком - if (size_vec == 0) { - int size_vec_sort = array_region_local.size(); - for (int i = 0; i < size_vec_sort; i++) { - for (int j = 0; j < size_vec_sort-1; j++) { - if (array_region_local[j] > array_region_local[j + 1]) { - auto b = array_region_local[j]; - array_region_local[j] = array_region_local[j + 1]; - array_region_local[j + 1] = b; - b = array_region[j]; - array_region[j] = array_region[j + 1]; - array_region[j + 1] = b; - } - } - } - } - - for (string ® : array_region_local) { - if (size_vec == 0) { - tmpCbReg->append(Glib::ustring(reg)); - } - if (reg == string(_(region.c_str()))) { - tmpCbReg->set_active_text(reg); - } - } - tmpCbZone->remove_all(); - index = 0; - string zone_mixing = ""; - string path_reg_zone = ""; - string zone_offest = ""; - path_reg_zone = region + "/" + zone; - zone_offest = this->zone_file_read(path_reg_zone) + _(zone.c_str()); - if (region == "") { - tmpCbZone->append(" "); - tmpCbZone->set_active(0); - tmpCbReg->set_active(-1); - return; - } - if (time_reg_map_local.find(region) == time_reg_map_local.end()) { - tmpCbZone->append(" "); - tmpCbZone->set_active(0); - tmpCbReg->set_active(-1); - } - else { - for (string &_str_zone: time_reg_map_local.at(region)) { - tmpCbZone->append(_str_zone); - if (_str_zone != "") { - if (zone_offest == _str_zone) { - tmpCbZone->set_active(index); - } - } - index+= 1; - } - } - if (region == "Etc" && zone == "") { - warning_info -= 1; - tmpCbZone->set_active(index); - } - else if (region == "" && zone== "") { - warning_info += 1; - int error = warning_info; - if (warning_info != error) { - warning_info = error; - } - } - -} - -string MainWindow::call(string cmd) { - FILE *fp; - int status; - char path[PATH_MAX] = {0}; - fp = popen(cmd.c_str(), "r"); - if (fp == NULL) { - exit(1); - } - while (fgets(path, PATH_MAX, fp) != NULL) { - break; - } - status = pclose(fp); - if (status == -1) { - exit(1); - } - return path; -} - -void MainWindow::append_zone() { - - cbZone->remove_all(); - int index = cbRegion->get_active_row_number(); - if (index!=-1) { - string str_region_buff = array_region[index]; - string zone_mixing = ""; - this->write_config(str_region_buff, "region"); - string path_dir = ""; - if(str_region_buff.length() != 0) { - for (const auto &_str_zone : time_reg_map_local.at(str_region_buff)) { - cbZone->append(Glib::ustring(_str_zone)); - } - } - cbZone->set_active(0); - } -} - -void MainWindow::update_time_date() { - bool flag_error_time = false; - string cmd = ""; - string response = ""; - if (((year != 0) && (month != 0) && (day != 0))) { - string str_month = ""; - string str_day = ""; - month += 2; - if (month < 10) { - str_month = "0"+to_string(month); - } - else { - str_month = to_string(month); - } - if (day < 10) { - str_day = "0" + to_string(day); - } - else { - str_day = to_string(day); - } - string str_data = ""; - str_data = str_day + "." + str_month + "." + to_string(year); - string str_data_entry = txtDate->get_text(); - if (str_data == str_data_entry) { - cmd = "date +%Y%m%d -s \"" + to_string(year)+ - str_month + str_day + "\""; - wrapper_system(cmd); - txtDate->set_text(str_data); - year = 0; - month = 0; - day = 0; - lblWarning->set_text(date_time_ok_synchronized); - info_status_app(info_box_ok_css); - flag_error_time = false; - } - else { - flag_error_time = this->post_entry_data(); - year = 0; - month = 0; - day = 0; - } - } - else { - flag_error_time = this->post_entry_data(); - year = 0; - month = 0; - day = 0; - } - if (flag_error_time == false) { - lblWarning->set_text(date_time_ok_synchronized); - info_status_app(info_box_ok_css); - hour = numTimeHrs->get_value_as_int(); - minute = numTimeMin->get_value_as_int(); - time_t now = time(0); - tm *ltm = localtime(&now); - cmd = "date +%T -s \"" + - to_string(hour) + ":" + to_string(minute) - + ":" + to_string(ltm->tm_sec) +"\""; - wrapper_system(cmd); - } - -} - -bool MainWindow::post_entry_data() { - string cmd = ""; - string data = txtDate->get_text(); - if (data.length() == 10) { - string str_day = data.substr(0,2); - string str_month = data.substr(3,2); - string str_year = data.substr(6,data.length()); - cmd = "date +%Y%m%d -s \"" + str_year+ - str_month+str_day+"\""; - string str_error_clock = this->call(cmd); - size_t index = str_error_clock.find("date:"); - if (index != std::string::npos) { - lblWarning->set_text(incorrect_date_f); - info_status_app(info_box_error_css); - return true; - } - else { - lblWarning->set_text(date_time_ok_synchronized); - info_status_app(info_box_ok_css); - return false; - } - } - else { - lblWarning->set_text(incorrect_date_f); - info_status_app(info_box_error_css); - return true; - } -} - -void MainWindow::update_hour_minute() { - time_t now = time(0); - tm *ltm = localtime(&now); - numTimeHrs->set_value(ltm->tm_hour); - numTimeMin->set_value(ltm->tm_min); -} - -void MainWindow::update_calendar() { - time_t now = time(0); - tm *ltm = localtime(&now); - int year1 = 1900 + (int)ltm->tm_year; - string str_month = ""; - string str_day = ""; - unsigned int month, day; - month=ltm->tm_mon+1; - day=ltm->tm_mday; - if (month <= 10) { - str_month = "0" + to_string(month); - } - else { - str_month = to_string(month); - } - if (day < 10) { - str_day = "0" + to_string(day); - } - else { - str_day = to_string(day); - } - string date = str_day + '.' + str_month + '.' + to_string(year1); - txtDate->set_text(date); -} - -void MainWindow::read_file() { - std::string line; - string key_zone_local = ""; - string path_reg_zone = ""; - namespace fs = std::filesystem; - for (const auto & entry : fs::directory_iterator("/usr/share/zoneinfo/")) { - std::ifstream in(entry.path()); - if (in.is_open()) { - string key_reg = entry.path().filename().string(); - string path_dir = "/usr/share/zoneinfo/" + key_reg; - if (fs::is_directory(path_dir)) { - if (key_reg != "Pacific") { - if (key_reg != "posix") { - if (key_reg != "right") { - vector zone; - vector zone_local; - for (const auto & entry_zone : fs::directory_iterator(path_dir)) { - std::ifstream in1(entry_zone.path()); - if (in1.is_open()) { - string key_zone = entry_zone.path().filename().string(); - if (fs::is_directory(path_dir + "/" + key_zone)) { - string reg_reg_zone = path_dir + "/" + key_zone; - for (const auto & entry_reg_reg_zone : fs::directory_iterator(reg_reg_zone)) { - std::ifstream in2(entry_zone.path()); - if (in2.is_open()) { - string reg_reg_zone = entry_reg_reg_zone.path().filename().string(); - zone.push_back(reg_reg_zone); - path_reg_zone=key_reg + "/" + reg_reg_zone; - key_zone_local = this->zone_file_read(path_reg_zone) + _(reg_reg_zone.c_str()); - zone_local.push_back(key_zone_local); - } - in2.close(); - } - } - 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()); - zone_local.push_back(key_zone_local); - } - } - in1.close(); - } - this->sort_zone(&zone_local, &zone); - time_reg_map.insert({key_reg, zone}); - time_reg_map_local.insert({key_reg, zone_local}); - }}} - } - } - in.close(); - } -} - -void MainWindow::sort_zone(vector *time_reg_map_local,vector *time_reg_map) { - string str_j = ""; - int j_i; - string str_j_1 = ""; - int j_i_1; - int size_vec = time_reg_map_local->size(); - for (int i = 1; i < size_vec; i++) { - for (int j = 1; j < size_vec-1; j++) { - str_j=(*time_reg_map_local)[j]; - if (str_j != " ") { - str_j = str_j.substr(5,str_j.find(")")-5); - if (str_j[1] == '0') { - str_j.replace(1,1, "0"); - } - - if (str_j.find("+") != std::string::npos) { - str_j.replace(0,1, "+"); - j_i = stoi(str_j); - } - else { - str_j.replace(0,1, "-"); - j_i = stoi(str_j); - j_i=-j_i; - } - str_j_1=(*time_reg_map_local)[j+1]; - str_j_1 = str_j_1.substr(5,str_j_1.find(")")-5); - if (str_j_1[1]=='0') { - str_j_1.replace(1,1, "0"); - } - if (str_j_1.find("+") != std::string::npos) { - str_j_1.replace(0,1, "+"); - j_i_1 = stoi(str_j_1); - } - else { - str_j_1.replace(0, 1, "-"); - j_i_1 = stoi(str_j_1); - j_i_1 = -j_i_1; - } - if (j_i > j_i_1) { - string b = (*time_reg_map_local)[j]; - (*time_reg_map_local)[j] = (*time_reg_map_local)[j + 1]; - (*time_reg_map_local)[j + 1] = b; - - b = (*time_reg_map)[j]; - (*time_reg_map)[j] = (*time_reg_map)[j + 1]; - (*time_reg_map)[j + 1] = b; - } - } - } - } -} - -string MainWindow::zone_file_read(string zone) { - if (zone.length() == 1) { - return ""; - } - UErrorCode success = U_ZERO_ERROR; - UDate curDate; - int32_t stdOffset,dstOffset; - U_ICU_NAMESPACE::TimeZone *tzWest = U_ICU_NAMESPACE::TimeZone::createTimeZone(zone.c_str()); - U_ICU_NAMESPACE::Calendar* calendar = U_ICU_NAMESPACE::Calendar::createInstance(success); - curDate = calendar->getNow(); - tzWest->getOffset(curDate,true,stdOffset,dstOffset,success); - int offset = stdOffset/(1000 * 60 * 60); - string str_utc = ""; - if (offset >= 0) { - if (offset <=9) { - str_utc = "(UTC +0" + to_string(offset) + ") "; - } - else { - str_utc = "(UTC +" + to_string(offset) + ") "; - } - - } - else { - if (offset >= -9) { - offset *= -1; - str_utc = "(UTC -0" + to_string(offset) + ") "; - } - else { - str_utc = "(UTC " + to_string(offset) + ") "; - } - } - delete calendar; - delete tzWest; - return str_utc; -} - -MainWindow::~MainWindow() { -} - -vector MainWindow::split(const std::string &s, char delim) { - std::stringstream ss(s); - std::string item; - std::vector elems; - while (std::getline(ss, item, delim)) { - elems.push_back(item); - } - return elems; -} - -SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr builder) - :Gtk::Plug{p_socketID} { - MainWindow* wnd = nullptr; - builder->get_widget_derived("window", wnd); - builder->get_widget("plugBox", plugBox); - plugBox->get_parent()->remove(*plugBox); - add(*plugBox); - show_all_children(); -} - -void help() { - string version = string(str_version) + version_application + "\n"; - cout << version.c_str();; - cout << str_help_h; - -} - diff --git a/source/ubl-settings-datetime.h b/source/ubl-settings-datetime.h index 2092f6e..ed7c714 100644 --- a/source/ubl-settings-datetime.h +++ b/source/ubl-settings-datetime.h @@ -1,378 +1,139 @@ -#ifndef UBL_SETTINGS_DATETIME_H -#define UBL_SETTINGS_DATETIME_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include "ubl-util-standard.c" -#include "../compile/ubl-cmake.h" +#include +#include +#include +#include +#include +#include +#include +#include #ifdef WEBKIT_FOUND + #include +#endif +#include "ubl-strings.h" -#include -#endif - - -#define const_link_doc "https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-datetime" -#define cmd_xdg "xdg-open " -#define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \"" -#define get_NTPSERVERS_DEFAULT "ubconfig --source default get [] NTPSERVERS_DEFAULT" -#define get_global_NTPSERVERS "ubconfig --default --source global get network NTPSERVERS" -#define get_system_ZONE "ubconfig --default --source system get clock ZONE" -#define get_system_NTPSERVERS "ubconfig --default --source system get network NTPSERVERS" -#define get_system_HWCLOCK_SYNC "ubconfig --default --source system get clock HWCLOCK_SYNC" -#define get_global_ZONE "ubconfig --default --source global get clock ZONE" -#define get_global_HWCLOCK_SYNC "ubconfig --source global get clock HWCLOCK_SYNC" -#define set_system_ZONE "ubconfig --target system set clock ZONE=" -#define set_global_HWCLOCK_SYNC_utc "ubconfig --target global --noexecute set clock HWCLOCK_SYNC=utc" -#define set_global_HWCLOCK_SYNC_localtime "ubconfig --target global --noexecute set clock HWCLOCK_SYNC=localtime" -#define set_system_HWCLOCK_SYNC_localtime "ubconfig --target system set clock HWCLOCK_SYNC=localtime" -#define set_system_HWCLOCK_SYNC_utc "ubconfig --target system set clock HWCLOCK_SYNC=utc" -#define remove_global_NTPSERVERS "ubconfig --target global --noexecute remove network NTPSERVERS" -#define set_system_NTPSERVERS_default "ubconfig --target system set network NTPSERVERS=default" -#define set_system_NTPSERVERS_dhcp "ubconfig --target system set network NTPSERVERS=dhcp" -#define set_system_NTPSERVERS "ubconfig --target system set network NTPSERVERS=\"" -#define remove_system_NTPSERVERS "ubconfig --target system remove network NTPSERVERS" -#define set_global_ZONE "ubconfig --target global --noexecute set clock ZONE=" - -#define set_all_ZONE "ubconfig set clock ZONE=" -#define set_all_NTPSERVERS_default "ubconfig set network NTPSERVERS=default" -#define set_all_NTPSERVERS_dhcp "ubconfig set network NTPSERVERS=dhcp" -#define set_all_NTPSERVERS "ubconfig set network NTPSERVERS=\"" -#define remove_all_NTPSERVERS "ubconfig remove network NTPSERVERS" -#define set_all_HWCLOCK_SYNC_localtime "ubconfig set clock HWCLOCK_SYNC=localtime" -#define set_all_HWCLOCK_SYNC_utc "ubconfig set clock HWCLOCK_SYNC=utc" - -#define set_global_NTPSERVERS_default "ubconfig --target global --noexecute set network NTPSERVERS=default" -#define set_global_NTPSERVERS_dhcp "ubconfig --target global --noexecute set network NTPSERVERS=dhcp" -#define set_global_NTPSERVERS "ubconfig --target global --noexecute set network NTPSERVERS=\"" -#define set_hwclock "hwclock --systohc" -#define icon_checked "com.ublinux.ubl-settings-datetime.checked" -#define icon_warning "com.ublinux.ubl-settings-datetime.warning" -#define get_global_defalult_HWCLOCK_SYNC "ubconfig --default --source global get clock HWCLOCK_SYNC" -#define path_app "/usr/bin/" -#define path_glade "/com/ublinux/ui/ubl-settings-datetime.glade" -#define app_name "ubl-settings-datetime" -#define path_locale "/usr/share/locale/" -#define path_css "/com/ublinux/css/ubl-settings-datetime.css" -#define path_img_head_background "/com/ublinux/images/ubl-settings-datetime-banner.png" - - -#include -#define copyright _("Copyright © UBSoft LLC, 2022 - ") -#define name_app _("ubl-settings-datetime") -#define website _("https://wiki.ublinux.com") -#define home_page _("Project Home Page") -#define str_about_1 _("About") -#define str_about _("About ubl-settings-datetime") -#define str_help _("Help") -#define str_save _("Save") -#define str_load _("Load") -#define save_all _("Save in global and local configuration") -#define save_local _("Save in local configuration") -#define save_global _("Save in global configuration") -#define load_global _("Load global configuration") -#define load_local _("Load local configuration") -#define read_online _("Read online") -#define cancel _("Cancel") -#define always_redirect _("Always redirect") -#define nothing_save _("Nothing to save!") -#define read_documentation_web _("Would you like to read documentation in the Web?") -#define redirected_documentation _("You will be redirected to documentation website where documentation is\n""translated and supported by community.") -#define str_help_h _("Setting up the date and time for UBLinux\n\n""Usage: ubl-settings-datetime [OPTIONS...]\n""Options:\n"" -h, --help Show this help\n"" -V, --version Show package version\n"" --lock-datetime Lock date and time changes\n"" --lock-timezone Lock time zone changes\n"" --lock-ntp-mode Lock NTP mode selection\n"" --lock-ntp-edit Lock editing NTP servers\n"" --lock-sync-hwclock Lock sync hwclock mode selection\n"" --lock-save Lock saving local and global configuration\n"" --lock-save-local Lock save global configuration\n"" --lock-save-global Lock load global configuration\n"" --lock-load-global Lock load global configuration\n") -#define str_version _("ubl-settings-datetime version: ") -#define local_read_error _("Local configuration reading error") -#define global_read_error _("Global configuration read error") -#define local_write_error _("Local configuration write error") -#define global_write_error _("Global configuration write error") -#define error_save_all _("Error saved local and global configuration") -#define local_load_ok _("Local configuration downloaded successfully") -#define global_load_ok _("Global configuration downloaded successfully") -#define local_ok_written _("Local configuration successfully written") -#define global_ok_written _("Global configuration successfully written") -#define successfully_save_all _("Successfully saved local and global configuration") - -#define incorrect_date_f _("Incorrect date format") -#define date_time_ok_synchronized _("Date and time are successfully synchronized") -#define entry_list_ntp _("Enter a list of NTP servers") -#define error_ntp_name _("Error in the NTP server name") -#define invalid_character_entry _("An invalid character is entered") -#define ntp_server_ok _("NTP server name is correct") -#define hardware_clock_ok _("Hardware clock successfully synchronized") -#define hardware_clock_error _("Hardware clock synchronization error") - -#define no_recognized _("Argument not recognized\n") -#define program_as_root _("The program must be run as root") -#define str_date_flag _(": \"Date\"") -#define str_time_zone_flag _(": \"Time Zone\"") -#define str_hardware_time_flag _(": \"Hardware time\"") -#define str_NTP_flag _(": \"NTP\"") -#define str_default _("Default") -#define str_DHCP _("DHCP") -#define str_manual _("Manual") -#define str_disabled _("Disabled") -#define str_time _("Time:") -#define str_date_time _("Date and Time") -#define utc_time _("UTC time") -#define str_local_time _("Local time") -#define str_attention _("Attention") -#define str_sync_by _("Sync by") -#define str_zone _("Zone:") -#define str_region _("Region:") -#define str_time_zone _("Time zone") -#define str_date _("Date:") -#define synchronize_hw _("Synchronize hardware time") -#define setting_date_time _("Setting the system date and time") -#define current_date_time _("Current date and time") -#define data_format_d_m_y _("Date of\nFormat: DD.MM.YYYY") -#define synchronize_ntp _("Synchronize via NTP") -#define enter_name_ntp_tooltip _("Enter the name of the ntp-server or its ip-address.\nWhen entering multiple addresses, separate them with commas.") -#define info_box_ok_css "boxInfoMessOK" -#define info_box_error_css "boxInfoMessError" - -using namespace std; -extern bool flag_datetime; -extern bool flag_timezone; -extern bool flag_ntp_mode; -extern bool flag_ntp_edit; -extern bool flag_save; -extern bool flag_save_local; -extern bool flag_save_global; -extern bool flag_load_global; -extern bool flag_sync_hwclock; -extern int socket_ext_id_I; -extern int socket_trd_id_I; -extern string version_application; - -class MainWindow : public Gtk::ApplicationWindow { - public: - Glib::RefPtr builder; - Gtk::Button *btnUpdateDateTime; - Gtk::Button *btnChooseDate; - Gtk::Button *btnMessClose; - Gtk::ComboBoxText *cbDhcp; - Gtk::SpinButton *numTimeHrs; - Gtk::SpinButton *numTimeMin; - Gtk::Box *boxColor; - Gtk::ComboBoxText *cbRegion; - Gtk::ComboBoxText *cbZone; - Gtk::Window *windowMessDchp; - Gtk::Popover *popCalendar; - Gtk::Calendar *cldrDate; - Gtk::Label *lblMessage; - Gtk::Label *lblDateTimeSetting; - Gtk::Label *lblHead; - Gtk::Label *lblTime; - Gtk::Label *lblData; - Gtk::Label *lblTimeZone; - Gtk::Label *lblReg; - Gtk::Label *lblZone; - Gtk::Label *lblSynchronizebChk; - Gtk::Label *lblSynchronizebChkGLob; - Gtk::Label *lblSynchronizeBtn; - Gtk::Label *lblTimeBios; - Gtk::Label *lblSave; - Gtk::Label *lblLoad; - Gtk::Button *btnHardwareTime; - Gtk::CheckButton *cbxSynchronizeNtp; - Gtk::Entry *txtNtpServer; - Gtk::Entry *txtDate; - Gtk::Button *btnLoad; - Gtk::Button *btnSave; - Gtk::Button *btnSettings; - Gtk::AboutDialog *aboutWindows; - Gtk::ButtonBox *btnBoxAboutDialog; - Gtk::Box *boxWidgetFunc; - Gtk::Box *boxInfoError; - Gtk::Label *lblWarning; - Gtk::Image *imgInfo; - std::map > time_reg_map; - std::map > time_reg_map_local; - Gtk::MenuItem *btnSaveLocalGlob; - Gtk::MenuItem *btnSaveLocal; - Gtk::MenuItem *btnSaveGlob; - Gtk::MenuItem *btnLoadGlob; - Gtk::MenuItem *btnLoadLocal; - Gtk::MenuItem *btnAbout; - Gtk::MenuItem *btnhelp; - Gtk::HeaderBar *headerBar; - Gtk::Label *lblHeader; - Gtk::Label *lblHW; - Gtk::ComboBoxText *cbHw; - Gtk::Box *boxDateTime; - Gtk::Widget *boxButton; - Gtk::Widget *boxSave; - Gtk::Widget *standartHead; - Gtk::Widget *plugBox; - Gtk::Window *window; - Gtk::Image *imgLoad; - Gtk::Image *imgSave; - Gtk::Image *imgSettings; - Gtk::Overlay *overHead; - Gtk::Image *imgHeadBackground; - Gtk::Label *headInfoLabel; - Gtk::Label *lblHeadeWndWeb; - Gtk::Label *lblHeaderAboutTopic; - - Gtk::Label *lblwebHeaderName; - Gtk::Label *lblhelpText; - Gtk::Label *lblhelpHeader; - Gtk::CheckButton *chkAlwaysOpenHelp; - Gtk::Button *btnReadHelp; - Gtk::Button *btnCancelHelp; - Gtk::Window *wndShowWeb; - bool flag_open_browser = false; - #ifdef WEBKIT_FOUND - Gtk::Window *wndWeb; - Gtk::Widget *three; - WebKitWebView *my_web_kit = NULL; - #endif - string array_hw[2]; - string array_hw_local[2]; - bool flag_load = false; - unsigned int year = 0; - unsigned int month = 0; - unsigned int day = 0; - string default_get_dhcp = ""; - int error_info = 0; - int warning_info = 0; - string cmd_error = ""; - int index_error = 0; - int flag_local_global_load = 2; - int hour; - int minute; - string str_region_buff = ""; - string str_zone_buff = ""; - string global_lick_doc = ""; - int count_edit = 0; - bool flag_global = false; - bool flag_local = false; - bool flag_global_local = false; - template - struct Result{ - Type response; - int error; - }; - vector array_region_local; - vector array_region; - std::map map_error; - - std::map map_config_data_global; - std::map map_config_data_local; - std::map map_config_data_global_local; - std::map map_config_data_global_old; - std::map map_config_data_local_old; - std::map map_config_data_global_local_old; - - - - public: - MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder); - MainWindow(Glib::RefPtr const& builder); - ~MainWindow(); - void open_browser(); - void log_mess_error(string &cmd); - void set_hardware_clock(string &local, string &etc); - void info_warning_error(int mess); - void help_show(); - void temp_help_show(); - void open_help(); - void get_hardware_clock(string cmd); - void save_global_local_cfg(); - void fill_in_reg_zone(string cmd); - void load_globl_cfg(); - void save_local_cfg(); - void template_open_browser(string link_doc); - void event_zone(); - bool focus_ntp(GdkEventFocus* event); - bool check_config(string key, int key_save); - void event_log_hw(); - void write_config(string data, string key); - string get_ubconfig_value(string cmd); - void save_global_cfg(); - void save_Dhcp(string &cmd_default, string &cmd_dhcp, string &remove, string &cmd_set_ntp); - void load_local_cfg(); - bool post_entry_data(); - void lacalization(); - void settings(); - void flag_block_gui(); - void add_CSS(); - bool check_is_string_ntp(string &str_ntp); - bool check_is_num_ntp(string &str_ntp); - void get_builder(); - void event(); - bool wrapper_check_ntp(string &str_ntp); - bool validate_domen(string &str_ntp); - bool validate_ip_address(string &str_ntp); - void gui_mess_close(); - bool focus_ntp_text() ; - void event_entry_cbDhcp(); - void get_calendar(); - void calendar_show(); - void entry_dhcp_mess(string cmd_get_dhcp, string cmd_default_get_dhcp); - void get_config(); - void enter_zone(string &cmd); - void set_ntp_toggle(); - void append_region_zone(string region, string zone, Gtk::ComboBoxText *tmpCbReg, Gtk::ComboBoxText *tmpCbZone); - string call(string cmd); - void append_zone(); - void append_zone_glob(); - void update_time_date(); - void bubble_sort(string arr[],string arr_local[], int len_arr); - void update_hour_minute(); - void update_calendar(); - void read_file(); - void parse_text_date(); - void hardware_clock(); - void set_ntp_toggle_glob(); - void wind_close_ntp(); - void wrapper_system(string cmd, string thread_str); - void info_status_app(string stule); - void wrapper_update_time_date(); - string zone_file_read(string zone); - void sort_zone(vector *time_reg_map_local,vector *time_reg_map); - array split_region_zone(string &read_reg_zon_cfg); - string str_remove(std::string& source, const std::string to_remove); - vector split(const std::string &s, char delim); - struct Result wrapper_call(string cmd); - bool check_ntp(string &str_ntp); - vector find_all(string &str_ntp, string substr); - - -}; - - -class CmdArgParser : public Glib::OptionGroup { -public: - CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help); - ::Window GetSocketID() const; -private: - int m_socketID = 0; - -}; -class SettingsPlug : public Gtk::Plug{ -public: - Gtk::Window *window; - SettingsPlug(::Window p_socketID, Glib::RefPtr builder); - -private: - Gtk::Widget *plugBox; - Gtk::Widget *parent; -}; - -void wrapper_help_show(GtkWidget *self, char* link, gpointer user_data); -void help(); -#endif +#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-TEMPLATE" + +#define _(String) gettext(String) + +#define glade_path "/com/ublinux/ui/ubl-settings-datetime.glade" +#define banner_path "/com/ublinux/images/ubl-settings-datetime-banner.png" +#define CssPath "/com/ublinux/css/ubl-settings-datetime.css" +#define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) + +#define LocalePath "/usr/share/locale" +#define LocaleName "ubl-settings-datetime" + +#define icon_name "com.ublinux.ubl-settings-datetime" + +#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get clock HWCLOCK_SYNC ZONE","; ", "ubconfig --source ",target," get et network NTPSERVERS",NULL) +#define config_get_local_command "ubconfig --source system get clock HWCLOCK_SYNC ZONE", "ubconfig --source system get network NTPSERVERS" +#define config_get_global_command "ubconfig --source global get clock HWCLOCK_SYNC ZONE", "ubconfig --source global get network NTPSERVERS" +#define config_get_default_command "ubconfig --source default get clock ZONE HWCLOCK_SYNC" + +#define config_get_global_only_parameters "" +#define config_get_local_only_parameters "" + +#define NTPSERVERS_parameter "NTPSERVERS" +#define NTPSERVERS_parameter_command "ubconfig --source global get network NTPSERVERS" +#define HWCLOCK_SYNC_parameter "HWCLOCK_SYNC" +#define HWCLOCK_SYNC_parameter_command "ubconfig --source global get clock HWCLOCK_SYNC" +#define ZONE_parameter "ZONE" +#define ZONE_parameter_command "ubconfig --source global get clock ZONE" + +#define time_sync_command(time) yon_char_unite("date +%T -s \"",time,"\"",NULL) +#define date_sync_command(date) yon_char_unite("date +%Y%m%d -s \"",date,"\"",NULL) + +#define hardware_datetime_sync_command "hwclock --systohc" + +#define zone_path "/usr/share/zoneinfo/" + +typedef char* string; +string version_application; + +char *local; + +typedef struct { + template_config_fields + +} config; + +typedef struct { + template_window_fields + GtkWidget *HourSpin; + GtkWidget *MinuteSpin; + GtkWidget *DateEntry; + GtkWidget *DateButton; + GtkWidget *SyncButton; + GtkWidget *SyncHardwareButton; + GtkWidget *DHCPCombo; + GtkWidget *NTPEntry; + GtkWidget *TimeSyncTypeCombo; + GtkWidget *RegionCombo; + GtkWidget *ZoneCombo; + + GtkListStore *zone_list; + + GtkWidget *DatePopover; + GtkWidget *DateCalendar; + GtkWidget *DateAcceptButton; + GtkWidget *DateCancelButton; +} main_window; + + +typedef struct { + GtkWidget *Window; + GtkWidget *HeaderLabel; + + GtkWidget *AlwaysOpenCheck; + + GtkWidget *CloseButton; + GtkWidget *AcceptButton; +} documentation_confirmation_window; + +void yon_load_proceed(YON_CONFIG_TYPE type); + +void config_init(); + +void yon_main_window_complete(main_window *widgets); + +void on_region_changed(GtkComboBox *self, main_window *widgets); + +void yon_interface_update(main_window *widgets); + +void *on_sync_error(void*); + +void *yon_sync_hardware_thread_start(void*); +void *yon_sync_thread_start(void*); + +void on_sync_hardware_clicked(); +void on_sync_clicked(GtkWidget *, main_window *widgets); + +void on_ntp_sync(GtkWidget *, main_window *widgets); + +void yon_save_parameters(main_window *widgets); + +void on_config_save(GtkWidget *, main_window *widgets); + +void on_config_save_global(GtkWidget *, main_window *widgets); + +void on_config_save_local(GtkWidget *, main_window *widgets); + +void on_config_save_custom(GtkWidget *, main_window *widgets); + +void on_config_load_global(); + +void on_config_load_local(); + +void on_config_load_custom(); + +void yon_load_proceed(YON_CONFIG_TYPE type); + +void on_date_clicked(GtkWidget *,main_window *widgets); + +void on_date_accept(GtkWidget *,main_window *widgets); + +void on_date_cancel(GtkWidget *, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-settings-datetime.h.in b/source/ubl-settings-datetime.h.in deleted file mode 100644 index 17ba454..0000000 --- a/source/ubl-settings-datetime.h.in +++ /dev/null @@ -1 +0,0 @@ -#cmakedefine WEBKIT_FOUND \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h new file mode 100644 index 0000000..e8e7547 --- /dev/null +++ b/source/ubl-strings.h @@ -0,0 +1,24 @@ + +#define TITLE_LABEL _("Date and time") +#define TITLE_INFO_LABEL _("Date and time configuration") + +#define SYNC_ERROR_LABEL _("Syncronisation error") +#define EMPTY_IMPORTANT_LABEL _("Important field is empty") + +#define ACCEPT_LABEL _("Accept") +#define CANCEL_LABEL _("Cancel") +#define CURRENT_DATETIME_LABEL _("Current date and time") +#define TIME_LABEL _("Time:") +#define DATE_LABEL _("Date:") +#define SYNC_LABEL _("Synchronize") +#define SYNC_HARDWARE_BUTTON_LABEL _("Synchronize hardware time") +#define SYNC_HARDWARE_LABEL _("Synchronize hardware time:") +#define SYNC_NTP_LABEL _("Synchronize via NTP") +#define DEFAULT_LABEL _("Default") +#define STOPPED_LABEL _("Stopped") +#define MANUAL_LABEL _("Manual") +#define MANUAL_TOOLTIP_LABEL _("Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces.") +#define TIME_ZONE_LABEL _("Time Zone") +#define REGION_LABEL _("Region:") +#define ZONE_LABEL _("Zone:") +#define LOCAL_TIME_LABEL _("Local time") \ No newline at end of file diff --git a/source/ubl-util-standard.c b/source/ubl-util-standard.c deleted file mode 100644 index 3b753b1..0000000 --- a/source/ubl-util-standard.c +++ /dev/null @@ -1,91 +0,0 @@ -#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()); - {GdkScreen *screen = gtk_widget_get_screen(plug); - gtk_widget_set_app_paintable(plug,TRUE); - GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); - gtk_widget_set_visual(plug, colormap);} - {GdkScreen *screen = gtk_widget_get_screen(toplug); - gtk_widget_set_app_paintable(toplug,TRUE); - GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); - gtk_widget_set_visual(toplug, colormap);} - 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)); - gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim"); - gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim"); - gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar"); - } - if (right_plug_id>0&&RightWidget){ - GtkWidget *plug=gtk_plug_new(right_plug_id); - GtkWidget *toplug=GTK_WIDGET(RightWidget->gobj()); - {GdkScreen *screen = gtk_widget_get_screen(plug); - gtk_widget_set_app_paintable(plug,TRUE); - GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); - gtk_widget_set_visual(plug, colormap);} - {GdkScreen *screen = gtk_widget_get_screen(toplug); - gtk_widget_set_app_paintable(toplug,TRUE); - GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); - gtk_widget_set_visual(toplug, colormap);} - 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)); - gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim"); - gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim"); - gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar"); - } -} -#endif \ No newline at end of file diff --git a/source/ubl-util-standard.h b/source/ubl-util-standard.h deleted file mode 100644 index 3209625..0000000 --- a/source/ubl-util-standard.h +++ /dev/null @@ -1,20 +0,0 @@ -#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.glade b/ubl-settings-datetime.glade index adb26c4..74fb941 100644 --- a/ubl-settings-datetime.glade +++ b/ubl-settings-datetime.glade @@ -3,1167 +3,322 @@ - - False - Внимание! - com.ublinux.ubl-settings-datetime - dialog - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - - - True - False - 5 - 5 - 5 - 5 - 5 - 50 - gtk-dialog-warning - - - True - True - 0 - - - - - 160 - True - False - start - center - 5 - 5 - Enter DHCP ! - - - True - True - 1 - - - - - False - True - 1 - - - - - OK - True - True - True - 5 - 5 - 5 - 5 - 3 - 3 - - - False - True - 1 - - - - - - - False - False - True - center - com.ublinux.ubl-settings-datetime - dialog - True - ubl-settings-datetime - 1.0 - Copyright © 2022 - 2023, UBSoft LLC - Date and Time - https://ublinux.ru/ - Project Home Page - Это приложение распространяется без каких-либо гарантий. -Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. - UBGroup - UBGroup - com.ublinux.ubl-settings-datetime - True - gpl-2-0 - - - True - False - vertical - 2 - - - False - end - - - False - False - 1 - - - - - - - - - - True - False - True - - - True - False - 5 - 5 - 5 - 5 - 2 - Date and Time - - - - - - - - - - True - False - - - 90 - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 69 - com.ublinux.ubl-settings-datetime - - - False - True - 0 - - - - - True - False - - - True - False - - - True - False - vertical - - - 255 - True - False - end - Date and Time - 0 - - - - - - - - True - True - 0 - - - - - 255 - True - False - start - Setting the system date and time - 0 - - - - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - True - 0 - - - - - True - True - 1 - - - - - True - False - emblem-ok-symbolic - - - True - False - process-stop-symbolic - - - 450 - False - dialog-question-symbolic - - - True - False - 5 - 5 - 5 - 5 - vertical - - - True - False - - - True - False - start - 20 - 20 - dialog-question-symbolic - 6 - - - False - True - 0 - - - - - True - False - 10 - vertical - 5 - - - True - False - start - Would you like to read documentation in the Web? - True - 0 - - - - - - - False - True - 0 - - - - - True - False - start - start - 10 - 10 - You will be redirected to documentation website where documentation is -translated and supported by community. - 0 - - - - True - True - 1 - - - - - Always redirect to online documentation - True - True - False - end - 10 - True - - - - False - True - 2 - - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - - - True - False - - - True - False - Date and Time - - - - - - - - Cancel - True - True - True - image2 - - - - - - Read Online - True - True - True - image1 - - - - end - 1 - - - - - - - True - False - False - False - 4 - - - True - False - Load global configuration - - - - - - True - False - Load local configuration - - - - - - True - False - False - False - 4 - - - True - False - Help - - - - - - True - False - About - - - + + 23 + 1 + 10 - + + 59 + 1 + 10 + + True False - False - False - 4 - - - True - False - Save configuration - - - - - - True - False - Save to global configuration - - - - - - True - False - Save to local configuration - - - + com.ublinux.libublsettingsui-gtk3.sync-symbolic - - 659 + + True + False + com.ublinux.libublsettingsui-gtk3.calendar-symbolic + + + True False - com.ublinux.ubl-settings-datetime + 5 + 5 + 5 + 5 + vertical - + True False vertical - + True False - vertical - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 25 - 1 - - - False - True - 0 - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - - - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - - - 81 - True - False - - - True - False - start - - - -1 - - - - - False - True - 0 - - - - - False - True - 1 - - + 0.019999999552965164 + in - + True False - vertical + 5 + 5 + 5 - + True False vertical + 5 - + True False - 5 - 5 - 5 - 5 - 0.019999999552965164 - in + 5 - + True False - 5 - 5 - 5 + 5 - + True False - vertical - 5 - - - True - False - 5 - - - True - False - 5 - - - True - False - Time: - True - 0 - - - False - True - 0 - - - - - True - True - 2 - 0.099999999776482579 - True - - - False - True - 1 - - - - - True - False - : - - - False - True - 2 - - - - - True - True - 2 - True - - - False - True - 3 - - - - - False - True - 0 - - - - - 20 - True - False - Date: - True - 0 - - - False - True - 4 - - - - - True - True - True - Интерактивный выбор даты - - - True - False - x-office-calendar - - - - - False - True - 5 - - - - - -1 - True - True - Date -Format: DD.MM.YYYY - - - True - True - 5 - - - - - False - True - 1 - - - - - True - False - 5 - - - 0 - True - True - True - - - True - False - center - center - - - True - False - 5 - 5 - 5 - 5 - media-playlist-repeat - - - False - True - 0 - - - - - True - False - center - center - Sync by - - - False - True - 1 - - - - - - - True - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - False - - - False - True - 2 - - - - - True - True - True - - - True - False - center - center - Synchronize hardware time - - - - - True - True - 3 - - - - - False - True - 3 - - + Time: + True + 0 + + + False + True + 0 + + + + + True + True + 2 + 0.099999999776482579 + adjustment1 + True + + + False + True + 1 + + + + + True + False + : + + False + True + 2 + + + + + True + True + 2 + adjustment2 + True + + + False + True + 3 + + + False + True + 0 + + + + + 20 + True + False + Date: + True + 0 + + + False + True + 4 + - - + + + -1 True False - Current date and time + Date +Format: DD.MM.YYYY + + + True + True + 5 + + + + + True + True + True + image2 + + False + True + 6 + False True - 0 + 1 - - - False - True - 1 - - - - - True - False - vertical - + True False - 5 - 5 - 5 - 5 - 0.019999999552965164 - in + 5 + True - + + Synchronize + 0 True - False - 5 - 5 - 5 - - - True - False - vertical - - - True - False - 5 - - - True - False - - - False - True - 1 - - - - - True - True - Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces. - center - - - True - True - 3 - - - - - False - True - 1 - - - - + True + True + image1 + + True + True + 0 + - - + + + Synchronize hardware time True - False - Synchronize via NTP + True + True + + True + True + 3 + False True - 0 + 3 - - False - True - 2 - + + + + + True + False + Current date and time + + + + + False + True + 0 + + + + + False + True + 1 + + + + + True + False + vertical + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 - + True False - 5 - 5 - 5 - 5 - 5 - 0.019999999552965164 - in + vertical - + True False - 5 - 5 - 5 + 5 - + True False - vertical - 5 - - - True - False - 5 - - - True - False - start - Synchronize hardware time: - - - False - True - 0 - - - - - True - False - False - False - - - True - True - 2 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - False - Region: - 0 - - - False - True - 2 - - - - - True - False - False - False - - - True - True - 3 - - - - - True - False - Area: - 0 - - - False - True - 4 - - - - - 5 - True - False - - - False - True - 5 - - - - - True - False - False - False - - - True - True - 5 - - - - - True - True - 1 - - + 0 + + Default + Stopped + DHCP + Manual + + + False + True + 1 + + + + + True + False + True + Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces. + center + + + True + True + 3 + - - - - True - False - Time Zone - + + False + True + 1 + - - False - True - 3 - - - False - True - 2 - + + + + True + False + Synchronize via NTP + @@ -1173,59 +328,42 @@ Format: DD.MM.YYYY + + False + True + 2 + - - + + True False - True - - - True - False - start - 5 - 5 - 5 - 5 - 1 - False - Date and Time - - - - - - - - True - False - 32 - com.ublinux.ubl-settings-datetime - - + 0.019999999552965164 + in - + True False + 5 + 5 + 5 - + True - True - False - True - True - menu - none + False + vertical + 5 True False + 5 - + True False - Load + start + Synchronize hardware time: False @@ -1234,59 +372,42 @@ Format: DD.MM.YYYY - + True False - pan-down-symbolic + False + False + 0 + + Local time + UTC + False True - 1 + end + 2 + + False + True + 0 + - - - False - True - 0 - - - - - - 1 - - - - - True - False - - - True - True - False - True - True - menu2 - none True False + 5 - + True False - Save - + False + False False @@ -1295,233 +416,274 @@ Format: DD.MM.YYYY - + True False - pan-down-symbolic + Region: + 0 False True - 1 + 0 + + + + + True + False + + + False + True + end + 2 + + + + + True + False + Zone: + 0 + + + False + True + end + 3 + + + + + 5 + True + False + + + False + True + 4 + + True + True + 1 + - - False - True - 0 - - - - - True - True - False - True - True - menu1 - none - - - True - False - open-menu-symbolic - - - - - False - True - 1 - - - - end - 3 - + + + + True + False + Time Zone + + + False + True + 3 + - both - True - - + + - - both - True - - - - + + True + False + com.ublinux.libublsettingsui-gtk3.cancel-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.accept-symbolic - + 240 185 False - btnChooseDate + DateButton bottom - none - - - True - True - 10 - 10 - 10 - 10 - 10 - 10 - 2023 - 1 - 10 - - - - - False - False True False + 5 + 5 + 5 + 5 vertical + 5 + + + True + True + 2023 + 1 + 10 + + + False + True + 0 + + True False + 5 - + + Accept True - False - center - start - 20 - 20 - 20 - 20 - 20 - 20 - dialog-warning-symbolic - 5 + True + True + image4 False True - 1 + end + 0 - + + Cancel True - False - center - center - 10 - 25 - 10 - 25 - 20 - 20 - Enter DHCP ! - True - 0 + True + True + image3 - True + False True - 2 + end + 1 - - True - True - 0 - - - - - Close - True - True - True - 5 - 5 - 5 - 5 - 5 - 5 - False True - 2 + 1 - - + + + + + + + + + + + + + liststore1 + + + True + False + False + False + 4 + + True False - Attention - True - - - True - False - 32 - com.ublinux.ubl-settings-datetime - 5 - - + Load global configuration + + + + + + True + False + Load local configuration + + + + + + True + False + False + False + 4 + + + True + False + Help + + + + + + True + False + About + - - 800 - 600 + + True False - True - True - com.ublinux.ubl-settings-datetime - center + False + False + 4 + + + True + False + Save configuration + + + - + + True + False + Save to global configuration + + - - + + True False - True - - - True - False - Date and Time - - - - - True - False - 32 - com.ublinux.ubl-settings-datetime - 5 - - + Save to local configuration + diff --git a/ubl-settings-datetime.pot b/ubl-settings-datetime.pot index 8cd9eca..7020e9c 100644 --- a/ubl-settings-datetime.pot +++ b/ubl-settings-datetime.pot @@ -17,81 +17,92 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -msgid ":" -msgstr "" - -#: source/ubl-settings-datetime.h:110 source/ubl-settings-datetime.h:109 -#: source/ubl-settings-datetime.cc:81 source/ubl-settings-datetime.cc:82 -#: source/ubl-settings-datetime.cc:83 source/ubl-settings-datetime.cc:84 -#: source/ubl-settings-datetime.h:119 -msgid ": \"Date\"" -msgstr "" - -#: source/ubl-settings-datetime.h:112 source/ubl-settings-datetime.h:111 -#: source/ubl-settings-datetime.cc:59 source/ubl-settings-datetime.cc:61 -#: source/ubl-settings-datetime.cc:64 source/ubl-settings-datetime.cc:65 -#: source/ubl-settings-datetime.cc:71 source/ubl-settings-datetime.cc:72 -#: source/ubl-settings-datetime.cc:78 source/ubl-settings-datetime.cc:79 -#: source/ubl-settings-datetime.cc:60 source/ubl-settings-datetime.cc:63 -#: source/ubl-settings-datetime.cc:66 source/ubl-settings-datetime.cc:67 -#: source/ubl-settings-datetime.cc:73 source/ubl-settings-datetime.cc:74 -#: source/ubl-settings-datetime.cc:80 source/ubl-settings-datetime.cc:81 -#: source/ubl-settings-datetime.cc:85 source/ubl-settings-datetime.cc:62 -#: source/ubl-settings-datetime.cc:84 source/ubl-settings-datetime.h:121 -msgid ": \"Hardware time\"" -msgstr "" - -#: source/ubl-settings-datetime.h:113 source/ubl-settings-datetime.h:112 -#: source/ubl-settings-datetime.cc:60 source/ubl-settings-datetime.cc:62 -#: source/ubl-settings-datetime.cc:67 source/ubl-settings-datetime.cc:68 -#: source/ubl-settings-datetime.cc:69 source/ubl-settings-datetime.cc:70 -#: source/ubl-settings-datetime.cc:74 source/ubl-settings-datetime.cc:75 -#: source/ubl-settings-datetime.cc:76 source/ubl-settings-datetime.cc:77 -#: source/ubl-settings-datetime.cc:80 source/ubl-settings-datetime.cc:61 -#: source/ubl-settings-datetime.cc:64 source/ubl-settings-datetime.cc:71 -#: source/ubl-settings-datetime.cc:72 source/ubl-settings-datetime.cc:78 -#: source/ubl-settings-datetime.cc:79 source/ubl-settings-datetime.cc:82 -#: source/ubl-settings-datetime.cc:63 source/ubl-settings-datetime.cc:81 -#: source/ubl-settings-datetime.h:122 -msgid ": \"NTP\"" -msgstr "" - -#: source/ubl-settings-datetime.h:111 source/ubl-settings-datetime.h:110 -#: source/ubl-settings-datetime.cc:58 source/ubl-settings-datetime.cc:63 -#: source/ubl-settings-datetime.cc:66 source/ubl-settings-datetime.cc:73 -#: source/ubl-settings-datetime.cc:59 source/ubl-settings-datetime.cc:65 -#: source/ubl-settings-datetime.cc:68 source/ubl-settings-datetime.cc:75 -#: source/ubl-settings-datetime.cc:64 source/ubl-settings-datetime.cc:67 -#: source/ubl-settings-datetime.cc:74 source/ubl-settings-datetime.h:120 -msgid ": \"Time Zone\"" -msgstr "" - -#: source/ubl-settings-datetime.cc:58 source/ubl-settings-datetime.cc:57 -msgid ": \"xdg-open\"" +#: source/ubl-strings.h:2 +msgid "Date and time" msgstr "" -msgid "Abidjan" +#: source/ubl-strings.h:3 +msgid "Datetime configuration" msgstr "" -#: source/ubl-settings-datetime.h:70 source/ubl-settings-datetime.h:69 -#: source/ubl-settings-datetime.h:79 -msgid "About" +#: source/ubl-strings.h:5 +msgid "Syncronisation error" msgstr "" -#: source/ubl-settings-datetime.h:71 source/ubl-settings-datetime.h:70 -#: source/ubl-settings-datetime.cc:137 source/ubl-settings-datetime.h:80 -msgid "About ubl-settings-datetime" +#: source/ubl-strings.h:7 +msgid "Accept" msgstr "" -msgid "Accra" +#: source/ubl-strings.h:8 +msgid "Cancel" msgstr "" -msgid "Acre" +#: source/ubl-strings.h:9 +msgid "Current date and time" +msgstr "" + +#: source/ubl-strings.h:10 +msgid "Time:" msgstr "" +#: source/ubl-strings.h:11 +msgid "Date:" +msgstr "" + +#: source/ubl-strings.h:12 +msgid "Synchronize" +msgstr "" + +#: source/ubl-strings.h:13 +msgid "Synchronize hardware time" +msgstr "" + +#: source/ubl-strings.h:14 +msgid "Synchronize via NTP" +msgstr "" + +#: source/ubl-strings.h:15 +msgid "Default" +msgstr "" + +#: source/ubl-strings.h:16 +msgid "Stopped" +msgstr "" + +#: source/ubl-strings.h:17 +msgid "Manual" +msgstr "" + +#: source/ubl-strings.h:18 msgid "" -"Active service detected\n" -"Automatic time and date synchronization service detected" +"Enter the name of the ntp server or its ip address. When entering multiple " +"addresses, separate them with spaces." +msgstr "" + +#: source/ubl-strings.h:19 +msgid "Time Zone" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Region:" +msgstr "" + +#: source/ubl-strings.h:21 +msgid "Zone:" +msgstr "" + +#: source/ubl-strings.h:22 +msgid "Local time" +msgstr "" + + +msgid "Abidjan" +msgstr "" + +msgid "Accra" +msgstr "" + +msgid "Acre" msgstr "" msgid "Adak" @@ -121,11 +132,6 @@ msgstr "" msgid "Almaty" msgstr "" -#: source/ubl-settings-datetime.h:82 source/ubl-settings-datetime.h:81 -#: source/ubl-settings-datetime.cc:173 source/ubl-settings-datetime.h:91 -msgid "Always redirect" -msgstr "" - msgid "America" msgstr "" @@ -135,12 +141,6 @@ msgstr "" msgid "Amsterdam" msgstr "" -#: source/ubl-settings-datetime.h:103 source/ubl-settings-datetime.h:102 -#: source/ubl-settings-datetime.cc:898 source/ubl-settings-datetime.cc:834 -#: source/ubl-settings-datetime.cc:817 source/ubl-settings-datetime.h:112 -msgid "An invalid character is entered" -msgstr "" - msgid "Anadyr" msgstr "" @@ -177,11 +177,6 @@ msgstr "" msgid "Arctic" msgstr "" -#: source/ubl-settings-datetime.h:108 source/ubl-settings-datetime.h:107 -#: source/ubl-settings-datetime.h:117 -msgid "Argument not recognized\n" -msgstr "" - msgid "Arizona" msgstr "" @@ -221,12 +216,6 @@ msgstr "" msgid "Atlantic" msgstr "" -#: source/ubl-settings-datetime.h:122 source/ubl-settings-datetime.h:121 -#: source/ubl-settings-datetime.cc:157 source/ubl-settings-datetime.cc:152 -#: source/ubl-settings-datetime.cc:147 source/ubl-settings-datetime.h:131 -msgid "Attention" -msgstr "" - msgid "Atyrau" msgstr "" @@ -236,9 +225,6 @@ msgstr "" msgid "Australia" msgstr "" -msgid "Automatic time synchronization" -msgstr "" - msgid "Azores" msgstr "" @@ -386,11 +372,6 @@ msgstr "" msgid "Canberra" msgstr "" -#: source/ubl-settings-datetime.h:81 source/ubl-settings-datetime.h:80 -#: source/ubl-settings-datetime.cc:172 source/ubl-settings-datetime.h:90 -msgid "Cancel" -msgstr "" - msgid "Cancun" msgstr "" @@ -430,12 +411,6 @@ msgstr "" msgid "Chagos" msgstr "" -msgid "Change the NTPSERVERS parameter" -msgstr "" - -msgid "Change zone setting" -msgstr "" - msgid "Chatham" msgstr "" @@ -499,12 +474,6 @@ msgstr "" msgid "Copenhagen" msgstr "" -#: source/ubl-settings-datetime.h:66 source/ubl-settings-datetime.h:65 -#: source/ubl-settings-datetime.cc:130 source/ubl-settings-datetime.cc:128 -#: source/ubl-settings-datetime.cc:123 source/ubl-settings-datetime.h:75 -msgid "Copyright © UBSoft LLC, 2022 - " -msgstr "" - msgid "Coral_Harbour" msgstr "" @@ -523,21 +492,6 @@ msgstr "" msgid "Curacao" msgstr "" -#: source/ubl-settings-datetime.h:130 source/ubl-settings-datetime.h:129 -#: source/ubl-settings-datetime.cc:147 source/ubl-settings-datetime.cc:143 -#: source/ubl-settings-datetime.cc:138 source/ubl-settings-datetime.h:139 -msgid "Current date and time" -msgstr "" - -msgid "Currie" -msgstr "" - -#: source/ubl-settings-datetime.h:115 source/ubl-settings-datetime.h:114 -#: source/ubl-settings-datetime.cc:144 source/ubl-settings-datetime.cc:140 -#: source/ubl-settings-datetime.cc:135 source/ubl-settings-datetime.h:124 -msgid "DHCP" -msgstr "" - msgid "Dacca" msgstr "" @@ -556,34 +510,6 @@ msgstr "" msgid "Darwin" msgstr "" -#: source/ubl-settings-datetime.h:119 source/ubl-settings-datetime.h:118 -#: source/ubl-settings-datetime.cc:133 source/ubl-settings-datetime.cc:130 -#: source/ubl-settings-datetime.cc:125 source/ubl-settings-datetime.h:128 -msgid "Date and Time" -msgstr "" - -#: source/ubl-settings-datetime.h:100 source/ubl-settings-datetime.h:99 -#: source/ubl-settings-datetime.cc:1459 source/ubl-settings-datetime.cc:1477 -#: source/ubl-settings-datetime.cc:1508 source/ubl-settings-datetime.cc:1395 -#: source/ubl-settings-datetime.cc:1414 source/ubl-settings-datetime.cc:1445 -#: source/ubl-settings-datetime.h:109 -msgid "Date and time are successfully synchronized" -msgstr "" - -#: source/ubl-settings-datetime.h:131 source/ubl-settings-datetime.h:130 -#: source/ubl-settings-datetime.cc:140 source/ubl-settings-datetime.cc:136 -#: source/ubl-settings-datetime.cc:131 source/ubl-settings-datetime.h:140 -msgid "" -"Date of\n" -"Format: DD.MM.YYYY" -msgstr "" - -#: source/ubl-settings-datetime.h:127 source/ubl-settings-datetime.h:126 -#: source/ubl-settings-datetime.cc:150 source/ubl-settings-datetime.cc:146 -#: source/ubl-settings-datetime.cc:141 source/ubl-settings-datetime.h:136 -msgid "Date:" -msgstr "" - msgid "Davis" msgstr "" @@ -596,12 +522,6 @@ msgstr "" msgid "DeNoronha" msgstr "" -#: source/ubl-settings-datetime.h:114 source/ubl-settings-datetime.h:113 -#: source/ubl-settings-datetime.cc:143 source/ubl-settings-datetime.cc:139 -#: source/ubl-settings-datetime.cc:134 source/ubl-settings-datetime.h:123 -msgid "Default" -msgstr "" - msgid "Denver" msgstr "" @@ -614,12 +534,6 @@ msgstr "" msgid "Dili" msgstr "" -#: source/ubl-settings-datetime.h:117 source/ubl-settings-datetime.h:116 -#: source/ubl-settings-datetime.cc:146 source/ubl-settings-datetime.cc:142 -#: source/ubl-settings-datetime.cc:137 source/ubl-settings-datetime.h:126 -msgid "Disabled" -msgstr "" - msgid "Djibouti" msgstr "" @@ -683,41 +597,6 @@ msgstr "" msgid "Ensenada" msgstr "" -#: source/ubl-settings-datetime.h:101 source/ubl-settings-datetime.h:100 -#: source/ubl-settings-datetime.cc:867 source/ubl-settings-datetime.cc:1139 -#: source/ubl-settings-datetime.cc:803 source/ubl-settings-datetime.cc:1075 -#: source/ubl-settings-datetime.h:110 -msgid "Enter a list of NTP servers" -msgstr "" - -#: source/ubl-settings-datetime.cc:791 source/ubl-settings-datetime.cc:1054 -msgid "Enter a list of ntp servers" -msgstr "" - -#: source/ubl-settings-datetime.h:133 source/ubl-settings-datetime.h:132 -#: source/ubl-settings-datetime.cc:141 source/ubl-settings-datetime.cc:137 -#: source/ubl-settings-datetime.cc:132 source/ubl-settings-datetime.h:142 -msgid "" -"Enter the name of the ntp-server or its ip-address.\n" -"When entering multiple addresses, separate them with commas." -msgstr "" - -#: source/ubl-settings-datetime.h:102 source/ubl-settings-datetime.h:101 -#: source/ubl-settings-datetime.cc:903 source/ubl-settings-datetime.cc:839 -#: source/ubl-settings-datetime.h:111 -msgid "Error in the NTP server name" -msgstr "" - -#: source/ubl-settings-datetime.cc:821 -msgid "Error in the ntp name" -msgstr "" - -#: source/ubl-settings-datetime.h:92 source/ubl-settings-datetime.h:91 -#: source/ubl-settings-datetime.cc:745 source/ubl-settings-datetime.cc:681 -#: source/ubl-settings-datetime.cc:678 source/ubl-settings-datetime.h:101 -msgid "Error saved local and global configuration" -msgstr "" - msgid "Eucla" msgstr "" @@ -760,26 +639,6 @@ msgstr "" msgid "GMT-3" msgstr "" -#: source/ubl-settings-datetime.h:86 source/ubl-settings-datetime.h:85 -#: source/ubl-settings-datetime.h:95 -msgid "" -"Setting up the date and time for UBLinux\n" -"\n" -"Usage: ubl-settings-datetime [OPTIONS...]\n" -"Options:\n" -" -h, --help\t Show this help\n" -" -V, --version\t Show package version\n" -" --lock-datetime Lock date and time changes\n" -" --lock-timezone Lock time zone changes\n" -" --lock-ntp-mode Lock NTP mode selection\n" -" --lock-ntp-edit Lock editing NTP servers\n" -" --lock-sync-hwclock Lock sync hwclock mode selection\n" -" --lock-save Lock saving local and global configuration\n" -" --lock-save-local Lock save global configuration\n" -" --lock-save-global Lock load global configuration\n" -" --lock-load-global Lock load global configuration\n" -msgstr "" - msgid "Gaborone" msgstr "" @@ -801,33 +660,6 @@ msgstr "" msgid "Glace_Bay" msgstr "" -#: source/ubl-settings-datetime.h:94 source/ubl-settings-datetime.h:93 -#: source/ubl-settings-datetime.cc:757 source/ubl-settings-datetime.cc:693 -#: source/ubl-settings-datetime.cc:690 source/ubl-settings-datetime.h:103 -msgid "Global configuration downloaded successfully" -msgstr "" - -#: source/ubl-settings-datetime.h:89 source/ubl-settings-datetime.h:88 -#: source/ubl-settings-datetime.cc:733 source/ubl-settings-datetime.cc:669 -#: source/ubl-settings-datetime.cc:666 source/ubl-settings-datetime.h:98 -msgid "Global configuration read error" -msgstr "" - -#: source/ubl-settings-datetime.h:96 source/ubl-settings-datetime.h:95 -#: source/ubl-settings-datetime.cc:763 source/ubl-settings-datetime.cc:699 -#: source/ubl-settings-datetime.cc:696 source/ubl-settings-datetime.h:105 -msgid "Global configuration successfully written" -msgstr "" - -#: source/ubl-settings-datetime.h:91 source/ubl-settings-datetime.h:90 -#: source/ubl-settings-datetime.cc:741 source/ubl-settings-datetime.cc:677 -#: source/ubl-settings-datetime.cc:674 source/ubl-settings-datetime.h:100 -msgid "Global configuration write error" -msgstr "" - -msgid "Global customization" -msgstr "" - msgid "Godthab" msgstr "" @@ -873,18 +705,6 @@ msgstr "" msgid "Harbin" msgstr "" -#: source/ubl-settings-datetime.h:105 source/ubl-settings-datetime.h:104 -#: source/ubl-settings-datetime.cc:856 source/ubl-settings-datetime.cc:792 -#: source/ubl-settings-datetime.h:114 -msgid "Hardware clock successfully synchronized" -msgstr "" - -#: source/ubl-settings-datetime.h:106 source/ubl-settings-datetime.h:105 -#: source/ubl-settings-datetime.cc:852 source/ubl-settings-datetime.cc:788 -#: source/ubl-settings-datetime.h:115 -msgid "Hardware clock synchronization error" -msgstr "" - msgid "Havana" msgstr "" @@ -894,11 +714,6 @@ msgstr "" msgid "Hebron" msgstr "" -#: source/ubl-settings-datetime.h:72 source/ubl-settings-datetime.h:71 -#: source/ubl-settings-datetime.h:81 -msgid "Help" -msgstr "" - msgid "Helsinki" msgstr "" @@ -920,14 +735,6 @@ msgstr "" msgid "Hovd" msgstr "" -#: source/ubl-settings-datetime.h:99 source/ubl-settings-datetime.h:98 -#: source/ubl-settings-datetime.cc:1503 source/ubl-settings-datetime.cc:1514 -#: source/ubl-settings-datetime.cc:1440 source/ubl-settings-datetime.cc:1451 -#: source/ubl-settings-datetime.cc:1402 source/ubl-settings-datetime.cc:1407 -#: source/ubl-settings-datetime.h:108 -msgid "Incorrect date format" -msgstr "" - msgid "Indian" msgstr "" @@ -940,9 +747,6 @@ msgstr "" msgid "Indianapolis" msgstr "" -msgid "Interactive date picker" -msgstr "" - msgid "Inuvik" msgstr "" @@ -1099,52 +903,6 @@ msgstr "" msgid "Ljubljana" msgstr "" -#: source/ubl-settings-datetime.h:74 source/ubl-settings-datetime.h:73 -#: source/ubl-settings-datetime.cc:139 source/ubl-settings-datetime.cc:135 -#: source/ubl-settings-datetime.cc:130 source/ubl-settings-datetime.h:83 -msgid "Load" -msgstr "" - -#: source/ubl-settings-datetime.h:78 source/ubl-settings-datetime.h:77 -#: source/ubl-settings-datetime.h:87 -msgid "Load global configuration" -msgstr "" - -#: source/ubl-settings-datetime.h:79 source/ubl-settings-datetime.h:78 -#: source/ubl-settings-datetime.h:88 -msgid "Load local configuration" -msgstr "" - -#: source/ubl-settings-datetime.h:93 source/ubl-settings-datetime.h:92 -#: source/ubl-settings-datetime.cc:754 source/ubl-settings-datetime.cc:690 -#: source/ubl-settings-datetime.cc:687 source/ubl-settings-datetime.h:102 -msgid "Local configuration downloaded successfully" -msgstr "" - -#: source/ubl-settings-datetime.h:88 source/ubl-settings-datetime.h:87 -#: source/ubl-settings-datetime.cc:729 source/ubl-settings-datetime.cc:665 -#: source/ubl-settings-datetime.cc:662 source/ubl-settings-datetime.h:97 -msgid "Local configuration reading error" -msgstr "" - -#: source/ubl-settings-datetime.h:95 source/ubl-settings-datetime.h:94 -#: source/ubl-settings-datetime.cc:760 source/ubl-settings-datetime.cc:696 -#: source/ubl-settings-datetime.cc:693 source/ubl-settings-datetime.h:104 -msgid "Local configuration successfully written" -msgstr "" - -#: source/ubl-settings-datetime.h:90 source/ubl-settings-datetime.h:89 -#: source/ubl-settings-datetime.cc:737 source/ubl-settings-datetime.cc:673 -#: source/ubl-settings-datetime.cc:670 source/ubl-settings-datetime.h:99 -msgid "Local configuration write error" -msgstr "" - -#: source/ubl-settings-datetime.h:121 source/ubl-settings-datetime.h:120 -#: source/ubl-settings-datetime.cc:161 source/ubl-settings-datetime.cc:156 -#: source/ubl-settings-datetime.cc:151 source/ubl-settings-datetime.h:130 -msgid "Local time" -msgstr "" - msgid "Lome" msgstr "" @@ -1226,12 +984,6 @@ msgstr "" msgid "Manila" msgstr "" -#: source/ubl-settings-datetime.h:116 source/ubl-settings-datetime.h:115 -#: source/ubl-settings-datetime.cc:145 source/ubl-settings-datetime.cc:141 -#: source/ubl-settings-datetime.cc:136 source/ubl-settings-datetime.h:125 -msgid "Manual" -msgstr "" - msgid "Maputo" msgstr "" @@ -1349,16 +1101,6 @@ msgstr "" msgid "NSW" msgstr "" -#: source/ubl-settings-datetime.cc:818 -msgid "NTP is correct" -msgstr "" - -#: source/ubl-settings-datetime.h:104 source/ubl-settings-datetime.h:103 -#: source/ubl-settings-datetime.cc:891 source/ubl-settings-datetime.cc:827 -#: source/ubl-settings-datetime.h:113 -msgid "NTP server name is correct" -msgstr "" - msgid "Nairobi" msgstr "" @@ -1407,15 +1149,6 @@ msgstr "" msgid "North_Dokota" msgstr "" -#: source/ubl-settings-datetime.h:83 source/ubl-settings-datetime.h:82 -#: source/ubl-settings-datetime.cc:473 source/ubl-settings-datetime.cc:502 -#: source/ubl-settings-datetime.cc:533 source/ubl-settings-datetime.cc:434 -#: source/ubl-settings-datetime.cc:466 source/ubl-settings-datetime.cc:497 -#: source/ubl-settings-datetime.cc:433 source/ubl-settings-datetime.cc:464 -#: source/ubl-settings-datetime.cc:494 source/ubl-settings-datetime.h:92 -msgid "Nothing to save!" -msgstr "" - msgid "Nouakchott" msgstr "" @@ -1521,12 +1254,6 @@ msgstr "" msgid "Prague" msgstr "" -#: source/ubl-settings-datetime.h:69 source/ubl-settings-datetime.h:68 -#: source/ubl-settings-datetime.cc:136 source/ubl-settings-datetime.cc:133 -#: source/ubl-settings-datetime.cc:128 source/ubl-settings-datetime.h:78 -msgid "Project Home Page" -msgstr "" - msgid "Puerto_Rico" msgstr "" @@ -1560,23 +1287,12 @@ msgstr "" msgid "Rarotonga" msgstr "" -#: source/ubl-settings-datetime.h:80 source/ubl-settings-datetime.h:79 -#: source/ubl-settings-datetime.cc:171 source/ubl-settings-datetime.h:89 -msgid "Read online" -msgstr "" - msgid "Recife" msgstr "" msgid "Regina" msgstr "" -#: source/ubl-settings-datetime.h:125 source/ubl-settings-datetime.h:124 -#: source/ubl-settings-datetime.cc:152 source/ubl-settings-datetime.cc:148 -#: source/ubl-settings-datetime.cc:143 source/ubl-settings-datetime.h:134 -msgid "Region:" -msgstr "" - msgid "Resolute" msgstr "" @@ -1664,45 +1380,12 @@ msgstr "" msgid "Saskatchewan" msgstr "" -#: source/ubl-settings-datetime.h:73 source/ubl-settings-datetime.h:72 -#: source/ubl-settings-datetime.cc:138 source/ubl-settings-datetime.cc:134 -#: source/ubl-settings-datetime.cc:129 source/ubl-settings-datetime.h:82 -msgid "Save" -msgstr "" - -#: source/ubl-settings-datetime.h:77 source/ubl-settings-datetime.h:76 -msgid "Save to global configuration" -msgstr "" - -#: source/ubl-settings-datetime.h:76 source/ubl-settings-datetime.h:75 -msgid "Save to local configuration" -msgstr "" - -#: source/ubl-settings-datetime.h:75 source/ubl-settings-datetime.h:74 -msgid "Save configuration" -msgstr "" - msgid "Scoresbysund" msgstr "" -msgid "Select the method of hardware time synchronization" -msgstr "" - msgid "Seoul" msgstr "" -msgid "Setting date and time in global configuration" -msgstr "" - -#: source/ubl-settings-datetime.h:129 source/ubl-settings-datetime.h:128 -#: source/ubl-settings-datetime.cc:148 source/ubl-settings-datetime.cc:144 -#: source/ubl-settings-datetime.cc:139 -msgid "Setting the date and time" -msgstr "" - -msgid "Settings the date and time" -msgstr "" - msgid "Shanghai" msgstr "" @@ -1763,44 +1446,12 @@ msgstr "" msgid "Stockholm" msgstr "" -msgid "Stop the synchronization service" -msgstr "" - -#: source/ubl-settings-datetime.h:97 source/ubl-settings-datetime.h:96 -#: source/ubl-settings-datetime.cc:766 source/ubl-settings-datetime.cc:702 -#: source/ubl-settings-datetime.cc:699 source/ubl-settings-datetime.h:106 -msgid "Successfully saved local and global configuration" -msgstr "" - msgid "Swift_Current" msgstr "" msgid "Sydney" msgstr "" -#: source/ubl-settings-datetime.h:123 source/ubl-settings-datetime.h:122 -#: source/ubl-settings-datetime.cc:154 source/ubl-settings-datetime.cc:150 -#: source/ubl-settings-datetime.cc:145 source/ubl-settings-datetime.h:132 -msgid "Sync by" -msgstr "" - -#: source/ubl-settings-datetime.h:128 source/ubl-settings-datetime.h:127 -#: source/ubl-settings-datetime.cc:158 source/ubl-settings-datetime.cc:153 -#: source/ubl-settings-datetime.cc:148 source/ubl-settings-datetime.h:137 -msgid "Synchronize hardware time" -msgstr "" - -#: source/ubl-settings-datetime.cc:159 source/ubl-settings-datetime.cc:154 -#: source/ubl-settings-datetime.cc:149 -msgid "Synchronize hardware time:" -msgstr "" - -#: source/ubl-settings-datetime.h:132 source/ubl-settings-datetime.h:131 -#: source/ubl-settings-datetime.cc:142 source/ubl-settings-datetime.cc:138 -#: source/ubl-settings-datetime.cc:133 source/ubl-settings-datetime.h:141 -msgid "Synchronize via NTP" -msgstr "" - msgid "Syowa" msgstr "" @@ -1837,17 +1488,6 @@ msgstr "" msgid "Tell_City" msgstr "" -#: source/ubl-settings-datetime.h:109 source/ubl-settings-datetime.h:108 -#: source/ubl-settings-datetime.cc:122 source/ubl-settings-datetime.cc:120 -#: source/ubl-settings-datetime.cc:115 source/ubl-settings-datetime.h:118 -msgid "The program must be run as root" -msgstr "" - -msgid "" -"The program must be run with \n" -"superuser privileges!" -msgstr "" - msgid "Thimbu" msgstr "" @@ -1866,18 +1506,6 @@ msgstr "" msgid "Timbuktu" msgstr "" -#: source/ubl-settings-datetime.h:126 source/ubl-settings-datetime.h:125 -#: source/ubl-settings-datetime.cc:151 source/ubl-settings-datetime.cc:147 -#: source/ubl-settings-datetime.cc:142 source/ubl-settings-datetime.h:135 -msgid "Time zone" -msgstr "" - -#: source/ubl-settings-datetime.h:118 source/ubl-settings-datetime.h:117 -#: source/ubl-settings-datetime.cc:149 source/ubl-settings-datetime.cc:145 -#: source/ubl-settings-datetime.cc:140 source/ubl-settings-datetime.h:127 -msgid "Time:" -msgstr "" - msgid "Tirane" msgstr "" @@ -1917,12 +1545,6 @@ msgstr "" msgid "US" msgstr "" -#: source/ubl-settings-datetime.h:120 source/ubl-settings-datetime.h:119 -#: source/ubl-settings-datetime.cc:160 source/ubl-settings-datetime.cc:155 -#: source/ubl-settings-datetime.cc:150 source/ubl-settings-datetime.h:129 -msgid "UTC time" -msgstr "" - msgid "Ujung_Pandang" msgstr "" @@ -2013,11 +1635,6 @@ msgstr "" msgid "Winnipeg" msgstr "" -#: source/ubl-settings-datetime.h:84 source/ubl-settings-datetime.h:83 -#: source/ubl-settings-datetime.cc:168 source/ubl-settings-datetime.h:93 -msgid "Would you like to read documentation in the Web?" -msgstr "" - msgid "Yakutat" msgstr "" @@ -2042,17 +1659,6 @@ msgstr "" msgid "Yerevan" msgstr "" -#: source/ubl-settings-datetime.h:85 source/ubl-settings-datetime.h:84 -#: source/ubl-settings-datetime.cc:169 source/ubl-settings-datetime.h:94 -msgid "" -"You will be redirected to documentation website where documentation is\n" -"translated and supported by community." -msgstr "" - -#: source/ubl-settings-datetime.h:138 -msgid "Setting the system date and time" -msgstr "" - msgid "Yukon" msgstr "" @@ -2062,54 +1668,8 @@ msgstr "" msgid "Zaporozhye" msgstr "" -#: source/ubl-settings-datetime.h:124 source/ubl-settings-datetime.h:123 -#: source/ubl-settings-datetime.cc:153 source/ubl-settings-datetime.cc:149 -#: source/ubl-settings-datetime.cc:144 source/ubl-settings-datetime.h:133 -msgid "Zone:" -msgstr "" - msgid "Zulu" msgstr "" msgid "Zurich" -msgstr "" - -#: source/ubl-settings-datetime.h:68 source/ubl-settings-datetime.h:67 -#: source/ubl-settings-datetime.cc:134 source/ubl-settings-datetime.cc:131 -#: source/ubl-settings-datetime.cc:126 source/ubl-settings-datetime.h:77 -msgid "https://wiki.ublinux.com" -msgstr "" - -#: source/ubl-settings-datetime.cc:387 -msgid "" -"https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/" -msgstr "" - -#: source/ubl-settings-datetime.cc:174 -msgid "ubl-settings-bootloader" -msgstr "" - -#: source/ubl-settings-datetime.h:67 source/ubl-settings-datetime.h:66 -#: source/ubl-settings-datetime.cc:131 source/ubl-settings-datetime.cc:155 -#: source/ubl-settings-datetime.cc:156 source/ubl-settings-datetime.cc:151 -#: source/ubl-settings-datetime.cc:146 source/ubl-settings-datetime.h:76 -msgid "ubl-settings-datetime" -msgstr "" - -#: source/ubl-settings-datetime.h:87 source/ubl-settings-datetime.h:86 -#: source/ubl-settings-datetime.cc:1714 source/ubl-settings-datetime.cc:1651 -#: source/ubl-settings-datetime.cc:1606 source/ubl-settings-datetime.h:96 -msgid "ubl-settings-datetime version: " -msgstr "" - -#: source/ubl-settings-datetime.h:84 -msgid "Save in global and local configuration" -msgstr "" - -#: source/ubl-settings-datetime.h:85 -msgid "Save in local configuration" -msgstr "" - -#: source/ubl-settings-datetime.h:86 -msgid "Save in global configuration" -msgstr "" +msgstr "" \ No newline at end of file diff --git a/ubl-settings-datetime_ru.po b/ubl-settings-datetime_ru.po index 566b8bf..b2ad32a 100644 --- a/ubl-settings-datetime_ru.po +++ b/ubl-settings-datetime_ru.po @@ -17,52 +17,92 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -msgid ":" -msgstr ":" - -#: source/ubl-settings-datetime.h:110 source/ubl-settings-datetime.h:109 -#: source/ubl-settings-datetime.cc:81 source/ubl-settings-datetime.cc:82 -#: source/ubl-settings-datetime.cc:83 source/ubl-settings-datetime.cc:84 -#: source/ubl-settings-datetime.h:119 -msgid ": \"Date\"" -msgstr ": \"Дата\"" - -#: source/ubl-settings-datetime.h:112 source/ubl-settings-datetime.h:111 -#: source/ubl-settings-datetime.cc:59 source/ubl-settings-datetime.cc:61 -#: source/ubl-settings-datetime.cc:64 source/ubl-settings-datetime.cc:65 -#: source/ubl-settings-datetime.cc:71 source/ubl-settings-datetime.cc:72 -#: source/ubl-settings-datetime.cc:78 source/ubl-settings-datetime.cc:79 -#: source/ubl-settings-datetime.cc:60 source/ubl-settings-datetime.cc:63 -#: source/ubl-settings-datetime.cc:66 source/ubl-settings-datetime.cc:67 -#: source/ubl-settings-datetime.cc:73 source/ubl-settings-datetime.cc:74 -#: source/ubl-settings-datetime.cc:80 source/ubl-settings-datetime.cc:81 -#: source/ubl-settings-datetime.cc:85 source/ubl-settings-datetime.cc:62 -#: source/ubl-settings-datetime.cc:84 source/ubl-settings-datetime.h:121 -msgid ": \"Hardware time\"" -msgstr ": \"Аппаратное время\"" - -#: source/ubl-settings-datetime.h:111 source/ubl-settings-datetime.h:110 -#: source/ubl-settings-datetime.cc:58 source/ubl-settings-datetime.cc:63 -#: source/ubl-settings-datetime.cc:66 source/ubl-settings-datetime.cc:73 -#: source/ubl-settings-datetime.cc:59 source/ubl-settings-datetime.cc:65 -#: source/ubl-settings-datetime.cc:68 source/ubl-settings-datetime.cc:75 -#: source/ubl-settings-datetime.cc:64 source/ubl-settings-datetime.cc:67 -#: source/ubl-settings-datetime.cc:74 source/ubl-settings-datetime.h:120 -msgid ": \"Time Zone\"" -msgstr ": \"Временная зона\"" +#: source/ubl-strings.h:2 +msgid "Date and time" +msgstr "Дата и Время" -msgid "Abidjan" -msgstr "Абиджан" +#: source/ubl-strings.h:3 +msgid "Date and time configuration" +msgstr "Настройка даты и времени системы" + +#: source/ubl-strings.h:5 +msgid "Syncronisation error" +msgstr "Ошибка синхронизации аппаратных часов" + +#: source/ubl-strings.h:7 +msgid "Accept" +msgstr "Принять" + +#: source/ubl-strings.h:8 +msgid "Cancel" +msgstr "Отменить" + +#: source/ubl-strings.h:9 +msgid "Current date and time" +msgstr "Текущие дата и время" + +#: source/ubl-strings.h:10 +msgid "Time:" +msgstr "Время:" + +#: source/ubl-strings.h:11 +msgid "Date:" +msgstr "Дата:" + +#: source/ubl-strings.h:12 +msgid "Synchronize" +msgstr "Синхронизировать" -#: source/ubl-settings-datetime.h:70 source/ubl-settings-datetime.h:69 -#: source/ubl-settings-datetime.h:79 -msgid "About" -msgstr "О программе" +#: source/ubl-strings.h:13 +msgid "Synchronize hardware time" +msgstr "Синхронизировать аппаратное время" + +#: source/ubl-strings.h:13 +msgid "Synchronize hardware time:" +msgstr "Синхронизировать аппаратное время:" + +#: source/ubl-strings.h:14 +msgid "Synchronize via NTP" +msgstr "Синхронизировать через NTP" + +#: source/ubl-strings.h:15 +msgid "Default" +msgstr "По умолчанию" -#: source/ubl-settings-datetime.h:71 source/ubl-settings-datetime.h:70 -#: source/ubl-settings-datetime.cc:137 source/ubl-settings-datetime.h:80 -msgid "About ubl-settings-datetime" -msgstr "О программе Дата и время" +#: source/ubl-strings.h:16 +msgid "Stopped" +msgstr "Остановлен" + +#: source/ubl-strings.h:17 +msgid "Manual" +msgstr "Вручную" + +#: source/ubl-strings.h:18 +msgid "" +"Enter the name of the ntp server or its ip address. When entering multiple " +"addresses, separate them with spaces." +msgstr "" +"Введите имя ntp-сервера или его ip-адрес.\n" +"При вводе нескольких адресов, разделяйте их запятыми." + +#: source/ubl-strings.h:19 +msgid "Time Zone" +msgstr "Часовой пояс" + +#: source/ubl-strings.h:20 +msgid "Region:" +msgstr "Регион:" + +#: source/ubl-strings.h:21 +msgid "Zone:" +msgstr "Зона:" + +#: source/ubl-strings.h:22 +msgid "Local time" +msgstr "Локальное время" + +msgid "Abidjan" +msgstr "Абиджан" msgid "Accra" msgstr "Аккра" @@ -70,13 +110,6 @@ msgstr "Аккра" msgid "Acre" msgstr "Акр" -msgid "" -"Active service detected\n" -"Automatic time and date synchronization service detected" -msgstr "" -"Обнаружен активный сервис\n" -"автоматической синхронизации времени и даты" - msgid "Adak" msgstr "Адак" @@ -104,11 +137,6 @@ msgstr "Алжир" msgid "Almaty" msgstr "Алматы" -#: source/ubl-settings-datetime.h:82 source/ubl-settings-datetime.h:81 -#: source/ubl-settings-datetime.cc:173 source/ubl-settings-datetime.h:91 -msgid "Always redirect" -msgstr "Всегда перенаправлять" - msgid "America" msgstr "Америка" @@ -118,12 +146,6 @@ msgstr "Амман" msgid "Amsterdam" msgstr "Амстердам" -#: source/ubl-settings-datetime.h:103 source/ubl-settings-datetime.h:102 -#: source/ubl-settings-datetime.cc:898 source/ubl-settings-datetime.cc:834 -#: source/ubl-settings-datetime.cc:817 source/ubl-settings-datetime.h:112 -msgid "An invalid character is entered" -msgstr "Введён недопустимый символ" - msgid "Anadyr" msgstr "Анадырь" @@ -160,11 +182,6 @@ msgstr "Арагуайна" msgid "Arctic" msgstr "Арктика" -#: source/ubl-settings-datetime.h:108 source/ubl-settings-datetime.h:107 -#: source/ubl-settings-datetime.h:117 -msgid "Argument not recognized\n" -msgstr "Нepacпoзнaнный аргумент\n" - msgid "Arizona" msgstr "Аризона" @@ -204,12 +221,6 @@ msgstr "Атка" msgid "Atlantic" msgstr "Атлантика" -#: source/ubl-settings-datetime.h:122 source/ubl-settings-datetime.h:121 -#: source/ubl-settings-datetime.cc:157 source/ubl-settings-datetime.cc:152 -#: source/ubl-settings-datetime.cc:147 source/ubl-settings-datetime.h:131 -msgid "Attention" -msgstr "Внимание" - msgid "Atyrau" msgstr "Атырау" @@ -219,9 +230,6 @@ msgstr "Окленд" msgid "Australia" msgstr "Австралия" -msgid "Automatic time synchronization" -msgstr "Автоматическая синхронизация времени" - msgid "Azores" msgstr "Азорские острова" @@ -369,11 +377,6 @@ msgstr "Канари" msgid "Canberra" msgstr "Канберра" -#: source/ubl-settings-datetime.h:81 source/ubl-settings-datetime.h:80 -#: source/ubl-settings-datetime.cc:172 source/ubl-settings-datetime.h:90 -msgid "Cancel" -msgstr "Отменить" - msgid "Cancun" msgstr "Канкун" @@ -413,12 +416,6 @@ msgstr "Сеута" msgid "Chagos" msgstr "Чагос" -msgid "Change the NTPSERVERS parameter" -msgstr "Изменить параметр NTPSERVERS" - -msgid "Change zone setting" -msgstr "Изменить параметр зоны" - msgid "Chatham" msgstr "Чатем" @@ -482,12 +479,6 @@ msgstr "Континентальный" msgid "Copenhagen" msgstr "Копенгаген" -#: source/ubl-settings-datetime.h:66 source/ubl-settings-datetime.h:65 -#: source/ubl-settings-datetime.cc:130 source/ubl-settings-datetime.cc:128 -#: source/ubl-settings-datetime.cc:123 source/ubl-settings-datetime.h:75 -msgid "Copyright © UBSoft LLC, 2022 - " -msgstr "Авторские права © ООО \"Юбисофт\", 2022 - " - msgid "Coral_Harbour" msgstr "Корал Харбор" @@ -506,15 +497,6 @@ msgstr "Куяба" msgid "Curacao" msgstr "Кюрасао" -#: source/ubl-settings-datetime.h:130 source/ubl-settings-datetime.h:129 -#: source/ubl-settings-datetime.cc:147 source/ubl-settings-datetime.cc:143 -#: source/ubl-settings-datetime.cc:138 source/ubl-settings-datetime.h:139 -msgid "Current date and time" -msgstr "Текущие дата и время" - -msgid "Currie" -msgstr "Карри" - msgid "Dacca" msgstr "Дакка" @@ -533,36 +515,6 @@ msgstr "Дар-эс-Салам" msgid "Darwin" msgstr "Дарвин" -#: source/ubl-settings-datetime.h:119 source/ubl-settings-datetime.h:118 -#: source/ubl-settings-datetime.cc:133 source/ubl-settings-datetime.cc:130 -#: source/ubl-settings-datetime.cc:125 source/ubl-settings-datetime.h:128 -msgid "Date and Time" -msgstr "Дата и Время" - -#: source/ubl-settings-datetime.h:100 source/ubl-settings-datetime.h:99 -#: source/ubl-settings-datetime.cc:1459 source/ubl-settings-datetime.cc:1477 -#: source/ubl-settings-datetime.cc:1508 source/ubl-settings-datetime.cc:1395 -#: source/ubl-settings-datetime.cc:1414 source/ubl-settings-datetime.cc:1445 -#: source/ubl-settings-datetime.h:109 -msgid "Date and time are successfully synchronized" -msgstr "Дата и время успешно синхронизированы" - -#: source/ubl-settings-datetime.h:131 source/ubl-settings-datetime.h:130 -#: source/ubl-settings-datetime.cc:140 source/ubl-settings-datetime.cc:136 -#: source/ubl-settings-datetime.cc:131 source/ubl-settings-datetime.h:140 -msgid "" -"Date of\n" -"Format: DD.MM.YYYY" -msgstr "" -"Дата\n" -"Формат: ДД.ММ.ГГГГ" - -#: source/ubl-settings-datetime.h:127 source/ubl-settings-datetime.h:126 -#: source/ubl-settings-datetime.cc:150 source/ubl-settings-datetime.cc:146 -#: source/ubl-settings-datetime.cc:141 source/ubl-settings-datetime.h:136 -msgid "Date:" -msgstr "Дата:" - msgid "Davis" msgstr "Дэвис" @@ -575,12 +527,6 @@ msgstr "Доусон Крик" msgid "DeNoronha" msgstr "Фернанду-ди-Норонья" -#: source/ubl-settings-datetime.h:114 source/ubl-settings-datetime.h:113 -#: source/ubl-settings-datetime.cc:143 source/ubl-settings-datetime.cc:139 -#: source/ubl-settings-datetime.cc:134 source/ubl-settings-datetime.h:123 -msgid "Default" -msgstr "По умолчанию" - msgid "Denver" msgstr "Денвер" @@ -593,12 +539,6 @@ msgstr "Дакка" msgid "Dili" msgstr "Дили" -#: source/ubl-settings-datetime.h:117 source/ubl-settings-datetime.h:116 -#: source/ubl-settings-datetime.cc:146 source/ubl-settings-datetime.cc:142 -#: source/ubl-settings-datetime.cc:137 source/ubl-settings-datetime.h:126 -msgid "Disabled" -msgstr "Отключено" - msgid "Djibouti" msgstr "Джибути" @@ -662,45 +602,6 @@ msgstr "Эндербери" msgid "Ensenada" msgstr "Энсенада" -#: source/ubl-settings-datetime.h:101 source/ubl-settings-datetime.h:100 -#: source/ubl-settings-datetime.cc:867 source/ubl-settings-datetime.cc:1139 -#: source/ubl-settings-datetime.cc:803 source/ubl-settings-datetime.cc:1075 -#: source/ubl-settings-datetime.h:110 -msgid "Enter a list of NTP servers" -msgstr "Введите перечень NTP серверов" - -#: source/ubl-settings-datetime.cc:791 source/ubl-settings-datetime.cc:1054 -#, fuzzy -msgid "Enter a list of ntp servers" -msgstr "Введите перечень NTP серверов" - -#: source/ubl-settings-datetime.h:133 source/ubl-settings-datetime.h:132 -#: source/ubl-settings-datetime.cc:141 source/ubl-settings-datetime.cc:137 -#: source/ubl-settings-datetime.cc:132 source/ubl-settings-datetime.h:142 -msgid "" -"Enter the name of the ntp-server or its ip-address.\n" -"When entering multiple addresses, separate them with commas." -msgstr "" -"Введите имя ntp-сервера или его ip-адрес.\n" -"При вводе нескольких адресов, разделяйте их запятыми." - -#: source/ubl-settings-datetime.h:102 source/ubl-settings-datetime.h:101 -#: source/ubl-settings-datetime.cc:903 source/ubl-settings-datetime.cc:839 -#: source/ubl-settings-datetime.h:111 -msgid "Error in the NTP server name" -msgstr "Ошибка в имени NTP сервера" - -#: source/ubl-settings-datetime.cc:821 -#, fuzzy -msgid "Error in the ntp name" -msgstr "Ошибка в имени NTP сервера" - -#: source/ubl-settings-datetime.h:92 source/ubl-settings-datetime.h:91 -#: source/ubl-settings-datetime.cc:745 source/ubl-settings-datetime.cc:681 -#: source/ubl-settings-datetime.cc:678 source/ubl-settings-datetime.h:101 -msgid "Error saved local and global configuration" -msgstr "Ошибка сохранения локальной и глобальной конфигурации" - msgid "Eucla" msgstr "Евкла" @@ -743,43 +644,6 @@ msgstr "ГМТ-1" msgid "GMT-3" msgstr "ГМТ-3" -#: source/ubl-settings-datetime.h:86 source/ubl-settings-datetime.h:85 -#: source/ubl-settings-datetime.h:95 -msgid "" -"Setting up the date and time for UBLinux\n" -"\n" -"Usage: ubl-settings-datetime [OPTIONS...]\n" -"Options:\n" -" -h, --help\t Show this help\n" -" -V, --version\t Show package version\n" -" --lock-datetime Lock date and time changes\n" -" --lock-timezone Lock time zone changes\n" -" --lock-ntp-mode Lock NTP mode selection\n" -" --lock-ntp-edit Lock editing NTP servers\n" -" --lock-sync-hwclock Lock sync hwclock mode selection\n" -" --lock-save Lock saving local and global configuration\n" -" --lock-save-local Lock save global configuration\n" -" --lock-save-global Lock load global configuration\n" -" --lock-load-global Lock load global configuration\n" -msgstr "" -"GTK-утилита настройки даты и времени для UBLinux\n" -"\n" -"Использование: ubl-settings-datetime [Параметры приложения...]\n" -"Параметры приложения:\n" -" -h, --help\t Показать параметры справки\n" -" -V, --version\t Показать версию пакета\n" -" --lock-datetime Блокировка изменения даты и времени\n" -" --lock-timezone Блокировка изменения часового пояса\n" -" --lock-ntp-mode Блокировка выбора режима NTP\n" -" --lock-ntp-edit Блокировка перечня NTP серверов\n" -" --lock-sync-hwclock Блокировка выбора режима синхронизации аппаратного " -"времени\n" -" --lock-save Блокировка сохранения локальной и глобальной " -"конфигурации\n" -" --lock-save-local Блокировка сохранения локальной конфигурации\n" -" --lock-save-global Блокировка сохранения глобальной конфигурации\n" -" --lock-load-global Блокировка загрузки глобальной конфигурации\n" - msgid "Gaborone" msgstr "Габороне" @@ -801,33 +665,6 @@ msgstr "Гибралтар" msgid "Glace_Bay" msgstr "Глейс-Бей" -#: source/ubl-settings-datetime.h:94 source/ubl-settings-datetime.h:93 -#: source/ubl-settings-datetime.cc:757 source/ubl-settings-datetime.cc:693 -#: source/ubl-settings-datetime.cc:690 source/ubl-settings-datetime.h:103 -msgid "Global configuration downloaded successfully" -msgstr "Успешно загружена глобальная конфигурация" - -#: source/ubl-settings-datetime.h:89 source/ubl-settings-datetime.h:88 -#: source/ubl-settings-datetime.cc:733 source/ubl-settings-datetime.cc:669 -#: source/ubl-settings-datetime.cc:666 source/ubl-settings-datetime.h:98 -msgid "Global configuration read error" -msgstr "Ошибка чтения глобальной конфигурации" - -#: source/ubl-settings-datetime.h:96 source/ubl-settings-datetime.h:95 -#: source/ubl-settings-datetime.cc:763 source/ubl-settings-datetime.cc:699 -#: source/ubl-settings-datetime.cc:696 source/ubl-settings-datetime.h:105 -msgid "Global configuration successfully written" -msgstr "Успешно записана глобальная конфигурация" - -#: source/ubl-settings-datetime.h:91 source/ubl-settings-datetime.h:90 -#: source/ubl-settings-datetime.cc:741 source/ubl-settings-datetime.cc:677 -#: source/ubl-settings-datetime.cc:674 source/ubl-settings-datetime.h:100 -msgid "Global configuration write error" -msgstr "Ошибка записи глобальной конфигурации" - -msgid "Global customization" -msgstr "Глобальная настройка" - msgid "Godthab" msgstr "Годтаб" @@ -873,18 +710,6 @@ msgstr "Хараре" msgid "Harbin" msgstr "Харбин" -#: source/ubl-settings-datetime.h:105 source/ubl-settings-datetime.h:104 -#: source/ubl-settings-datetime.cc:856 source/ubl-settings-datetime.cc:792 -#: source/ubl-settings-datetime.h:114 -msgid "Hardware clock successfully synchronized" -msgstr "Аппаратные часы успешно синхронизированы" - -#: source/ubl-settings-datetime.h:106 source/ubl-settings-datetime.h:105 -#: source/ubl-settings-datetime.cc:852 source/ubl-settings-datetime.cc:788 -#: source/ubl-settings-datetime.h:115 -msgid "Hardware clock synchronization error" -msgstr "Ошибка синхронизации аппаратных часов" - msgid "Havana" msgstr "Гавана" @@ -894,11 +719,6 @@ msgstr "Гавайи" msgid "Hebron" msgstr "Хеврон" -#: source/ubl-settings-datetime.h:72 source/ubl-settings-datetime.h:71 -#: source/ubl-settings-datetime.h:81 -msgid "Help" -msgstr "Справка" - msgid "Helsinki" msgstr "Хельсинки" @@ -920,14 +740,6 @@ msgstr "Гонолулу" msgid "Hovd" msgstr "Ховд" -#: source/ubl-settings-datetime.h:99 source/ubl-settings-datetime.h:98 -#: source/ubl-settings-datetime.cc:1503 source/ubl-settings-datetime.cc:1514 -#: source/ubl-settings-datetime.cc:1440 source/ubl-settings-datetime.cc:1451 -#: source/ubl-settings-datetime.cc:1402 source/ubl-settings-datetime.cc:1407 -#: source/ubl-settings-datetime.h:108 -msgid "Incorrect date format" -msgstr "Не верный формат даты" - msgid "Indian" msgstr "Индиана" @@ -940,9 +752,6 @@ msgstr "Индиана-Старке" msgid "Indianapolis" msgstr "Индианаполис" -msgid "Interactive date picker" -msgstr "Интерактивный выбор даты" - msgid "Inuvik" msgstr "Инувик" @@ -1099,52 +908,6 @@ msgstr "Лиссабон" msgid "Ljubljana" msgstr "Любляна" -#: source/ubl-settings-datetime.h:74 source/ubl-settings-datetime.h:73 -#: source/ubl-settings-datetime.cc:139 source/ubl-settings-datetime.cc:135 -#: source/ubl-settings-datetime.cc:130 source/ubl-settings-datetime.h:83 -msgid "Load" -msgstr "Загрузить" - -#: source/ubl-settings-datetime.h:78 source/ubl-settings-datetime.h:77 -#: source/ubl-settings-datetime.h:87 -msgid "Load global configuration" -msgstr "Загрузить глобальную конфигурацию" - -#: source/ubl-settings-datetime.h:79 source/ubl-settings-datetime.h:78 -#: source/ubl-settings-datetime.h:88 -msgid "Load local configuration" -msgstr "Загрузить локальную конфигурацию" - -#: source/ubl-settings-datetime.h:93 source/ubl-settings-datetime.h:92 -#: source/ubl-settings-datetime.cc:754 source/ubl-settings-datetime.cc:690 -#: source/ubl-settings-datetime.cc:687 source/ubl-settings-datetime.h:102 -msgid "Local configuration downloaded successfully" -msgstr "Успешно загружена локальная конфигурация" - -#: source/ubl-settings-datetime.h:88 source/ubl-settings-datetime.h:87 -#: source/ubl-settings-datetime.cc:729 source/ubl-settings-datetime.cc:665 -#: source/ubl-settings-datetime.cc:662 source/ubl-settings-datetime.h:97 -msgid "Local configuration reading error" -msgstr "Ошибка чтения локальной конфигурации" - -#: source/ubl-settings-datetime.h:95 source/ubl-settings-datetime.h:94 -#: source/ubl-settings-datetime.cc:760 source/ubl-settings-datetime.cc:696 -#: source/ubl-settings-datetime.cc:693 source/ubl-settings-datetime.h:104 -msgid "Local configuration successfully written" -msgstr "Успешно записана локальная конфигурация" - -#: source/ubl-settings-datetime.h:90 source/ubl-settings-datetime.h:89 -#: source/ubl-settings-datetime.cc:737 source/ubl-settings-datetime.cc:673 -#: source/ubl-settings-datetime.cc:670 source/ubl-settings-datetime.h:99 -msgid "Local configuration write error" -msgstr "Ошибка записи локальной конфигурации" - -#: source/ubl-settings-datetime.h:121 source/ubl-settings-datetime.h:120 -#: source/ubl-settings-datetime.cc:161 source/ubl-settings-datetime.cc:156 -#: source/ubl-settings-datetime.cc:151 source/ubl-settings-datetime.h:130 -msgid "Local time" -msgstr "Локальное время" - msgid "Lome" msgstr "Ломе" @@ -1226,12 +989,6 @@ msgstr "Манаус" msgid "Manila" msgstr "Манила" -#: source/ubl-settings-datetime.h:116 source/ubl-settings-datetime.h:115 -#: source/ubl-settings-datetime.cc:145 source/ubl-settings-datetime.cc:141 -#: source/ubl-settings-datetime.cc:136 source/ubl-settings-datetime.h:125 -msgid "Manual" -msgstr "Вручную" - msgid "Maputo" msgstr "Мапуту" @@ -1349,17 +1106,6 @@ msgstr "Мускат" msgid "NSW" msgstr "Новый Южный Уэльс" -#: source/ubl-settings-datetime.cc:818 -#, fuzzy -msgid "NTP is correct" -msgstr "Имя NTP сервера корректно" - -#: source/ubl-settings-datetime.h:104 source/ubl-settings-datetime.h:103 -#: source/ubl-settings-datetime.cc:891 source/ubl-settings-datetime.cc:827 -#: source/ubl-settings-datetime.h:113 -msgid "NTP server name is correct" -msgstr "Имя NTP сервера корректно" - msgid "Nairobi" msgstr "Найроби" @@ -1408,15 +1154,6 @@ msgstr "Север" msgid "North_Dokota" msgstr "Северная Докота" -#: source/ubl-settings-datetime.h:83 source/ubl-settings-datetime.h:82 -#: source/ubl-settings-datetime.cc:473 source/ubl-settings-datetime.cc:502 -#: source/ubl-settings-datetime.cc:533 source/ubl-settings-datetime.cc:434 -#: source/ubl-settings-datetime.cc:466 source/ubl-settings-datetime.cc:497 -#: source/ubl-settings-datetime.cc:433 source/ubl-settings-datetime.cc:464 -#: source/ubl-settings-datetime.cc:494 source/ubl-settings-datetime.h:92 -msgid "Nothing to save!" -msgstr "Нечего сохранять!" - msgid "Nouakchott" msgstr "Нуакшот" @@ -1522,12 +1259,6 @@ msgstr "Порту-Велью" msgid "Prague" msgstr "Прага" -#: source/ubl-settings-datetime.h:69 source/ubl-settings-datetime.h:68 -#: source/ubl-settings-datetime.cc:136 source/ubl-settings-datetime.cc:133 -#: source/ubl-settings-datetime.cc:128 source/ubl-settings-datetime.h:78 -msgid "Project Home Page" -msgstr "Домашняя страница проекта" - msgid "Puerto_Rico" msgstr "Пуэрто-Рико" @@ -1561,23 +1292,12 @@ msgstr "Ранкин-Инлет" msgid "Rarotonga" msgstr "Раротонга" -#: source/ubl-settings-datetime.h:80 source/ubl-settings-datetime.h:79 -#: source/ubl-settings-datetime.cc:171 source/ubl-settings-datetime.h:89 -msgid "Read online" -msgstr "Прочитать онлайн" - msgid "Recife" msgstr "Ресифи" msgid "Regina" msgstr "Реджайна" -#: source/ubl-settings-datetime.h:125 source/ubl-settings-datetime.h:124 -#: source/ubl-settings-datetime.cc:152 source/ubl-settings-datetime.cc:148 -#: source/ubl-settings-datetime.cc:143 source/ubl-settings-datetime.h:134 -msgid "Region:" -msgstr "Регион:" - msgid "Resolute" msgstr "Резольют" @@ -1665,45 +1385,12 @@ msgstr "Саратов" msgid "Saskatchewan" msgstr "Саскачеван" -#: source/ubl-settings-datetime.h:73 source/ubl-settings-datetime.h:72 -#: source/ubl-settings-datetime.cc:138 source/ubl-settings-datetime.cc:134 -#: source/ubl-settings-datetime.cc:129 source/ubl-settings-datetime.h:82 -msgid "Save" -msgstr "Сохранить" - -#: source/ubl-settings-datetime.h:77 source/ubl-settings-datetime.h:76 -msgid "Save to global configuration" -msgstr "Сохранить в глобальную конфигурацию" - -#: source/ubl-settings-datetime.h:76 source/ubl-settings-datetime.h:75 -msgid "Save to local configuration" -msgstr "Сохранить в локальную конфигурацию" - -#: source/ubl-settings-datetime.h:75 source/ubl-settings-datetime.h:74 -msgid "Save configuration" -msgstr "Сохранить конфигурацию" - msgid "Scoresbysund" msgstr "Скорсбисунд" -msgid "Select the method of hardware time synchronization" -msgstr "Выберите способ синхронизации аппаратного времени" - msgid "Seoul" msgstr "Сеул" -msgid "Setting date and time in global configuration" -msgstr "Настройка даты и времени в глобальной конфигурации" - -#: source/ubl-settings-datetime.h:129 source/ubl-settings-datetime.h:128 -#: source/ubl-settings-datetime.cc:148 source/ubl-settings-datetime.cc:144 -#: source/ubl-settings-datetime.cc:139 -msgid "Setting the date and time" -msgstr "Настройка даты и времени" - -msgid "Settings the date and time" -msgstr "Настройки даты и времени" - msgid "Shanghai" msgstr "Шанхай" @@ -1764,44 +1451,12 @@ msgstr "Стэнли" msgid "Stockholm" msgstr "Стокгольм" -msgid "Stop the synchronization service" -msgstr "Остановить сервис синхронизации" - -#: source/ubl-settings-datetime.h:97 source/ubl-settings-datetime.h:96 -#: source/ubl-settings-datetime.cc:766 source/ubl-settings-datetime.cc:702 -#: source/ubl-settings-datetime.cc:699 source/ubl-settings-datetime.h:106 -msgid "Successfully saved local and global configuration" -msgstr "Успешно сохранена локальная и глобальная конфигурация" - msgid "Swift_Current" msgstr "Суифт-Каррент" msgid "Sydney" msgstr "Сидней" -#: source/ubl-settings-datetime.h:123 source/ubl-settings-datetime.h:122 -#: source/ubl-settings-datetime.cc:154 source/ubl-settings-datetime.cc:150 -#: source/ubl-settings-datetime.cc:145 source/ubl-settings-datetime.h:132 -msgid "Sync by" -msgstr "Синхронизировать" - -#: source/ubl-settings-datetime.h:128 source/ubl-settings-datetime.h:127 -#: source/ubl-settings-datetime.cc:158 source/ubl-settings-datetime.cc:153 -#: source/ubl-settings-datetime.cc:148 source/ubl-settings-datetime.h:137 -msgid "Synchronize hardware time" -msgstr "Синхронизировать аппаратное время" - -#: source/ubl-settings-datetime.cc:159 source/ubl-settings-datetime.cc:154 -#: source/ubl-settings-datetime.cc:149 -msgid "Synchronize hardware time:" -msgstr "Синхронизировать аппаратное время:" - -#: source/ubl-settings-datetime.h:132 source/ubl-settings-datetime.h:131 -#: source/ubl-settings-datetime.cc:142 source/ubl-settings-datetime.cc:138 -#: source/ubl-settings-datetime.cc:133 source/ubl-settings-datetime.h:141 -msgid "Synchronize via NTP" -msgstr "Синхронизировать через NTP" - msgid "Syowa" msgstr "Сёва" @@ -1838,19 +1493,6 @@ msgstr "Тель-Авив" msgid "Tell_City" msgstr "Телл-Сити" -#: source/ubl-settings-datetime.h:109 source/ubl-settings-datetime.h:108 -#: source/ubl-settings-datetime.cc:122 source/ubl-settings-datetime.cc:120 -#: source/ubl-settings-datetime.cc:115 source/ubl-settings-datetime.h:118 -msgid "The program must be run as root" -msgstr "Программа должна быть запущена с правами суперпользователя!" - -msgid "" -"The program must be run with \n" -"superuser privileges!" -msgstr "" -"Программа должна быть запущена с правами \n" -"суперпользователя!" - msgid "Thimbu" msgstr "Тимбу" @@ -1869,18 +1511,6 @@ msgstr "Тихуана" msgid "Timbuktu" msgstr "Тимбукту" -#: source/ubl-settings-datetime.h:126 source/ubl-settings-datetime.h:125 -#: source/ubl-settings-datetime.cc:151 source/ubl-settings-datetime.cc:147 -#: source/ubl-settings-datetime.cc:142 source/ubl-settings-datetime.h:135 -msgid "Time zone" -msgstr "Часовой пояс" - -#: source/ubl-settings-datetime.h:118 source/ubl-settings-datetime.h:117 -#: source/ubl-settings-datetime.cc:149 source/ubl-settings-datetime.cc:145 -#: source/ubl-settings-datetime.cc:140 source/ubl-settings-datetime.h:127 -msgid "Time:" -msgstr "Время:" - msgid "Tirane" msgstr "Тиран" @@ -1920,12 +1550,6 @@ msgstr "Тунис" msgid "US" msgstr "США" -#: source/ubl-settings-datetime.h:120 source/ubl-settings-datetime.h:119 -#: source/ubl-settings-datetime.cc:160 source/ubl-settings-datetime.cc:155 -#: source/ubl-settings-datetime.cc:150 source/ubl-settings-datetime.h:129 -msgid "UTC time" -msgstr "Время по UTC" - msgid "Ujung_Pandang" msgstr "Уджунг_Панданг" @@ -2016,11 +1640,6 @@ msgstr "Виндхук" msgid "Winnipeg" msgstr "Виннипег" -#: source/ubl-settings-datetime.h:84 source/ubl-settings-datetime.h:83 -#: source/ubl-settings-datetime.cc:168 source/ubl-settings-datetime.h:93 -msgid "Would you like to read documentation in the Web?" -msgstr "Вы хотите прочитать справку в Сети?" - msgid "Yakutat" msgstr "Якутат" @@ -2045,19 +1664,6 @@ msgstr "Йеллоунайф" msgid "Yerevan" msgstr "Ереван" -#: source/ubl-settings-datetime.h:85 source/ubl-settings-datetime.h:84 -#: source/ubl-settings-datetime.cc:169 source/ubl-settings-datetime.h:94 -msgid "" -"You will be redirected to documentation website where documentation is\n" -"translated and supported by community." -msgstr "" -"Вы будете перенаправлены на сайт с документацией где страницы помощи\n" -"переводятся и поддерживаются сообществом." - -#: source/ubl-settings-datetime.h:138 -msgid "Setting the system date and time" -msgstr "Настройка даты и времени системы" - msgid "Yukon" msgstr "Юкон" @@ -2067,51 +1673,8 @@ msgstr "Загреб" msgid "Zaporozhye" msgstr "Запорожье" -#: source/ubl-settings-datetime.h:124 source/ubl-settings-datetime.h:123 -#: source/ubl-settings-datetime.cc:153 source/ubl-settings-datetime.cc:149 -#: source/ubl-settings-datetime.cc:144 source/ubl-settings-datetime.h:133 -msgid "Zone:" -msgstr "Зона:" - msgid "Zulu" msgstr "Зулу" msgid "Zurich" msgstr "Цюрих" - -#: source/ubl-settings-datetime.h:68 source/ubl-settings-datetime.h:67 -#: source/ubl-settings-datetime.cc:134 source/ubl-settings-datetime.cc:131 -#: source/ubl-settings-datetime.cc:126 source/ubl-settings-datetime.h:77 -msgid "https://wiki.ublinux.com" -msgstr "https://wiki.ublinux.ru" - -#: source/ubl-settings-datetime.cc:387 -msgid "" -"https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/" -msgstr "" -"https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/" - -#: source/ubl-settings-datetime.h:67 source/ubl-settings-datetime.h:66 -#: source/ubl-settings-datetime.cc:131 source/ubl-settings-datetime.cc:155 -#: source/ubl-settings-datetime.cc:156 source/ubl-settings-datetime.cc:151 -#: source/ubl-settings-datetime.cc:146 source/ubl-settings-datetime.h:76 -msgid "ubl-settings-datetime" -msgstr "Дата и время" - -#: source/ubl-settings-datetime.h:87 source/ubl-settings-datetime.h:86 -#: source/ubl-settings-datetime.cc:1714 source/ubl-settings-datetime.cc:1651 -#: source/ubl-settings-datetime.cc:1606 source/ubl-settings-datetime.h:96 -msgid "ubl-settings-datetime version: " -msgstr "ubl-settings-datetime версия: " - -#: source/ubl-settings-datetime.h:84 -msgid "Save in global and local configuration" -msgstr "Сохранить конфигурацию" - -#: source/ubl-settings-datetime.h:85 -msgid "Save in local configuration" -msgstr "Сохранить в локальную конфигурацию" - -#: source/ubl-settings-datetime.h:86 -msgid "Save in global configuration" -msgstr "Сохранить в глобальную конфигурацию"