From e3bdd00ff345de62a3612555fd59327e51ae33b7 Mon Sep 17 00:00:00 2001 From: TingPing Date: Fri, 30 Nov 2012 11:59:42 -0500 Subject: handle plugingui window like other utils --- src/fe-gtk/plugingui.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c index e344c336..45ef761b 100644 --- a/src/fe-gtk/plugingui.c +++ b/src/fe-gtk/plugingui.c @@ -43,6 +43,7 @@ typedef struct session hexchat_context; #include "../common/hexchatc.h" #include "../common/cfgfiles.h" #include "gtkutil.h" +#include "maingui.h" /* model for the plugin treeview */ enum @@ -213,38 +214,39 @@ void plugingui_open (void) { GtkWidget *view; - GtkWidget *vbox, *action_area; + GtkWidget *vbox, *hbox; if (plugin_window) { - gtk_window_present (GTK_WINDOW (plugin_window)); + mg_bring_tofront (plugin_window); return; } - plugin_window = gtk_dialog_new (); - g_signal_connect (G_OBJECT (plugin_window), "destroy", - G_CALLBACK (plugingui_close), 0); - gtk_window_set_default_size (GTK_WINDOW (plugin_window), 500, 250); - vbox = GTK_DIALOG (plugin_window)->vbox; - action_area = GTK_DIALOG (plugin_window)->action_area; - gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); - gtk_window_set_position (GTK_WINDOW (plugin_window), GTK_WIN_POS_CENTER); - gtk_window_set_title (GTK_WINDOW (plugin_window), _(DISPLAY_NAME": Plugins and Scripts")); + plugin_window = mg_create_generic_tab ("Addons", _(DISPLAY_NAME": Plugins and Scripts"), + FALSE, TRUE, plugingui_close, NULL, + 500, 250, &vbox, 0); view = plugingui_treeview_new (vbox); g_object_set_data (G_OBJECT (plugin_window), "view", view); - gtkutil_button (action_area, GTK_STOCK_REVERT_TO_SAVED, NULL, + + hbox = gtk_hbutton_box_new (); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_SPREAD); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0); + + gtkutil_button (hbox, GTK_STOCK_REVERT_TO_SAVED, NULL, plugingui_loadbutton_cb, NULL, _("_Load...")); - gtkutil_button (action_area, GTK_STOCK_DELETE, NULL, + gtkutil_button (hbox, GTK_STOCK_DELETE, NULL, plugingui_unload, NULL, _("_UnLoad")); - gtkutil_button (action_area, - GTK_STOCK_CLOSE, NULL, plugingui_close_button, - NULL, _("_Close")); + if (!prefs.hex_gui_tab_utils) + gtkutil_button (hbox, + GTK_STOCK_CLOSE, NULL, plugingui_close_button, + NULL, _("_Close")); fe_pluginlist_update (); - gtk_widget_show (plugin_window); + gtk_widget_show_all (plugin_window); } -- cgit 1.4.1 From f06fd74d25b3a6aac7a5427b9acb545588edd93e Mon Sep 17 00:00:00 2001 From: TingPing Date: Sun, 2 Dec 2012 23:16:07 -0500 Subject: remove close button for consistancy --- src/fe-gtk/plugingui.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c index 45ef761b..eed6ac10 100644 --- a/src/fe-gtk/plugingui.c +++ b/src/fe-gtk/plugingui.c @@ -83,12 +83,6 @@ plugingui_treeview_new (GtkWidget *box) return view; } -static void -plugingui_close_button (GtkWidget * wid, gpointer a) -{ - gtk_widget_destroy (plugin_window); -} - static void plugingui_close (GtkWidget * wid, gpointer a) { @@ -241,11 +235,6 @@ plugingui_open (void) gtkutil_button (hbox, GTK_STOCK_DELETE, NULL, plugingui_unload, NULL, _("_UnLoad")); - if (!prefs.hex_gui_tab_utils) - gtkutil_button (hbox, - GTK_STOCK_CLOSE, NULL, plugingui_close_button, - NULL, _("_Close")); - fe_pluginlist_update (); gtk_widget_show_all (plugin_window); -- cgit 1.4.1 From 18f248cdbece0adbff326e8eb9f5f9c316d21dc4 Mon Sep 17 00:00:00 2001 From: TingPing Date: Mon, 3 Dec 2012 16:13:53 -0500 Subject: remove unneeded gtk_widget_show --- src/fe-gtk/plugingui.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c index eed6ac10..f10e439c 100644 --- a/src/fe-gtk/plugingui.c +++ b/src/fe-gtk/plugingui.c @@ -79,7 +79,6 @@ plugingui_treeview_new (GtkWidget *box) col_id++) gtk_tree_view_column_set_alignment (col, 0.5); - gtk_widget_show (view); return view; } -- cgit 1.4.1