Перед внесением больших изменений

pull/46/head
Igor Belitskiy 3 years ago
parent 4fc3e9f6ed
commit e68202ce39

@ -0,0 +1,21 @@
xhost: bad hostname "superadmin"
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 109 (X_ChangeHosts)
Value in failed request: 0xa
Serial number of failed request: 7
Current serial number in output stream: 9
localuser: being added to access control list
xhost: bad hostname "superadmin"
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 109 (X_ChangeHosts)
Value in failed request: 0xa
Serial number of failed request: 7
Current serial number in output stream: 9
localuser: being added to access control list
xhost: bad hostname "superadmin"
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 109 (X_ChangeHosts)
Value in failed request: 0xa
Serial number of failed request: 7
Current serial number in output stream: 9
localuser: being added to access control list

@ -25,17 +25,24 @@ int main(int argc, char* 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();
setlocale(LC_ALL, "");
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;
}

@ -46,29 +46,26 @@ bool flag_ntp = false;
bool flag_update = false;
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::OptionGroup{p_name, p_description, p_help} {
Glib::OptionEntry socketIDArg;
socketIDArg.set_long_name("socket-id");
socketIDArg.set_short_name('s');
socketIDArg.set_flags(Glib::OptionEntry::FLAG_IN_MAIN);
socketIDArg.set_description("Settings manager socket");
cout << m_socketID << endl;
add_entry(socketIDArg, m_socketID);
}
::Window CmdArgParser::GetSocketID() const {
::Window CmdArgParser::GetSocketID() const{
return m_socketID;
}
MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder)
: Gtk::ApplicationWindow(obj)
, builder{builder} {
this->settings();
: Gtk::ApplicationWindow(obj), builder{builder} {
this->builder = builder;
this->settings();
}
MainWindow::MainWindow(Glib::RefPtr<Gtk::Builder> const& builder) {
this->builder = builder;
this->builder = builder;
this->settings();
}
@ -126,7 +123,7 @@ int MainWindow::check_root(){
void MainWindow::lacalization(){
txtDate->set_tooltip_text(_("Date of\nFormat: DD.MM.YYYY"));
txtNtpServer->set_tooltip_text(_("Enter the name of the ntp-server or its ip-address.\nWhen entering multiple addresses, separate them with commas."));
lblSynchronizebChkGLob->set_text(_("Synchronize via NTP"));
lblSynchronizebChkGLob->set_text(_("Synchronize via NTP:"));
cbDhcp->append(_("Default"));
cbDhcp->append(_("DHCP"));
cbDhcp->append(_("Manual"));
@ -202,8 +199,10 @@ void MainWindow::add_CSS(){
styleContext->add_provider_for_screen(screen, cssProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);//add provider for screen in all application
Glib::RefPtr<Gtk::StyleContext> context = boxColor->get_style_context();
Glib::RefPtr<Gtk::StyleContext> context_lbl_head = lblHead->get_style_context();
//Glib::RefPtr<Gtk::StyleContext> context_button = btnHardwareTime->get_style_context();
context->add_class("cssboxColor1");
context_lbl_head->add_class("textHead");
//context_button->add_class("textHead");
}
void MainWindow::get_builder(){
@ -385,13 +384,15 @@ void MainWindow::event_entry_cbDhcp(){
}
cbDhcp->set_active(activ_index);
}
}
}
else if (activ_index==3){
system("/usr/bin/ubconfig remove network NTPSERVERS");
string cmd = "/usr/bin/ubconfig remove network NTPSERVERS";
system(cmd.c_str());
txtNtpServer->set_text("");
txtNtpServer->set_sensitive(false);
}
}
else{
string cmd = "/usr/bin/ubconfig set network NTPSERVERS=dhcp";
system(cmd.c_str());
@ -865,14 +866,14 @@ void MainWindow::sort_zone(vector<string> *time_reg_map_local,vector<string> *ti
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;
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;
b = (*time_reg_map)[j];
(*time_reg_map)[j] = (*time_reg_map)[j + 1];
(*time_reg_map)[j + 1] = b;
}
}
}
@ -925,9 +926,10 @@ vector<std::string> MainWindow::split(const std::string &s, char delim){
}
SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> builder)
: Gtk::Plug{p_socketID}
{
builder->get_widget("id_plug", plugBox);
: 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();

@ -30,6 +30,7 @@ public:
::Window GetSocketID() const;
private:
int m_socketID = 0;
};
class MainWindow : public Gtk::ApplicationWindow {
@ -152,11 +153,11 @@ class MainWindow : public Gtk::ApplicationWindow {
"US"};
};
class SettingsPlug : public Gtk::Plug
{
class SettingsPlug : public Gtk::Plug{
public:
Gtk::Window *window;
SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> builder);
private:
Gtk::Widget *plugBox;
Gtk::Widget *parent;

@ -3,4 +3,4 @@
}
.textHead{
text-shadow: 1px 1px #ffffff;
}
}

@ -7,7 +7,8 @@ GenericName[ru]=Настройка даты и времени
Comment=Date time settings
Comment[ru]=Приложение для настройки даты и времени
Type=Application
Exec=pkexec ubl-settings-datetime
Exec=ubl-settings-datetime
Icon=ubl-settings-datetime
Terminal=false
X-XfcePluggable=true
Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-SystemSettings;

@ -169,29 +169,6 @@
</object>
</child>
</object>
<object class="GtkPopover" id="popCalendar">
<property name="width-request">240</property>
<property name="height-request">185</property>
<property name="can-focus">False</property>
<property name="relative-to">btnChooseDate</property>
<property name="position">bottom</property>
<property name="constrain-to">none</property>
<child>
<object class="GtkCalendar" id="cldrDate">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-left">10</property>
<property name="margin-right">10</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="year">2023</property>
<property name="month">1</property>
<property name="day">10</property>
</object>
</child>
</object>
<object class="GtkWindow" id="window">
<property name="can-focus">False</property>
<property name="title" translatable="yes" context="Settings the date and time" comments="Date and Time Settings">Настройки даты и времени</property>
@ -201,7 +178,7 @@
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="id_plug">
<object class="GtkBox" id="plugBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
@ -794,7 +771,7 @@ Format: DD.MM.YYYY</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="label" translatable="yes" context="Synchronize via NTP" comments="Synchronize via NTP">Synchronize via NTP</property>
<property name="label" translatable="yes" context="Synchronize via NTP" comments="Synchronize via NTP">Synchronize via NTP:</property>
</object>
<packing>
<property name="expand">False</property>
@ -1015,6 +992,29 @@ Format: DD.MM.YYYY</property>
</object>
</child>
</object>
<object class="GtkPopover" id="popCalendar">
<property name="width-request">240</property>
<property name="height-request">185</property>
<property name="can-focus">False</property>
<property name="relative-to">btnChooseDate</property>
<property name="position">bottom</property>
<property name="constrain-to">none</property>
<child>
<object class="GtkCalendar" id="cldrDate">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-left">10</property>
<property name="margin-right">10</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="year">2023</property>
<property name="month">1</property>
<property name="day">10</property>
</object>
</child>
</object>
<object class="GtkWindow" id="windowsNnpClose">
<property name="can-focus">False</property>
<child>

@ -97,8 +97,8 @@ msgstr "Синхронизировать"
msgid "Automatic time synchronization"
msgstr "Автоматическая синхронизация времени"
msgid "Synchronize via NTP"
msgstr "Синхронизировать через NTP"
msgid "Synchronize via NTP:"
msgstr "Синхронизировать через NTP:"
msgid "Time zone"
msgstr "Часовой пояс"

Loading…
Cancel
Save