Добавлены кнопки и функционал загрузить, сохранить

pull/11/head
Igor Belitskiy 3 years ago
parent fa533884f4
commit 4f0a062622

@ -112,12 +112,14 @@ void MainWindow::get_builder(){
builder->get_widget("btnSynopsis", btnSynopsis); builder->get_widget("btnSynopsis", btnSynopsis);
builder->get_widget("btnAbout", btnAbout); builder->get_widget("btnAbout", btnAbout);
builder->get_widget("btnDonwlodLocal", btnDonwlodLocal);
builder->get_widget("btnDonwlolGlob", btnDonwlolGlob);
builder->get_widget("btnSaveLocalGlob", btnSaveLocalGlob);
builder->get_widget("btnSaveLocal", btnSaveLocal);
builder->get_widget("btnSaveGlob", btnSaveGlob);
builder->get_widget("btnSettings", btnSettings);
builder->get_widget("btnDownload", btnDownload);
builder->get_widget("btnSave", btnSave);
} }
void MainWindow::localization(){ void MainWindow::localization(){
@ -170,8 +172,13 @@ void MainWindow::localization(){
chbVgaText->set_label(gettext("chbVgaText")); chbVgaText->set_label(gettext("chbVgaText"));
btnSynopsis->set_label(gettext("Help")); btnSynopsis->set_label(gettext("Help"));
btnAbout->set_label(gettext("About")); btnAbout->set_label(gettext("About"));
btnSaveLocalGlob->set_label(gettext("Save to global and local configuration"));
//set_label(gettext("Command line parameters:")); btnSaveLocal->set_label(gettext("Save local configuration"));
btnSaveGlob->set_label(gettext("Save global configuration"));
btnDonwlolGlob->set_label(gettext("Load global configuration"));
btnDonwlodLocal->set_label(gettext("Load local configuration"));
btnSave->set_label(gettext("Save"));
btnDownload->set_label(gettext("Donwload"));
} }
@ -182,8 +189,34 @@ void MainWindow::event(){
signal_configure_event().connect(sigc::mem_fun(*this, &MainWindow::gui_set_orientation), false); signal_configure_event().connect(sigc::mem_fun(*this, &MainWindow::gui_set_orientation), false);
btnSynopsis->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::synopsis_show)); btnSynopsis->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::synopsis_show));
btnAbout->signal_activate().connect([&]() {aboutWindows->show();}); btnAbout->signal_activate().connect([&]() {aboutWindows->show();});
btnDonwlodLocal->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::download_local_cfg));
btnDonwlolGlob->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::download_globl_cfg));
btnSaveLocalGlob->signal_activate().connect([&]() {save_global_local_cfg();});
btnSaveLocal->signal_activate().connect([&]() {save_local_cfg();});
btnSaveGlob->signal_activate().connect([&]() {save_global_cfg();});
}
void MainWindow::save_global_local_cfg(){
} }
void MainWindow::save_local_cfg(){
}
void MainWindow::save_global_cfg(){
}
void MainWindow::download_local_cfg(){
}
void MainWindow::download_globl_cfg(){
}
void MainWindow::synopsis_show() { void MainWindow::synopsis_show() {
wrapper_system("xdg-open https://wiki.ublinux.ru/ru/home", "&"); wrapper_system("xdg-open https://wiki.ublinux.ru/ru/home", "&");
} }

@ -81,6 +81,14 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::AboutDialog *aboutWindows; Gtk::AboutDialog *aboutWindows;
Gtk::MenuItem *btnAbout; Gtk::MenuItem *btnAbout;
Gtk::MenuItem *btnSynopsis; Gtk::MenuItem *btnSynopsis;
Gtk::MenuItem *btnSaveLocalGlob;
Gtk::MenuItem *btnSaveLocal;
Gtk::MenuItem *btnSaveGlob;
Gtk::MenuItem *btnDonwlolGlob;
Gtk::MenuItem *btnDonwlodLocal;
Gtk::Button *btnDownload;
Gtk::Button *btnSave;
Gtk::Button *btnSettings;
private: private:
int width; int width;
@ -114,6 +122,11 @@ class MainWindow : public Gtk::ApplicationWindow {
void wrapper_system(string cmd, string thread_str); void wrapper_system(string cmd, string thread_str);
struct Result<string> wrapper_call(string cmd); struct Result<string> wrapper_call(string cmd);
void log_mess_error(string &cmd); void log_mess_error(string &cmd);
void save_global_local_cfg();
void save_local_cfg();
void save_global_cfg();
void download_local_cfg();
void download_globl_cfg();

@ -1,7 +1,89 @@
.boxInfoMessError{
background-color: #ea9999;
}
.cssboxColor1{ .cssboxColor1{
background: url("/usr/share/ublexec/images/bg_top.png") no-repeat; background: url("/usr/share/ubl-settings-datetime/images/bg_top.png") no-repeat;
}
.boxInfoMessOK{
background-color: #f3f0ac;
} }
.textHead{ .textHead{
text-shadow: 1px 1px #ffffff; text-shadow: 1px 1px #ffffff;
} }
.textHeaderBar{
font-weight: bold;
}
.menuitemtop *{
margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px;
}
.menuitemmiddle *{
margin:0 2px 0 2px;
padding: 3px 10px 3px 5px;
}
.menuitembottom *{
margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px;
}
.menuitemtop:hover {
border-radius:3px;
background:@theme_bg_color;
}
.menuitemmiddle:hover {
border-radius:3px;
background:@theme_bg_color;
}
.menuitembottom:hover {
border-radius:3px;
background:@theme_bg_color;
}
.menuitemtop:hover* {
border-radius:3px;
margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px;
background:@theme_selected_bg_color;
border-color:transparent;
}
.menuitemmiddle:hover* {
border-radius:3px;
margin:0 2px 0 2px;
padding: 3px 10px 3px 5px;
background:@theme_selected_bg_color;
border-color:transparent;
}
.menuitembottom:hover* {
border-radius:3px;
margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px;
background:@theme_selected_bg_color;
border-color:transparent;
}
.menuitembottom{
margin-top:0px;
}
.menuitemmiddle{
margin-top:0px;
margin-bottom:0px;
}
.menuitemtop{
margin-bottom:0px;
}
.bkimHeadBar{
opacity:1.0;
}
.bkimButton{
background-color: transparent;
opacity:1.0;
}
.bkimButtonPlug{
background-color: transparent;
color: rgb(0, 0, 0);
opacity:1.0;
}
.noborder{
border:none;
}

@ -49,6 +49,33 @@
</object> </object>
</child> </child>
</object> </object>
<object class="GtkMenu" id="menu">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="take-focus">False</property>
<property name="reserve-toggle-size">False</property>
<property name="rect-anchor-dy">4</property>
<child>
<object class="GtkMenuItem" id="btnDonwlolGlob">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Load global configuration</property>
<style>
<class name="menuitemtop"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuItem" id="btnDonwlodLocal">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Load local configuration</property>
<style>
<class name="menuitembottom"/>
</style>
</object>
</child>
</object>
<object class="GtkMenu" id="menu1"> <object class="GtkMenu" id="menu1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
@ -76,6 +103,43 @@
</object> </object>
</child> </child>
</object> </object>
<object class="GtkMenu" id="menu2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="take-focus">False</property>
<property name="reserve-toggle-size">False</property>
<property name="rect-anchor-dy">4</property>
<child>
<object class="GtkMenuItem" id="btnSaveLocalGlob">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Save to global and local configuration</property>
<style>
<class name="menuitemtop"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuItem" id="btnSaveGlob">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Save global configuration</property>
<style>
<class name="menuitemmiddle"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuItem" id="btnSaveLocal">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Save local configuration</property>
<style>
<class name="menuitembottom"/>
</style>
</object>
</child>
</object>
<object class="GtkWindow" id="window"> <object class="GtkWindow" id="window">
<property name="width-request">750</property> <property name="width-request">750</property>
<property name="height-request">550</property> <property name="height-request">550</property>
@ -1264,7 +1328,7 @@ specified priority</property>
<object class="GtkLabel" id="lblHeaderName"> <object class="GtkLabel" id="lblHeaderName">
<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">UBConfig - Loading</property> <property name="label" translatable="yes">ubl-settings-bootloader</property>
</object> </object>
</child> </child>
<child> <child>
@ -1280,19 +1344,146 @@ specified priority</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkMenuButton" id="btnSettings"> <object class="GtkBox" id="boxSave">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkMenuButton" id="btnSave">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="draw-indicator">True</property>
<property name="popup">menu2</property>
<property name="direction">none</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lblSave">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="label" translatable="yes">Save</property>
<style>
<class name="toolbar"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="imgSave">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">pan-down-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="btnSettings">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="draw-indicator">True</property>
<property name="popup">menu1</property>
<property name="direction">none</property>
<child>
<object class="GtkImage" id="imgSettings">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">open-menu-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="primary-toolbar"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="boxButton">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkMenuButton" id="btnDownload">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="focus-on-click">False</property> <property name="focus-on-click">False</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<property name="popup">menu1</property> <property name="popup">menu</property>
<property name="direction">none</property> <property name="direction">none</property>
<child> <child>
<object class="GtkImage" id="imgSettings"> <object class="GtkBox">
<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> <child>
<object class="GtkLabel" id="lblDownload">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="label" translatable="yes">Download</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="imgDonwload">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">pan-down-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>
@ -1302,10 +1493,12 @@ specified priority</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<style>
<class name="primary-toolbar"/>
</style>
</object> </object>
<packing> <packing>
<property name="pack-type">end</property> <property name="position">2</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>

@ -120,3 +120,24 @@ msgstr "О программе"
msgid "Help" msgid "Help"
msgstr "Справка" msgstr "Справка"
msgid "Save to global and local configuration"
msgstr "Сохранить глобальную и локальную конфигурацию"
msgid "Save global configuration"
msgstr "Сохранить глобальную конфигурацию"
msgid "Save local configuration"
msgstr "Сохранить локальную конфигурацию"
msgid "Load global configuration"
msgstr "Загрузить глобальную конфигурацию"
msgid "Load local configuration"
msgstr "Загрузить локальную конфигурацию"
msgid "Save"
msgstr "Сохранить"
msgid "Download"
msgstr "Загрузить"

Loading…
Cancel
Save