[empathy] added structure to show text when list empty



commit d9db9822240a5aece8ee660bebb2afe7202a7f53
Author: Felix Kaser <f kaser gmx net>
Date:   Thu Aug 5 10:19:39 2010 +0200

    added structure to show text when list empty
    
    I've added a notebook which holds the treeview and on another page
    it holds a label. The logic when to switch has to be implemented.

 src/empathy-main-window.c  |    9 +++++++++
 src/empathy-main-window.ui |   31 ++++++++++++++++++++++++++-----
 2 files changed, 35 insertions(+), 5 deletions(-)
---
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 826cda4..b82c077 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -115,6 +115,8 @@ struct _EmpathyMainWindowPriv {
 	GtkWidget              *presence_chooser;
 	GtkWidget              *errors_vbox;
 	GtkWidget              *search_bar;
+	GtkWidget              *notebook;
+	GtkWidget              *no_entry_label;
 
 	GtkToggleAction        *show_protocols;
 	GtkRadioAction         *sort_by_name;
@@ -1511,6 +1513,8 @@ empathy_main_window_init (EmpathyMainWindow *window)
 				       "view_show_map", &show_map_widget,
 				       "room_join_favorites", &priv->room_join_favorites,
 				       "presence_toolbar", &priv->presence_toolbar,
+				       "notebook", &priv->notebook,
+				       "no_entry_label", &priv->no_entry_label,
 				       "roster_scrolledwindow", &sw,
 				       NULL);
 	g_free (filename);
@@ -1645,6 +1649,11 @@ empathy_main_window_init (EmpathyMainWindow *window)
 	g_signal_connect_swapped (window, "map",
 		G_CALLBACK (gtk_widget_grab_focus), priv->individual_view);
 
+	/* TODO: Set up the TreeView Notebook */
+	// have to detect when the contact list is empty (gtk_tree_model_get_iter_first)
+	//if we are searching display: no match found, otherwise: your contact list is empty
+	//hook to row-added and row removed? fire own signals when empty, not empty?
+
 	/* Load user-defined accelerators. */
 	main_window_accels_load ();
 
diff --git a/src/empathy-main-window.ui b/src/empathy-main-window.ui
index cd0ff29..97ab02b 100644
--- a/src/empathy-main-window.ui
+++ b/src/empathy-main-window.ui
@@ -302,14 +302,35 @@
           </packing>
         </child>
         <child>
-          <object class="GtkScrolledWindow" id="roster_scrolledwindow">
+          <object class="GtkNotebook" id="notebook">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="has_focus">True</property>
-            <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+            <property name="show_tabs">False</property>
+            <property name="show_border">False</property>
             <child>
-              <placeholder/>
+              <object class="GtkScrolledWindow" id="roster_scrolledwindow">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="has_focus">True</property>
+                <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="no_entry_label">
+                <property name="visible">True</property>
+                <property name="yalign">0.30000001192092896</property>
+                <property name="label" translatable="yes">label</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
             </child>
           </object>
           <packing>



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