From: Thierry Lorthiois Date: Mon, 26 Oct 2009 21:21:54 +0000 (+0000) Subject: tint2conf : delete theme X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=b6f48e139354d3601f471d962e8a28e090cb5e72;p=chaz%2Ftint2 tint2conf : delete theme --- diff --git a/src/tint.c b/src/tint.c index 7e373a4..1b4dc48 100644 --- a/src/tint.c +++ b/src/tint.c @@ -294,11 +294,7 @@ void event_button_press (XEvent *e) { Panel *panel = get_panel(e->xany.window); if (!panel) return; -/* - if (wm_menu && (e->xbutton.button != 1) ) { - task_drag = click_task(panel, e->xbutton.x, e->xbutton.y); - if (!task_drag && !click_clock(panel, e->xbutton.x, e->xbutton.y) ) { - */ + task_drag = click_task(panel, e->xbutton.x, e->xbutton.y); if (wm_menu && !task_drag && !click_clock(panel, e->xbutton.x, e->xbutton.y) && (e->xbutton.button != 1) ) { diff --git a/src/tint2conf/main.c b/src/tint2conf/main.c index e1e87a1..9ba7ed0 100644 --- a/src/tint2conf/main.c +++ b/src/tint2conf/main.c @@ -308,20 +308,17 @@ static void menuDelete (void) sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view)); if (gtk_tree_selection_get_selected(GTK_TREE_SELECTION(sel), &model, &iter)) { gtk_tree_model_get(model, &iter, LIST_ITEM, &value, -1); + gtk_tree_selection_unselect_all(sel); + // remove from the gui + gtk_list_store_remove(GTK_LIST_STORE(model), &iter); + name1 = g_build_filename (g_get_user_config_dir(), "tint2", value, NULL); name2 = g_strdup_printf("%s.tint2rc", name1); - g_free(name1); + g_remove(name2); - printf("selected row %s\n", value); - //g_remove(name2); -/* - GtkListStore *store; - GtkTreeIter iter; - store = GTK_LIST_STORE(model); - gtk_list_store_remove(store, &iter); -*/ - g_free(value); + g_free(name1); g_free(name2); + g_free(value); } } @@ -393,22 +390,16 @@ static void view_popup_menu(GtkWidget *treeview, GdkEventButton *event, gpointer static gboolean view_onButtonPressed (GtkWidget *treeview, GdkEventButton *event, gpointer userdata) { - /* single click with the right mouse button? */ + // single click with the right mouse button? if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - /* optional: select row if no row is selected or only - * one other row is selected (will only do something - * if you set a tree selection mode as described later - * in the tutorial) */ GtkTreeSelection *selection; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); - /* Note: gtk_tree_selection_count_selected_rows() does not - * exist in gtk+-2.0, only in gtk+ >= v2.2 ! */ if (gtk_tree_selection_count_selected_rows(selection) <= 1) { GtkTreePath *path; - /* Get tree path for row that was clicked */ + // Get tree path for row that was clicked if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview), (gint) event->x, (gint) event->y, &path, NULL, NULL, NULL)) { gtk_tree_selection_unselect_all(selection); gtk_tree_selection_select_path(selection, path);