~vrruiz/gnome-control-center-signon/quantal-autoreconf

« back to all changes in this revision

Viewing changes to src/cc-credentials-preferences.c

* New upstream release.
  - removed the clutter based transition, it broke the scrollbar and was 
    inconsistent with the other panels (LP: #1043697) (LP: #1043732)
  - Selection style in account type list is inconsistent with the rest 
    of Ubuntu (LP: #1043724)
* debian/control
  - removed clutter build depends
* New upstream release.
* debian/control
  - added libclutter-gtk-1.0-dev and libclutter-1.0-dev to build depends
  - depend on gnome-control-center >= 3.4.2-0ubuntu10, which includes 
    the clutter init patch
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
typedef enum  {
101
101
        CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS = 0,
102
102
        CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_AUTHORIZATION = 1,
103
 
        CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_APPLICATION_OPTIONS = 2
 
103
        CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_OPTIONS = 2
104
104
} CcCredentialsPreferencesPreferencesPage;
105
105
 
106
106
struct _CcCredentialsAccountApplicationRow {
146
146
static void cc_credentials_preferences_on_accounts_page_account_options_request (CcCredentialsPreferences* self, CcCredentialsAccountApplicationRow* application_row);
147
147
static void cc_credentials_preferences_on_account_application_options_finished (CcCredentialsPreferences* self, ApApplicationPlugin* plugin);
148
148
static void _cc_credentials_preferences_on_account_application_options_finished_ap_application_plugin_finished (ApApplicationPlugin* _sender, gpointer self);
 
149
static void cc_credentials_preferences_on_accounts_page_account_edit_options_request (CcCredentialsPreferences* self, ApPlugin* plugin);
 
150
static void cc_credentials_preferences_on_account_edit_options_finished (CcCredentialsPreferences* self, ApPlugin* plugin);
 
151
static void _cc_credentials_preferences_on_account_edit_options_finished_ap_plugin_finished (ApPlugin* _sender, gpointer self);
149
152
guint cc_credentials_preferences_get_account_details_id (CcCredentialsPreferences* self);
150
153
static void cc_credentials_preferences_set_account_details_id (CcCredentialsPreferences* self, guint value);
151
154
const gchar* cc_credentials_preferences_get_application_id (CcCredentialsPreferences* self);
161
164
static void _cc_credentials_preferences_on_accounts_page_new_account_request_cc_credentials_accounts_page_new_account_request (CcCredentialsAccountsPage* _sender, const gchar* provider_name, gpointer self);
162
165
static void _cc_credentials_preferences_on_accounts_page_reauthenticate_account_request_cc_credentials_accounts_page_reauthenticate_account_request (CcCredentialsAccountsPage* _sender, AgAccount* account, gpointer self);
163
166
static void _cc_credentials_preferences_on_accounts_page_account_options_request_cc_credentials_accounts_page_account_options_request (CcCredentialsAccountsPage* _sender, CcCredentialsAccountApplicationRow* application_row, gpointer self);
 
167
static void _cc_credentials_preferences_on_accounts_page_account_edit_options_request_cc_credentials_accounts_page_account_edit_options_request (CcCredentialsAccountsPage* _sender, ApPlugin* plugin, gpointer self);
164
168
CcCredentialsAuthorizationPage* cc_credentials_authorization_page_new (void);
165
169
CcCredentialsAuthorizationPage* cc_credentials_authorization_page_construct (GType object_type);
166
170
static void _cc_credentials_preferences_on_authorization_page_cancelled_cc_credentials_authorization_page_cancelled (CcCredentialsAuthorizationPage* _sender, gpointer self);
179
183
     * @param ACCOUNTS select an account or provider in a two-pane view
180
184
     * @param AUTHORIZATION authorize an account in a full-size widget, such as
181
185
     * a WebKit view
182
 
     * @param ACCOUNT_APPLICATION_OPTIONS set options on an account for a
183
 
     * specific application
 
186
     * @param ACCOUNT_OPTIONS set options on an account for either a specific
 
187
     * application or for the account globally
184
188
     */
185
189
static GType cc_credentials_preferences_preferences_page_get_type (void) {
186
190
        static volatile gsize cc_credentials_preferences_preferences_page_type_id__volatile = 0;
187
191
        if (g_once_init_enter (&cc_credentials_preferences_preferences_page_type_id__volatile)) {
188
 
                static const GEnumValue values[] = {{CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS, "CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS", "accounts"}, {CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_AUTHORIZATION, "CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_AUTHORIZATION", "authorization"}, {CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_APPLICATION_OPTIONS, "CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_APPLICATION_OPTIONS", "account-application-options"}, {0, NULL, NULL}};
 
192
                static const GEnumValue values[] = {{CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS, "CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS", "accounts"}, {CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_AUTHORIZATION, "CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_AUTHORIZATION", "authorization"}, {CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_OPTIONS, "CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_OPTIONS", "account-options"}, {0, NULL, NULL}};
189
193
                GType cc_credentials_preferences_preferences_page_type_id;
190
194
                cc_credentials_preferences_preferences_page_type_id = g_enum_register_static ("CcCredentialsPreferencesPreferencesPage", values);
191
195
                g_once_init_leave (&cc_credentials_preferences_preferences_page_type_id__volatile, cc_credentials_preferences_preferences_page_type_id);
360
364
        _tmp4_ = *application_row;
361
365
        _tmp5_ = _tmp4_.plugin;
362
366
        g_signal_connect_object (_tmp5_, "finished", (GCallback) _cc_credentials_preferences_on_account_application_options_finished_ap_application_plugin_finished, self, 0);
363
 
        gtk_notebook_set_current_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_APPLICATION_OPTIONS);
 
367
        gtk_notebook_set_current_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_OPTIONS);
364
368
}
365
369
 
366
370
 
393
397
                const gchar* _tmp5_;
394
398
                _tmp4_ = plugin_err;
395
399
                _tmp5_ = _tmp4_->message;
396
 
                g_warning ("cc-credentials-preferences.vala:215: Error during account application " \
 
400
                g_warning ("cc-credentials-preferences.vala:216: Error during account application " \
397
401
"options process: %s", _tmp5_);
398
402
        }
399
 
        gtk_notebook_remove_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_APPLICATION_OPTIONS);
 
403
        gtk_notebook_remove_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_OPTIONS);
 
404
        gtk_notebook_set_current_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS);
 
405
        _g_error_free0 (plugin_err);
 
406
}
 
407
 
 
408
 
 
409
/**
 
410
     * Handle the account-edit-options-request signal from AccountsPage (and ini
 
411
     * turn AccountDetailsPage), switching notebook page to the application
 
412
     * account options view.
 
413
     *
 
414
     * @param application_row the AccountApplicationRow to show options for
 
415
     */
 
416
static gpointer _g_object_ref0 (gpointer self) {
 
417
        return self ? g_object_ref (self) : NULL;
 
418
}
 
419
 
 
420
 
 
421
static void _cc_credentials_preferences_on_account_edit_options_finished_ap_plugin_finished (ApPlugin* _sender, gpointer self) {
 
422
        cc_credentials_preferences_on_account_edit_options_finished (self, _sender);
 
423
}
 
424
 
 
425
 
 
426
static void cc_credentials_preferences_on_accounts_page_account_edit_options_request (CcCredentialsPreferences* self, ApPlugin* plugin) {
 
427
        ApPlugin* _tmp0_;
 
428
        GtkWidget* _tmp1_ = NULL;
 
429
        GtkWidget* _tmp2_;
 
430
        GtkWidget* widget;
 
431
        GtkWidget* _tmp3_;
 
432
        GtkWidget* _tmp4_;
 
433
        GtkWidget* _tmp5_;
 
434
        ApPlugin* _tmp6_;
 
435
        g_return_if_fail (self != NULL);
 
436
        g_return_if_fail (plugin != NULL);
 
437
        _tmp0_ = plugin;
 
438
        _tmp1_ = ap_plugin_build_widget (_tmp0_);
 
439
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
440
        widget = _tmp2_;
 
441
        _tmp3_ = widget;
 
442
        if (_tmp3_ == NULL) {
 
443
                g_critical ("cc-credentials-preferences.vala:237: Error building configuration widg" \
 
444
"et");
 
445
                _g_object_unref0 (widget);
 
446
                return;
 
447
        }
 
448
        _tmp4_ = widget;
 
449
        gtk_widget_show (_tmp4_);
 
450
        _tmp5_ = widget;
 
451
        gtk_notebook_append_page ((GtkNotebook*) self, _tmp5_, NULL);
 
452
        _tmp6_ = plugin;
 
453
        g_signal_connect_object (_tmp6_, "finished", (GCallback) _cc_credentials_preferences_on_account_edit_options_finished_ap_plugin_finished, self, 0);
 
454
        gtk_notebook_set_current_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_OPTIONS);
 
455
        _g_object_unref0 (widget);
 
456
}
 
457
 
 
458
 
 
459
/**
 
460
     * Handle the account options editing process finishing, and switch back to
 
461
     * the accounts view.
 
462
     *
 
463
     * @param plugin the plugin that emitted the finished signal
 
464
     */
 
465
static void cc_credentials_preferences_on_account_edit_options_finished (CcCredentialsPreferences* self, ApPlugin* plugin) {
 
466
        ApPlugin* _tmp0_;
 
467
        GError* _tmp1_ = NULL;
 
468
        GError* _tmp2_;
 
469
        GError* plugin_err;
 
470
        GError* _tmp3_;
 
471
        g_return_if_fail (self != NULL);
 
472
        g_return_if_fail (plugin != NULL);
 
473
        _tmp0_ = plugin;
 
474
        _tmp1_ = ap_plugin_get_error (_tmp0_);
 
475
        _tmp2_ = _g_error_copy0 (_tmp1_);
 
476
        plugin_err = _tmp2_;
 
477
        _tmp3_ = plugin_err;
 
478
        if (_tmp3_ != NULL) {
 
479
                GError* _tmp4_;
 
480
                const gchar* _tmp5_;
 
481
                _tmp4_ = plugin_err;
 
482
                _tmp5_ = _tmp4_->message;
 
483
                g_warning ("cc-credentials-preferences.vala:259: Error during account edit options" \
 
484
" process: %s", _tmp5_);
 
485
        }
 
486
        gtk_notebook_remove_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNT_OPTIONS);
400
487
        gtk_notebook_set_current_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS);
401
488
        _g_error_free0 (plugin_err);
402
489
}
458
545
}
459
546
 
460
547
 
 
548
static void _cc_credentials_preferences_on_accounts_page_account_edit_options_request_cc_credentials_accounts_page_account_edit_options_request (CcCredentialsAccountsPage* _sender, ApPlugin* plugin, gpointer self) {
 
549
        cc_credentials_preferences_on_accounts_page_account_edit_options_request (self, plugin);
 
550
}
 
551
 
 
552
 
461
553
static void _cc_credentials_preferences_on_authorization_page_cancelled_cc_credentials_authorization_page_cancelled (CcCredentialsAuthorizationPage* _sender, gpointer self) {
462
554
        cc_credentials_preferences_on_authorization_page_cancelled (self);
463
555
}
479
571
        CcCredentialsAccountsPage* _tmp16_;
480
572
        CcCredentialsAccountsPage* _tmp17_;
481
573
        CcCredentialsAccountsPage* _tmp18_;
482
 
        CcCredentialsAuthorizationPage* _tmp19_;
 
574
        CcCredentialsAccountsPage* _tmp19_;
483
575
        CcCredentialsAuthorizationPage* _tmp20_;
484
576
        CcCredentialsAuthorizationPage* _tmp21_;
485
577
        CcCredentialsAuthorizationPage* _tmp22_;
486
 
        CcCredentialsLoginCapture* _tmp23_;
 
578
        CcCredentialsAuthorizationPage* _tmp23_;
487
579
        CcCredentialsLoginCapture* _tmp24_;
 
580
        CcCredentialsLoginCapture* _tmp25_;
488
581
        GError * _inner_error_ = NULL;
489
582
        parent_class = G_OBJECT_CLASS (cc_credentials_preferences_parent_class);
490
583
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
567
660
        _tmp17_ = accounts_page;
568
661
        g_signal_connect_object (_tmp17_, "account-options-request", (GCallback) _cc_credentials_preferences_on_accounts_page_account_options_request_cc_credentials_accounts_page_account_options_request, self, 0);
569
662
        _tmp18_ = accounts_page;
570
 
        gtk_notebook_append_page ((GtkNotebook*) self, (GtkWidget*) _tmp18_, NULL);
571
 
        _tmp19_ = cc_credentials_authorization_page_new ();
572
 
        _tmp20_ = g_object_ref_sink (_tmp19_);
 
663
        g_signal_connect_object (_tmp18_, "account-edit-options-request", (GCallback) _cc_credentials_preferences_on_accounts_page_account_edit_options_request_cc_credentials_accounts_page_account_edit_options_request, self, 0);
 
664
        _tmp19_ = accounts_page;
 
665
        gtk_notebook_append_page ((GtkNotebook*) self, (GtkWidget*) _tmp19_, NULL);
 
666
        _tmp20_ = cc_credentials_authorization_page_new ();
 
667
        _tmp21_ = g_object_ref_sink (_tmp20_);
573
668
        _g_object_unref0 (self->priv->authorization_page);
574
 
        self->priv->authorization_page = _tmp20_;
575
 
        _tmp21_ = self->priv->authorization_page;
576
 
        g_signal_connect_object (_tmp21_, "cancelled", (GCallback) _cc_credentials_preferences_on_authorization_page_cancelled_cc_credentials_authorization_page_cancelled, self, 0);
 
669
        self->priv->authorization_page = _tmp21_;
577
670
        _tmp22_ = self->priv->authorization_page;
578
 
        gtk_notebook_append_page ((GtkNotebook*) self, (GtkWidget*) _tmp22_, NULL);
 
671
        g_signal_connect_object (_tmp22_, "cancelled", (GCallback) _cc_credentials_preferences_on_authorization_page_cancelled_cc_credentials_authorization_page_cancelled, self, 0);
 
672
        _tmp23_ = self->priv->authorization_page;
 
673
        gtk_notebook_append_page ((GtkNotebook*) self, (GtkWidget*) _tmp23_, NULL);
579
674
        gtk_notebook_set_current_page ((GtkNotebook*) self, (gint) CC_CREDENTIALS_PREFERENCES_PREFERENCES_PAGE_ACCOUNTS);
580
675
        gtk_widget_set_size_request ((GtkWidget*) self, -1, 400);
581
676
        gtk_widget_show ((GtkWidget*) self);
582
 
        _tmp23_ = cc_credentials_login_capture_new ();
 
677
        _tmp24_ = cc_credentials_login_capture_new ();
583
678
        _g_object_unref0 (self->priv->login_capture);
584
 
        self->priv->login_capture = _tmp23_;
585
 
        _tmp24_ = self->priv->login_capture;
586
 
        g_signal_connect_object (_tmp24_, "new-account-request", (GCallback) _cc_credentials_preferences_on_login_capture_new_account_request_cc_credentials_login_capture_new_account_request, self, 0);
 
679
        self->priv->login_capture = _tmp24_;
 
680
        _tmp25_ = self->priv->login_capture;
 
681
        g_signal_connect_object (_tmp25_, "new-account-request", (GCallback) _cc_credentials_preferences_on_login_capture_new_account_request_cc_credentials_login_capture_new_account_request, self, 0);
587
682
        _g_object_unref0 (accounts_page);
588
683
        return obj;
589
684
}