Set the correct parent window for the toolbar editor dialog (closes #2913334).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4503 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-12-20 20:49:28 +00:00
parent c0a243c43d
commit baccf0391e
5 changed files with 17 additions and 7 deletions

View File

@ -22,6 +22,9 @@
* src/keyfile.c, src/msgwindow.c, src/msgwindow.h, src/ui_utils.h: * src/keyfile.c, src/msgwindow.c, src/msgwindow.h, src/ui_utils.h:
Add preferences for hiding single tabs from the messages window Add preferences for hiding single tabs from the messages window
(no GUI preferences yet, still to be implemented). (no GUI preferences yet, still to be implemented).
* src/callbacks.c, src/prefs.c, src/toolbar.c, src/toolbar.h:
Set the correct parent window for the toolbar editor
dialog (closes #2913334).
2009-12-20 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> 2009-12-20 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>

View File

@ -2261,7 +2261,7 @@ void
on_customize_toolbar1_activate (GtkMenuItem *menuitem, on_customize_toolbar1_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
{ {
toolbar_configure(); toolbar_configure(GTK_WINDOW(main_widgets.window));
} }
@ -2269,7 +2269,7 @@ void
on_button_customize_toolbar_clicked (GtkButton *button, on_button_customize_toolbar_clicked (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
toolbar_configure(); toolbar_configure(GTK_WINDOW(ui_widgets.prefs_dialog));
} }

View File

@ -1535,10 +1535,14 @@ void prefs_show_dialog(void)
GtkWidget *label; GtkWidget *label;
guint i; guint i;
gchar *encoding_string; gchar *encoding_string;
GdkPixbuf *pb;
ui_widgets.prefs_dialog = create_prefs_dialog(); ui_widgets.prefs_dialog = create_prefs_dialog();
gtk_widget_set_name(ui_widgets.prefs_dialog, "GeanyPrefsDialog"); gtk_widget_set_name(ui_widgets.prefs_dialog, "GeanyPrefsDialog");
gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.prefs_dialog), GTK_WINDOW(main_widgets.window)); gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.prefs_dialog), GTK_WINDOW(main_widgets.window));
pb = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO);
gtk_window_set_icon(GTK_WINDOW(ui_widgets.prefs_dialog), pb);
g_object_unref(pb); /* free our reference */
/* init the default file encoding combo box */ /* init the default file encoding combo box */
combo_new = ui_lookup_widget(ui_widgets.prefs_dialog, "combo_new_encoding"); combo_new = ui_lookup_widget(ui_widgets.prefs_dialog, "combo_new_encoding");

View File

@ -882,7 +882,7 @@ static void tb_editor_available_items_deleted_cb(GtkTreeModel *model, GtkTreePat
} }
static TBEditorWidget *tb_editor_create_dialog(void) static TBEditorWidget *tb_editor_create_dialog(GtkWindow *parent)
{ {
GtkWidget *dialog, *vbox, *hbox, *vbox_buttons, *button_add, *button_remove; GtkWidget *dialog, *vbox, *hbox, *vbox_buttons, *button_add, *button_remove;
GtkWidget *swin_available, *swin_used, *tree_available, *tree_used, *label; GtkWidget *swin_available, *swin_used, *tree_available, *tree_used, *label;
@ -890,8 +890,11 @@ static TBEditorWidget *tb_editor_create_dialog(void)
GtkTreeViewColumn *column; GtkTreeViewColumn *column;
TBEditorWidget *tbw = g_new(TBEditorWidget, 1); TBEditorWidget *tbw = g_new(TBEditorWidget, 1);
if (parent == NULL)
parent = GTK_WINDOW(main_widgets.window);
dialog = gtk_dialog_new_with_buttons(_("Customize Toolbar"), dialog = gtk_dialog_new_with_buttons(_("Customize Toolbar"),
GTK_WINDOW(main_widgets.window), parent,
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog)); vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
@ -1011,7 +1014,7 @@ static TBEditorWidget *tb_editor_create_dialog(void)
} }
void toolbar_configure(void) void toolbar_configure(GtkWindow *parent)
{ {
gchar *markup; gchar *markup;
const gchar *name; const gchar *name;
@ -1030,7 +1033,7 @@ void toolbar_configure(void)
all_items = gtk_action_group_list_actions(group); all_items = gtk_action_group_list_actions(group);
/* create the GUI */ /* create the GUI */
tbw = tb_editor_create_dialog(); tbw = tb_editor_create_dialog(parent);
/* fill the stores */ /* fill the stores */
gtk_list_store_insert_with_values(tbw->store_available, NULL, -1, gtk_list_store_insert_with_values(tbw->store_available, NULL, -1,

View File

@ -63,6 +63,6 @@ GtkWidget *toolbar_init(void);
void toolbar_finalize(void); void toolbar_finalize(void);
void toolbar_configure(void); void toolbar_configure(GtkWindow *parent);
#endif #endif