~directhex/libubuntuone/mono_packaging

« back to all changes in this revision

Viewing changes to libubuntuone/u1-music-store.c

  • Committer: stuart.langridge at canonical
  • Date: 2010-02-15 13:04:49 UTC
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: stuart.langridge@canonical.com-20100215130449-vok5rusxrh3succ3
Override the library page when displayed as well as in links; debug print URLs

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
{
102
102
        U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
103
103
 
 
104
        g_debug ("Loading URL: %s", webkit_network_request_get_uri (request));
 
105
 
104
106
        /* Change the cursor when loading */
105
107
        if (music_store->priv->normal_cursor)
106
108
                gdk_cursor_unref (music_store->priv->normal_cursor);
337
339
        gchar *tmp_url;
338
340
        U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
339
341
 
 
342
        g_debug ("URL loaded: %s", webkit_web_view_get_uri (web_view));
 
343
 
340
344
        /* Inject some JavaScript to enable previews and hide the Flash player */
341
345
        execute_script (web_view, "u1-preview.js", NULL);
342
346
 
347
351
 
348
352
        gdk_window_set_cursor (GTK_WIDGET (web_view)->window, music_store->priv->normal_cursor);
349
353
 
 
354
        /* If the URL just loaded is the 7d library page, and we have a library
 
355
           override set, load ours instead. */
 
356
        if (g_strrstr(webkit_web_view_get_uri (web_view), "library.aspx") != NULL) {
 
357
                if (library_override != NULL) {
 
358
                        g_debug ("overriding the library page to ours");
 
359
                        webkit_web_view_open (web_view, library_override);
 
360
                }
 
361
        }
 
362
 
 
363
 
350
364
        /* If the URL just loaded is for not registered users, fire the OAuth authentication */
351
365
        tmp_url = g_strdup_printf ("%s%s", music_store->priv->base_url, U1_NOT_REGISTERED_URL);
352
366
        if (g_str_has_prefix (webkit_web_view_get_uri (web_view), tmp_url)) {