[virt-tools-list] [PATCH virt-viewer v4 07/12] Run iso-dialog when 'Change CD' menu is activated
Eduardo Lima (Etrunko)
etrunko at redhat.com
Tue Nov 1 20:33:37 UTC 2016
Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
src/resources/ui/virt-viewer.ui | 1 +
src/virt-viewer-window.c | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/src/resources/ui/virt-viewer.ui b/src/resources/ui/virt-viewer.ui
index af3ae46..e9609ec 100644
--- a/src/resources/ui/virt-viewer.ui
+++ b/src/resources/ui/virt-viewer.ui
@@ -78,6 +78,7 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Change CD</property>
<property name="use_underline">True</property>
+ <signal name="activate" handler="virt_viewer_window_menu_change_cd_activate" swapped="no"/>
</object>
</child>
<child>
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 99fd102..d172af6 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -43,6 +43,8 @@
#include "virt-viewer-util.h"
#include "virt-viewer-timed-revealer.h"
+#include "remote-viewer-iso-list-dialog.h"
+
#define ZOOM_STEP 10
/* Signal handlers for main window (move in a VirtViewerMainWindow?) */
@@ -62,6 +64,7 @@ void virt_viewer_window_menu_file_smartcard_insert(GtkWidget *menu, VirtViewerWi
void virt_viewer_window_menu_file_smartcard_remove(GtkWidget *menu, VirtViewerWindow *self);
void virt_viewer_window_menu_view_release_cursor(GtkWidget *menu, VirtViewerWindow *self);
void virt_viewer_window_menu_preferences_cb(GtkWidget *menu, VirtViewerWindow *self);
+void virt_viewer_window_menu_change_cd_activate(GtkWidget *menu, VirtViewerWindow *self);
/* Internal methods */
@@ -1056,6 +1059,27 @@ virt_viewer_window_menu_help_about(GtkWidget *menu G_GNUC_UNUSED,
g_object_unref(G_OBJECT(about));
}
+static void
+iso_dialog_response(GtkDialog *dialog,
+ gint response_id,
+ gpointer user_data G_GNUC_UNUSED)
+{
+ if (response_id == GTK_RESPONSE_NONE)
+ return;
+
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+}
+
+void
+virt_viewer_window_menu_change_cd_activate(GtkWidget *menu G_GNUC_UNUSED,
+ VirtViewerWindow *self)
+{
+ VirtViewerWindowPrivate *priv = self->priv;
+ GtkWidget *dialog = remote_viewer_iso_list_dialog_new(GTK_WINDOW(priv->window));
+ g_signal_connect(dialog, "response", G_CALLBACK(iso_dialog_response), NULL);
+ gtk_widget_show_all(dialog);
+ gtk_dialog_run(GTK_DIALOG(dialog));
+}
static void
virt_viewer_window_toolbar_setup(VirtViewerWindow *self)
--
2.7.4
More information about the virt-tools-list
mailing list