Merge lp:~rodrigo-moya/libubuntuone/initial-page into lp:libubuntuone

Proposed by Rodrigo Moya on 2010-03-12
Status: Merged
Approved by: Rodrigo Moya on 2010-03-17
Approved revision: 66
Merged at revision: not available
Proposed branch: lp:~rodrigo-moya/libubuntuone/initial-page
Merge into: lp:libubuntuone
Diff against target: 137 lines (+53/-21)
1 file modified
libubuntuone/u1-music-store.c (+53/-21)
To merge this branch: bzr merge lp:~rodrigo-moya/libubuntuone/initial-page
Reviewer Review Type Date Requested Status
Martin Albisetti (community) Approve on 2010-03-15
John Lenton 2010-03-12 Approve on 2010-03-13
Review via email: mp+21253@code.launchpad.net

Commit message

Show a temporary view when loading the initial store page

Description of the change

Show a temporary view when loading the initial store page

To post a comment you must log in.
John Lenton (chipaca) wrote :

Nice!
When are we _()'ing all these strings?

review: Approve
Martin Albisetti (beuno) :
review: Approve
Rodrigo Moya (rodrigo-moya) wrote :
Download full text (7.9 KiB)

The attempt to merge lp:~rodrigo-moya/libubuntuone/initial-page into lp:libubuntuone failed.Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
(B testing autoconf2.50... not found.
  testing autoconf... found 2.65
checking for automake >= 1.6...
(B testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
(B testing libtoolize... found 2.2.6b
checking for glib-gettext >= 2.2.0...
(B testing glib-gettextize... found 2.23.5
checking for intltool >= 0.30...
(B testing intltoolize... found 0.41.0
checking for pkg-config >= 0.14.0...
(B testing pkg-config... found 0.22
checking for gtk-doc >= 1.0...
(B testing gtkdocize... found 1.11
Checking for required M4 macros...
(BChecking for forbidden M4 macros...
(BProcessing ./configure.ac
(BRunning libtoolize...
(Blibtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize: `/usr/share/aclocal/libtool.m4'
libtoolize: `/usr/share/aclocal/ltoptions.m4'
libtoolize: `/usr/share/aclocal/ltversion.m4'
libtoolize: `/usr/share/aclocal/ltsugar.m4'
libtoolize: `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Running glib-gettextize... Ignore non-fatal messages.
(BCopying file mkinstalldirs
Copying file po/Makefile.in.in

Please add the files
  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
  progtest.m4
from the /aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

Running intltoolize...
(BRunning gtkdocize...
(BRunning aclocal-1.11...
(BRunning autoconf...
(BRunning autoheader...
(BRunning automake-1.11...
(BRunning ./configure --prefix=/usr ...
(Bchecking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes...

Read more...

Rodrigo Moya (rodrigo-moya) wrote :
Download full text (8.3 KiB)

The attempt to merge lp:~rodrigo-moya/libubuntuone/initial-page into lp:libubuntuone failed.Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
(B testing autoconf2.50... not found.
  testing autoconf... found 2.65
checking for automake >= 1.6...
(B testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
(B testing libtoolize... found 2.2.6b
checking for glib-gettext >= 2.2.0...
(B testing glib-gettextize... found 2.23.5
checking for intltool >= 0.30...
(B testing intltoolize... found 0.41.0
checking for pkg-config >= 0.14.0...
(B testing pkg-config... found 0.22
checking for gtk-doc >= 1.0...
(B testing gtkdocize... found 1.11
Checking for required M4 macros...
(BChecking for forbidden M4 macros...
(BProcessing ./configure.ac
(BRunning libtoolize...
(Blibtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Running glib-gettextize... Ignore non-fatal messages.
(BCopying file mkinstalldirs
Copying file po/Makefile.in.in

Please add the files
  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
  progtest.m4
from the /aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

Running intltoolize...
(BRunning gtkdocize...
(BRunning aclocal-1.11...
(BRunning autoconf...
(BRunning autoheader...
(BRunning automake-1.11...
(BRunning ./configure --prefix=/usr ...
(Bchecking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... n...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntuone/u1-music-store.c'
2--- libubuntuone/u1-music-store.c 2010-03-11 13:06:15 +0000
3+++ libubuntuone/u1-music-store.c 2010-03-12 16:18:18 +0000
4@@ -37,6 +37,7 @@
5 #define U1_NOT_LOGGED_IN_STORE_URL "/music/store-no-token"
6 #define U1_NOT_REGISTERED_URL "https://one.ubuntu.com/music/notregistered?returnUrl="
7
8+#define U1_INITIAL_PAGE "<html><body>Loading Ubuntu One music store</body></html>"
9 #define U1_DEFAULT_ERROR_PAGE "<html><body>Could not load Music Store</body></html>"
10 #define U1_IN_DEVELOPMENT_PAGE "<html><body>The music store is under development, please be patient</body></html>"
11 #define U1_CONNECTING_PAGE "<html><body>Connecting to Ubuntu One. Please wait...</body></html>"
12@@ -45,6 +46,8 @@
13 DBusGConnection *bus;
14 gchar *base_url;
15
16+ GtkWidget *scroll;
17+ GtkWidget *initial_web_viewer;
18 GtkWidget *web_viewer;
19 WebKitWebFrame *frame_to_use;
20
21@@ -573,6 +576,18 @@
22 gchar *tmp_url;
23 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
24
25+ /* Remove the initial view if still around */
26+ if (music_store->priv->initial_web_viewer != NULL) {
27+ gtk_widget_destroy (music_store->priv->initial_web_viewer);
28+ music_store->priv->initial_web_viewer = NULL;
29+
30+ /* And show the real store viewer */
31+ g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "navigation-policy-decision-requested",
32+ G_CALLBACK (navigation_requested_cb), music_store);
33+ gtk_widget_show (music_store->priv->web_viewer);
34+ gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->web_viewer);
35+ }
36+
37 /* Inject some JavaScript to enable previews and hide the Flash player */
38 execute_script (web_view, "u1-preview.js", NULL);
39
40@@ -601,7 +616,7 @@
41
42 /* Signal users the URL finished loading */
43 g_signal_emit (music_store, u1_music_store_signals[URL_LOADED_SIGNAL], 0,
44- (const gchar *) webkit_web_view_get_uri (music_store->priv->web_viewer));
45+ (const gchar *) webkit_web_view_get_uri (WEBKIT_WEB_VIEW (music_store->priv->web_viewer)));
46 }
47
48 static void
49@@ -694,11 +709,27 @@
50 return real_url;
51 }
52
53+static gboolean
54+load_real_store_cb (gpointer user_data)
55+{
56+ gchar *real_url;
57+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
58+
59+ g_debug ("Loading the real store page");
60+ real_url = get_url_to_use (music_store);
61+ if (real_url != NULL) {
62+ webkit_web_view_open (WEBKIT_WEB_VIEW (music_store->priv->web_viewer), real_url);
63+
64+ /* Free memory */
65+ g_free (real_url);
66+ }
67+
68+ return FALSE;
69+}
70+
71 static void
72 u1_music_store_init (U1MusicStore *music_store)
73 {
74- GtkWidget *scroll;
75- gchar *real_url;
76 gchar *new_user_agent;
77 GError *error = NULL;
78
79@@ -732,11 +763,11 @@
80 syncdaemon_init ();
81
82 /* Create web viewer object */
83- scroll = gtk_scrolled_window_new (NULL, NULL);
84- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
85+ music_store->priv->scroll = gtk_scrolled_window_new (NULL, NULL);
86+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (music_store->priv->scroll),
87 GTK_POLICY_AUTOMATIC,
88 GTK_POLICY_AUTOMATIC);
89- gtk_widget_show (scroll);
90+ gtk_widget_show (music_store->priv->scroll);
91
92 music_store->priv->web_viewer = webkit_web_view_new ();
93
94@@ -751,27 +782,28 @@
95
96 g_free(new_user_agent);
97
98- g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "navigation-policy-decision-requested",
99- G_CALLBACK (navigation_requested_cb), music_store);
100 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "load-finished",
101 G_CALLBACK (load_finished_cb), music_store);
102 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "status-bar-text-changed",
103 G_CALLBACK (status_bar_text_changed_cb), music_store);
104 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "load-error",
105 G_CALLBACK (load_error_cb), music_store);
106- gtk_widget_show (music_store->priv->web_viewer);
107- gtk_container_add (GTK_CONTAINER (scroll), music_store->priv->web_viewer);
108-
109-
110- real_url = get_url_to_use (music_store);
111- if (real_url != NULL) {
112- webkit_web_view_open (WEBKIT_WEB_VIEW (music_store->priv->web_viewer), real_url);
113-
114- /* Free memory */
115- g_free (real_url);
116- }
117-
118- gtk_box_pack_start (GTK_BOX (music_store), scroll, TRUE, TRUE, 3);
119+
120+ /* Show a temp view when loading the initial store page */
121+ music_store->priv->initial_web_viewer = webkit_web_view_new ();
122+ g_object_set (G_OBJECT (webkit_web_view_get_settings (WEBKIT_WEB_VIEW (music_store->priv->initial_web_viewer))),
123+ "enable-default-context-menu", g_getenv ("U1SHOWCONTEXTMENU") != NULL,
124+ NULL);
125+ webkit_web_view_load_string (WEBKIT_WEB_VIEW (music_store->priv->initial_web_viewer),
126+ U1_INITIAL_PAGE,
127+ "text/html", "utf-8", "file:///");
128+ gtk_widget_show (music_store->priv->initial_web_viewer);
129+ gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->initial_web_viewer);
130+
131+ /* And load the real store in the background */
132+ g_idle_add ((GSourceFunc) load_real_store_cb, music_store);
133+
134+ gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 3);
135 }
136
137 /**

Subscribers

People subscribed via source and target branches