|
|
|
|
@ -471,7 +471,7 @@ void on_filter_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
void on_system_kill_confirmed(GtkWidget *self,char *service_name){
|
|
|
|
|
if (self){};
|
|
|
|
|
yon_launch_app_with_arguments(service_name,"");
|
|
|
|
|
yon_launch(service_name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets){
|
|
|
|
|
@ -497,13 +497,14 @@ void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets)
|
|
|
|
|
dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
|
|
|
|
|
data->action_text=SERVICE_STOP_WARNING_LABEL(service_name);
|
|
|
|
|
data->data=service_stop_command(service_name);
|
|
|
|
|
data->function=(void*)(void*)on_system_kill_confirmed;
|
|
|
|
|
data->function=NULL;
|
|
|
|
|
int size;
|
|
|
|
|
config_str result = yon_config_load(service_check_active_command(service_name),&size);
|
|
|
|
|
yon_char_remove_last_symbol(result[0],'\n');
|
|
|
|
|
if (size>0&&!strcmp(result[0],"active")){
|
|
|
|
|
int responce = yon_confirmation_dialog_call(widgets->Window,data);
|
|
|
|
|
if (responce == GTK_RESPONSE_ACCEPT){
|
|
|
|
|
on_system_kill_confirmed(NULL,data->data);
|
|
|
|
|
result = yon_config_load(service_check_active_command(service_name),&size);
|
|
|
|
|
yon_char_remove_last_symbol(result[0],'\n');
|
|
|
|
|
if (strcmp(result[0],"active")){
|
|
|
|
|
@ -513,6 +514,9 @@ void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
gtk_list_store_set(GTK_LIST_STORE(model),&iter,4,0,-1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(result,size);
|
|
|
|
|
} else {
|
|
|
|
|
@ -523,10 +527,11 @@ void on_system_launch_clicked(GtkWidget *self, char *path, main_window *widgets)
|
|
|
|
|
int size;
|
|
|
|
|
config_str result = yon_config_load(service_check_active_command(service_name),&size);
|
|
|
|
|
yon_char_remove_last_symbol(result[0],'\n');
|
|
|
|
|
if (size>0&&!strcmp(result[0],"active")){
|
|
|
|
|
if (size>0&&strcmp(result[0],"active")){
|
|
|
|
|
int responce = yon_confirmation_dialog_call(widgets->Window,data);
|
|
|
|
|
if (responce == GTK_RESPONSE_ACCEPT){
|
|
|
|
|
gtk_list_store_set(GTK_LIST_STORE(model),&iter,4,1,-1);
|
|
|
|
|
yon_ubl_status_box_render(SERVICE_RELOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -566,6 +571,21 @@ void on_system_restart_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_sessions_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
if (self){};
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SessionMainTree)),&model,&iter)){
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SessionStopButton,1);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SessionBlockButton,1);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SessionStartButton,1);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SessionStopButton,0);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SessionBlockButton,0);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->SessionStartButton,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_sessions_update(main_window *widgets){
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->SessionMainTree),NULL);
|
|
|
|
|
gtk_list_store_clear(widgets->SessionsList);
|
|
|
|
|
@ -1710,6 +1730,7 @@ void yon_main_window_complete(main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SessionStartButton),"clicked",G_CALLBACK(on_session_activate),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SessionStopButton),"clicked",G_CALLBACK(on_session_end),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SessionBlockButton),"clicked",G_CALLBACK(on_session_block),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SessionMainTree),"cursor-changed",G_CALLBACK(on_sessions_selection_changed),widgets);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->SystemServicesStatusMenuItem),"activate",G_CALLBACK(on_system_services_status),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->InstalledUnitsStatusMenuItem),"activate",G_CALLBACK(on_units_status),widgets);
|
|
|
|
|
|