|
|
|
|
@ -47,8 +47,12 @@ void configuration_mode_accept(GtkWidget *,configuration_window *window){
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PathEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets");
|
|
|
|
|
if (yon_configuration_path_check(path)){
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),1);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -64,25 +68,15 @@ void on_path_choose(GtkWidget *,configuration_window *window){
|
|
|
|
|
void on_configuration_exit(GtkWidget *,configuration_window *window){
|
|
|
|
|
main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets");
|
|
|
|
|
|
|
|
|
|
GList *box = gtk_container_get_children(GTK_CONTAINER(widgets->ConfigurationModeMenuItem));
|
|
|
|
|
GList *children = gtk_container_get_children(GTK_CONTAINER(box->data));
|
|
|
|
|
GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,1));
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),0);
|
|
|
|
|
g_list_free(box);
|
|
|
|
|
g_list_free(children);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),0);
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
if (getuid()){
|
|
|
|
|
gtk_main_quit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){
|
|
|
|
|
|
|
|
|
|
GList *box = gtk_container_get_children(GTK_CONTAINER(self));
|
|
|
|
|
GList *children = gtk_container_get_children(GTK_CONTAINER(box->data));
|
|
|
|
|
|
|
|
|
|
GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,0));
|
|
|
|
|
int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Check));
|
|
|
|
|
void on_configuration_mode_switch(GtkWidget *,main_window *widgets){
|
|
|
|
|
int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck));
|
|
|
|
|
if (!active){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_configuration_mode);
|
|
|
|
|
configuration_window *window = malloc(sizeof(configuration_window));
|
|
|
|
|
@ -96,6 +90,7 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_configuration_exit),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(gtk_main_quit),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->ChooseButton),"clicked",G_CALLBACK(configuration_mode_accept),window);
|
|
|
|
|
g_object_set_data(G_OBJECT(window->Window),"widgets",widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PathButton),"clicked",G_CALLBACK(on_path_choose),window);
|
|
|
|
|
g_object_set_data(G_OBJECT(window->Window),"widgets",widgets);
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"configuration_window");
|
|
|
|
|
@ -131,8 +126,4 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){
|
|
|
|
|
main_config.configure_mode = 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),!active);
|
|
|
|
|
g_list_free(box);
|
|
|
|
|
g_list_free(children);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|