|
|
|
|
@ -733,8 +733,30 @@ void on_monitor_delete(GtkWidget *,monitor_data *window){
|
|
|
|
|
*/
|
|
|
|
|
void on_monitor_switch(GtkWidget *,monitor_data *window){
|
|
|
|
|
if(window){
|
|
|
|
|
int enable = 0;
|
|
|
|
|
gtk_widget_set_sensitive(window->MonitorImage,!enable);
|
|
|
|
|
const char *name = gtk_label_get_text(GTK_LABEL(window->NameLabel));
|
|
|
|
|
char *parameter = config(XORG_MONITOR(name));
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(parameter,&size,",");
|
|
|
|
|
int found = yon_char_parsed_check_exist(parsed,size,"enable");
|
|
|
|
|
if (found != -1){
|
|
|
|
|
free(parsed[found]);
|
|
|
|
|
parsed[found]=yon_char_new("disable");
|
|
|
|
|
gtk_widget_set_sensitive(window->MonitorImage,0);
|
|
|
|
|
} else {
|
|
|
|
|
found = yon_char_parsed_check_exist(parsed,size,"disable");
|
|
|
|
|
if (found !=-1){
|
|
|
|
|
free(parsed[found]);
|
|
|
|
|
parsed[found]=yon_char_new("enable");
|
|
|
|
|
} else {
|
|
|
|
|
parsed = yon_char_parsed_append(parsed,&size,"enable");
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_set_sensitive(window->MonitorImage,1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *final = yon_char_parsed_to_string(parsed,size,",");
|
|
|
|
|
yon_config_register(XORG_MONITOR(name),XORG_MONITOR_get_command,final);
|
|
|
|
|
yon_char_parsed_free(parsed,size);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|