~ubuntu-branches/ubuntu/saucy/shotwell/saucy-proposed

« back to all changes in this revision

Viewing changes to .pc/06_uoa.patch/plugins/shotwell-publishing/PicasaPublishing.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Alberto Mardegan
  • Date: 2013-03-19 19:34:19 UTC
  • mfrom: (1.2.18)
  • Revision ID: package-import@ubuntu.com-20130319193419-ed5bq7690j3c8pp1
Tags: 0.14.0-0ubuntu1
* New upstream version
* debian/control: drop leftover build-depends on libgnomevfs2-dev

[ Alberto Mardegan]
* debian/patches/06_uoa.patch: new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
internal const string SERVICE_WELCOME_MESSAGE = 
58
58
    _("You are not currently logged into Picasa Web Albums.\n\nClick Login to log into Picasa Web Albums in your Web browser. You will have to authorize Shotwell Connect to link to your Picasa Web Albums account.");
59
59
internal const string DEFAULT_ALBUM_NAME = _("Shotwell Connect");
60
 
internal const string OAUTH_CLIENT_ID = "1073902228337.apps.googleusercontent.com";
61
 
internal const string OAUTH_CLIENT_SECRET = "tcZxcw_HeyUbq4IIuOF1uq8u";
 
60
internal const string OAUTH_CLIENT_ID = "1073902228337-gm4uf5etk25s0hnnm0g7uv2tm2bm1j0b.apps.googleusercontent.com";
 
61
internal const string OAUTH_CLIENT_SECRET = "_kA4RZz72xqed4DqfO7xMmMN";
62
62
 
63
63
public class PicasaPublisher : Spit.Publishing.Publisher, GLib.Object {
64
64
    private weak Spit.Publishing.PluginHost host = null;
255
255
 
256
256
        if (session.is_authenticated()) // ignore these events if the session is already auth'd
257
257
            return;
 
258
        
 
259
        // 400 errors indicate that the OAuth client ID and secret have become invalid. In most
 
260
        // cases, this can be fixed by logging the user out
 
261
        if (txn.get_status_code() == 400) {
 
262
            do_logout();
 
263
            return;
 
264
        }
258
265
 
259
266
        debug("EVENT: refresh access token transaction caused a network error.");
260
267
        
334
341
 
335
342
        debug("EVENT: user clicked 'Logout' in the publishing options pane.");
336
343
 
337
 
        session.deauthenticate();
338
 
        invalidate_persistent_session();
339
 
 
340
 
        do_show_service_welcome_pane();
 
344
        do_logout();
341
345
    }
342
346
 
343
347
    private void on_publishing_options_publish(PublishingParameters parameters, 
453
457
        host.install_welcome_pane(SERVICE_WELCOME_MESSAGE, on_service_welcome_login);
454
458
    }
455
459
    
 
460
    private void do_logout() {
 
461
        debug("ACTION: logging out user.");
 
462
        
 
463
        session.deauthenticate();
 
464
        invalidate_persistent_session();
 
465
 
 
466
        do_show_service_welcome_pane();
 
467
    }
 
468
    
456
469
    private void do_launch_browser_for_authorization() {
457
470
        string auth_url = get_user_authorization_url();
458
471
        
590
603
        try {
591
604
            txn.execute();
592
605
        } catch (Spit.Publishing.PublishingError err) {
593
 
            host.post_error(err);
 
606
            // don't post an error to the host -- let the error handler signal connected above
 
607
            // handle the problem
594
608
        }
595
609
    }
596
610