Часть переменных вынесено в отдельный файл

pull/107/head
Igor Belitskiy 3 years ago
parent be48cf2c97
commit 1ed3b1550b

@ -34,7 +34,7 @@ set(SOURCE_FILES
ubl-settings-datetime-cm.h ubl-settings-datetime-cm.h
ubl-util-standard.h ubl-util-standard.h
ubl-util-standard.c ubl-util-standard.c
my_cmd.h my_cmd_and_path.h
main.cc main.cc
ubl-settings-datetime.cc ubl-settings-datetime.cc
ubl-settings-datetime.h) ubl-settings-datetime.h)

@ -21,7 +21,7 @@ int main(int argc, char* argv[]) {
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");
auto builder = Gtk::Builder::create_from_file(path_glade + "ubl-settings-datetime.glade"); auto builder = Gtk::Builder::create_from_file(path_glade);
Glib::init(); Glib::init();
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
Glib::OptionContext context; Glib::OptionContext context;
@ -48,7 +48,7 @@ int main(int argc, char* argv[]) {
int len_argv = 1; int len_argv = 1;
pars_flag(1, argc, argv); pars_flag(1, argc, argv);
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);
MainWindow* wnd = nullptr; MainWindow* wnd = nullptr;
builder->get_widget_derived("window", wnd); builder->get_widget_derived("window", wnd);
auto r = app->run(*wnd); auto r = app->run(*wnd);

@ -29,10 +29,12 @@
#define icon_checked "com.ublinux.ubl-settings-datetime.checked" #define icon_checked "com.ublinux.ubl-settings-datetime.checked"
#define icon_warning "com.ublinux.ubl-settings-datetime.warning" #define icon_warning "com.ublinux.ubl-settings-datetime.warning"
#define get_global_defalult_HWCLOCK_SYNC "ubconfig --default --source global get clock HWCLOCK_SYNC" #define get_global_defalult_HWCLOCK_SYNC "ubconfig --default --source global get clock HWCLOCK_SYNC"
#define path_app "/usr/bin/"
#define path_glade "/usr/share/ubl-settings-datetime/ui/ubl-settings-datetime.glade"
#define app_name "ubl-settings-datetime"
#define path_locale "/usr/share/locale/"
#define path_css "/usr/share/ubl-settings-datetime/css/ubl-settings-datetime.css"
#define path_img_head_background "/usr/share/ubl-settings-datetime/images/logo-background.png"
#endif #endif

@ -2,12 +2,6 @@
#include "ubl-settings-datetime.h" #include "ubl-settings-datetime.h"
using namespace std; using namespace std;
const string path_app = "/usr/bin/";
const string path_glade = "/usr/share/ubl-settings-datetime/ui/";
const string app_name = "ubl-settings-datetime";
const string path_locale = "/usr/share/locale/";
const string path_css = "/usr/share/ubl-settings-datetime/css/ubl-settings-datetime.css";
const string path_img_head_background = "/usr/share/ubl-settings-datetime/images/logo-background.png";
bool flag_datetime = false; bool flag_datetime = false;
bool flag_timezone = false; bool flag_timezone = false;
bool flag_ntp_mode = false; bool flag_ntp_mode = false;

@ -18,7 +18,7 @@
#include <map> #include <map>
#include <pwd.h> #include <pwd.h>
#include "ubl-util-standard.c" #include "ubl-util-standard.c"
#include "my_cmd.h" #include "my_cmd_and_path.h"
#include "ubl-settings-datetime-cm.h" #include "ubl-settings-datetime-cm.h"
#include "my_localization.h" #include "my_localization.h"
#ifdef WEBKIT_FOUND #ifdef WEBKIT_FOUND
@ -27,13 +27,6 @@
#endif #endif
using namespace std; using namespace std;
extern const string path_app;
extern const string path_glade;
extern const string app_name;
extern const string path_locale;
extern const string path_css;
extern const string path_img_head_background;
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;

Loading…
Cancel
Save