Richard W.M. Jones
2015-May-06 15:23 UTC
[Libguestfs] [PATCH 0/3] p2v: Add Configure Network button (RHBZ#1167921).
https://bugzilla.redhat.com/show_bug.cgi?id=1167921
Richard W.M. Jones
2015-May-06 15:23 UTC
[Libguestfs] [PATCH 1/3] p2v: Use "About virt-p2v [VERSION]" on the about button.
This makes it clearer what the button does. This updates commit a743f57cb8e74adaccae3a6f3b3da0c6961dc5ba. --- p2v/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2v/gui.c b/p2v/gui.c index 391d3f0..b32075f 100644 --- a/p2v/gui.c +++ b/p2v/gui.c @@ -199,7 +199,7 @@ create_connection_dialog (struct config *config) /* Buttons. */ gtk_dialog_add_buttons (GTK_DIALOG (conn_dlg), /* _("Configure network ..."), 1, */ - _("virt-p2v " PACKAGE_VERSION " ..."), 2, + _("About virt-p2v " PACKAGE_VERSION " ..."), 2, _("Next"), 3, NULL); -- 2.3.1
Richard W.M. Jones
2015-May-06 15:23 UTC
[Libguestfs] [PATCH 2/3] p2v: Switch from matchbox-window-manager to metacity.
Matchbox only supports a single window on screen. This worked fine until we added the NetworkManager connection dialog -- which tries to open in a new top level window, and of course fails. Metacity supports multiple top-level windows so doesn't suffer this problem. Apart from that it's hard to tell the difference between the two. --- p2v/launch-virt-p2v.in | 2 +- p2v/p2v.ks.in | 2 +- p2v/virt-p2v-make-disk.in | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/p2v/launch-virt-p2v.in b/p2v/launch-virt-p2v.in index a70e5c2..d2bafe3 100755 --- a/p2v/launch-virt-p2v.in +++ b/p2v/launch-virt-p2v.in @@ -22,7 +22,7 @@ # and virt-p2v. if [ "$1" = "run" ]; then cd / - matchbox-window-manager & + metacity & exec @libexecdir@/virt-p2v else xinit "$0" run diff --git a/p2v/p2v.ks.in b/p2v/p2v.ks.in index 9649a5b..0053293 100644 --- a/p2v/p2v.ks.in +++ b/p2v/p2v.ks.in @@ -73,7 +73,7 @@ firewalld /usr/bin/Xorg xorg-x11-drivers xorg-x11-fonts-Type1 -matchbox-window-manager +metacity pcre libxml2 gtk2 diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in index fb02856..2bb364b 100644 --- a/p2v/virt-p2v-make-disk.in +++ b/p2v/virt-p2v-make-disk.in @@ -94,12 +94,12 @@ trap cleanup INT QUIT TERM EXIT ERR # - Xorg drivers # - some fonts # - hardware support (firmware etc, RHBZ#1157679) -# - matchbox (window manager, another could be used) +# - metacity (window manager, another could be used) # # Note that libguestfs is NOT a dependency. case "$osversion" in centos-*|fedora-*|rhel-*|scientificlinux-*) - deps=pcre,libxml2,gtk2,/usr/bin/xinit,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/Xorg,xorg-x11-drivers,xorg-x11-fonts-Type1,matchbox-window-manager,@hardware-support + deps=pcre,libxml2,gtk2,/usr/bin/xinit,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/Xorg,xorg-x11-drivers,xorg-x11-fonts-Type1,metacity,@hardware-support cat > $tmpdir/p2v.conf <<'EOF' add_drivers+=" usb-storage " EOF @@ -117,13 +117,13 @@ EOF " ;; debian-*|ubuntu-*) - deps=libpcre3,libxml2,libgtk2.0-0,openssh-client,qemu-utils,xorg,xserver-xorg-video-all,matchbox-window-manager + deps=libpcre3,libxml2,libgtk2.0-0,openssh-client,qemu-utils,xorg,xserver-xorg-video-all,metacity ;; archlinux-*) - deps=pcre,libxml2,gtk2,openssh,qemu,xorg-xinit,xorg-server,xf86-video-*,matchbox-window-manager + deps=pcre,libxml2,gtk2,openssh,qemu,xorg-xinit,xorg-server,xf86-video-*,metacity ;; opensuse-*|suse-*) - deps=pcre,libxml2,gtk2,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/xinit,/usr/bin/Xorg,xf86-video-*,matchbox-window-manager + deps=pcre,libxml2,gtk2,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/xinit,/usr/bin/Xorg,xf86-video-*,metacity ;; *) echo "$program: internal error: could not work out the Linux distro from '$osversion'" -- 2.3.1
Richard W.M. Jones
2015-May-06 15:23 UTC
[Libguestfs] [PATCH 3/3] p2v: Add Configure Network button (RHBZ#1167921).
The old version of virt-p2v had a whole custom-written dialog which interacted with NetworkManager over dbus. After trying that approach, it's really complex to get right. Instead this button simply opens NetworkManager's connection editor. This also adds nm-applet to the disk and starts it. However nm-applet does not display any visible indication -- probably because we are lacking a system tray. --- p2v/gui.c | 14 +++++++++++++- p2v/launch-virt-p2v.in | 1 + p2v/p2v.ks.in | 2 ++ p2v/virt-p2v-make-disk.in | 11 +++++++---- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/p2v/gui.c b/p2v/gui.c index b32075f..cec236f 100644 --- a/p2v/gui.c +++ b/p2v/gui.c @@ -94,6 +94,7 @@ gui_application (struct config *config) static void test_connection_clicked (GtkWidget *w, gpointer data); static void *test_connection_thread (void *data); +static void configure_network_button_clicked (GtkWidget *w, gpointer data); static void about_button_clicked (GtkWidget *w, gpointer data); static void connection_next_clicked (GtkWidget *w, gpointer data); static void repopulate_output_combo (struct config *config); @@ -108,6 +109,7 @@ create_connection_dialog (struct config *config) GtkWidget *password_label; GtkWidget *test_hbox, *test; GtkWidget *about; + GtkWidget *configure_network; char port_str[64]; conn_dlg = gtk_dialog_new (); @@ -198,7 +200,7 @@ create_connection_dialog (struct config *config) /* Buttons. */ gtk_dialog_add_buttons (GTK_DIALOG (conn_dlg), - /* _("Configure network ..."), 1, */ + _("Configure network ..."), 1, _("About virt-p2v " PACKAGE_VERSION " ..."), 2, _("Next"), 3, NULL); @@ -206,6 +208,8 @@ create_connection_dialog (struct config *config) next_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (conn_dlg), 3); gtk_widget_set_sensitive (next_button, FALSE); + configure_network + gtk_dialog_get_widget_for_response (GTK_DIALOG (conn_dlg), 1); about = gtk_dialog_get_widget_for_response (GTK_DIALOG (conn_dlg), 2); /* Signals. */ @@ -213,6 +217,8 @@ create_connection_dialog (struct config *config) G_CALLBACK (gtk_main_quit), NULL); g_signal_connect (G_OBJECT (test), "clicked", G_CALLBACK (test_connection_clicked), config); + g_signal_connect (G_OBJECT (configure_network), "clicked", + G_CALLBACK (configure_network_button_clicked), NULL); g_signal_connect (G_OBJECT (about), "clicked", G_CALLBACK (about_button_clicked), NULL); g_signal_connect (G_OBJECT (next_button), "clicked", @@ -342,6 +348,12 @@ test_connection_thread (void *data) } static void +configure_network_button_clicked (GtkWidget *w, gpointer data) +{ + ignore_value (system ("nm-connection-editor &")); +} + +static void about_button_clicked (GtkWidget *w, gpointer data) { gtk_show_about_dialog (GTK_WINDOW (conn_dlg), diff --git a/p2v/launch-virt-p2v.in b/p2v/launch-virt-p2v.in index d2bafe3..e4a5a80 100755 --- a/p2v/launch-virt-p2v.in +++ b/p2v/launch-virt-p2v.in @@ -23,6 +23,7 @@ if [ "$1" = "run" ]; then cd / metacity & + nm-applet & exec @libexecdir@/virt-p2v else xinit "$0" run diff --git a/p2v/p2v.ks.in b/p2v/p2v.ks.in index 0053293..505703a 100644 --- a/p2v/p2v.ks.in +++ b/p2v/p2v.ks.in @@ -77,6 +77,8 @@ metacity pcre libxml2 gtk2 +network-manager-applet +dbus-x11 @hardware-support --optional %end diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in index 2bb364b..e2ea7f5 100644 --- a/p2v/virt-p2v-make-disk.in +++ b/p2v/virt-p2v-make-disk.in @@ -95,11 +95,14 @@ trap cleanup INT QUIT TERM EXIT ERR # - some fonts # - hardware support (firmware etc, RHBZ#1157679) # - metacity (window manager, another could be used) +# - NetworkManager +# - nm-applet +# - dbus-x11 (required by nm-applet, but not specified as a dep in Fedora) # # Note that libguestfs is NOT a dependency. case "$osversion" in centos-*|fedora-*|rhel-*|scientificlinux-*) - deps=pcre,libxml2,gtk2,/usr/bin/xinit,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/Xorg,xorg-x11-drivers,xorg-x11-fonts-Type1,metacity,@hardware-support + deps=pcre,libxml2,gtk2,/usr/bin/xinit,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/Xorg,xorg-x11-drivers,xorg-x11-fonts-Type1,metacity,NetworkManager,network-manager-applet,dbus-x11,@hardware-support cat > $tmpdir/p2v.conf <<'EOF' add_drivers+=" usb-storage " EOF @@ -117,13 +120,13 @@ EOF " ;; debian-*|ubuntu-*) - deps=libpcre3,libxml2,libgtk2.0-0,openssh-client,qemu-utils,xorg,xserver-xorg-video-all,metacity + deps=libpcre3,libxml2,libgtk2.0-0,openssh-client,qemu-utils,xorg,xserver-xorg-video-all,metacity,network-manager,network-manager-applet,dbus-x11 ;; archlinux-*) - deps=pcre,libxml2,gtk2,openssh,qemu,xorg-xinit,xorg-server,xf86-video-*,metacity + deps=pcre,libxml2,gtk2,openssh,qemu,xorg-xinit,xorg-server,xf86-video-*,metacity,NetworkManager,network-manager-applet,dbus-x11 ;; opensuse-*|suse-*) - deps=pcre,libxml2,gtk2,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/xinit,/usr/bin/Xorg,xf86-video-*,metacity + deps=pcre,libxml2,gtk2,/usr/bin/ssh,/usr/bin/qemu-nbd,/usr/bin/xinit,/usr/bin/Xorg,xf86-video-*,metacity,NetworkManager,network-manager-applet,dbus-x11 ;; *) echo "$program: internal error: could not work out the Linux distro from '$osversion'" -- 2.3.1
Seemingly Similar Threads
- [PATCH v2 0/2] p2v: add Shutdown option
- [PATCH 0/2] p2v: add Shutdown option
- [PATCH 0/2] p2v: Allow virt-p2v to be built with Gtk 2 or 3.
- [PATCH v2 0/3] p2v: Allow virt-p2v to be built with Gtk 2 or 3.
- [PATCH] p2v: add mnemonics to labels and buttons (RHBZ#1379289)