[f-spot] More visual feedback during login process
- From: Ruben Vermeersch <rubenv src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] More visual feedback during login process
- Date: Fri, 19 Jun 2009 16:08:11 -0400 (EDT)
commit d86148524fea75202ad1e33b9253339694c0da37
Author: Jim Ramsay <i am jimramsay com>
Date: Fri Jun 19 08:46:40 2009 -0400
More visual feedback during login process
The login can take a while, so I added a progress bar and helped the GUI refresh
itself as the login progresses, updating the bar as it goes.
.../Exporters/FacebookExport/FacebookExport.cs | 34 +++++-
.../Exporters/FacebookExport/FacebookExport.glade | 112 +++++++++++++-------
2 files changed, 104 insertions(+), 42 deletions(-)
---
diff --git a/extensions/Exporters/FacebookExport/FacebookExport.cs b/extensions/Exporters/FacebookExport/FacebookExport.cs
index c71f1c3..4ebb6ae 100644
--- a/extensions/Exporters/FacebookExport/FacebookExport.cs
+++ b/extensions/Exporters/FacebookExport/FacebookExport.cs
@@ -200,7 +200,7 @@ namespace FSpot.Exporter.Facebook
Gtk.Button logout_button;
[Glade.WidgetAttribute]
- Gtk.Label whoami_label;
+ Gtk.ProgressBar login_progress;
[Glade.WidgetAttribute]
Gtk.RadioButton existing_album_radiobutton;
@@ -279,7 +279,8 @@ namespace FSpot.Exporter.Facebook
logout_button.Visible = false;
logout_button.Clicked += HandleLogoutClicked;
- whoami_label.Text = Catalog.GetString ("You are not logged in.");
+ login_progress.Fraction = 0;
+ login_progress.Text = Catalog.GetString ("You are not logged in.");
album_info_vbox.Sensitive = false;
picture_info_vbox.Sensitive = false;
@@ -340,26 +341,48 @@ namespace FSpot.Exporter.Facebook
album_info_vbox.Sensitive = true;
picture_info_vbox.Sensitive = true;
+ login_progress.Fraction = 0.2;
+ login_progress.Text = Catalog.GetString ("Session established, fetching user info...");
+ Log.Debug (login_progress.Text);
+ while (Application.EventsPending ()) Application.RunIteration ();
+
User me = account.Facebook.GetLoggedInUser ().GetUserInfo ();
- // Note for translators: {0} and {1} are respectively firstname and surname of the user
- whoami_label.Text = String.Format (Catalog.GetString ("{0} {1} is logged into Facebook"), me.FirstName, me.LastName);
+ login_progress.Fraction = 0.4;
+ login_progress.Text = Catalog.GetString ("Session established, fetching friend list...");
+ Log.Debug (login_progress.Text);
+ while (Application.EventsPending ()) Application.RunIteration ();
Friend[] friend_list = account.Facebook.GetFriends ();
long[] uids = new long [friend_list.Length];
for (int i = 0; i < friend_list.Length; i++)
uids [i] = friend_list [i].UId;
+ login_progress.Fraction = 0.6;
+ login_progress.Text = Catalog.GetString ("Session established, fetching friend details...");
+ Log.Debug (login_progress.Text);
+ while (Application.EventsPending ()) Application.RunIteration ();
+
User[] infos = account.Facebook.GetUserInfo (uids, new string[] { "first_name", "last_name" });
friends = new Dictionary<long, User> ();
foreach (User user in infos)
friends.Add (user.UId, user);
+ login_progress.Fraction = 0.8;
+ login_progress.Text = Catalog.GetString ("Session established, fetching photo album list");
+ Log.Debug (login_progress.Text);
+ while (Application.EventsPending ()) Application.RunIteration ();
+
Album[] albums = account.Facebook.GetAlbums ();
AlbumStore store = new AlbumStore (albums);
existing_album_combobox.Model = store;
existing_album_combobox.Active = 0;
+
+ // Note for translators: {0} and {1} are respectively firstname and surname of the user
+ login_progress.Fraction = 1.0;
+ login_progress.Text = String.Format (Catalog.GetString ("{0} {1} is logged into Facebook"), me.FirstName, me.LastName);
+ Log.Debug (login_progress.Text);
}
}
@@ -368,7 +391,8 @@ namespace FSpot.Exporter.Facebook
login_button.Visible = true;
logout_button.Visible = false;
- whoami_label.Text = Catalog.GetString ("You are not logged in.");
+ login_progress.Fraction = 0;
+ login_progress.Text = Catalog.GetString ("You are not logged in.");
album_info_vbox.Sensitive = false;
picture_info_vbox.Sensitive = false;
diff --git a/extensions/Exporters/FacebookExport/FacebookExport.glade b/extensions/Exporters/FacebookExport/FacebookExport.glade
index cfdc5e6..9141d45 100644
--- a/extensions/Exporters/FacebookExport/FacebookExport.glade
+++ b/extensions/Exporters/FacebookExport/FacebookExport.glade
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.2.2 on Fri Sep 28 19:12:26 2007 by lgv bidule-->
+<?xml version="1.0"?>
<glade-interface>
+ <!-- interface-requires gtk+ 2.12 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="facebook_export_dialog">
<property name="width_request">930</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -9,9 +9,9 @@
<property name="title" translatable="yes">Export to Facebook</property>
<property name="resizable">False</property>
<property name="modal">True</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
@@ -33,38 +33,44 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkButton" id="login_button">
+ <property name="label" translatable="yes">Login</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">Login</property>
- <property name="response_id">0</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="logout_button">
+ <property name="label" translatable="yes">Logout</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">Logout</property>
- <property name="response_id">0</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkLabel" id="whoami_label">
+ <widget class="GtkProgressBar" id="login_progress">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">This is who I am</property>
+ <property name="text" translatable="yes">Not logged in</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkVBox" id="album_info_vbox">
@@ -78,6 +84,7 @@
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -91,23 +98,26 @@
<property name="spacing">2</property>
<child>
<widget class="GtkRadioButton" id="create_album_radiobutton">
+ <property name="label" translatable="yes">Create a new album</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">Create a new album</property>
- <property name="response_id">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">existing_album_radiobutton</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkRadioButton" id="existing_album_radiobutton">
+ <property name="label" translatable="yes">Use an existing album</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">Use an existing album</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -117,6 +127,7 @@
</widget>
<packing>
<property name="padding">5</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -142,6 +153,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">5</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -157,6 +169,7 @@
</widget>
<packing>
<property name="padding">5</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -170,6 +183,9 @@
<property name="xpad">7</property>
<property name="label" translatable="yes">Location</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkEntry" id="album_location_entry">
@@ -187,6 +203,9 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkHBox" id="new_album_info2_hbox">
@@ -201,6 +220,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">7</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -258,6 +278,7 @@
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -270,13 +291,16 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
<child>
<placeholder/>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkVBox" id="vbox6">
@@ -300,6 +324,7 @@
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -307,9 +332,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
<child>
<widget class="GtkTextView" id="caption_textview">
<property name="visible">True</property>
@@ -324,6 +349,9 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkHBox" id="hbox10">
@@ -337,10 +365,11 @@
<property name="xpad">2</property>
<property name="label" translatable="yes">In this photo</property>
<property name="wrap">True</property>
- <property name="wrap_mode">PANGO_WRAP_WORD_CHAR</property>
+ <property name="wrap_mode">word-char</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -349,9 +378,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
<child>
<widget class="GtkTreeView" id="tag_treeview">
<property name="visible">True</property>
@@ -414,36 +443,44 @@
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="cancel_button">
+ <property name="label">gtk-cancel</property>
+ <property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
- <property name="response_id">-6</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="add_button">
+ <property name="label">gtk-add</property>
+ <property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label">gtk-add</property>
<property name="use_stock">True</property>
- <property name="response_id">-5</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -453,10 +490,10 @@
<property name="width_request">190</property>
<property name="height_request">300</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="type">GTK_WINDOW_POPUP</property>
- <property name="window_position">GTK_WIN_POS_MOUSE</property>
+ <property name="type">popup</property>
+ <property name="window_position">mouse</property>
<property name="destroy_with_parent">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_POPUP_MENU</property>
+ <property name="type_hint">popup-menu</property>
<property name="skip_taskbar_hint">True</property>
<property name="skip_pager_hint">True</property>
<property name="decorated">False</property>
@@ -474,6 +511,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">3</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -491,8 +529,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<child>
<widget class="GtkTreeView" id="tag_popup_treeview">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]