master #51

Merged
asmeron merged 4 commits from YanTheKaller/ubl-settings-system:master into master 2 years ago

@ -4,7 +4,7 @@ config main_config;
//functions
void yon_load_proceed(YON_CONFIG_TYPE type){
int yon_load_proceed(YON_CONFIG_TYPE type){
yon_config_clean();
if (!yon_char_is_empty(config_get_default_command))
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
@ -15,8 +15,12 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
yon_config_load_config(type,config_get_command("system"),NULL);
} else if (type==YON_CONFIG_CUSTOM){
char *path;
textdomain(template_ui_LocaleName);
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
textdomain(LocaleName);
yon_gtk_window_setup(GTK_WINDOW(dialog),NULL,TITLE_LABEL,main_icon,"LoadWindow");
GtkFileFilter *filter = gtk_file_filter_new();
gtk_file_filter_set_name(filter,"*.ini");
gtk_file_filter_add_pattern(filter,"*.ini");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
gtk_widget_show(dialog);
@ -24,15 +28,17 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
if (response == GTK_RESPONSE_ACCEPT){
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
if (!yon_char_is_empty(file)){
path=file;
path=yon_char_unite("'",file,"'",NULL);
main_config.custom_load_path = path;
}
gtk_widget_destroy(dialog);
} else {
gtk_widget_destroy(dialog);
return;
return 0;
}
yon_config_load_config(type,config_get_command(path),NULL);
}
return 1;
}
@ -196,6 +202,8 @@ void yon_config_global_local_save(){
}
void yon_config_custom_load(GtkWidget *self, main_window *widgets){
if (!yon_load_proceed(YON_CONFIG_CUSTOM))
return;
g_signal_handlers_block_by_func(G_OBJECT(widgets->IDEntry),G_CALLBACK(on_id_changed),widgets);
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),"");
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),"");
@ -207,7 +215,6 @@ void yon_config_custom_load(GtkWidget *self, main_window *widgets){
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),*rtn);
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConsoleFontCombo),0);
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0);
yon_load_proceed(YON_CONFIG_CUSTOM);
char *hostname = yon_config_get_by_key(hostname_parameter);
if (!yon_char_is_empty(hostname)){
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),hostname);
@ -518,7 +525,7 @@ void on_status_clicked(GtkWidget *self, connection_window *window){
}
}
void on_find_domains_clicked(GtkWidget *self, connection_window *window){
void on_find_domains_clicked(GtkWidget *self, main_window *window){
yon_debug_output("%s\n",domains_seek_command);
domain_info_window *dialog = yon_information_window_new();
yon_terminal_integrated_start(dialog->ExecuteTerminal,domains_seek_command);
@ -559,7 +566,7 @@ gboolean on_main_window_domain_status_update(connection_window *window){
}
// gboolean yon_update_thread(GtkWidget *self, GdkEvent *event, connection_window *window){
gboolean yon_update_thread(connection_window *window){
gboolean yon_update_thread(GtkWidget *self, connection_window *window){
if (!update_thread_buzy){
update_thread_buzy=1;
pthread_t thread_id;
@ -567,9 +574,6 @@ gboolean on_main_window_domain_status_update(connection_window *window){
}
return 1;
}
void remove_checking(GtkWidget *self, connection_window *window){
g_source_remove(window->timer_id);
}
connection_window *yon_connection_window_new(){
GtkBuilder *builder = gtk_builder_new_from_resource(glade_connection_path);
@ -578,7 +582,6 @@ connection_window *yon_connection_window_new(){
window->AdressEntry = yon_gtk_builder_get_widget(builder,"AdressEntry");
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
window->StatusEntry = yon_gtk_builder_get_widget(builder,"StatusEntry");
window->FindEntry = yon_gtk_builder_get_widget(builder,"FindEntry");
window->LoginEntry = yon_gtk_builder_get_widget(builder,"LoginEntry");
window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry");
window->KerberosServerEntry = yon_gtk_builder_get_widget(builder,"KerberosServerEntry");
@ -589,14 +592,11 @@ connection_window *yon_connection_window_new(){
window->SettingsTree = yon_gtk_builder_get_widget(builder,"SettingsTree");
window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton");
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
window->CheckButton = yon_gtk_builder_get_widget(builder,"CheckButton");
window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
g_signal_connect(G_OBJECT(window->StatusEntry),"clicked",G_CALLBACK(on_status_clicked),window);
g_signal_connect(G_OBJECT(window->FindEntry),"clicked",G_CALLBACK(on_find_domains_clicked),window);
g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(remove_checking),window);
// g_signal_connect(G_OBJECT(window->AdressEntry),"focus-out-event",G_CALLBACK(yon_update_thread),window);
// yon_update_thread(NULL,NULL,window);
window->timer_id = g_timeout_add(1000,(GSourceFunc)yon_update_thread,window);
g_signal_connect(G_OBJECT(window->CheckButton),"clicked",G_CALLBACK(yon_update_thread),window);
return window;
}
@ -724,6 +724,26 @@ void on_check_domain_connected(GtkWidget *self, main_window *widgets){
gtk_entry_set_icon_tooltip_markup(GTK_ENTRY(widgets->DomainEntry),GTK_ENTRY_ICON_SECONDARY,DOMAIN_DISCONNECTED_LABEL);
main_config.domain_connected=0;
}
YON_CONFIG_TYPE type;
switch(main_config.load_mode){
case 0: type=YON_CONFIG_GLOBAL;
yon_config_load_config(type,yon_config_parameter_prepare_command(DOMAIN_get_command,"global",NULL,NULL), yon_config_parameter_prepare_command(HOSTNAME_get_command,"global",NULL,NULL),NULL);
break;
case 1: type=YON_CONFIG_LOCAL;
yon_config_load_config(type,yon_config_parameter_prepare_command(DOMAIN_get_command,"system",NULL,NULL), yon_config_parameter_prepare_command(HOSTNAME_get_command,"system",NULL,NULL),NULL);
break;
case 3: type=YON_CONFIG_CUSTOM;
if (!yon_char_is_empty(main_config.custom_load_path))
yon_config_load_config(type,yon_config_parameter_prepare_command(DOMAIN_get_command,main_config.custom_load_path,NULL,NULL), yon_config_parameter_prepare_command(HOSTNAME_get_command,main_config.custom_load_path,NULL,NULL),NULL);
break;
}
char *hostname = yon_config_get_by_key(hostname_parameter);
char *domain = yon_config_get_by_key(DOMAIN);
if (!yon_char_is_empty(hostname))
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),hostname);
if (!yon_char_is_empty(domain))
gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),domain);
}
main_window *yon_main_window_complete(main_window *widgets){
@ -742,6 +762,7 @@ main_window *yon_main_window_complete(main_window *widgets){
widgets->LocaleButton = yon_gtk_builder_get_widget(builder,"getLocalesButton");
widgets->LocaleEntry = yon_gtk_builder_get_widget(builder,"localeEntry");
widgets->FindButton = yon_gtk_builder_get_widget(builder,"FindButton");
widgets->DomainButton = yon_gtk_builder_get_widget(builder,"DomainButton");
widgets->DomainEntry = yon_gtk_builder_get_widget(builder,"DomainEntry");
@ -787,6 +808,8 @@ main_window *yon_main_window_complete(main_window *widgets){
g_signal_connect(G_OBJECT(widgets->DomainEntry),"focus-out-event",G_CALLBACK(on_domain_address_save),NULL);
g_signal_connect(G_OBJECT(widgets->FindButton),"clicked",G_CALLBACK(on_find_domains_clicked),widgets);
gtk_widget_set_size_request(widgets->Window,800,440);
// g_timeout_add(1000,(GSourceFunc)on_check_domain_connected,widgets);

@ -20,6 +20,7 @@
#define _(String) gettext(String)
#define main_icon "com.ublinux.ubl-settings-system"
#define glade_path "/com/ublinux/ui/ubl-settings-system.glade"
#define glade_domain_path "/com/ublinux/ui/ubl-settings-system-domain.glade"
#define glade_connection_path "/com/ublinux/ui/ubl-settings-system-connection.glade"
@ -115,6 +116,7 @@ typedef struct {
GtkWidget *DomainEntry;
GtkWidget *DomainButton;
GtkWidget *FindButton;
GtkListStore *fontlist;
GtkListStore *languagelist;
@ -171,7 +173,7 @@ typedef struct {
GtkWidget *PasswordEntry;
GtkWidget *DNSEntry;
GtkWidget *StatusEntry;
GtkWidget *FindEntry;
GtkWidget *CheckButton;
GtkWidget *KerberosServerEntry;
GtkWidget *ClientCombo;
GtkWidget *AdditionalCombo;

@ -60,3 +60,4 @@
#define DOMAIN_DISCONNECTED_LABEL _("Disconnected from domain")
#define LOADING_LABEL _("Loading...")
#define CHECK_CONNECTION_LABEL _("Check")

@ -8,11 +8,6 @@
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.important-symbolic</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.zoom-symbolic</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can-focus">False</property>
@ -107,15 +102,11 @@
</packing>
</child>
<child>
<object class="GtkButton" id="StatusEntry">
<object class="GtkButton" id="CheckButton">
<property name="label" translatable="yes">Check</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Check domain name</property>
<property name="image">image1</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
@ -124,12 +115,12 @@
</packing>
</child>
<child>
<object class="GtkButton" id="FindEntry">
<object class="GtkButton" id="StatusEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">List all domains</property>
<property name="image">image2</property>
<property name="tooltip-text" translatable="yes">Check domain name</property>
<property name="image">image1</property>
<style>
<class name="thin"/>
</style>

@ -54,6 +54,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.arrows-left-right-symbolic</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.zoom-symbolic</property>
</object>
<object class="GtkListStore" id="languagelist">
<columns>
<!-- column-name LocaleName -->
@ -155,6 +160,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="FindButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">List all domains</property>
<property name="image">image4</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="DomainButton">
<property name="label" translatable="yes">Join</property>
@ -167,7 +189,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>

@ -216,3 +216,7 @@ msgstr ""
#: source/ubl-strings.h:62
msgid "Loading..."
msgstr ""
#: source/ubl-strings.h:63
msgid "Check"
msgstr ""

@ -94,130 +94,134 @@ msgstr "По умолчанию"
msgid "Cancel"
msgstr "Отмена"
#: source/ubl-strings.h:23
#: source/ubl-strings.h:24
msgid "Machine ID has been copied"
msgstr "ID рабочей станции скопирован"
#: source/ubl-strings.h:25
#: source/ubl-strings.h:26
msgid "ID field can't be empty!"
msgstr "Поле ID не может быть пустым!"
#: source/ubl-strings.h:27
#: source/ubl-strings.h:28
msgid "Insert data"
msgstr "Введите данные"
#: source/ubl-strings.h:29
#: source/ubl-strings.h:30
msgid "Accept"
msgstr "Принять"
#: source/ubl-strings.h:31
#: source/ubl-strings.h:32
msgid "Important field is empty"
msgstr "Пустое важное поле"
#: source/ubl-strings.h:33
#: source/ubl-strings.h:34
msgid "Connect"
msgstr "Подключиться"
#: source/ubl-strings.h:34
#: source/ubl-strings.h:35
msgid "Disconnect"
msgstr "Отключиться"
#: source/ubl-strings.h:35
#: source/ubl-strings.h:36
msgid "Domain address"
msgstr "Адрес домена"
#: source/ubl-strings.h:36
#: source/ubl-strings.h:37
msgid "Domain address:"
msgstr "Адрес домена:"
#: source/ubl-strings.h:37
#: source/ubl-strings.h:38
msgid "Domain administrator name:"
msgstr "Имя администратора домена:"
#: source/ubl-strings.h:38
#: source/ubl-strings.h:39
msgid "Domain administrator password:"
msgstr "Пароль администратора домена:"
#: source/ubl-strings.h:39
#: source/ubl-strings.h:40
msgid "Main"
msgstr "Основные"
#: source/ubl-strings.h:40
#: source/ubl-strings.h:41
msgid "Additional"
msgstr "Дополнительные"
#: source/ubl-strings.h:41
#: source/ubl-strings.h:42
msgid "Kerberos/AD domain server:"
msgstr "Сервер домена Kerberos/AD"
#: source/ubl-strings.h:42
#: source/ubl-strings.h:43
msgid "DNS server:"
msgstr "DNS сервер:"
#: source/ubl-strings.h:43
#: source/ubl-strings.h:44
msgid "Domain connection client"
msgstr "Клиент подключения к домену"
#: source/ubl-strings.h:44
#: source/ubl-strings.h:45
msgid "Sssd client"
msgstr "Клиент sssd"
#: source/ubl-strings.h:45
#: source/ubl-strings.h:46
msgid "Winbind client"
msgstr "Клиент windbind"
#: source/ubl-strings.h:46
#: source/ubl-strings.h:47
msgid "Samba client"
msgstr "Клиент samba"
#: source/ubl-strings.h:47
#: source/ubl-strings.h:48
msgid "Switch client off or automatically"
msgstr "Выключить клиент или автоматически"
#: source/ubl-strings.h:48
#: source/ubl-strings.h:49
msgid "Domain information"
msgstr "Информация о домене"
#: source/ubl-strings.h:49
#: source/ubl-strings.h:50
msgid "Domain connection"
msgstr "Соединение домена"
#: source/ubl-strings.h:50
#: source/ubl-strings.h:51
msgid "Check domain name"
msgstr "Проверить домен"
#: source/ubl-strings.h:51
#: source/ubl-strings.h:52
msgid "List all domains"
msgstr "Показать все домены"
#: source/ubl-strings.h:53
#: source/ubl-strings.h:54
msgid "Connecting to domain"
msgstr "Подключение к домену"
#: source/ubl-strings.h:54
#: source/ubl-strings.h:55
msgid "Disconnecting from domain"
msgstr "Отключение от домена"
#: source/ubl-strings.h:55
#: source/ubl-strings.h:56
msgid "Join"
msgstr "Присоединиться"
#: source/ubl-strings.h:56
#: source/ubl-strings.h:57
msgid "Leave"
msgstr "Отсоединиться"
#: source/ubl-strings.h:58
#: source/ubl-strings.h:59
msgid "Connected to domain"
msgstr "Подключен к домену"
#: source/ubl-strings.h:59
#: source/ubl-strings.h:60
msgid "Disconnected from domain"
msgstr "Не подключен к домену"
#: source/ubl-strings.h:61
#: source/ubl-strings.h:62
msgid "Loading..."
msgstr "Загрузка..."
#: source/ubl-strings.h:63
msgid "Check"
msgstr "Проверка"
msgid "Afrikaans, South Africa"
msgstr "Африканский, Южная Африка"

Loading…
Cancel
Save