~ubuntu-multiseat/ubuntu/saucy/unity-greeter/bug1201122

« back to all changes in this revision

Viewing changes to src/session-list.c

Tags: upstream-12.10.3
ImportĀ upstreamĀ versionĀ 12.10.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
typedef struct _Block5Data Block5Data;
111
111
typedef struct _Block6Data Block6Data;
112
112
 
 
113
#define TYPE_UNITY_GREETER (unity_greeter_get_type ())
 
114
#define UNITY_GREETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNITY_GREETER, UnityGreeter))
 
115
#define UNITY_GREETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNITY_GREETER, UnityGreeterClass))
 
116
#define IS_UNITY_GREETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNITY_GREETER))
 
117
#define IS_UNITY_GREETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNITY_GREETER))
 
118
#define UNITY_GREETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNITY_GREETER, UnityGreeterClass))
 
119
 
 
120
typedef struct _UnityGreeter UnityGreeter;
 
121
typedef struct _UnityGreeterClass UnityGreeterClass;
 
122
typedef struct _UnityGreeterPrivate UnityGreeterPrivate;
 
123
 
113
124
#define TYPE_DASH_BUTTON (dash_button_get_type ())
114
125
#define DASH_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DASH_BUTTON, DashButton))
115
126
#define DASH_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DASH_BUTTON, DashButtonClass))
241
252
        GtkWidget* best;
242
253
};
243
254
 
 
255
struct _UnityGreeter {
 
256
        GTypeInstance parent_instance;
 
257
        volatile int ref_count;
 
258
        UnityGreeterPrivate * priv;
 
259
        gboolean test_mode;
 
260
};
 
261
 
 
262
struct _UnityGreeterClass {
 
263
        GTypeClass parent_class;
 
264
        void (*finalize) (UnityGreeter *self);
 
265
};
 
266
 
244
267
typedef enum  {
245
268
        GREETER_LIST_MODE_ENTRY,
246
269
        GREETER_LIST_MODE_SCROLLING
293
316
 
294
317
 
295
318
static gpointer session_prompt_parent_class = NULL;
296
 
extern gboolean unity_greeter_test_mode;
 
319
extern UnityGreeter* unity_greeter_singleton;
297
320
static gpointer session_list_parent_class = NULL;
298
321
static GHashTable* session_list_badges;
299
322
static GHashTable* session_list_badges = NULL;
337
360
static void session_prompt_set_default_session (SessionPrompt* self, const gchar* value);
338
361
static GObject * session_prompt_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
339
362
void prompt_box_set_label (PromptBox* self, const gchar* value);
 
363
gpointer unity_greeter_ref (gpointer instance);
 
364
void unity_greeter_unref (gpointer instance);
 
365
GParamSpec* param_spec_unity_greeter (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
 
366
void value_set_unity_greeter (GValue* value, gpointer v_object);
 
367
void value_take_unity_greeter (GValue* value, gpointer v_object);
 
368
gpointer value_get_unity_greeter (const GValue* value);
 
369
GType unity_greeter_get_type (void) G_GNUC_CONST;
340
370
DashButton* dash_button_new (const gchar* text);
341
371
DashButton* dash_button_construct (GType object_type, const gchar* text);
342
372
GType dash_button_get_type (void) G_GNUC_CONST;
514
544
                gtk_css_provider_load_from_data (style, "* {padding: 8px;}", (gssize) (-1), &_inner_error_);
515
545
                if (_inner_error_ != NULL) {
516
546
                        _g_object_unref0 (style);
517
 
                        goto __catch10_g_error;
 
547
                        goto __catch12_g_error;
518
548
                }
519
549
                _tmp32_ = item;
520
550
                _tmp33_ = gtk_widget_get_style_context ((GtkWidget*) _tmp32_);
521
551
                gtk_style_context_add_provider (_tmp33_, (GtkStyleProvider*) style, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
522
552
                _g_object_unref0 (style);
523
553
        }
524
 
        goto __finally10;
525
 
        __catch10_g_error:
 
554
        goto __finally12;
 
555
        __catch12_g_error:
526
556
        {
527
557
                GError* e = NULL;
528
558
                GError* _tmp34_;
535
565
"s", _tmp35_);
536
566
                _g_error_free0 (e);
537
567
        }
538
 
        __finally10:
 
568
        __finally12:
539
569
        if (_inner_error_ != NULL) {
540
570
                _g_object_unref0 (label);
541
571
                _g_free0 (name);
840
870
        GObjectClass * parent_class;
841
871
        SessionPrompt * self;
842
872
        const gchar* _tmp0_ = NULL;
843
 
        gboolean _tmp1_;
844
 
        const gchar* _tmp15_ = NULL;
845
 
        DashButton* _tmp16_;
 
873
        UnityGreeter* _tmp1_;
 
874
        gboolean _tmp2_;
 
875
        const gchar* _tmp16_ = NULL;
846
876
        DashButton* _tmp17_;
 
877
        DashButton* _tmp18_;
847
878
        DashButton* ok;
848
 
        DashButton* _tmp18_;
849
879
        DashButton* _tmp19_;
850
 
        FadingLabel* _tmp20_;
851
 
        DashButton* _tmp21_;
 
880
        DashButton* _tmp20_;
 
881
        FadingLabel* _tmp21_;
852
882
        DashButton* _tmp22_;
 
883
        DashButton* _tmp23_;
853
884
        parent_class = G_OBJECT_CLASS (session_prompt_parent_class);
854
885
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
855
886
        self = SESSION_PROMPT (obj);
856
887
        _tmp0_ = _ ("Select desktop environment");
857
888
        prompt_box_set_label ((PromptBox*) self, _tmp0_);
858
 
        _tmp1_ = unity_greeter_test_mode;
859
 
        if (_tmp1_) {
 
889
        _tmp1_ = unity_greeter_singleton;
 
890
        _tmp2_ = _tmp1_->test_mode;
 
891
        if (_tmp2_) {
860
892
                session_prompt_add_session (self, "gnome", "GNOME");
861
893
                session_prompt_add_session (self, "kde", "KDE");
862
894
                session_prompt_add_session (self, "ubuntu", "Ubuntu");
863
895
        } else {
864
 
                GList* _tmp2_ = NULL;
865
 
                _tmp2_ = lightdm_get_sessions ();
 
896
                GList* _tmp3_ = NULL;
 
897
                _tmp3_ = lightdm_get_sessions ();
866
898
                {
867
899
                        GList* session_collection = NULL;
868
900
                        GList* session_it = NULL;
869
 
                        session_collection = _tmp2_;
 
901
                        session_collection = _tmp3_;
870
902
                        for (session_it = session_collection; session_it != NULL; session_it = session_it->next) {
871
903
                                LightDMSession* session = NULL;
872
904
                                session = (LightDMSession*) session_it->data;
873
905
                                {
874
 
                                        LightDMSession* _tmp3_;
875
 
                                        const gchar* _tmp4_;
 
906
                                        LightDMSession* _tmp4_;
876
907
                                        const gchar* _tmp5_;
877
 
                                        LightDMSession* _tmp6_;
878
 
                                        const gchar* _tmp7_;
 
908
                                        const gchar* _tmp6_;
 
909
                                        LightDMSession* _tmp7_;
879
910
                                        const gchar* _tmp8_;
880
 
                                        LightDMSession* _tmp9_;
881
 
                                        const gchar* _tmp10_;
 
911
                                        const gchar* _tmp9_;
 
912
                                        LightDMSession* _tmp10_;
882
913
                                        const gchar* _tmp11_;
883
 
                                        LightDMSession* _tmp12_;
884
 
                                        const gchar* _tmp13_;
 
914
                                        const gchar* _tmp12_;
 
915
                                        LightDMSession* _tmp13_;
885
916
                                        const gchar* _tmp14_;
886
 
                                        _tmp3_ = session;
887
 
                                        _tmp4_ = lightdm_session_get_key (_tmp3_);
888
 
                                        _tmp5_ = _tmp4_;
889
 
                                        _tmp6_ = session;
890
 
                                        _tmp7_ = lightdm_session_get_name (_tmp6_);
891
 
                                        _tmp8_ = _tmp7_;
892
 
                                        g_debug ("session-list.vala:46: Adding session %s (%s)", _tmp5_, _tmp8_);
893
 
                                        _tmp9_ = session;
894
 
                                        _tmp10_ = lightdm_session_get_key (_tmp9_);
895
 
                                        _tmp11_ = _tmp10_;
896
 
                                        _tmp12_ = session;
897
 
                                        _tmp13_ = lightdm_session_get_name (_tmp12_);
898
 
                                        _tmp14_ = _tmp13_;
899
 
                                        session_prompt_add_session (self, _tmp11_, _tmp14_);
 
917
                                        const gchar* _tmp15_;
 
918
                                        _tmp4_ = session;
 
919
                                        _tmp5_ = lightdm_session_get_key (_tmp4_);
 
920
                                        _tmp6_ = _tmp5_;
 
921
                                        _tmp7_ = session;
 
922
                                        _tmp8_ = lightdm_session_get_name (_tmp7_);
 
923
                                        _tmp9_ = _tmp8_;
 
924
                                        g_debug ("session-list.vala:46: Adding session %s (%s)", _tmp6_, _tmp9_);
 
925
                                        _tmp10_ = session;
 
926
                                        _tmp11_ = lightdm_session_get_key (_tmp10_);
 
927
                                        _tmp12_ = _tmp11_;
 
928
                                        _tmp13_ = session;
 
929
                                        _tmp14_ = lightdm_session_get_name (_tmp13_);
 
930
                                        _tmp15_ = _tmp14_;
 
931
                                        session_prompt_add_session (self, _tmp12_, _tmp15_);
900
932
                                }
901
933
                        }
902
934
                }
903
935
        }
904
 
        _tmp15_ = _ ("OK");
905
 
        _tmp16_ = dash_button_new (_tmp15_);
906
 
        _tmp17_ = g_object_ref_sink (_tmp16_);
907
 
        ok = _tmp17_;
908
 
        _tmp18_ = ok;
909
 
        g_signal_connect_object ((GtkButton*) _tmp18_, "clicked", (GCallback) __session_prompt___lambda23__gtk_button_clicked, self, 0);
 
936
        _tmp16_ = _ ("OK");
 
937
        _tmp17_ = dash_button_new (_tmp16_);
 
938
        _tmp18_ = g_object_ref_sink (_tmp17_);
 
939
        ok = _tmp18_;
910
940
        _tmp19_ = ok;
911
 
        prompt_box_attach_item ((PromptBox*) self, (GtkWidget*) _tmp19_, TRUE);
912
 
        _tmp20_ = ((PromptBox*) self)->name_label;
913
 
        gtk_widget_set_vexpand ((GtkWidget*) _tmp20_, FALSE);
914
 
        _tmp21_ = ok;
915
 
        gtk_widget_set_valign ((GtkWidget*) _tmp21_, GTK_ALIGN_END);
 
941
        g_signal_connect_object ((GtkButton*) _tmp19_, "clicked", (GCallback) __session_prompt___lambda23__gtk_button_clicked, self, 0);
 
942
        _tmp20_ = ok;
 
943
        prompt_box_attach_item ((PromptBox*) self, (GtkWidget*) _tmp20_, TRUE);
 
944
        _tmp21_ = ((PromptBox*) self)->name_label;
 
945
        gtk_widget_set_vexpand ((GtkWidget*) _tmp21_, FALSE);
916
946
        _tmp22_ = ok;
917
 
        gtk_widget_set_vexpand ((GtkWidget*) _tmp22_, TRUE);
 
947
        gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_END);
 
948
        _tmp23_ = ok;
 
949
        gtk_widget_set_vexpand ((GtkWidget*) _tmp23_, TRUE);
918
950
        _g_object_unref0 (ok);
919
951
        return obj;
920
952
}
1131
1163
                        default:
1132
1164
                        {
1133
1165
                                gchar* _tmp8_;
1134
 
                                _tmp8_ = g_strdup ("unknown_badge.png");
 
1166
                                _tmp8_ = g_strdup ("remote_login_help.png");
1135
1167
                                result = _tmp8_;
1136
1168
                                return result;
1137
1169
                        }
1248
1280
                        _g_free0 (_tmp23_);
1249
1281
                        _tmp26_ = _tmp25_;
1250
1282
                        if (_inner_error_ != NULL) {
1251
 
                                goto __catch11_g_error;
 
1283
                                goto __catch13_g_error;
1252
1284
                        }
1253
1285
                        _g_object_unref0 (pixbuf);
1254
1286
                        pixbuf = _tmp26_;
1259
1291
                        _tmp31_ = _g_object_ref0 (_tmp30_);
1260
1292
                        g_hash_table_insert (_tmp27_, _tmp29_, _tmp31_);
1261
1293
                }
1262
 
                goto __finally11;
1263
 
                __catch11_g_error:
 
1294
                goto __finally13;
 
1295
                __catch13_g_error:
1264
1296
                {
1265
1297
                        GError* e = NULL;
1266
1298
                        const gchar* _tmp32_;
1274
1306
                        g_debug ("session-list.vala:235: Error loading badge %s: %s", _tmp32_, _tmp34_);
1275
1307
                        _g_error_free0 (e);
1276
1308
                }
1277
 
                __finally11:
 
1309
                __finally13:
1278
1310
                if (_inner_error_ != NULL) {
1279
1311
                        _g_object_unref0 (pixbuf);
1280
1312
                        _g_free0 (name);