[virt-tools-list] [PATCH virt-viewer] !fixup Simplify file transfer dialog UI

Jonathon Jongsma jjongsma at redhat.com
Thu Oct 27 19:33:08 UTC 2016


---
Includes fixes from Pavel and Fabiano's reviews

 src/resources/ui/virt-viewer-file-transfer-dialog.ui | 12 +++++++-----
 src/virt-viewer-file-transfer-dialog.c               |  6 +++---
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/resources/ui/virt-viewer-file-transfer-dialog.ui b/src/resources/ui/virt-viewer-file-transfer-dialog.ui
index e3514d6..5e761c8 100644
--- a/src/resources/ui/virt-viewer-file-transfer-dialog.ui
+++ b/src/resources/ui/virt-viewer-file-transfer-dialog.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <requires lib="gtk+" version="2.24"/>
+  <requires lib="gtk+" version="3.10"/>
   <!-- interface-naming-policy project-wide -->
   <template class="VirtViewerFileTransferDialog" parent="GtkDialog">
     <property name="default_width">400</property>
@@ -8,13 +8,15 @@
     <property name="border_width">5</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox1">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="orientation">vertical</property>
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="spacing">12</property>
         <property name="border-width">12</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="orientation">horizontal</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
@@ -28,7 +30,6 @@
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_underline">True</property>
-                <property name="use_stock">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -44,7 +45,8 @@
           </packing>
         </child>
         <child>
-          <object class="GtkVBox" id="vbox1">
+          <object class="GtkBox" id="vbox1">
+            <property name="orientation">vertical</property>
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="spacing">12</property>
diff --git a/src/virt-viewer-file-transfer-dialog.c b/src/virt-viewer-file-transfer-dialog.c
index 3339ba4..cd1b4aa 100644
--- a/src/virt-viewer-file-transfer-dialog.c
+++ b/src/virt-viewer-file-transfer-dialog.c
@@ -58,7 +58,7 @@ virt_viewer_file_transfer_dialog_class_init(VirtViewerFileTransferDialogClass *k
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 
     gtk_widget_class_set_template_from_resource(widget_class,
-                                                "/org/virt-manager/virt-viewer/ui/virt-viewer-file-transfer-dialog.ui");
+                                                VIRT_VIEWER_RESOURCE_PREFIX "/ui/virt-viewer-file-transfer-dialog.ui");
     gtk_widget_class_bind_template_child_private(widget_class,
                                                  VirtViewerFileTransferDialog,
                                                  transfer_summary);
@@ -75,7 +75,7 @@ dialog_response(GtkDialog *dialog,
                 gpointer user_data G_GNUC_UNUSED)
 {
     VirtViewerFileTransferDialog *self = VIRT_VIEWER_FILE_TRANSFER_DIALOG(dialog);
-    GSList *slist = self->priv->file_transfers;
+    GSList *slist;
 
     switch (response_id) {
         case GTK_RESPONSE_CANCEL:
@@ -182,7 +182,7 @@ static void task_finished(SpiceFileTransferTask *task,
     update_global_progress(self);
 
     /* if this is the last transfer, close the dialog */
-    if (!g_slist_length(self->priv->file_transfers)) {
+    if (self->priv->file_transfers == NULL) {
         /* cancel any pending 'show' operations if all tasks complete before
          * the dialog can be shown */
         if (self->priv->timer_show_src) {
-- 
2.7.4




More information about the virt-tools-list mailing list