master #55

Merged
asmeron merged 23 commits from :master into develop 3 years ago

@ -111,6 +111,8 @@ install: check uninstall
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" "${pkgname}.svg"
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" "${pkgname}.png"
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" bg_top.png
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" checked.svg
@install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" warning.svg
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/
@update-desktop-database --quiet 2>/dev/null
@touch /usr/share/applications

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 24 24"
id="svg2"
version="1.1"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
sodipodi:docname="alert.svg"
width="24"
height="24"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1027"
id="namedview8"
showgrid="false"
inkscape:zoom="26.825864"
inkscape:cx="10.735908"
inkscape:cy="11.462818"
inkscape:current-layer="svg2"
inkscape:pagecheckerboard="0"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<path
id="path4140"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 12 1 A 11 11 0 0 0 1 12 A 11 11 0 0 0 12 23 A 11 11 0 0 0 23 12 A 11 11 0 0 0 12 1 z M 3.75 10.625 L 20.25 10.625 L 20.25 13.375 L 3.75 13.375 L 3.75 10.625 z " />
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
version="1.1"
viewBox="0 0 24 24"
id="svg25"
sodipodi:docname="checked.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview27"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="14.8125"
inkscape:cx="-4.6919831"
inkscape:cy="9.9578059"
inkscape:window-width="1920"
inkscape:window-height="1027"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg25" />
<defs
id="defs19">
<style
id="current-color-scheme"
type="text/css">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style3">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style5">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style7">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style9">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style11">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style13">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style15">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style17">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
</defs>
<path
id="path21"
d="M 12 1 C 5.906 1 1 5.906 1 12 C 1 18.094 5.906 23 12 23 C 18.094 23 23 18.094 23 12 C 23 5.906 18.094 1 12 1 z M 15.480469 8.9042969 C 16.392469 8.8782969 16.860031 9.9850937 16.207031 10.621094 L 11 15.828125 L 8.09375 12.921875 C 7.11175 11.979875 8.5648125 10.525813 9.5078125 11.507812 L 11 13 L 14.792969 9.2070312 A 1 1 0 0 1 15.480469 8.9042969 z "
style="fill:#4d4d4d;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 24 24"
id="svg2"
version="1.1"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
sodipodi:docname="close.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1027"
id="namedview8"
showgrid="false"
inkscape:zoom="8"
inkscape:cx="6.875"
inkscape:cy="11.0625"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:pagecheckerboard="0" />
<path
d="M 3.8312451,0.00270105 C 6.6165637,2.6335365 9.2800785,5.3919927 12.002108,8.0876398 14.724116,5.3918531 17.387684,2.6337829 20.172977,0.00270105 l 3.827655,3.82765225 c -2.630952,2.7854245 -5.389244,5.4487758 -8.084944,8.1708607 2.695781,2.722007 5.453855,5.385575 8.084944,8.170866 l -3.827655,3.827648 c -2.78543,-2.630944 -5.448781,-5.389235 -8.170869,-8.084934 -2.7220013,2.695782 -5.3855699,5.453852 -8.1708629,8.084934 L 0.0035959,20.17208 C 2.634542,17.386651 5.3928334,14.723302 8.0885352,12.001214 5.3927504,9.2792119 2.6346777,6.6156425 0.0035959,3.8303533 Z"
style="fill:#ffffff;stroke-width:2.18155"
id="path6"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 60 KiB

@ -13,9 +13,11 @@ find_package(ICU REQUIRED COMPONENTS uc dt in io)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
-O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection ")
-fstack-clash-protection -fcf-protection")
set(SOURCE_FILES
ubl-util-standard.h
ubl-util-standard.c
main.cc
ubl-settings-datetime.cc
ubl-settings-datetime.h)

@ -1,10 +1,7 @@
#include <gtkmm/window.h>
#include <gtkmm.h>
#include <string>
#include <iostream>
#include <libintl.h>
#include <locale.h>
#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 = "";
@ -20,8 +17,9 @@ int main(int argc, char* argv[]) {
str_argv = argv[1];
}
if ((str_argv.find("-s")!=std::string::npos) || (str_argv.find("--socket-id")!=std::string::npos)){
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_file(path_glade + "ubl-settings-datetime.glade");
Glib::init();
@ -50,29 +48,7 @@ int main(int argc, char* argv[]) {
int len_argv = 1;
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");
for (int i=1; i<argc; i++){
str_argv = argv[i];
if (str_argv=="--help" || str_argv=="-h"){
help();
return 1;
}
else if (str_argv=="--lock-datetime"){
flag_datetime=true;
}
else if (str_argv=="--lock-timezone"){
flag_timezone=true;
}
else if (str_argv=="--lock-ntp"){
flag_ntp=true;
}
else if (str_argv=="--lock-update"){
flag_update=true;
}
else{
g_print(gettext("Argument not recognized\n"));
}
}
pars_flag(1, argc, argv);
MainWindow* wnd = nullptr;
builder->get_widget_derived("window", wnd);
auto r = app->run(*wnd);
@ -84,3 +60,44 @@ int main(int argc, char* argv[]) {
return 0;
}
}
void pars_flag(int index_start, int argc, char* argv[]){
string str_argv="";
for (int i=index_start; i<argc; i++){
str_argv = argv[i];
if (str_argv=="--help" || str_argv=="-h"){
help();
exit (1);
}
else if (str_argv == "--lock-datetime"){
flag_datetime = true;
}
else if (str_argv == "--lock-timezone"){
flag_timezone = true;
}
else if (str_argv == "--lock-ntp-mode"){
flag_ntp_mode = true;
}
else if (str_argv == "--lock-ntp-edit"){
flag_ntp_edit = true;
}
else if (str_argv == "--lock-save"){
flag_save = true;
}
else if (str_argv == "--lock-save-local"){
flag_save_local = true;
}
else if (str_argv == "--lock-save-global"){
flag_save_global = true;
}
else if (str_argv == "--lock-load-global"){
flag_load_global = true;
}
else{
if (index_start == 1){
g_print(gettext("Argument not recognized\n"));
}
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,14 +1,21 @@
#ifndef UBL_SETTINGS_DATETIME_H
#define UBL_SETTINGS_DATETIME_H
#include <gtkmm/window.h>
#include <iostream>
#include <gtkmm.h>
#include <string>
#include <vector>
#include <map>
#include <glibmm/i18n.h>
#include <gtkmm/plug.h>
#include <gtkmm/stock.h>
#include <gtkmm.h>
#include <iostream>
#include <map>
#include <string>
#include <array>
#include <vector>
#include <fstream>
#include <filesystem>
#include <stdio.h>
#include <unicode/timezone.h>
#include <unicode/calendar.h>
#include "ubl-util-standard.c"
using namespace std;
@ -20,9 +27,14 @@ extern string path_locale;
extern string path_css;
extern bool flag_datetime;
extern bool flag_timezone;
extern bool flag_ntp;
extern bool flag_update;
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 int socket_ext_id_I;
extern int socket_trd_id_I;
class CmdArgParser : public Glib::OptionGroup
{
public:
@ -46,12 +58,13 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::CheckButton *cbxSynchronizeNtpGlob;
Gtk::Box *boxColor;
Gtk::ComboBoxText *cbRegion;
Gtk::ComboBoxText *cbRegionGlob;
Gtk::ComboBoxText *cbZone;
Gtk::ComboBoxText *cbZoneGlob;
Gtk::Window *mess_dchp;
Gtk::Window *mess_sudo;
Gtk::Popover *popCalendar;
Gtk::Popover *popSaveMenu;
Gtk::Popover *popDownloadMenu;
Gtk::Popover *popAbout;
Gtk::Calendar *cldrDate;
Gtk::Label *lblMessage;
Gtk::Label *lblMessageSudo;
@ -62,38 +75,49 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::Label *lblTimeZone;
Gtk::Label *lblReg;
Gtk::Label *lblZone;
Gtk::Label *lblRegGlob;
Gtk::Label *lblZone1Glob;
Gtk::Label *lblTimeZoneGlob;
Gtk::Label *lblSynchronizebChk;
Gtk::Label *lblSynchronizebChkGLob;
Gtk::Label *lblSynchronizeBtn;
Gtk::Label *lblDateTimeSettingGlob;
Gtk::Label *lblTimeBios;
Gtk::Label *lblBanerStopNtp;
Gtk::Label *lblSave;
Gtk::Label *lblDownload;
Gtk::Button *btnHardwareTime;
Gtk::CheckButton *cbxSynchronizeNtp;
Gtk::Window *windowsNnpClose;
Gtk::Button *btnNtpStop;
Gtk::Button *btnNtpWinClose;
Gtk::Label *lblNtpStop;
Gtk::Label *lblNtpClose;
Gtk::Entry *txtNtpServer;
Gtk::Entry *txtDate;
Gtk::Button *btnDownload;
Gtk::Button *btnSave;
Gtk::Button *btnSettings;
Gtk::AboutDialog *aboutWindows;
Gtk::ButtonBox *btnBoxAboutDialog;
Gtk::Box *boxInfoError;
Gtk::Label *lblWarning;
Gtk::Image *imgInfo;
std::map <string, vector<string>> time_reg_map;
std::map <string, vector<string>> time_reg_map_local;
Gtk::ModelButton *btnSaveLocalGlob;
Gtk::ModelButton *btnSaveLocal;
Gtk::ModelButton *btnSaveGlob;
Gtk::ModelButton *btnDonwlolGlob;
Gtk::ModelButton *btnDonwlodLocal;
Gtk::ModelButton *btnAbout;
Gtk::ModelButton *btnSynopsis;
Gtk::HeaderBar *headerBar;
Gtk::Label *lblHeader;
Gtk::Label *lblHW;
Gtk::ComboBoxText *cbHw;
unsigned int year=0;
unsigned int month=0;
unsigned int day=0;
int error_info = 0;
int warning_info = 0;
int hour;
int minute;
string str_region="";
string str_region_glob="";
string str_txtDate;
string strtxtNtpServer;
string str_zone="";
string str_zoneGlob;
int response_cmd;
bool bool_close_banner_info=true;
template<typename Type>
struct Result{
Type response;
@ -101,10 +125,22 @@ class MainWindow : public Gtk::ApplicationWindow {
};
vector<string> array_region_local;
vector<string> array_region;
public:
MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder);
MainWindow(Glib::RefPtr<Gtk::Builder> const& builder);
virtual ~MainWindow() = default;
void hardware_clock_global(string &local, string &utc);
void info_warning_error(int mess);
void synopsis_show();
void entry_hardware_clock(string &cmd);
void save_global_local_cfg();
void fill_in_reg_zone(string &cmd);
void download_globl_cfg();
void save_local_cfg();
void save_global_cfg();
void save_Dhcp(string &cmd_default, string &cmd_dhcp, string &remove, string &cmd_set_ntp);
void download_local_cfg();
void post_entry_data();
void lacalization();
void settings();
@ -113,14 +149,13 @@ class MainWindow : public Gtk::ApplicationWindow {
void get_builder();
void event();
void gui_mess_close();
bool focus_ntp(GdkEventFocus* event);
bool focus_ntp(string &cmd_set_ntp);
void event_entry_cbDhcp();
void get_calendar();
void calendar_show();
void enry_dhcp_mess();
void entry_dhcp_mess(string cmd_get_dhcp, string cmd_default_get_dhcp);
void get_config();
void enter_zone();
void enter_zone_glob();
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);
@ -136,8 +171,9 @@ class MainWindow : public Gtk::ApplicationWindow {
int check_root();
void gui_exit();
bool gui_exit_2(GdkEventAny* event);
void stop_ntp();
void wind_close_ntp();
void wrapper_system(string cmd);
void info_status_app(string stule);
void wrapper_update_time_date();
string zone_file_read(string zone);
void sort_zone(vector<string> *time_reg_map_local,vector<string> *time_reg_map);
@ -145,6 +181,8 @@ class MainWindow : public Gtk::ApplicationWindow {
string str_remove(std::string& source, const std::string to_remove);
vector<std::string> split(const std::string &s, char delim);
struct Result<string> wrapper_call(string cmd);
bool check_ntp(string &str_ntp);
vector<int> find_all(string &str_ntp, string substr);
};

@ -0,0 +1,69 @@
#include "ubl-util-standard.h"
#ifndef __cplusplus
#ifndef UBL_GET_STANDARD_UI
#define UBL_GET_STANDARD_UI
inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id){
returnstruct *ret=(returnstruct*)malloc(sizeof(returnstruct*));
if (left_plug_id>0&&LeftWidget){
GtkWidget *plug=gtk_plug_new(left_plug_id);
GtkWidget *toplug=LeftWidget;
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
g_object_ref(G_OBJECT(toplug));
GtkWidget *parent=gtk_widget_get_parent(toplug);
gtk_container_remove(GTK_CONTAINER(parent),toplug);
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
} else
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
gtk_widget_show(GTK_WIDGET(plug));
ret->plugLeft=plug;
}
if (right_plug_id>0&&RightWidget){
GtkWidget *plug=gtk_plug_new(right_plug_id);
GtkWidget *toplug=RightWidget;
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
g_object_ref(G_OBJECT(toplug));
GtkWidget *parent=gtk_widget_get_parent(toplug);
gtk_container_remove(GTK_CONTAINER(parent),toplug);
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
} else
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
gtk_widget_show(GTK_WIDGET(plug));
ret->plugRight=plug;
}
return ret;
}
#endif
#else
inline void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id){
if (left_plug_id>0&&LeftWidget){
GtkWidget *plug=gtk_plug_new(left_plug_id);
GtkWidget *toplug=GTK_WIDGET(LeftWidget->gobj());
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
g_object_ref(G_OBJECT(toplug));
GtkWidget *parent=gtk_widget_get_parent(toplug);
gtk_container_remove(GTK_CONTAINER(parent),toplug);
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
} else
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
gtk_widget_show(GTK_WIDGET(plug));
}
if (right_plug_id>0&&RightWidget){
GtkWidget *plug=gtk_plug_new(right_plug_id);
GtkWidget *toplug=GTK_WIDGET(RightWidget->gobj());
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
g_object_ref(G_OBJECT(toplug));
GtkWidget *parent=gtk_widget_get_parent(toplug);
gtk_container_remove(GTK_CONTAINER(parent),toplug);
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
} else
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
gtk_widget_show(GTK_WIDGET(plug));
}
}
#endif

@ -0,0 +1,20 @@
#ifndef __cplusplus
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
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 <gtkmm.h>
#include <gtkmm/stock.h>
#include <gtkmm/window.h>
#include <gtkmm/plug.h>
static void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id);
#endif

@ -1,6 +1,16 @@
.boxInfoMessError{
background-color: #ea9999;
}
.cssboxColor1{
background: url("/usr/share/ubl-settings-datetime/images/bg_top.png") no-repeat;
}
.boxInfoMessOK{
background-color: #f3f0ac;
}
.textHead{
text-shadow: 1px 1px #ffffff;
}
.textHeaderBar{
font-weight: bold;
}

@ -11,4 +11,5 @@ Exec=pkexec ubl-settings-datetime
Icon=ubl-settings-datetime
Terminal=false
X-XfcePluggable=true
X-UBLPluggable=true
Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-SystemSettings;

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 210 KiB

@ -16,12 +16,27 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Select the method of hardware time synchronization"
msgstr "Выберите способ синхронизации аппаратного времени"
msgid "Local time"
msgstr "Локальное время"
msgid "UTC time"
msgstr "Время по UTC"
msgid "Synchronize hardware time:"
msgstr "Синхронизировать аппаратное время:"
msgid "An invalid character is entered"
msgstr "Введён недопустимый символ"
msgid "Longyearbyen"
msgstr "Лонгйир"
msgid "Error in the ntp name"
msgstr "Ошибка в имени ntp"
msgid "Stop the synchronization service"
msgstr "Остановить сервис синхронизации"
@ -46,11 +61,20 @@ msgstr "Введите DHCP!"
msgid "OK"
msgstr "OK"
msgid "Setting the date and time"
msgstr "Настройка даты времени"
msgid "Successfully saved local and global configuration"
msgstr "Успешно сохранена локальная и глобальная конфигурация"
msgid "Error saved local and global configuration"
msgstr "Ошибка сохранена локальной и глобальной конфигурации"
msgid "Settings the date and time"
msgstr "Настройки даты и времени"
msgid "Local Configuration"
msgstr "Локальная настройка"
msgid "Current date and time"
msgstr "Текущие дата и время"
msgid "Global customization"
msgstr "Глобальная настройка"
@ -1633,9 +1657,132 @@ msgstr " --lock-update Отключить сохранение измене
msgid "Options:\n"
msgstr "Опции:\n"
msgid "Save"
msgstr "Сохранить"
msgid "Save to global and local configuration"
msgstr "Сохранить в глобальную и локальную конфигурацию"
msgid "Save to Global configuration"
msgstr "Сохранить в глобальную конфигурацию"
msgid "Save to local configuration"
msgstr "Сохранить в локальную конфигурацию"
msgid "Download global"
msgstr "Загрузить глобально"
msgid "Download local"
msgstr "Загрузить локально"
msgid "Disabled"
msgstr "Отключено"
msgid "Download"
msgstr "Загрузить"
msgid "Argument not recognized\n"
msgstr "Не распознанный аргумент\n"
msgstr "Нepacпoзнaнный аргумент\n"
msgid "La_Rioja"
msgstr "Риоха"
msgid "Rio_Gallegos"
msgstr "Рио-Гальегос"
msgid "Salta"
msgstr "Сальта"
msgid "San_Juan"
msgstr "Сан-Хуан"
msgid "San_Luis"
msgstr "Сан-Луис"
msgid "Tucuman"
msgstr "Тукуман"
msgid "Ushuaia"
msgstr "Ушуая"
msgid "Knox"
msgstr "Ноксвилл"
msgid "Marengo"
msgstr "Маренго"
msgid "Petersburg"
msgstr "Петербург"
msgid "Tell_City"
msgstr "Телл-Сити"
msgid "Vevay"
msgstr "Вевей"
msgid "Vincennes"
msgstr "Венсен"
msgid "Winamac"
msgstr "Винамаке"
msgid "Project Home Page"
msgstr "Домашняя страница проекта"
msgid "ComodRivadavia"
msgstr "Комодоро-Ривадавия"
msgid "Monticello"
msgstr "Монтиселло"
msgid "Beulah"
msgstr "Беула"
msgid "Center"
msgstr "Центр"
msgid "New_Salem"
msgstr "Нью-Салем"
msgid "Windhoek"
msgstr "Виндхук"
msgid "Iqaluit"
msgstr "Икалуит"
msgid "EasterIsland"
msgstr "Остров Пасхи"
msgid "Andorra"
msgstr "Андорра"
msgid "About the program"
msgstr "О программе"
msgid "Synopsis"
msgstr "Справка"
msgid "Local configuration reading error"
msgstr "Ошибка чтения локальной конфигурации"
msgid "Local configuration write error"
msgstr "Ошибка записи локальной конфигурации"
msgid "Global configuration read error"
msgstr "Ошибка чтения глобальной конфигурации"
msgid "Global configuration write error"
msgstr "Ошибка записи глобальной конфигурации"
msgid "Local configuration downloaded successfully"
msgstr "Успешно загружена локальная конфигурация"
msgid "Global configuration downloaded successfully"
msgstr "Успешно загружена глобальная конфигурация"
msgid "Global configuration successfully written"
msgstr "Успешно записана глобальная конфигурация"
msgid "Local configuration successfully written"
msgstr "Успешно записана локальная конфигурация"

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 24 24"
id="svg2"
version="1.1"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
sodipodi:docname="warning.svg"
width="24"
height="24"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1027"
id="namedview8"
showgrid="false"
inkscape:zoom="18.96875"
inkscape:cx="5.4827018"
inkscape:cy="9.3047776"
inkscape:current-layer="svg2"
inkscape:pagecheckerboard="0"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<path
id="path4136-2"
style="opacity:1;fill:#4d4d4d;fill-opacity:1"
d="M 11.292969 1.0234375 A 11 11.000002 86.311656 0 0 1.0234375 12.707031 A 11 11.000002 86.311656 0 0 12.707031 22.976562 A 11 11.000002 86.311656 0 0 22.976562 11.292969 A 11 11.000002 86.311656 0 0 11.292969 1.0234375 z M 11.996094 6 L 12.003906 6 C 12.556173 6 13 6.4439 13 6.9960938 L 13 14.003906 C 13 14.556325 12.556173 15 12.003906 15 L 11.996094 15 C 11.443827 15 11 14.556325 11 14.003906 L 11 6.9960938 C 11 6.4439 11.443827 6 11.996094 6 z M 12 17 C 12.554 17 13 17.446 13 18 C 13 18.554 12.554 19 12 19 C 11.446 19 11 18.554 11 18 C 11 17.446 11.446 17 12 17 z " />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Loading…
Cancel
Save