From: Thierry Lorthiois Date: Tue, 14 Jun 2011 14:10:45 +0000 (+0000) Subject: tint2conf: work in progress X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=f51860112cd7db97d3239dfeedc6406d8bcff581;p=chaz%2Ftint2 tint2conf: work in progress --- diff --git a/src/tint2conf/properties.c b/src/tint2conf/properties.c index 769a634..5b2cf0b 100644 --- a/src/tint2conf/properties.c +++ b/src/tint2conf/properties.c @@ -781,7 +781,6 @@ void create_taskbar(GtkWidget *parent) void create_task(GtkWidget *parent) { GtkWidget *table, *label, *notebook, *page_task; - GtkWidget *margin_x, *combo_background; label = gtk_label_new (_("Mouse action")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); @@ -800,80 +799,80 @@ void create_task(GtkWidget *parent) gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); - combo_background = gtk_combo_box_new_text (); - gtk_widget_show (combo_background); - gtk_table_attach (GTK_TABLE (table), combo_background, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("none")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("close")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("shade")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle_iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("maximize_restore")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_left")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_right")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("next_task")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("previous_task")); + task_mouse_middle = gtk_combo_box_new_text (); + gtk_widget_show (task_mouse_middle); + gtk_table_attach (GTK_TABLE (table), task_mouse_middle, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("None")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Close")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Toggle")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("sShade")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Toggle or iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Maximize or restore")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Desktop left")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Desktop right")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Next task")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_middle), _("Previous task")); label = gtk_label_new (_("Wheel scroll up")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 6, 7, 0, 1, GTK_FILL, 0, 0, 0); - combo_background = gtk_combo_box_new_text (); - gtk_widget_show (combo_background); - gtk_table_attach (GTK_TABLE (table), combo_background, 7, 8, 0, 1, GTK_FILL, 0, 0, 0); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("none")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("close")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("shade")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle_iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("maximize_restore")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_left")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_right")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("next_task")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("previous_task")); + task_mouse_scroll_up = gtk_combo_box_new_text (); + gtk_widget_show (task_mouse_scroll_up); + gtk_table_attach (GTK_TABLE (table), task_mouse_scroll_up, 7, 8, 0, 1, GTK_FILL, 0, 0, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("None")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Close")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Toggle")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Shade")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Toggle or iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Maximize or restore")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Desktop left")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Desktop right")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Next task")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_up), _("Previous task")); label = gtk_label_new (_("Right click")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); - combo_background = gtk_combo_box_new_text (); - gtk_widget_show (combo_background); - gtk_table_attach (GTK_TABLE (table), combo_background, 3, 4, 1, 2, GTK_FILL, 0, 0, 0); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("none")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("close")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("shade")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle_iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("maximize_restore")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_left")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_right")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("next_task")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("previous_task")); + task_mouse_right = gtk_combo_box_new_text (); + gtk_widget_show (task_mouse_right); + gtk_table_attach (GTK_TABLE (table), task_mouse_right, 3, 4, 1, 2, GTK_FILL, 0, 0, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("None")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Close")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Toggle")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Shade")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Toggle or iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Maximize or restore")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Desktop left")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Desktop right")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Next task")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_right), _("Previous task")); label = gtk_label_new (_("Wheel scroll down")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 6, 7, 1, 2, GTK_FILL, 0, 0, 0); - combo_background = gtk_combo_box_new_text (); - gtk_widget_show (combo_background); - gtk_table_attach (GTK_TABLE (table), combo_background, 7, 8, 1, 2, GTK_FILL, 0, 0, 0); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("none")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("close")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("shade")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("toggle_iconify")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("maximize_restore")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_left")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("desktop_right")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("next_task")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo_background), _("previous_task")); + task_mouse_scroll_down = gtk_combo_box_new_text (); + gtk_widget_show (task_mouse_scroll_down); + gtk_table_attach (GTK_TABLE (table), task_mouse_scroll_down, 7, 8, 1, 2, GTK_FILL, 0, 0, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("None")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Close")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Toggle")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Shade")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Toggle or iconify")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Maximize or restore")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Desktop left")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Desktop right")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Next task")); + gtk_combo_box_append_text (GTK_COMBO_BOX (task_mouse_scroll_down), _("Previous task")); change_paragraph(parent); @@ -883,7 +882,7 @@ void create_task(GtkWidget *parent) gtk_widget_show (label); gtk_box_pack_start(GTK_BOX (parent), label, FALSE, FALSE, 0); - table = gtk_table_new (4, 10, FALSE); + table = gtk_table_new (4, 13, FALSE); gtk_widget_show (table); gtk_box_pack_start (GTK_BOX (parent), table, FALSE, FALSE, 0); gtk_table_set_row_spacings (GTK_TABLE (table), ROW_SPACING); @@ -894,40 +893,86 @@ void create_task(GtkWidget *parent) gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); - margin_x = gtk_check_button_new (); - gtk_widget_show (margin_x); - gtk_entry_set_max_length (GTK_ENTRY (margin_x), 3); - gtk_table_attach (GTK_TABLE (table), margin_x, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); + task_show_icon = gtk_check_button_new (); + gtk_widget_show (task_show_icon); + gtk_entry_set_max_length (GTK_ENTRY (task_show_icon), 3); + gtk_table_attach (GTK_TABLE (table), task_show_icon, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); label = gtk_label_new (_("Show text")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); - margin_x = gtk_check_button_new (); - gtk_widget_show (margin_x); - gtk_entry_set_max_length (GTK_ENTRY (margin_x), 3); - gtk_table_attach (GTK_TABLE (table), margin_x, 3, 4, 1, 2, GTK_FILL, 0, 0, 0); + task_show_text = gtk_check_button_new (); + gtk_widget_show (task_show_text); + gtk_entry_set_max_length (GTK_ENTRY (task_show_text), 3); + gtk_table_attach (GTK_TABLE (table), task_show_text, 3, 4, 1, 2, GTK_FILL, 0, 0, 0); label = gtk_label_new (_("Align center")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 2, 3, 2, 3, GTK_FILL, 0, 0, 0); - margin_x = gtk_check_button_new (); - gtk_widget_show (margin_x); - gtk_entry_set_max_length (GTK_ENTRY (margin_x), 3); - gtk_table_attach (GTK_TABLE (table), margin_x, 3, 4, 2, 3, GTK_FILL, 0, 0, 0); + task_align_center = gtk_check_button_new (); + gtk_widget_show (task_align_center); + gtk_entry_set_max_length (GTK_ENTRY (task_align_center), 3); + gtk_table_attach (GTK_TABLE (table), task_align_center, 3, 4, 2, 3, GTK_FILL, 0, 0, 0); label = gtk_label_new (_("Font shadow")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 2, 3, 3, 4, GTK_FILL, 0, 0, 0); - margin_x = gtk_check_button_new (); - gtk_widget_show (margin_x); - gtk_entry_set_max_length (GTK_ENTRY (margin_x), 3); - gtk_table_attach (GTK_TABLE (table), margin_x, 3, 4, 3, 4, GTK_FILL, 0, 0, 0); + task_font_shadow = gtk_check_button_new (); + gtk_widget_show (task_font_shadow); + gtk_entry_set_max_length (GTK_ENTRY (task_font_shadow), 3); + gtk_table_attach (GTK_TABLE (table), task_font_shadow, 3, 4, 3, 4, GTK_FILL, 0, 0, 0); + + label = gtk_label_new (_("Maximum width")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 6, 7, 0, 1, GTK_FILL, 0, 0, 0); + + task_maximum_width = gtk_spin_button_new_with_range (0, 9000, 1); + gtk_widget_show (task_maximum_width); + gtk_table_attach (GTK_TABLE (table), task_maximum_width, 7, 8, 0, 1, GTK_FILL, 0, 0, 0); + + label = gtk_label_new (_("Maximum height")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 6, 7, 1, 2, GTK_FILL, 0, 0, 0); + + task_maximum_height = gtk_spin_button_new_with_range (0, 9000, 1); + gtk_widget_show (task_maximum_height); + gtk_table_attach (GTK_TABLE (table), task_maximum_height, 7, 8, 1, 2, GTK_FILL, 0, 0, 0); + + label = gtk_label_new (_("Horizontal padding")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 6, 7, 2, 3, GTK_FILL, 0, 0, 0); + + task_padding_x = gtk_spin_button_new_with_range (0, 9000, 1); + gtk_widget_show (task_padding_x); + gtk_table_attach (GTK_TABLE (table), task_padding_x, 7, 8, 2, 3, GTK_FILL, 0, 0, 0); + + label = gtk_label_new (_("Vertical padding")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 6, 7, 3, 4, GTK_FILL, 0, 0, 0); + + task_padding_y = gtk_spin_button_new_with_range (0, 9000, 1); + gtk_widget_show (task_padding_y); + gtk_table_attach (GTK_TABLE (table), task_padding_y, 7, 8, 3, 4, GTK_FILL, 0, 0, 0); + + label = gtk_label_new (_("Font")); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 10, 11, 0, 1, GTK_FILL, 0, 0, 0); + + task_font = gtk_font_button_new (); + gtk_widget_show (task_font); + gtk_table_attach (GTK_TABLE (table), task_font, 11, 12, 0, 1, GTK_FILL, 0, 0, 0); +// gtk_font_button_set_show_style (GTK_FONT_BUTTON (task_font), FALSE); // tasks notebook = gtk_notebook_new (); diff --git a/src/tint2conf/properties.h b/src/tint2conf/properties.h index 3fe0239..e9bec9c 100644 --- a/src/tint2conf/properties.h +++ b/src/tint2conf/properties.h @@ -15,6 +15,9 @@ GtkWidget *taskbar_show_desktop, *taskbar_show_name, *taskbar_padding_x, *taskb GtkWidget *taskbar_name_padding_x, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font; // task +GtkWidget *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down; +GtkWidget *task_show_icon, *task_show_text, *task_align_center, *task_font_shadow; +GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_font; // clock GtkWidget *clock_format_line1, *clock_format_line2, *clock_tmz_line1, *clock_tmz_line2; diff --git a/src/tint2conf/properties_rw.c b/src/tint2conf/properties_rw.c index 1436450..a82a9fa 100644 --- a/src/tint2conf/properties_rw.c +++ b/src/tint2conf/properties_rw.c @@ -11,6 +11,7 @@ void add_entry (char *key, char *value); void hex2gdk(char *hex, GdkColor *color); +void get_action(char *event, GtkWidget *combo); @@ -152,12 +153,6 @@ void add_entry (char *key, char *value) else if (strcmp (key, "panel_monitor") == 0) { //panel_config.monitor = config_get_monitor(value); } - else if (strcmp (key, "font_shadow") == 0) { - //panel_config.g_task.font_shadow = atoi (value); - } - else if (strcmp (key, "urgent_nb_of_blink") == 0) { - //max_tick_urgent = atoi (value); - } /* autohide options */ else if (strcmp(key, "autohide") == 0) { @@ -350,34 +345,39 @@ void add_entry (char *key, char *value) /* Task */ else if (strcmp (key, "task_text") == 0) { - //panel_config.g_task.text = atoi (value); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_show_text), atoi(value)); } else if (strcmp (key, "task_icon") == 0) { - //panel_config.g_task.icon = atoi (value); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_show_icon), atoi(value)); } else if (strcmp (key, "task_centered") == 0) { - //panel_config.g_task.centered = atoi (value); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_align_center), atoi(value)); + } + else if (strcmp (key, "font_shadow") == 0) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_font_shadow), atoi(value)); + } + else if (strcmp (key, "urgent_nb_of_blink") == 0) { + //max_tick_urgent = atoi (value); } else if (strcmp (key, "task_width") == 0) { // old parameter : just for backward compatibility - //panel_config.g_task.maximum_width = atoi (value); - //panel_config.g_task.maximum_height = 30; + gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_width), atof(value)); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_height), 30.0); } else if (strcmp (key, "task_maximum_size") == 0) { extract_values(value, &value1, &value2, &value3); - //panel_config.g_task.maximum_width = atoi (value1); - //panel_config.g_task.maximum_height = 30; - //if (value2) - //panel_config.g_task.maximum_height = atoi (value2); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_width), atof(value1)); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_height), 30.0); + if (value2) + gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_maximum_height), atof(value2)); } else if (strcmp (key, "task_padding") == 0) { extract_values(value, &value1, &value2, &value3); - //panel_config.g_task.area.paddingxlr = panel_config.g_task.area.paddingx = atoi (value1); - //if (value2) panel_config.g_task.area.paddingy = atoi (value2); - //if (value3) panel_config.g_task.area.paddingx = atoi (value3); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_padding_x), atof(value1)); + if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_padding_y), atof(value2)); } else if (strcmp (key, "task_font") == 0) { - //panel_config.g_task.font_desc = pango_font_description_from_string (value); + gtk_font_button_set_font_name(GTK_FONT_BUTTON(task_font), value); } else if (g_regex_match_simple("task.*_font_color", key, 0, 0)) { /*gchar** split = g_regex_split_simple("_", key, 0, 0); @@ -509,13 +509,16 @@ void add_entry (char *key, char *value) /* Mouse actions */ else if (strcmp (key, "mouse_middle") == 0) { - //get_action (value, &mouse_middle); + get_action(value, task_mouse_middle); } else if (strcmp (key, "mouse_right") == 0) { + get_action(value, task_mouse_right); } else if (strcmp (key, "mouse_scroll_up") == 0) { + get_action(value, task_mouse_scroll_up); } else if (strcmp (key, "mouse_scroll_down") == 0) { + get_action(value, task_mouse_scroll_down); } if (value1) free (value1); @@ -534,3 +537,29 @@ void hex2gdk(char *hex, GdkColor *color) } +void get_action(char *event, GtkWidget *combo) +{ + if (strcmp (event, "none") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0); + else if (strcmp (event, "close") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1); + else if (strcmp (event, "toggle") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 2); + else if (strcmp (event, "iconify") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 3); + else if (strcmp (event, "shade") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 4); + else if (strcmp (event, "toggle_iconify") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 5); + else if (strcmp (event, "maximize_restore") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 6); + else if (strcmp (event, "desktop_left") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 7); + else if (strcmp (event, "desktop_right") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 8); + else if (strcmp (event, "next_task") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 9); + else if (strcmp (event, "prev_task") == 0) + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 10); +} +