Merge pull request 'master' (#71) from Igor1/ubl-settings-datetime:master into develop

Reviewed-on: #71
pull/72/head
Dmitry Razumov 3 years ago
commit e903d01fea

@ -21,6 +21,11 @@ all: init build
init: init:
@echo "Initialize ..."; \ @echo "Initialize ..."; \
version="$$(cat VERSION.md)"; \
version=$${version:8}; \
search="s/string version_application.*$&"; \
replace="string version_application = \"$${version}\";"; \
sed -i -e "$$search/$$replace/gi" source/ubl-settings-datetime.h; \
echo "-- Build path: ${CMAKE_BUILD_DIR}" echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend: depend:

@ -16,5 +16,3 @@ if [[ -z ${VER} ]] ; then
fi fi
echo ":: Updated VERSION ${CURRENT} to ${VER}" echo ":: Updated VERSION ${CURRENT} to ${VER}"
find ../ -maxdepth 2 -type f -iname "${FILE_VERSION}" -exec echo ":: Insert version in file: {}" \; -exec sed "s/VERSION *[[:digit:]]*.*/VERSION ${VER}/" -i {} \; find ../ -maxdepth 2 -type f -iname "${FILE_VERSION}" -exec echo ":: Insert version in file: {}" \; -exec sed "s/VERSION *[[:digit:]]*.*/VERSION ${VER}/" -i {} \;

@ -3,7 +3,7 @@
void pars_flag(int index_start, int argc, char* argv[]); void pars_flag(int index_start, int argc, char* argv[]);
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
string str_argv=""; string str_argv= "";
string str_cmd_argv = ""; string str_cmd_argv = "";
for (int i=1; i<argc; i++){ for (int i=1; i<argc; i++){
str_cmd_argv+= to_string(*argv[i]) + " "; str_cmd_argv+= to_string(*argv[i]) + " ";
@ -13,11 +13,11 @@ int main(int argc, char* argv[]) {
bindtextdomain("ubl-settings-datetime", "/usr/share/locale/"); bindtextdomain("ubl-settings-datetime", "/usr/share/locale/");
bind_textdomain_codeset("ubl-settings-datetime", "UTF-8"); bind_textdomain_codeset("ubl-settings-datetime", "UTF-8");
textdomain("ubl-settings-datetime"); textdomain("ubl-settings-datetime");
if (argc>1){ if (argc > 1){
str_argv = argv[1]; str_argv = argv[1];
} }
if (str_argv.find("--socket-id")!=std::string::npos){ if (str_argv.find("--socket-id") != std::string::npos){
pars_flag(3, argc, argv); pars_flag(3, argc, argv);
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug"); auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug");
@ -44,7 +44,7 @@ int main(int argc, char* argv[]) {
app->run(plug); app->run(plug);
return 0; return 0;
} }
else if (str_argv.find("-")!=std::string::npos || argc==1){ else if (str_argv.find("-") != std::string::npos || argc == 1){
int len_argv = 1; int len_argv = 1;
auto app = Gtk::Application::create(len_argv, argv, "org.gtkmm.example.plug"); auto app = Gtk::Application::create(len_argv, argv, "org.gtkmm.example.plug");
auto builder = Gtk::Builder::create_from_file(path_glade + "ubl-settings-datetime.glade"); auto builder = Gtk::Builder::create_from_file(path_glade + "ubl-settings-datetime.glade");
@ -62,10 +62,10 @@ int main(int argc, char* argv[]) {
} }
void pars_flag(int index_start, int argc, char* argv[]){ void pars_flag(int index_start, int argc, char* argv[]){
string str_argv=""; string str_argv = "";
for (int i=index_start; i<argc; i++){ for (int i = index_start; i<argc; i++){
str_argv = argv[i]; str_argv = argv[i];
if (str_argv=="--help" || str_argv=="-h"){ if (str_argv == "--help" || str_argv == "-h"){
help(); help();
exit (1); exit (1);
} }

File diff suppressed because it is too large Load Diff

@ -20,11 +20,11 @@
using namespace std; using namespace std;
extern string path_app; extern const string path_app;
extern string path_glade; extern const string path_glade;
extern string app_name; extern const string app_name;
extern string path_locale; extern const string path_locale;
extern string path_css; extern const string path_css;
extern bool flag_datetime; extern bool flag_datetime;
extern bool flag_timezone; extern bool flag_timezone;
extern bool flag_ntp_mode; extern bool flag_ntp_mode;
@ -72,7 +72,6 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::Label *lblTimeZone; Gtk::Label *lblTimeZone;
Gtk::Label *lblReg; Gtk::Label *lblReg;
Gtk::Label *lblZone; Gtk::Label *lblZone;
Gtk::Label *lblZone1Glob;
Gtk::Label *lblSynchronizebChk; Gtk::Label *lblSynchronizebChk;
Gtk::Label *lblSynchronizebChkGLob; Gtk::Label *lblSynchronizebChkGLob;
Gtk::Label *lblSynchronizeBtn; Gtk::Label *lblSynchronizeBtn;
@ -105,16 +104,27 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::Label *lblHeader; Gtk::Label *lblHeader;
Gtk::Label *lblHW; Gtk::Label *lblHW;
Gtk::ComboBoxText *cbHw; Gtk::ComboBoxText *cbHw;
unsigned int year=0; Gtk::Box *boxDateTime;
unsigned int month=0; Gtk::Widget *boxButton;
unsigned int day=0; Gtk::Widget *boxSave;
Gtk::Widget *standartHead;
Gtk::Widget *plugBox;
Gtk::Window *window;
Gtk::Image *imgDonwload;
Gtk::Image *imgSave;
Gtk::Image *imgSettings;
unsigned int year = 0;
unsigned int month = 0;
unsigned int day = 0;
string version_application = "1.3";
int error_info = 0; int error_info = 0;
int warning_info = 0; int warning_info = 0;
int hour; int hour;
int minute; int minute;
string str_region=""; string str_region = "";
string str_zone=""; string str_zone = "";
bool bool_close_banner_info=true; bool bool_close_banner_info = true;
template<typename Type> template<typename Type>
struct Result{ struct Result{
Type response; Type response;
@ -130,7 +140,8 @@ class MainWindow : public Gtk::ApplicationWindow {
void hardware_clock_global(string &local, string &etc); void hardware_clock_global(string &local, string &etc);
void info_warning_error(int mess); void info_warning_error(int mess);
void synopsis_show(); void synopsis_show();
void entry_hardware_clock(string &cmd); void entry_hardware_clock(string &cmd, string &cmd_default);
void entry_hardware_clock_default(string &cmd_default);
void save_global_local_cfg(); void save_global_local_cfg();
void fill_in_reg_zone(string &cmd); void fill_in_reg_zone(string &cmd);
void download_globl_cfg(); void download_globl_cfg();
@ -174,7 +185,7 @@ class MainWindow : public Gtk::ApplicationWindow {
void wrapper_update_time_date(); void wrapper_update_time_date();
string zone_file_read(string zone); string zone_file_read(string zone);
void sort_zone(vector<string> *time_reg_map_local,vector<string> *time_reg_map); void sort_zone(vector<string> *time_reg_map_local,vector<string> *time_reg_map);
array<string, 2> split_region_zone(string read_reg_zon_cfg); array<string, 2> split_region_zone(string &read_reg_zon_cfg);
string str_remove(std::string& source, const std::string to_remove); string str_remove(std::string& source, const std::string to_remove);
vector<std::string> split(const std::string &s, char delim); vector<std::string> split(const std::string &s, char delim);
struct Result<string> wrapper_call(string cmd); struct Result<string> wrapper_call(string cmd);

@ -26,60 +26,56 @@
padding: 3px 10px 5px 5px; padding: 3px 10px 5px 5px;
} }
.menuitemtop:hover { .menuitemtop:hover {
border-radius:3px;
background:@theme_bg_color; background:@theme_bg_color;
} }
.menuitemmiddle:hover { .menuitemmiddle:hover {
border-radius:3px;
background:@theme_bg_color; background:@theme_bg_color;
} }
.menuitembottom:hover { .menuitembottom:hover {
border-radius:3px;
background:@theme_bg_color; background:@theme_bg_color;
} }
.menuitemtop:hover* { .menuitemtop:hover* {
border-radius:3px;
margin:2px 2px 0 2px; margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px; padding: 5px 10px 3px 5px;
background:@theme_selected_bg_color; background:@theme_selected_bg_color;
border-radius:2px;
border-color:transparent; border-color:transparent;
} }
.menuitemmiddle:hover* { .menuitemmiddle:hover* {
border-radius:3px;
margin:0 2px 0 2px; margin:0 2px 0 2px;
padding: 3px 10px 3px 5px; padding: 3px 10px 3px 5px;
background:@theme_selected_bg_color; background:@theme_selected_bg_color;
border-radius:2px;
border-color:transparent; border-color:transparent;
} }
.menuitembottom:hover* { .menuitembottom:hover* {
border-radius:3px;
margin:0 2px 2px 2px; margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px; padding: 3px 10px 5px 5px;
background:@theme_selected_bg_color; background:@theme_selected_bg_color;
border-radius:2px;
border-color:transparent; border-color:transparent;
} }
.menuitembottom{ .menuitembottom{
margin-top:0px; margin-top:0px;
border-color:alpha(@theme_text_color, 0.4);
border-style:solid;
border-radius:0 0 5px 5px;
border-left-width:1px;
border-bottom-width:1px;
border-right-width:1px;
} }
.menuitemmiddle{ .menuitemmiddle{
margin-top:0px; margin-top:0px;
margin-bottom:0px; margin-bottom:0px;
border-color:alpha(@theme_text_color, 0.4);
border-style:solid;
border-left-width:1px;
border-right-width:1px;
} }
.menuitemtop{ .menuitemtop{
margin-bottom:0px; margin-bottom:0px;
border-color:alpha(@theme_text_color, 0.4); }
border-style:solid;
border-radius:5px 5px 0 0; .bkim{
border-left-width:1px; background-image: -gtk-gradient(linear,
border-top-width:1px; left top, left bottom,
border-right-width:1px; from(@entry_background_a),
color-stop(0.20, @entry_background_b),
color-stop(0.85, @entry_background_c),
to(@entry_background_d));
} }

@ -88,7 +88,7 @@
<object class="GtkMenuItem" id="btnSynopsis"> <object class="GtkMenuItem" id="btnSynopsis">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Synopsis</property> <property name="label" translatable="yes">Help</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<style> <style>
<class name="menuitemtop"/> <class name="menuitemtop"/>
@ -323,7 +323,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox" id="boxDateTime">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
@ -457,7 +457,7 @@ Format: DD.MM.YYYY</property>
<property name="margin-bottom">6</property> <property name="margin-bottom">6</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">5</property> <property name="position">5</property>
</packing> </packing>
@ -550,7 +550,7 @@ Format: DD.MM.YYYY</property>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
@ -680,7 +680,6 @@ Format: DD.MM.YYYY</property>
</child> </child>
<child> <child>
<object class="GtkEntry" id="txtNtpServer"> <object class="GtkEntry" id="txtNtpServer">
<property name="width-request">-1</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="tooltip-text" translatable="yes">Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces.</property> <property name="tooltip-text" translatable="yes">Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces.</property>
@ -754,19 +753,31 @@ Format: DD.MM.YYYY</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin-left">8</property> <property name="margin-left">8</property>
<property name="margin-right">31</property> <property name="margin-right">5</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">31</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">6</property>
<property name="margin-bottom">13</property> <property name="margin-bottom">13</property>
<property name="label" translatable="yes">Synchronize hardware time:</property> <property name="label" translatable="yes">Synchronize hardware time:</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-end">55</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child> <child>
<object class="GtkComboBoxText" id="cbHw"> <object class="GtkComboBoxText" id="cbHw">
<property name="visible">True</property> <property name="visible">True</property>
@ -783,7 +794,7 @@ Format: DD.MM.YYYY</property>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -817,7 +828,7 @@ Format: DD.MM.YYYY</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">6</property>
<property name="margin-bottom">6</property> <property name="margin-bottom">13</property>
<property name="label" translatable="yes" context="Region" comments="Region">Region</property> <property name="label" translatable="yes" context="Region" comments="Region">Region</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
@ -829,7 +840,6 @@ Format: DD.MM.YYYY</property>
</child> </child>
<child> <child>
<object class="GtkComboBoxText" id="cbRegion"> <object class="GtkComboBoxText" id="cbRegion">
<property name="width-request">167</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-left">5</property> <property name="margin-left">5</property>
@ -842,7 +852,7 @@ Format: DD.MM.YYYY</property>
<property name="vexpand">False</property> <property name="vexpand">False</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
@ -851,9 +861,9 @@ Format: DD.MM.YYYY</property>
<object class="GtkLabel" id="lblZone"> <object class="GtkLabel" id="lblZone">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-left">10</property> <property name="margin-left">5</property>
<property name="margin-right">5</property> <property name="margin-right">5</property>
<property name="margin-start">10</property> <property name="margin-start">5</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">6</property>
<property name="margin-bottom">13</property> <property name="margin-bottom">13</property>
@ -956,11 +966,11 @@ Format: DD.MM.YYYY</property>
<object class="GtkLabel" id="lblHeader"> <object class="GtkLabel" id="lblHeader">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">start</property>
<property name="margin-left">5</property> <property name="margin-left">5</property>
<property name="margin-right">5</property> <property name="margin-right">5</property>
<property name="margin-start">5</property> <property name="margin-start">5</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-bottom">2</property>
<property name="hexpand">False</property> <property name="hexpand">False</property>
<property name="label" translatable="yes">ubl-settings-datetime</property> <property name="label" translatable="yes">ubl-settings-datetime</property>
<attributes> <attributes>
@ -1014,7 +1024,7 @@ Format: DD.MM.YYYY</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage"> <object class="GtkImage" id="imgDonwload">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">pan-down-symbolic</property> <property name="icon-name">pan-down-symbolic</property>
@ -1079,7 +1089,7 @@ Format: DD.MM.YYYY</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage"> <object class="GtkImage" id="imgSave">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">pan-down-symbolic</property> <property name="icon-name">pan-down-symbolic</property>
@ -1109,7 +1119,7 @@ Format: DD.MM.YYYY</property>
<property name="popup">menu1</property> <property name="popup">menu1</property>
<property name="direction">none</property> <property name="direction">none</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage" id="imgSettings">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">open-menu-symbolic</property> <property name="icon-name">open-menu-symbolic</property>
@ -1134,6 +1144,30 @@ Format: DD.MM.YYYY</property>
</object> </object>
</child> </child>
</object> </object>
<object class="GtkSizeGroup">
<property name="mode">both</property>
<property name="ignore-hidden">True</property>
<widgets>
<widget name="cbRegion"/>
<widget name="cbZone"/>
</widgets>
</object>
<object class="GtkSizeGroup">
<property name="mode">both</property>
<property name="ignore-hidden">True</property>
<widgets>
<widget name="btnUpdateDateTime"/>
<widget name="lblHW"/>
</widgets>
</object>
<object class="GtkSizeGroup">
<property name="mode">both</property>
<property name="ignore-hidden">True</property>
<widgets>
<widget name="cbHw"/>
<widget name="cbZone"/>
</widgets>
</object>
<object class="GtkPopover" id="popCalendar"> <object class="GtkPopover" id="popCalendar">
<property name="width-request">240</property> <property name="width-request">240</property>
<property name="height-request">185</property> <property name="height-request">185</property>

@ -19,6 +19,9 @@ msgstr ""
msgid "Select the method of hardware time synchronization" msgid "Select the method of hardware time synchronization"
msgstr "Выберите способ синхронизации аппаратного времени" msgstr "Выберите способ синхронизации аппаратного времени"
msgid "https://wiki.ublinux.com"
msgstr "https://wiki.ublinux.ru"
msgid "Local time" msgid "Local time"
msgstr "Локальное время" msgstr "Локальное время"
@ -1759,7 +1762,7 @@ msgstr "Андорра"
msgid "About the program" msgid "About the program"
msgstr "О программе" msgstr "О программе"
msgid "Synopsis" msgid "Help"
msgstr "Справка" msgstr "Справка"
msgid "Local configuration reading error" msgid "Local configuration reading error"

Loading…
Cancel
Save