Procházet zdrojové kódy

Show where we are connecting to

Matthias Vogelgesang před 7 roky
rodič
revize
0624d8a84b
2 změnil soubory, kde provedl 9 přidání a 2 odebrání
  1. 7 0
      src/iridium-window.c
  2. 2 2
      src/iridium-window.ui

+ 7 - 0
src/iridium-window.c

@@ -49,6 +49,7 @@ struct _IridiumWindow
   GtkSearchBar      *search_bar;
   GtkSearchEntry    *search_entry;
   GtkRevealer       *notification_revealer;
+  GtkLabel          *notification_label;
   WebKitWebView     *html_view;
   GBinding          *title_binding;
   GBinding          *content_binding;
@@ -320,6 +321,11 @@ on_show (IridiumWindow *self, gpointer user_data)
   }
 
   if (valid) {
+    gchar *text;
+
+    text = g_strdup_printf ("Connecting to %s …", server);
+    gtk_label_set_text (self->notification_label, text);
+    g_free (text);
     gtk_revealer_set_reveal_child (self->notification_revealer, TRUE);
     iridium_standard_file_connect_async (self->client, server, email, password, NULL,
                                          on_standard_file_connected, self);
@@ -445,6 +451,7 @@ iridium_window_class_init (IridiumWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, IridiumWindow, search_entry);
   gtk_widget_class_bind_template_child (widget_class, IridiumWindow, html_view);
   gtk_widget_class_bind_template_child (widget_class, IridiumWindow, notification_revealer);
+  gtk_widget_class_bind_template_child (widget_class, IridiumWindow, notification_label);
 
   gtk_widget_class_bind_template_callback (widget_class, on_tag_selected);
   gtk_widget_class_bind_template_callback (widget_class, on_note_selected);

+ 2 - 2
src/iridium-window.ui

@@ -45,10 +45,10 @@
                   <object class="GtkBox">
                     <property name="visible">True</property>
                     <child>
-                      <object class="GtkLabel">
+                      <object class="GtkLabel" id="notification_label">
                         <property name="visible">True</property>
                         <property name="margin_end">30</property>
-                        <property name="label">Connecting to standard file server …</property>
+                        <property name="label"></property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>