diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c
index cce6be1..7a882ba 100644
--- a/source/ubl-settings-video.c
+++ b/source/ubl-settings-video.c
@@ -17,7 +17,22 @@ gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalMoreRevieler),active
void on_terminal_destroy(GtkWidget *self, main_window *widgets){
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0);
gtk_widget_destroy(widgets->TerminalRevealer);
- yon_proprietary_local_get();
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->DriversTree)),&model,&iter)){
+ char *module, *package;
+ gtk_tree_model_get(model, &iter, 7,&module, 8,&package,-1);
+ if (!yon_char_is_empty(module)){
+ if (!system(yon_get_is_installed_command(module))){
+ gtk_list_store_set(main_config.list,&iter,9,1,-1);
+ }
+ } else {
+ if (!system(yon_get_is_installed_command(package))){
+ gtk_list_store_set(main_config.list,&iter,10,1,-1);
+ }
+ }
+ }
+ yon_proprietary_get_thread(NULL,widgets);
yon_ubl_status_box_render(PROPRIETARY_OPETAION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
}
@@ -94,32 +109,6 @@ void yon_terminal_start(main_window *widgets, char *usr_command){
gtk_widget_show_all(widgets->TerminalRevealer);
}
-void on_driver_pack_install(GtkWidget *self,main_window *widgets){
- GtkTreeIter iter;
- char *name;
- GtkTreeModel *list_s=GTK_TREE_MODEL(main_config.list);
- GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->DriversTree));
- if(gtk_tree_selection_get_selected(selection,&list_s,&iter)){
- gtk_tree_model_get(list_s,&iter,1,&name,-1);
- yon_terminal_start(widgets,install_proprietary_command(name));
- } else {
- yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
- }
-}
-
-void on_driver_pack_delete(GtkWidget *self,main_window *widgets){
- GtkTreeIter iter;
- char *name;
- GtkTreeModel *list_s=GTK_TREE_MODEL(main_config.list);
- GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->DriversTree));
- if(gtk_tree_selection_get_selected(selection,&list_s,&iter)){
- gtk_tree_model_get(list_s,&iter,1,&name,-1);
- yon_terminal_start(widgets,delete_proprietary_command(name));
- } else {
- yon_ubl_status_box_render(PROPRIETARY_NOTHING_SELECTED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
- }
-}
-
void on_driver_pack_selection_change(GtkWidget *self, main_window *widgets){
GtkTreeIter iter;
char *name;
@@ -162,15 +151,29 @@ void on_pack_install_activate(GtkCellRendererToggle* self,gchar* path,main_windo
int installed;
gtk_tree_model_get(GTK_TREE_MODEL(main_config.list),&iter,1,&installed,8,&package,-1);
if (!installed){
- if (!yon_char_is_empty(package)){
- char *command = install_proprietary_command(package);
- yon_terminal_start(widgets,command);
+ dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
+ data->action_text=INSTALL_CONFIRMATION_LABEL(package);
+ data->function=NULL;
+ data->data=NULL;
+ if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
+ if (!yon_char_is_empty(package)){
+ char *command = install_proprietary_command(package);
+ yon_terminal_start(widgets,command);
+ }
}
+ free(data);
} else {
- if (!yon_char_is_empty(package)){
- char *command = delete_proprietary_command(package);
- yon_terminal_start(widgets,command);
+ dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
+ data->action_text=REMOVE_CONFIRMATION_LABEL(package);
+ data->function=NULL;
+ data->data=NULL;
+ if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
+ if (!yon_char_is_empty(package)){
+ char *command = delete_proprietary_command(package);
+ yon_terminal_start(widgets,command);
+ }
}
+ free(data);
}
}
@@ -180,17 +183,31 @@ void on_module_install_activate(GtkCellRendererToggle* self,gchar* path,main_win
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(main_config.list),&iter,path);
char *package;
int installed;
- gtk_tree_model_get(GTK_TREE_MODEL(main_config.list),&iter,0,&installed,7,&package,-1);
+ gtk_tree_model_get(GTK_TREE_MODEL(main_config.list),&iter,1,&installed,7,&package,-1);
if (!installed){
- if (!yon_char_is_empty(package)){
- char *command = install_proprietary_command(package);
- yon_terminal_start(widgets,command);
+ dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
+ data->action_text=INSTALL_CONFIRMATION_LABEL(package);
+ data->function=NULL;
+ data->data=NULL;
+ if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
+ if (!yon_char_is_empty(package)){
+ char *command = install_proprietary_command(package);
+ yon_terminal_start(widgets,command);
+ }
}
+ free(data);
} else {
- if (!yon_char_is_empty(package)){
- char *command = delete_proprietary_command(package);
- yon_terminal_start(widgets,command);
+ dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
+ data->action_text=REMOVE_CONFIRMATION_LABEL(package);
+ data->function=NULL;
+ data->data=NULL;
+ if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
+ if (!yon_char_is_empty(package)){
+ char *command = delete_proprietary_command(package);
+ yon_terminal_start(widgets,command);
+ }
}
+ free(data);
}
}
@@ -952,7 +969,7 @@ void yon_proprietary_local_get(main_window *widgets){
int module_status = !yon_char_is_empty(current[1])?!system(yon_get_is_installed_command(current[1])):0;
int package_status = !yon_char_is_empty(current[2])?!system(yon_get_is_installed_command(current[2])):0;
gtk_list_store_append(main_config.list,&iter);
- gtk_list_store_set(main_config.list,&iter,0,module_status,1,package_status,2,current[0],3,current[3],4,current[4],5,_(current[5]),7,current[1],8,current[2],-1);
+ gtk_list_store_set(main_config.list,&iter,0,module_status,1,package_status,2,current[0],3,current[3],4,current[4],5,_(current[5]),7,current[1],8,current[2],9,!yon_char_is_empty(current[1]),10,!yon_char_is_empty(current[2]),-1);
}
}
}
@@ -967,8 +984,6 @@ void yon_proprietary_get_thread(GtkWidget *self,main_window *widgets){
yon_ubl_status_box_render(PROPRIETARY_LOADING_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),NULL);
GThread *thread = g_thread_new("drivers_loading",(GThreadFunc)(yon_proprietary_local_get),widgets);
-
- // yon_proprietary_local_get(widgets);
}
void yon_monitor_view_dictionary_destroy(void *window){
diff --git a/source/ubl-settings-video.h b/source/ubl-settings-video.h
index 4d2b1d3..4915e5a 100644
--- a/source/ubl-settings-video.h
+++ b/source/ubl-settings-video.h
@@ -327,4 +327,6 @@ monitor_data *yon_monitor_new(main_window *widgets,int dull);
void yon_launch_with_output(char *command);
void yon_proprietary_local_get();
void yon_monitor_view_update();
+
+void yon_proprietary_get_thread(GtkWidget *self,main_window *widgets);
#endif
\ No newline at end of file
diff --git a/source/ubl-strings.h b/source/ubl-strings.h
index c24e9c6..6ce7cf6 100644
--- a/source/ubl-strings.h
+++ b/source/ubl-strings.h
@@ -188,4 +188,7 @@
#define KERNELS_SUPPORTED_UNFOUND_LABEL _("Warning: Couldn't find any supported kernel version")
-#define ALL_INSTALLED_KERNELS_LABEL _("Default (All installed)")
\ No newline at end of file
+#define ALL_INSTALLED_KERNELS_LABEL _("Default (All installed)")
+
+#define INSTALL_CONFIRMATION_LABEL(target) yon_char_unite(_("Are you sure want to install driver "),target,"?",NULL)
+#define REMOVE_CONFIRMATION_LABEL(target) yon_char_unite(_("Are you sure want to remove driver "),target,"?",NULL)
\ No newline at end of file
diff --git a/ubl-settings-video.glade b/ubl-settings-video.glade
index 1ca9a0f..08d4486 100644
--- a/ubl-settings-video.glade
+++ b/ubl-settings-video.glade
@@ -326,6 +326,10 @@
+
+
+
+