[recipes/todoist] Dialog-functional. Backbutton - still to be styled. buttons-Not working. Warnings(Old + New) - still



commit dec2434fd3558d5b1dcc72e2cfd24f291c04acad
Author: Ekta Nandwani <mailnandwaniekta gmail com>
Date:   Sat Jul 8 09:15:26 2017 +0530

    Dialog-functional. Backbutton - still to be styled. buttons-Not working. Warnings(Old + New) - still 
persist

 src/gr-ingredients-exporter.c      |   23 ++++++-
 src/ingredients-exporter-dialog.ui |  138 ++++++++++++++++++++++++++++--------
 2 files changed, 129 insertions(+), 32 deletions(-)
---
diff --git a/src/gr-ingredients-exporter.c b/src/gr-ingredients-exporter.c
index b87de43..0907c4d 100644
--- a/src/gr-ingredients-exporter.c
+++ b/src/gr-ingredients-exporter.c
@@ -32,8 +32,13 @@
         GObject parent_instance;
         GtkWindow *window;
 
+        GtkWidget *export_button;      
         GtkWidget *todoist_row;
         GtkWidget *accounts_box;
+        GtkWidget *providers_box;
+        GtkWidget *dialog_stack;
+        GtkWidget *header_start_stack;
+        GtkWidget *header;
 };
 
 
@@ -81,6 +86,15 @@ switch_dialog_contents (GtkLabel *label, const char *uri, GrIngredientsExporter
        g_print("do_something");
        //GtkWidget *accounts_box;
        gtk_widget_set_visible (exporter->accounts_box, FALSE);
+       if (!exporter->providers_box)
+       {
+               g_print("providers_box empty");
+               //gtk_widget_set_visible (exporter->providers_box, TRUE);
+       }
+       gtk_widget_set_visible (exporter->export_button, FALSE);
+       gtk_stack_set_visible_child_name (GTK_STACK (exporter->dialog_stack), "providers_box");
+       gtk_stack_set_visible_child_name (GTK_STACK (exporter->header_start_stack), "back");
+       gtk_header_bar_set_title (GTK_HEADER_BAR (exporter->header), "Add Account");
 }
 
 static void
@@ -96,8 +110,15 @@ show_export_dialog (GrIngredientsExporter *exporter)
         exporter->todoist_row = GTK_WIDGET (gtk_builder_get_object (builder, "todoist_account_row"));
         add_service = gtk_builder_get_object (builder, "add_service");
 
-        g_signal_connect (add_service, "activate-link", G_CALLBACK (switch_dialog_contents), exporter);
+        exporter->export_button = GTK_WIDGET (gtk_builder_get_object (builder, "export_button"));      
         exporter->accounts_box = GTK_WIDGET (gtk_builder_get_object (builder, "accounts_box"));
+        exporter->providers_box = GTK_WIDGET (gtk_builder_get_object (builder, "providers_box"));
+        exporter->dialog_stack = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_stack"));
+        exporter->header_start_stack = GTK_WIDGET (gtk_builder_get_object (builder, "header_start_stack"));
+        exporter->header =  gtk_builder_get_object (builder, "header");
+
+        g_signal_connect (add_service, "activate-link", G_CALLBACK (switch_dialog_contents), exporter);
+        
 
 
         GoaClient *client;
diff --git a/src/ingredients-exporter-dialog.ui b/src/ingredients-exporter-dialog.ui
index 1182504..beb1bd4 100644
--- a/src/ingredients-exporter-dialog.ui
+++ b/src/ingredients-exporter-dialog.ui
@@ -7,46 +7,112 @@
     <property name="destroy-with-parent">1</property>
     <property name="default-width">420</property>
     <property name="default-height">280</property>
-    <property name="title"> Export Ingredients</property>
-    <child type="action">
-      <object class="GtkButton" id="button_later">
+    <child type="titlebar">
+      <object class="GtkHeaderBar" id="header">
         <property name="visible">1</property>
-        <property name="use-underline">1</property>
-        <property name="label" translatable="yes">_Cancel</property>
+        <property name="title" translatable="yes">Export Ingredients</property>
+        <child>
+          <object class="GtkStack" id="header_start_stack">
+            <property name="visible">1</property>
+            <child>
+              <object class="GtkButton" id="cancel_button">
+                <property name="visible">1</property>
+                <property name="use-underline">1</property>
+                <property name="label" translatable="yes">Cancel</property>
+              </object>
+              <packing>
+                <property name="name">cancel_button</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="back_button">
+                <property name="visible">1</property>
+                <signal name="clicked" handler="go_back" swapped="yes"/>
+                <style>
+                  <class name="image-button"/>
+                </style>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">1</property>
+                    <property name="icon-name">go-previous-symbolic</property>
+                    <property name="icon-size">1</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="name">back</property>
+              </packing>
+            </child>
+          </object>
+        </child>
       </object>
     </child>
+<!--     <child type="title">
+          <object class="GtkStack" id="header_title_stack">
+            <property name="visible">1</property>
+            <property name="hhomogeneous">0</property>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">1</property>
+                <property name="label">Export Ingredeints</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="name">export</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">1</property>
+                <property name="label">Add Service</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="name">add</property>
+              </packing>
+            </child>
+          </object>
+        </child> -->
     <child type="action">
-      <object class="GtkButton" id="button_now">
-        <property name="visible">1</property>
-        <property name="use-underline">1</property>
-        <property name="label" translatable="yes">Export</property>
-        <signal name="clicked" handler="show_providers"/>
-      </object>
-    </child>
+              <object class="GtkButton" id="export_button">
+                <property name="visible">1</property>
+                <property name="use-underline">1</property>
+                <property name="label" translatable="yes">Export</property>
+                <signal name="clicked" handler="show_providers"/>
+              </object>
+            </child>
+    <child internal-child="vbox">
+          <object class="GtkBox">
     <child>
       <object class="GtkStack" id="dialog_stack">
         <property name="visible">1</property>
-        <child internal-child="vbox">
+        <child>
           <object class="GtkBox" id="accounts_box">
             <property name="margin">20</property>
             <property name="spacing">20</property>
+            <property name="visible">1</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkListBox" id="accounts_list">
-                <property name="visible">True</property>
+                <property name="visible">1</property>
                 <property name="selection_mode">none</property>
                 <child>
                   <object class="GtkListBoxRow">
-                    <property name="visible">True</property>
+                    <property name="visible">1</property>
                     <property name="can_focus">True</property>
                     <child>
                       <object class="GtkGrid">
-                        <property name="visible">True</property>
+                        <property name="visible">1</property>
                         <property name="border_width">6</property>
                         <property name="margin_end">18</property>
-                        <property name="column_spacing">12</property>
+                      <!--   <property name="column_spacing">12</property> -->
                         <child>
                           <object class="GtkImage">
-                            <property name="visible">True</property>
+                            <property name="visible">1</property>
                             <property name="pixel_size">32</property>
                             <property name="icon_name">mail-unread-symbolic</property>
                           </object>
@@ -58,7 +124,7 @@
                         </child>
                         <child>
                           <object class="GtkLabel">
-                            <property name="visible">True</property>
+                            <property name="visible">1</property>
                             <property name="label" translatable="yes">Email</property>
                             <property name="xalign">0</property>
                           </object>
@@ -73,17 +139,17 @@
                 </child>
                 <child>
                   <object class="GtkListBoxRow" id="todoist_account_row">
-                    <!-- <property name="visible">True</property> -->
+                    <!-- <property name="visible">1</property> -->
                     <property name="can_focus">True</property>
                     <child>
                       <object class="GtkGrid">
-                        <property name="visible">True</property>
+                        <property name="visible">1</property>
                         <property name="border_width">6</property>
                         <property name="margin_end">18</property>
                         <property name="column_spacing">12</property>
                         <child>
                           <object class="GtkImage">
-                            <property name="visible">True</property>
+                            <property name="visible">1</property>
                             <property name="pixel_size">32</property>
                             <property name="icon_name">goa-account-todoist</property>
                           </object>
@@ -95,7 +161,7 @@
                         </child>
                         <child>
                           <object class="GtkLabel" id="todoist_label">
-                            <property name="visible">True</property>
+                            <property name="visible">1</property>
                             <property name="label" translatable="yes">Todoist</property>
                             <property name="xalign">0</property>
                           </object>
@@ -113,31 +179,36 @@
             <child>
               <object class="GtkLabel" id="add_service">
                 <property name="label">&lt;a href=&quot;&quot;&gt;Add service&lt;/a&gt;</property>
-                 <property name="visible">True</property>
+                 <property name="visible">1</property>
                  <property name="use_markup">True</property>
                  <property name="use_underline">0</property>
               </object>
             </child>
           </object>
         </child>
-        <child internal-child="vbox">
+        <child>
           <object class="GtkBox" id="providers_box">
+                        <property name="margin">20</property>
+            <property name="spacing">20</property>
+            <property name="visible">1</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkListBox" id="providers_list">
                 <property name="selection_mode">none</property>
+                <property name="visible">1</property>
                 <child>
                   <object class="GtkListBoxRow" id="todoist_provider_row">
-                    <property name="visible">True</property>
+                    <property name="visible">1</property>
                     <property name="can_focus">True</property>
                     <child>
                       <object class="GtkGrid" >
-                        <property name="visible">True</property>
+                        <property name="visible">1</property>
                         <property name="border_width">6</property>
                         <property name="margin_end">18</property>
                         <property name="column_spacing">12</property>
                         <child>
                           <object class="GtkImage">
-                            <property name="visible">True</property>
+                            <property name="visible">1</property>
                             <property name="pixel_size">32</property>
                             <property name="icon_name">goa-account-todoist</property>
                           </object>
@@ -149,7 +220,7 @@
                         </child>
                         <child>
                           <object class="GtkLabel">
-                            <property name="visible">True</property>
+                            <property name="visible">1</property>
                             <property name="label" translatable="yes">Todoist</property>
                             <property name="xalign">0</property>
                           </object>
@@ -165,12 +236,17 @@
             </object>
           </child>
         </object>
+                    <packing>
+                <property name="name">providers_box</property>
+            </packing >
       </child>
     </object>
   </child>
-    <action-widgets>
+</object>
+</child>
+<!--     <action-widgets>
       <action-widget response="cancel">button_later</action-widget>
       <action-widget response="ok">button_now</action-widget>
-    </action-widgets>
+    </action-widgets> -->
   </object>
 </interface>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]