diff options
-rw-r--r-- | gtk/src/callbacks.c | 81 | ||||
-rw-r--r-- | gtk/src/ghb.ui | 4 |
2 files changed, 48 insertions, 37 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 42f7b6a09..bad0db24e 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2685,48 +2685,55 @@ void ghb_file_menu_add_dvd(signal_user_data_t *ud) { GList *link, *drives; - - GtkActionGroup *agroup = GTK_ACTION_GROUP( - gtk_builder_get_object(ud->builder, "actiongroup1")); - GtkUIManager *ui = GTK_UI_MANAGER( - gtk_builder_get_object(ud->builder, "uimanager1")); - guint merge_id = gtk_ui_manager_new_merge_id(ui); + static GtkActionGroup *agroup = NULL; link = drives = dvd_device_list(); - while (link != NULL) - { - GtkAction *action; - gchar *drive = (gchar*)link->data; - gchar *name = get_drive_name(drive); - - action = gtk_action_group_get_action(agroup, drive); - if (action != NULL) + if (drives != NULL) + { + GtkUIManager *ui = GTK_UI_MANAGER( + gtk_builder_get_object(ud->builder, "uimanager1")); + guint merge_id = gtk_ui_manager_new_merge_id(ui); + if (agroup == NULL) + { + agroup = gtk_action_group_new("dvdgroup"); + // Add separator + gtk_ui_manager_insert_action_group(ui, agroup, 0); + gtk_ui_manager_add_ui(ui, merge_id, + "ui/menubar1/menuitem1/quit1", "dvdsep", NULL, + GTK_UI_MANAGER_SEPARATOR, TRUE); + } + + while (link != NULL) { - gtk_action_group_remove_action(agroup, action); - g_object_unref(G_OBJECT(action)); + GtkAction *action; + gchar *drive = (gchar*)link->data; + gchar *name = get_drive_name(drive); + + action = gtk_action_group_get_action(agroup, drive); + if (action != NULL) + { + gtk_action_group_remove_action(agroup, action); + g_object_unref(G_OBJECT(action)); + } + // Create action for this drive + action = gtk_action_new(drive, name, + "Scan this DVD source", "gtk-cdrom"); + // Add action to action group + gtk_action_group_add_action_with_accel(agroup, action, NULL); + // Add to ui manager + gtk_ui_manager_add_ui(ui, merge_id, + "ui/menubar1/menuitem1/dvdsep", drive, drive, + //"ui/menubar1/menuitem1/quit1", drive, drive, + GTK_UI_MANAGER_AUTO, TRUE); + // Connect signal to action (menu item) + g_signal_connect(action, "activate", + (GCallback)dvd_source_activate_cb, ud); + g_free(name); + g_free(drive); + link = link->next; } - // Create action for this drive - action = gtk_action_new(drive, name, - "Scan this DVD source", "gtk-cdrom"); - // Add action to action group - gtk_action_group_add_action_with_accel(agroup, action, NULL); - // Add to ui manager - gtk_ui_manager_add_ui(ui, merge_id, - "ui/menubar1/menuitem1/quit1", drive, drive, - GTK_UI_MANAGER_AUTO, TRUE); - // Connect signal to action (menu item) - g_signal_connect(action, "activate", - (GCallback)dvd_source_activate_cb, ud); - g_free(name); - g_free(drive); - link = link->next; + g_list_free(drives); } - g_list_free(drives); - - // Add separator - gtk_ui_manager_add_ui(ui, merge_id, - "ui/menubar1/menuitem1/quit1", "", NULL, - GTK_UI_MANAGER_AUTO, TRUE); } gboolean ghb_is_cd(GDrive *gd); diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 29987c342..1a50256fa 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -3907,6 +3907,7 @@ location as the movie.</property> </action-widgets> </object> <object class="GtkWindow" id="activity_window"> + <property name="visible">False</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> <property name="skip_taskbar_hint">True</property> @@ -3960,6 +3961,7 @@ location as the movie.</property> </child> </object> <object class="GtkWindow" id="queue_window"> + <property name="visible">False</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="title" translatable="yes">HandBrake Queue</property> <property name="icon_name">hb-queue</property> @@ -4102,6 +4104,7 @@ location as the movie.</property> </child> </object> <object class="GtkWindow" id="settings_window"> + <property name="visible">False</property> <property name="title" translatable="yes">Picture Settings</property> <property name="window_position">GTK_WIN_POS_NONE</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> @@ -5284,6 +5287,7 @@ location as the movie.</property> </object> <object class="GtkWindow" id="preview_window"> + <property name="visible">False</property> <property name="title" translatable="yes">Preview</property> <property name="window_position">GTK_WIN_POS_CENTER</property> <property name="skip_taskbar_hint">True</property> |