1 /* moonshot-identity-management-view.c generated by valac 0.10.4, the Vala compiler
2 * generated from moonshot-identity-management-view.vala, do not modify */
6 #include <glib-object.h>
10 #include <gdk-pixbuf/gdk-pixdata.h>
13 #include <glib/gi18n-lib.h>
14 #include <pango/pango.h>
22 #define TYPE_IDENTITY_MANAGER_VIEW (identity_manager_view_get_type ())
23 #define IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerView))
24 #define IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass))
25 #define IS_IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_VIEW))
26 #define IS_IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_VIEW))
27 #define IDENTITY_MANAGER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass))
29 typedef struct _IdentityManagerView IdentityManagerView;
30 typedef struct _IdentityManagerViewClass IdentityManagerViewClass;
31 typedef struct _IdentityManagerViewPrivate IdentityManagerViewPrivate;
33 #define TYPE_IDENTITY_MANAGER_APP (identity_manager_app_get_type ())
34 #define IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerApp))
35 #define IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
36 #define IS_IDENTITY_MANAGER_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_APP))
37 #define IS_IDENTITY_MANAGER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_APP))
38 #define IDENTITY_MANAGER_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_APP, IdentityManagerAppClass))
40 typedef struct _IdentityManagerApp IdentityManagerApp;
41 typedef struct _IdentityManagerAppClass IdentityManagerAppClass;
43 #define TYPE_IDENTITY_MANAGER_MODEL (identity_manager_model_get_type ())
44 #define IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModel))
45 #define IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
46 #define IS_IDENTITY_MANAGER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_MODEL))
47 #define IS_IDENTITY_MANAGER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_MODEL))
48 #define IDENTITY_MANAGER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_MODEL, IdentityManagerModelClass))
50 typedef struct _IdentityManagerModel IdentityManagerModel;
51 typedef struct _IdentityManagerModelClass IdentityManagerModelClass;
53 #define TYPE_IDENTITY_REQUEST (identity_request_get_type ())
54 #define IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_REQUEST, IdentityRequest))
55 #define IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
56 #define IS_IDENTITY_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_REQUEST))
57 #define IS_IDENTITY_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_REQUEST))
58 #define IDENTITY_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_REQUEST, IdentityRequestClass))
60 typedef struct _IdentityRequest IdentityRequest;
61 typedef struct _IdentityRequestClass IdentityRequestClass;
63 #define TYPE_CUSTOM_VBOX (custom_vbox_get_type ())
64 #define CUSTOM_VBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CUSTOM_VBOX, CustomVBox))
65 #define CUSTOM_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CUSTOM_VBOX, CustomVBoxClass))
66 #define IS_CUSTOM_VBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CUSTOM_VBOX))
67 #define IS_CUSTOM_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CUSTOM_VBOX))
68 #define CUSTOM_VBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CUSTOM_VBOX, CustomVBoxClass))
70 typedef struct _CustomVBox CustomVBox;
71 typedef struct _CustomVBoxClass CustomVBoxClass;
73 #define TYPE_ID_CARD (id_card_get_type ())
74 #define ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ID_CARD, IdCard))
75 #define ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ID_CARD, IdCardClass))
76 #define IS_ID_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ID_CARD))
77 #define IS_ID_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ID_CARD))
78 #define ID_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ID_CARD, IdCardClass))
80 typedef struct _IdCard IdCard;
81 typedef struct _IdCardClass IdCardClass;
83 #define IDENTITY_MANAGER_VIEW_TYPE_COLUMNS (identity_manager_view_columns_get_type ())
84 #define _identity_manager_app_unref0(var) ((var == NULL) ? NULL : (var = (identity_manager_app_unref (var), NULL)))
85 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
86 #define __g_slist_free_g_object_unref0(var) ((var == NULL) ? NULL : (var = (_g_slist_free_g_object_unref (var), NULL)))
87 #define _g_queue_free0(var) ((var == NULL) ? NULL : (var = (g_queue_free (var), NULL)))
88 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
89 typedef struct _IdentityManagerAppPrivate IdentityManagerAppPrivate;
90 #define _g_free0(var) (var = (g_free (var), NULL))
92 #define TYPE_ID_CARD_WIDGET (id_card_widget_get_type ())
93 #define ID_CARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ID_CARD_WIDGET, IdCardWidget))
94 #define ID_CARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ID_CARD_WIDGET, IdCardWidgetClass))
95 #define IS_ID_CARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ID_CARD_WIDGET))
96 #define IS_ID_CARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ID_CARD_WIDGET))
97 #define ID_CARD_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ID_CARD_WIDGET, IdCardWidgetClass))
99 typedef struct _IdCardWidget IdCardWidget;
100 typedef struct _IdCardWidgetClass IdCardWidgetClass;
101 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
103 #define TYPE_ADD_IDENTITY_DIALOG (add_identity_dialog_get_type ())
104 #define ADD_IDENTITY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADD_IDENTITY_DIALOG, AddIdentityDialog))
105 #define ADD_IDENTITY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADD_IDENTITY_DIALOG, AddIdentityDialogClass))
106 #define IS_ADD_IDENTITY_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADD_IDENTITY_DIALOG))
107 #define IS_ADD_IDENTITY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADD_IDENTITY_DIALOG))
108 #define ADD_IDENTITY_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADD_IDENTITY_DIALOG, AddIdentityDialogClass))
110 typedef struct _AddIdentityDialog AddIdentityDialog;
111 typedef struct _AddIdentityDialogClass AddIdentityDialogClass;
112 typedef struct _IdentityRequestPrivate IdentityRequestPrivate;
113 #define __g_slist_free_g_free0(var) ((var == NULL) ? NULL : (var = (_g_slist_free_g_free (var), NULL)))
115 #define TYPE_RULE (rule_get_type ())
116 typedef struct _Rule Rule;
117 typedef struct _Block1Data Block1Data;
118 #define _g_pattern_spec_free0(var) ((var == NULL) ? NULL : (var = (g_pattern_spec_free (var), NULL)))
120 #define TYPE_ADD_PASSWORD_DIALOG (add_password_dialog_get_type ())
121 #define ADD_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADD_PASSWORD_DIALOG, AddPasswordDialog))
122 #define ADD_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADD_PASSWORD_DIALOG, AddPasswordDialogClass))
123 #define IS_ADD_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADD_PASSWORD_DIALOG))
124 #define IS_ADD_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADD_PASSWORD_DIALOG))
125 #define ADD_PASSWORD_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADD_PASSWORD_DIALOG, AddPasswordDialogClass))
127 typedef struct _AddPasswordDialog AddPasswordDialog;
128 typedef struct _AddPasswordDialogClass AddPasswordDialogClass;
129 #define _pango_font_description_free0(var) ((var == NULL) ? NULL : (var = (pango_font_description_free (var), NULL)))
130 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
132 struct _IdentityManagerView {
133 GtkWindow parent_instance;
134 IdentityManagerViewPrivate * priv;
135 IdentityManagerApp* parent_app;
136 IdentityManagerModel* identities_manager;
137 GQueue* request_queue;
140 struct _IdentityManagerViewClass {
141 GtkWindowClass parent_class;
144 struct _IdentityManagerViewPrivate {
145 GtkUIManager* ui_manager;
146 GtkEntry* search_entry;
148 CustomVBox* custom_vbox;
149 GtkVBox* services_internal_vbox;
150 GtkEntry* username_entry;
151 GtkEntry* password_entry;
152 GtkListStore* listmodel;
153 GtkTreeModelFilter* filter;
155 IdCard* default_id_card;
156 GHashTable* service_button_map;
160 IDENTITY_MANAGER_VIEW_COLUMNS_IDCARD_COL,
161 IDENTITY_MANAGER_VIEW_COLUMNS_LOGO_COL,
162 IDENTITY_MANAGER_VIEW_COLUMNS_ISSUER_COL,
163 IDENTITY_MANAGER_VIEW_COLUMNS_USERNAME_COL,
164 IDENTITY_MANAGER_VIEW_COLUMNS_PASSWORD_COL,
165 IDENTITY_MANAGER_VIEW_COLUMNS_N_COLUMNS
166 } IdentityManagerViewColumns;
168 struct _IdentityManagerApp {
169 GTypeInstance parent_instance;
170 volatile int ref_count;
171 IdentityManagerAppPrivate * priv;
172 IdentityManagerModel* model;
175 struct _IdentityManagerAppClass {
176 GTypeClass parent_class;
177 void (*finalize) (IdentityManagerApp *self);
180 struct _IdentityRequest {
181 GObject parent_instance;
182 IdentityRequestPrivate * priv;
185 gboolean select_default;
191 struct _IdentityRequestClass {
192 GObjectClass parent_class;
197 char* always_confirm;
202 IdentityManagerView * self;
207 static gpointer identity_manager_view_parent_class = NULL;
209 GType identity_manager_view_get_type (void) G_GNUC_CONST;
210 gpointer identity_manager_app_ref (gpointer instance);
211 void identity_manager_app_unref (gpointer instance);
212 GParamSpec* param_spec_identity_manager_app (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
213 void value_set_identity_manager_app (GValue* value, gpointer v_object);
214 void value_take_identity_manager_app (GValue* value, gpointer v_object);
215 gpointer value_get_identity_manager_app (const GValue* value);
216 GType identity_manager_app_get_type (void) G_GNUC_CONST;
217 GType identity_manager_model_get_type (void) G_GNUC_CONST;
218 GType identity_request_get_type (void) G_GNUC_CONST;
219 GType custom_vbox_get_type (void) G_GNUC_CONST;
220 GType id_card_get_type (void) G_GNUC_CONST;
221 #define IDENTITY_MANAGER_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewPrivate))
223 IDENTITY_MANAGER_VIEW_DUMMY_PROPERTY
225 static GType identity_manager_view_columns_get_type (void) G_GNUC_UNUSED;
226 static void _g_slist_free_g_object_unref (GSList* self);
227 #define IDENTITY_MANAGER_VIEW_WINDOW_WIDTH 400
228 #define IDENTITY_MANAGER_VIEW_WINDOW_HEIGHT 500
229 #define IDENTITY_MANAGER_VIEW_layout "<menubar name='MenuBar'>" " <menu name='FileMenu' action='FileMenuAction'>" " <menuitem name='AddIdCard' action='AddIdCardAction' />" " <separator />" " <menuitem name='Quit' action='QuitAction' />" " </menu>" "" " <menu name='HelpMenu' action='HelpMenuAction'>" " <menuitem name='About' action='AboutAction' />" " </menu>" "</menubar>"
230 IdentityManagerView* identity_manager_view_new (IdentityManagerApp* app);
231 IdentityManagerView* identity_manager_view_construct (GType object_type, IdentityManagerApp* app);
232 static void identity_manager_view_build_ui (IdentityManagerView* self);
233 static void identity_manager_view_setup_list_model (IdentityManagerView* self);
234 static void identity_manager_view_load_id_cards (IdentityManagerView* self);
235 static void identity_manager_view_connect_signals (IdentityManagerView* self);
236 void identity_manager_view_on_card_list_changed (IdentityManagerView* self);
237 void identity_manager_view_add_candidate (IdentityManagerView* self, IdCard* idcard);
238 static gboolean identity_manager_view_visible_func (IdentityManagerView* self, GtkTreeModel* model, GtkTreeIter* iter);
239 const char* id_card_get_issuer (IdCard* self);
240 const char* id_card_get_display_name (IdCard* self);
241 char** id_card_get_services (IdCard* self, int* result_length1);
242 static gboolean _identity_manager_view_visible_func_gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self);
243 static void identity_manager_view_search_entry_icon_press_cb (IdentityManagerView* self, GtkEntryIconPosition pos, GdkEvent* event);
244 static void identity_manager_view_search_entry_text_changed_cb (IdentityManagerView* self);
245 static void identity_manager_view_redraw_id_card_widgets (IdentityManagerView* self);
246 static gboolean identity_manager_view_search_entry_key_press_event_cb (IdentityManagerView* self, GdkEventKey* e);
247 GType id_card_widget_get_type (void) G_GNUC_CONST;
248 static void identity_manager_view_remove_id_card_widget (IdentityManagerView* self, IdCardWidget* id_card_widget);
249 GeeLinkedList* identity_manager_model_get_card_list (IdentityManagerModel* self);
250 static void identity_manager_view_add_id_card_data (IdentityManagerView* self, IdCard* id_card);
251 static void identity_manager_view_add_id_card_widget (IdentityManagerView* self, IdCard* id_card);
252 static void identity_manager_view_fill_details (IdentityManagerView* self, IdCardWidget* id_card_widget);
253 IdCard* id_card_widget_get_id_card (IdCardWidget* self);
254 const char* id_card_get_username (IdCard* self);
255 const char* id_card_get_password (IdCard* self);
256 static void identity_manager_view_fill_services_vbox (IdentityManagerView* self, IdCard* id_card);
257 static void identity_manager_view_show_details (IdentityManagerView* self, IdCard* id_card);
258 static void identity_manager_view_details_identity_cb (IdentityManagerView* self, IdCardWidget* id_card_widget);
259 GType add_identity_dialog_get_type (void) G_GNUC_CONST;
260 static IdCard* identity_manager_view_get_id_card_data (IdentityManagerView* self, AddIdentityDialog* dialog);
261 IdCard* id_card_new (void);
262 IdCard* id_card_construct (GType object_type);
263 const char* add_identity_dialog_get_display_name (AddIdentityDialog* self);
264 void id_card_set_display_name (IdCard* self, const char* value);
265 const char* add_identity_dialog_get_issuer (AddIdentityDialog* self);
266 void id_card_set_issuer (IdCard* self, const char* value);
267 const char* add_identity_dialog_get_username (AddIdentityDialog* self);
268 void id_card_set_username (IdCard* self, const char* value);
269 const char* add_identity_dialog_get_password (AddIdentityDialog* self);
270 void id_card_set_password (IdCard* self, const char* value);
271 void id_card_set_services (IdCard* self, char** value, int value_length1);
272 GdkPixbuf* find_icon (const char* name, gint size);
273 static void identity_manager_view_remove_id_card_data (IdentityManagerView* self, IdCard* id_card);
274 IdCardWidget* id_card_widget_new (IdCard* id_card);
275 IdCardWidget* id_card_widget_construct (GType object_type, IdCard* id_card);
276 void custom_vbox_add_id_card_widget (CustomVBox* self, IdCardWidget* id_card_widget);
277 static void _identity_manager_view_details_identity_cb_id_card_widget_details_id (IdCardWidget* _sender, gpointer self);
278 static void identity_manager_view_remove_identity_cb (IdentityManagerView* self, IdCardWidget* id_card_widget);
279 static void _identity_manager_view_remove_identity_cb_id_card_widget_remove_id (IdCardWidget* _sender, gpointer self);
280 static void _lambda2_ (IdCardWidget* w, IdentityManagerView* self);
281 void identity_manager_view_send_identity_cb (IdentityManagerView* self, IdCard* identity);
282 static void __lambda2__id_card_widget_send_id (IdCardWidget* _sender, gpointer self);
283 void custom_vbox_receive_expanded_event (CustomVBox* self, IdCardWidget* id_card_widget);
284 static void _custom_vbox_receive_expanded_event_id_card_widget_expanded (IdCardWidget* _sender, gpointer self);
285 static void _identity_manager_view_fill_details_id_card_widget_expanded (IdCardWidget* _sender, gpointer self);
286 gboolean identity_manager_view_display_name_is_valid (IdentityManagerView* self, const char* name, char** candidate);
287 void identity_manager_view_insert_id_card (IdentityManagerView* self, IdCard* id_card);
288 void identity_manager_model_add_card (IdentityManagerModel* self, IdCard* card);
289 gboolean identity_manager_view_add_identity (IdentityManagerView* self, IdCard* id_card);
290 static void identity_manager_view_add_identity_manual_cb (IdentityManagerView* self);
291 AddIdentityDialog* add_identity_dialog_new (void);
292 AddIdentityDialog* add_identity_dialog_construct (GType object_type);
293 void custom_vbox_remove_id_card_widget (CustomVBox* self, IdCardWidget* id_card_widget);
294 static void identity_manager_view_remove_identity (IdentityManagerView* self, IdCardWidget* id_card_widget);
295 void identity_manager_model_remove_card (IdentityManagerModel* self, IdCard* card);
296 void identity_manager_view_select_identity (IdentityManagerView* self, IdentityRequest* request);
297 IdCardWidget* custom_vbox_get_current_idcard (CustomVBox* self);
298 GtkButton* id_card_widget_get_send_button (IdCardWidget* self);
299 const char* id_card_get_nai (IdCard* self);
300 static void _g_slist_free_g_free (GSList* self);
301 GType rule_get_type (void) G_GNUC_CONST;
302 Rule* rule_dup (const Rule* self);
303 void rule_free (Rule* self);
304 void rule_copy (const Rule* self, Rule* dest);
305 void rule_destroy (Rule* self);
306 Rule* id_card_get_rules (IdCard* self, int* result_length1);
307 static gboolean identity_manager_view_match_service_pattern (IdentityManagerView* self, const char* service, const char* pattern);
308 static gboolean _lambda3_ (Block1Data* _data1_);
309 static gboolean __lambda3__gsource_func (gpointer self);
310 static Block1Data* block1_data_ref (Block1Data* _data1_);
311 static void block1_data_unref (Block1Data* _data1_);
312 void identity_manager_model_update_card (IdentityManagerModel* self, IdCard* card);
313 AddPasswordDialog* add_password_dialog_new (void);
314 AddPasswordDialog* add_password_dialog_construct (GType object_type);
315 GType add_password_dialog_get_type (void) G_GNUC_CONST;
316 const char* add_password_dialog_get_password (AddPasswordDialog* self);
317 gboolean add_password_dialog_get_remember (AddPasswordDialog* self);
318 void identity_request_return_identity (IdentityRequest* self, IdCard* id_card);
319 static void identity_manager_view_label_make_bold (IdentityManagerView* self, GtkLabel* label);
320 static void _lambda1_ (GtkButton* remove_button, IdentityManagerView* self);
321 void id_card_widget_update_id_card_label (IdCardWidget* self);
322 static void __lambda1__gtk_button_clicked (GtkButton* _sender, gpointer self);
323 static void identity_manager_view_on_about_action (IdentityManagerView* self);
324 static GtkActionEntry* identity_manager_view_create_actions (IdentityManagerView* self, int* result_length1);
325 static void _vala_array_add1 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value);
326 static void _identity_manager_view_add_identity_manual_cb_gtk_action_callback (GtkAction* action, gpointer self);
327 static void _vala_array_add2 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value);
328 static void _gtk_main_quit_gtk_action_callback (GtkAction* action, gpointer self);
329 static void _vala_array_add3 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value);
330 static void _vala_array_add4 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value);
331 static void _identity_manager_view_on_about_action_gtk_action_callback (GtkAction* action, gpointer self);
332 static void _vala_array_add5 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value);
333 static void identity_manager_view_create_ui_manager (IdentityManagerView* self);
334 static void identity_manager_view_set_atk_name_description (IdentityManagerView* self, GtkWidget* widget, const char* name, const char* description);
335 GdkPixbuf* find_icon_sized (const char* name, GtkIconSize icon_size);
336 static void _identity_manager_view_search_entry_icon_press_cb_gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
337 static void _identity_manager_view_search_entry_text_changed_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
338 static gboolean _identity_manager_view_search_entry_key_press_event_cb_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
339 CustomVBox* custom_vbox_new (IdentityManagerView* window, gboolean homogeneous, gint spacing);
340 CustomVBox* custom_vbox_construct (GType object_type, IdentityManagerView* window, gboolean homogeneous, gint spacing);
341 static void _gtk_main_quit_gtk_object_destroy (GtkObject* _sender, gpointer self);
342 static void _identity_manager_view_on_card_list_changed_identity_manager_model_card_list_changed (IdentityManagerModel* _sender, gpointer self);
343 static void identity_manager_view_finalize (GObject* obj);
344 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
345 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
346 static gint _vala_array_length (gpointer array);
347 static int _vala_strcmp0 (const char * str1, const char * str2);
351 static GType identity_manager_view_columns_get_type (void) {
352 static volatile gsize identity_manager_view_columns_type_id__volatile = 0;
353 if (g_once_init_enter (&identity_manager_view_columns_type_id__volatile)) {
354 static const GEnumValue values[] = {{IDENTITY_MANAGER_VIEW_COLUMNS_IDCARD_COL, "IDENTITY_MANAGER_VIEW_COLUMNS_IDCARD_COL", "idcard-col"}, {IDENTITY_MANAGER_VIEW_COLUMNS_LOGO_COL, "IDENTITY_MANAGER_VIEW_COLUMNS_LOGO_COL", "logo-col"}, {IDENTITY_MANAGER_VIEW_COLUMNS_ISSUER_COL, "IDENTITY_MANAGER_VIEW_COLUMNS_ISSUER_COL", "issuer-col"}, {IDENTITY_MANAGER_VIEW_COLUMNS_USERNAME_COL, "IDENTITY_MANAGER_VIEW_COLUMNS_USERNAME_COL", "username-col"}, {IDENTITY_MANAGER_VIEW_COLUMNS_PASSWORD_COL, "IDENTITY_MANAGER_VIEW_COLUMNS_PASSWORD_COL", "password-col"}, {IDENTITY_MANAGER_VIEW_COLUMNS_N_COLUMNS, "IDENTITY_MANAGER_VIEW_COLUMNS_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
355 GType identity_manager_view_columns_type_id;
356 identity_manager_view_columns_type_id = g_enum_register_static ("IdentityManagerViewColumns", values);
357 g_once_init_leave (&identity_manager_view_columns_type_id__volatile, identity_manager_view_columns_type_id);
359 return identity_manager_view_columns_type_id__volatile;
363 static void _g_slist_free_g_object_unref (GSList* self) {
364 g_slist_foreach (self, (GFunc) g_object_unref, NULL);
369 static gpointer _identity_manager_app_ref0 (gpointer self) {
370 return self ? identity_manager_app_ref (self) : NULL;
374 static gpointer _g_object_ref0 (gpointer self) {
375 return self ? g_object_ref (self) : NULL;
379 #line 54 "moonshot-identity-management-view.vala"
380 IdentityManagerView* identity_manager_view_construct (GType object_type, IdentityManagerApp* app) {
381 #line 382 "moonshot-identity-management-view.c"
382 IdentityManagerView * self;
383 IdentityManagerApp* _tmp0_;
384 IdentityManagerModel* _tmp1_;
387 #line 54 "moonshot-identity-management-view.vala"
388 g_return_val_if_fail (app != NULL, NULL);
389 #line 390 "moonshot-identity-management-view.c"
390 self = g_object_newv (object_type, 0, NULL);
391 #line 55 "moonshot-identity-management-view.vala"
392 self->parent_app = (_tmp0_ = _identity_manager_app_ref0 (app), _identity_manager_app_unref0 (self->parent_app), _tmp0_);
393 #line 59 "moonshot-identity-management-view.vala"
394 self->identities_manager = (_tmp1_ = _g_object_ref0 (self->parent_app->model), _g_object_unref0 (self->identities_manager), _tmp1_);
395 #line 60 "moonshot-identity-management-view.vala"
396 self->request_queue = (_tmp2_ = g_queue_new (), _g_queue_free0 (self->request_queue), _tmp2_);
397 #line 61 "moonshot-identity-management-view.vala"
398 self->priv->service_button_map = (_tmp3_ = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, g_free), _g_hash_table_unref0 (self->priv->service_button_map), _tmp3_);
399 #line 62 "moonshot-identity-management-view.vala"
400 gtk_window_set_title ((GtkWindow*) self, "Moonshoot");
401 #line 63 "moonshot-identity-management-view.vala"
402 gtk_window_set_position ((GtkWindow*) self, GTK_WIN_POS_CENTER);
403 #line 64 "moonshot-identity-management-view.vala"
404 gtk_window_set_default_size ((GtkWindow*) self, IDENTITY_MANAGER_VIEW_WINDOW_WIDTH, IDENTITY_MANAGER_VIEW_WINDOW_HEIGHT);
405 #line 65 "moonshot-identity-management-view.vala"
406 identity_manager_view_build_ui (self);
407 #line 66 "moonshot-identity-management-view.vala"
408 identity_manager_view_setup_list_model (self);
409 #line 67 "moonshot-identity-management-view.vala"
410 identity_manager_view_load_id_cards (self);
411 #line 68 "moonshot-identity-management-view.vala"
412 identity_manager_view_connect_signals (self);
413 #line 414 "moonshot-identity-management-view.c"
418 #line 54 "moonshot-identity-management-view.vala"
419 IdentityManagerView* identity_manager_view_new (IdentityManagerApp* app) {
420 #line 54 "moonshot-identity-management-view.vala"
421 return identity_manager_view_construct (TYPE_IDENTITY_MANAGER_VIEW, app);
422 #line 423 "moonshot-identity-management-view.c"
426 #line 71 "moonshot-identity-management-view.vala"
427 void identity_manager_view_on_card_list_changed (IdentityManagerView* self) {
428 #line 71 "moonshot-identity-management-view.vala"
429 g_return_if_fail (self != NULL);
430 #line 72 "moonshot-identity-management-view.vala"
431 identity_manager_view_load_id_cards (self);
432 #line 433 "moonshot-identity-management-view.c"
436 #line 75 "moonshot-identity-management-view.vala"
437 void identity_manager_view_add_candidate (IdentityManagerView* self, IdCard* idcard) {
438 #line 75 "moonshot-identity-management-view.vala"
439 g_return_if_fail (self != NULL);
440 #line 75 "moonshot-identity-management-view.vala"
441 g_return_if_fail (idcard != NULL);
442 #line 77 "moonshot-identity-management-view.vala"
443 self->priv->candidates = g_slist_append (self->priv->candidates, _g_object_ref0 (idcard));
444 #line 445 "moonshot-identity-management-view.c"
448 #line 1177 "glib-2.0.vapi"
449 static gboolean string_contains (const char* self, const char* needle) {
450 #line 451 "moonshot-identity-management-view.c"
451 gboolean result = FALSE;
452 #line 1177 "glib-2.0.vapi"
453 g_return_val_if_fail (self != NULL, FALSE);
454 #line 1177 "glib-2.0.vapi"
455 g_return_val_if_fail (needle != NULL, FALSE);
456 #line 457 "moonshot-identity-management-view.c"
457 result = strstr (self, needle) != NULL;
458 #line 1178 "glib-2.0.vapi"
460 #line 461 "moonshot-identity-management-view.c"
464 #line 80 "moonshot-identity-management-view.vala"
465 static gboolean identity_manager_view_visible_func (IdentityManagerView* self, GtkTreeModel* model, GtkTreeIter* iter) {
466 #line 467 "moonshot-identity-management-view.c"
467 gboolean result = FALSE;
470 gboolean _tmp0_ = FALSE;
471 #line 80 "moonshot-identity-management-view.vala"
472 g_return_val_if_fail (self != NULL, FALSE);
473 #line 80 "moonshot-identity-management-view.vala"
474 g_return_val_if_fail (model != NULL, FALSE);
475 #line 476 "moonshot-identity-management-view.c"
477 #line 84 "moonshot-identity-management-view.vala"
478 gtk_tree_model_get (model, iter, IDENTITY_MANAGER_VIEW_COLUMNS_IDCARD_COL, &id_card, -1);
479 #line 87 "moonshot-identity-management-view.vala"
480 if (id_card == NULL) {
481 #line 482 "moonshot-identity-management-view.c"
483 _g_object_unref0 (id_card);
484 #line 88 "moonshot-identity-management-view.vala"
486 #line 487 "moonshot-identity-management-view.c"
488 #line 90 "moonshot-identity-management-view.vala"
489 if (self->priv->candidates != NULL) {
490 #line 491 "moonshot-identity-management-view.c"
491 gboolean is_candidate;
492 #line 92 "moonshot-identity-management-view.vala"
493 is_candidate = FALSE;
494 #line 495 "moonshot-identity-management-view.c"
496 GSList* candidate_collection;
497 GSList* candidate_it;
498 #line 93 "moonshot-identity-management-view.vala"
499 candidate_collection = self->priv->candidates;
500 #line 501 "moonshot-identity-management-view.c"
501 for (candidate_it = candidate_collection; candidate_it != NULL; candidate_it = candidate_it->next) {
503 #line 93 "moonshot-identity-management-view.vala"
504 candidate = _g_object_ref0 ((IdCard*) candidate_it->data);
505 #line 506 "moonshot-identity-management-view.c"
507 #line 95 "moonshot-identity-management-view.vala"
508 if (candidate == id_card) {
509 #line 96 "moonshot-identity-management-view.vala"
511 #line 512 "moonshot-identity-management-view.c"
513 _g_object_unref0 (candidate);
517 #line 98 "moonshot-identity-management-view.vala"
519 #line 520 "moonshot-identity-management-view.c"
521 _g_object_unref0 (id_card);
522 #line 99 "moonshot-identity-management-view.vala"
524 #line 525 "moonshot-identity-management-view.c"
527 #line 102 "moonshot-identity-management-view.vala"
528 entry_text = g_strdup (gtk_entry_get_text (self->priv->search_entry));
529 #line 103 "moonshot-identity-management-view.vala"
530 if (entry_text == NULL) {
531 #line 103 "moonshot-identity-management-view.vala"
533 #line 534 "moonshot-identity-management-view.c"
535 #line 103 "moonshot-identity-management-view.vala"
536 _tmp0_ = _vala_strcmp0 (entry_text, "") == 0;
537 #line 538 "moonshot-identity-management-view.c"
539 #line 103 "moonshot-identity-management-view.vala"
541 #line 542 "moonshot-identity-management-view.c"
543 _g_free0 (entry_text);
544 _g_object_unref0 (id_card);
545 #line 105 "moonshot-identity-management-view.vala"
547 #line 548 "moonshot-identity-management-view.c"
551 char** search_text_collection;
552 int search_text_collection_length1;
554 #line 108 "moonshot-identity-management-view.vala"
555 search_text_collection = _tmp1_ = g_strsplit (entry_text, " ", 0);
556 #line 557 "moonshot-identity-management-view.c"
557 search_text_collection_length1 = _vala_array_length (_tmp1_);
558 for (search_text_it = 0; search_text_it < _vala_array_length (_tmp1_); search_text_it = search_text_it + 1) {
560 search_text = g_strdup (search_text_collection[search_text_it]);
562 char* search_text_casefold;
564 #line 110 "moonshot-identity-management-view.vala"
565 if (_vala_strcmp0 (search_text, "") == 0) {
566 #line 567 "moonshot-identity-management-view.c"
567 _g_free0 (search_text);
568 #line 111 "moonshot-identity-management-view.vala"
570 #line 571 "moonshot-identity-management-view.c"
572 #line 114 "moonshot-identity-management-view.vala"
573 search_text_casefold = g_utf8_casefold (search_text, -1);
574 #line 116 "moonshot-identity-management-view.vala"
575 if (id_card_get_issuer (id_card) != NULL) {
576 #line 577 "moonshot-identity-management-view.c"
577 char* issuer_casefold;
578 #line 118 "moonshot-identity-management-view.vala"
579 issuer_casefold = g_strdup (id_card_get_issuer (id_card));
580 #line 120 "moonshot-identity-management-view.vala"
581 if (string_contains (issuer_casefold, search_text_casefold)) {
582 #line 583 "moonshot-identity-management-view.c"
584 _g_free0 (issuer_casefold);
585 _g_free0 (search_text_casefold);
586 _g_free0 (search_text);
587 search_text_collection = (_vala_array_free (search_text_collection, search_text_collection_length1, (GDestroyNotify) g_free), NULL);
588 _g_free0 (entry_text);
589 _g_object_unref0 (id_card);
590 #line 121 "moonshot-identity-management-view.vala"
592 #line 593 "moonshot-identity-management-view.c"
594 _g_free0 (issuer_casefold);
596 #line 124 "moonshot-identity-management-view.vala"
597 if (id_card_get_display_name (id_card) != NULL) {
598 #line 599 "moonshot-identity-management-view.c"
599 char* display_name_casefold;
600 #line 126 "moonshot-identity-management-view.vala"
601 display_name_casefold = g_utf8_casefold (id_card_get_display_name (id_card), -1);
602 #line 128 "moonshot-identity-management-view.vala"
603 if (string_contains (display_name_casefold, search_text_casefold)) {
604 #line 605 "moonshot-identity-management-view.c"
606 _g_free0 (display_name_casefold);
607 _g_free0 (search_text_casefold);
608 _g_free0 (search_text);
609 search_text_collection = (_vala_array_free (search_text_collection, search_text_collection_length1, (GDestroyNotify) g_free), NULL);
610 _g_free0 (entry_text);
611 _g_object_unref0 (id_card);
612 #line 129 "moonshot-identity-management-view.vala"
614 #line 615 "moonshot-identity-management-view.c"
616 _g_free0 (display_name_casefold);
618 #line 132 "moonshot-identity-management-view.vala"
620 #line 621 "moonshot-identity-management-view.c"
623 char** service_collection;
624 int service_collection_length1;
626 #line 134 "moonshot-identity-management-view.vala"
627 service_collection = id_card_get_services (id_card, &_tmp3_);
628 #line 629 "moonshot-identity-management-view.c"
629 service_collection_length1 = _tmp3_;
630 for (service_it = 0; service_it < _tmp3_; service_it = service_it + 1) {
632 service = g_strdup (service_collection[service_it]);
634 char* service_casefold;
635 #line 136 "moonshot-identity-management-view.vala"
636 service_casefold = g_utf8_casefold (service, -1);
637 #line 138 "moonshot-identity-management-view.vala"
638 if (string_contains (service_casefold, search_text_casefold)) {
639 #line 640 "moonshot-identity-management-view.c"
641 _g_free0 (service_casefold);
643 _g_free0 (search_text_casefold);
644 _g_free0 (search_text);
645 search_text_collection = (_vala_array_free (search_text_collection, search_text_collection_length1, (GDestroyNotify) g_free), NULL);
646 _g_free0 (entry_text);
647 _g_object_unref0 (id_card);
648 #line 139 "moonshot-identity-management-view.vala"
650 #line 651 "moonshot-identity-management-view.c"
652 _g_free0 (service_casefold);
658 _g_free0 (search_text_casefold);
659 _g_free0 (search_text);
662 #line 108 "moonshot-identity-management-view.vala"
663 search_text_collection = (_vala_array_free (search_text_collection, search_text_collection_length1, (GDestroyNotify) g_free), NULL);
664 #line 665 "moonshot-identity-management-view.c"
667 _g_free0 (entry_text);
668 _g_object_unref0 (id_card);
669 #line 143 "moonshot-identity-management-view.vala"
671 #line 672 "moonshot-identity-management-view.c"
675 #line 80 "moonshot-identity-management-view.vala"
676 static gboolean _identity_manager_view_visible_func_gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self) {
677 #line 678 "moonshot-identity-management-view.c"
679 result = identity_manager_view_visible_func (self, model, iter);
684 #line 146 "moonshot-identity-management-view.vala"
685 static void identity_manager_view_setup_list_model (IdentityManagerView* self) {
686 #line 687 "moonshot-identity-management-view.c"
687 GtkTreeModelFilter* _tmp0_;
688 #line 146 "moonshot-identity-management-view.vala"
689 g_return_if_fail (self != NULL);
690 #line 148 "moonshot-identity-management-view.vala"
691 self->priv->listmodel = gtk_list_store_new ((gint) IDENTITY_MANAGER_VIEW_COLUMNS_N_COLUMNS, TYPE_ID_CARD, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
692 #line 153 "moonshot-identity-management-view.vala"
693 self->priv->filter = (_tmp0_ = (GtkTreeModelFilter*) gtk_tree_model_filter_new ((GtkTreeModel*) self->priv->listmodel, NULL), _g_object_unref0 (self->priv->filter), _tmp0_);
694 #line 155 "moonshot-identity-management-view.vala"
695 gtk_tree_model_filter_set_visible_func (self->priv->filter, _identity_manager_view_visible_func_gtk_tree_model_filter_visible_func, g_object_ref (self), g_object_unref);
696 #line 697 "moonshot-identity-management-view.c"
700 #line 158 "moonshot-identity-management-view.vala"
701 static void identity_manager_view_search_entry_icon_press_cb (IdentityManagerView* self, GtkEntryIconPosition pos, GdkEvent* event) {
702 #line 158 "moonshot-identity-management-view.vala"
703 g_return_if_fail (self != NULL);
704 #line 158 "moonshot-identity-management-view.vala"
705 g_return_if_fail (event != NULL);
706 #line 160 "moonshot-identity-management-view.vala"
707 if (pos == GTK_ENTRY_ICON_PRIMARY) {
708 #line 162 "moonshot-identity-management-view.vala"
709 g_print ("Search entry icon pressed\n");
710 #line 711 "moonshot-identity-management-view.c"
712 #line 166 "moonshot-identity-management-view.vala"
713 gtk_entry_set_text (self->priv->search_entry, "");
714 #line 715 "moonshot-identity-management-view.c"
719 #line 170 "moonshot-identity-management-view.vala"
720 static void identity_manager_view_search_entry_text_changed_cb (IdentityManagerView* self) {
721 #line 722 "moonshot-identity-management-view.c"
723 #line 170 "moonshot-identity-management-view.vala"
724 g_return_if_fail (self != NULL);
725 #line 172 "moonshot-identity-management-view.vala"
726 gtk_tree_model_filter_refilter (self->priv->filter);
727 #line 173 "moonshot-identity-management-view.vala"
728 identity_manager_view_redraw_id_card_widgets (self);
729 #line 175 "moonshot-identity-management-view.vala"
730 has_text = gtk_entry_get_text_length (self->priv->search_entry) > 0;
731 #line 176 "moonshot-identity-management-view.vala"
732 gtk_entry_set_icon_sensitive (self->priv->search_entry, GTK_ENTRY_ICON_PRIMARY, has_text);
733 #line 177 "moonshot-identity-management-view.vala"
734 gtk_entry_set_icon_sensitive (self->priv->search_entry, GTK_ENTRY_ICON_SECONDARY, has_text);
735 #line 179 "moonshot-identity-management-view.vala"
736 gtk_widget_set_visible ((GtkWidget*) self->priv->vbox_right, FALSE);
737 #line 738 "moonshot-identity-management-view.c"
741 #line 182 "moonshot-identity-management-view.vala"
742 static gboolean identity_manager_view_search_entry_key_press_event_cb (IdentityManagerView* self, GdkEventKey* e) {
743 #line 744 "moonshot-identity-management-view.c"
744 gboolean result = FALSE;
745 #line 182 "moonshot-identity-management-view.vala"
746 g_return_val_if_fail (self != NULL, FALSE);
747 #line 184 "moonshot-identity-management-view.vala"
748 if (_vala_strcmp0 (gdk_keyval_name ((*e).keyval), "Escape") == 0) {
749 #line 185 "moonshot-identity-management-view.vala"
750 gtk_entry_set_text (self->priv->search_entry, "");
751 #line 752 "moonshot-identity-management-view.c"
754 #line 189 "moonshot-identity-management-view.vala"
756 #line 757 "moonshot-identity-management-view.c"
760 #line 192 "moonshot-identity-management-view.vala"
761 static void identity_manager_view_load_id_cards (IdentityManagerView* self) {
762 #line 763 "moonshot-identity-management-view.c"
765 GeeLinkedList* card_list;
766 #line 192 "moonshot-identity-management-view.vala"
767 g_return_if_fail (self != NULL);
768 #line 193 "moonshot-identity-management-view.vala"
769 children = gtk_container_get_children ((GtkContainer*) self->priv->custom_vbox);
770 #line 771 "moonshot-identity-management-view.c"
772 GList* id_card_widget_collection;
773 GList* id_card_widget_it;
774 #line 194 "moonshot-identity-management-view.vala"
775 id_card_widget_collection = children;
776 #line 777 "moonshot-identity-management-view.c"
777 for (id_card_widget_it = id_card_widget_collection; id_card_widget_it != NULL; id_card_widget_it = id_card_widget_it->next) {
778 GtkWidget* id_card_widget;
779 #line 194 "moonshot-identity-management-view.vala"
780 id_card_widget = (GtkWidget*) id_card_widget_it->data;
781 #line 782 "moonshot-identity-management-view.c"
783 #line 195 "moonshot-identity-management-view.vala"
784 identity_manager_view_remove_id_card_widget (self, ID_CARD_WIDGET (id_card_widget));
785 #line 786 "moonshot-identity-management-view.c"
789 #line 198 "moonshot-identity-management-view.vala"
790 self->priv->default_id_card = (_tmp0_ = NULL, _g_object_unref0 (self->priv->default_id_card), _tmp0_);
791 #line 199 "moonshot-identity-management-view.vala"
792 card_list = identity_manager_model_get_card_list (self->identities_manager);
793 #line 200 "moonshot-identity-management-view.vala"
794 if (card_list == NULL) {
795 #line 796 "moonshot-identity-management-view.c"
796 _g_object_unref0 (card_list);
797 _g_list_free0 (children);
798 #line 201 "moonshot-identity-management-view.vala"
800 #line 801 "moonshot-identity-management-view.c"
803 GeeIterator* _id_card_it;
804 #line 204 "moonshot-identity-management-view.vala"
805 _id_card_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) card_list);
806 #line 204 "moonshot-identity-management-view.vala"
808 #line 809 "moonshot-identity-management-view.c"
810 #line 204 "moonshot-identity-management-view.vala"
811 if (!gee_iterator_next (_id_card_it)) {
812 #line 204 "moonshot-identity-management-view.vala"
814 #line 815 "moonshot-identity-management-view.c"
816 #line 204 "moonshot-identity-management-view.vala"
817 id_card = (IdCard*) gee_iterator_get (_id_card_it);
818 #line 205 "moonshot-identity-management-view.vala"
819 identity_manager_view_add_id_card_data (self, id_card);
820 #line 206 "moonshot-identity-management-view.vala"
821 identity_manager_view_add_id_card_widget (self, id_card);
822 #line 823 "moonshot-identity-management-view.c"
823 _g_object_unref0 (id_card);
825 _g_object_unref0 (_id_card_it);
827 #line 209 "moonshot-identity-management-view.vala"
828 if (gee_collection_get_size ((GeeCollection*) card_list) > 0) {
829 #line 830 "moonshot-identity-management-view.c"
831 #line 210 "moonshot-identity-management-view.vala"
832 self->priv->default_id_card = (_tmp1_ = (IdCard*) gee_abstract_list_first ((GeeAbstractList*) card_list), _g_object_unref0 (self->priv->default_id_card), _tmp1_);
833 #line 834 "moonshot-identity-management-view.c"
835 _g_object_unref0 (card_list);
836 _g_list_free0 (children);
840 #line 214 "moonshot-identity-management-view.vala"
841 static void identity_manager_view_fill_details (IdentityManagerView* self, IdCardWidget* id_card_widget) {
842 #line 843 "moonshot-identity-management-view.c"
846 #line 214 "moonshot-identity-management-view.vala"
847 g_return_if_fail (self != NULL);
848 #line 214 "moonshot-identity-management-view.vala"
849 g_return_if_fail (id_card_widget != NULL);
850 #line 216 "moonshot-identity-management-view.vala"
851 id_card = _g_object_ref0 (id_card_widget_get_id_card (id_card_widget));
852 #line 217 "moonshot-identity-management-view.vala"
853 gtk_entry_set_text (self->priv->username_entry, id_card_get_username (id_card));
854 #line 218 "moonshot-identity-management-view.vala"
855 _tmp0_ = g_strdup (id_card_get_password (id_card));
856 #line 218 "moonshot-identity-management-view.vala"
857 if (_tmp0_ == NULL) {
858 #line 859 "moonshot-identity-management-view.c"
860 #line 218 "moonshot-identity-management-view.vala"
861 _tmp0_ = (_tmp1_ = g_strdup (""), _g_free0 (_tmp0_), _tmp1_);
862 #line 863 "moonshot-identity-management-view.c"
864 #line 218 "moonshot-identity-management-view.vala"
865 gtk_entry_set_text (self->priv->password_entry, _tmp0_);
866 #line 220 "moonshot-identity-management-view.vala"
867 children = gtk_container_get_children ((GtkContainer*) self->priv->services_internal_vbox);
868 #line 869 "moonshot-identity-management-view.c"
870 GList* hbox_collection;
872 #line 221 "moonshot-identity-management-view.vala"
873 hbox_collection = children;
874 #line 875 "moonshot-identity-management-view.c"
875 for (hbox_it = hbox_collection; hbox_it != NULL; hbox_it = hbox_it->next) {
877 #line 221 "moonshot-identity-management-view.vala"
878 hbox = (GtkWidget*) hbox_it->data;
879 #line 880 "moonshot-identity-management-view.c"
881 #line 222 "moonshot-identity-management-view.vala"
882 gtk_object_destroy ((GtkObject*) hbox);
883 #line 884 "moonshot-identity-management-view.c"
887 #line 223 "moonshot-identity-management-view.vala"
888 identity_manager_view_fill_services_vbox (self, id_card_widget_get_id_card (id_card_widget));
889 #line 890 "moonshot-identity-management-view.c"
890 _g_list_free0 (children);
892 _g_object_unref0 (id_card);
896 #line 227 "moonshot-identity-management-view.vala"
897 static void identity_manager_view_show_details (IdentityManagerView* self, IdCard* id_card) {
898 #line 227 "moonshot-identity-management-view.vala"
899 g_return_if_fail (self != NULL);
900 #line 227 "moonshot-identity-management-view.vala"
901 g_return_if_fail (id_card != NULL);
902 #line 229 "moonshot-identity-management-view.vala"
903 gtk_widget_set_visible ((GtkWidget*) self->priv->vbox_right, !gtk_widget_get_visible ((GtkWidget*) self->priv->vbox_right));
904 #line 231 "moonshot-identity-management-view.vala"
905 if (gtk_widget_get_visible ((GtkWidget*) self->priv->vbox_right) == FALSE) {
906 #line 233 "moonshot-identity-management-view.vala"
907 gtk_window_resize ((GtkWindow*) self, IDENTITY_MANAGER_VIEW_WINDOW_WIDTH, IDENTITY_MANAGER_VIEW_WINDOW_HEIGHT);
908 #line 909 "moonshot-identity-management-view.c"
913 #line 237 "moonshot-identity-management-view.vala"
914 static void identity_manager_view_details_identity_cb (IdentityManagerView* self, IdCardWidget* id_card_widget) {
915 #line 237 "moonshot-identity-management-view.vala"
916 g_return_if_fail (self != NULL);
917 #line 237 "moonshot-identity-management-view.vala"
918 g_return_if_fail (id_card_widget != NULL);
919 #line 239 "moonshot-identity-management-view.vala"
920 identity_manager_view_fill_details (self, id_card_widget);
921 #line 240 "moonshot-identity-management-view.vala"
922 identity_manager_view_show_details (self, id_card_widget_get_id_card (id_card_widget));
923 #line 924 "moonshot-identity-management-view.c"
927 #line 243 "moonshot-identity-management-view.vala"
928 static IdCard* identity_manager_view_get_id_card_data (IdentityManagerView* self, AddIdentityDialog* dialog) {
929 #line 930 "moonshot-identity-management-view.c"
930 IdCard* result = NULL;
932 char** _tmp0_ = NULL;
936 #line 243 "moonshot-identity-management-view.vala"
937 g_return_val_if_fail (self != NULL, NULL);
938 #line 243 "moonshot-identity-management-view.vala"
939 g_return_val_if_fail (dialog != NULL, NULL);
940 #line 245 "moonshot-identity-management-view.vala"
941 id_card = id_card_new ();
942 #line 247 "moonshot-identity-management-view.vala"
943 id_card_set_display_name (id_card, add_identity_dialog_get_display_name (dialog));
944 #line 248 "moonshot-identity-management-view.vala"
945 id_card_set_issuer (id_card, add_identity_dialog_get_issuer (dialog));
946 #line 249 "moonshot-identity-management-view.vala"
947 if (_vala_strcmp0 (id_card_get_issuer (id_card), "") == 0) {
948 #line 250 "moonshot-identity-management-view.vala"
949 id_card_set_issuer (id_card, "Issuer");
950 #line 951 "moonshot-identity-management-view.c"
952 #line 251 "moonshot-identity-management-view.vala"
953 id_card_set_username (id_card, add_identity_dialog_get_username (dialog));
954 #line 252 "moonshot-identity-management-view.vala"
955 id_card_set_password (id_card, add_identity_dialog_get_password (dialog));
956 #line 253 "moonshot-identity-management-view.vala"
957 _tmp2_ = (_tmp1_ = (_tmp0_ = g_new0 (char*, 0 + 1), _tmp0_), _tmp1__length1 = 0, _tmp1_);
958 #line 253 "moonshot-identity-management-view.vala"
959 id_card_set_services (id_card, _tmp2_, 0);
960 #line 961 "moonshot-identity-management-view.c"
961 _tmp1_ = (_vala_array_free (_tmp1_, _tmp1__length1, (GDestroyNotify) g_free), NULL);
962 #line 254 "moonshot-identity-management-view.vala"
963 g_object_set_data_full ((GObject*) id_card, "pixbuf", find_icon ("avatar-default", 48), g_object_unref);
964 #line 965 "moonshot-identity-management-view.c"
966 #line 256 "moonshot-identity-management-view.vala"
968 #line 969 "moonshot-identity-management-view.c"
972 #line 259 "moonshot-identity-management-view.vala"
973 static void identity_manager_view_add_id_card_data (IdentityManagerView* self, IdCard* id_card) {
974 #line 975 "moonshot-identity-management-view.c"
975 GtkTreeIter iter = {0};
978 #line 259 "moonshot-identity-management-view.vala"
979 g_return_if_fail (self != NULL);
980 #line 259 "moonshot-identity-management-view.vala"
981 g_return_if_fail (id_card != NULL);
982 #line 983 "moonshot-identity-management-view.c"
984 #line 263 "moonshot-identity-management-view.vala"
985 gtk_list_store_append (self->priv->listmodel, &iter);
986 #line 264 "moonshot-identity-management-view.vala"
987 pixbuf = (_tmp0_ = _g_object_ref0 ((GdkPixbuf*) g_object_get_data ((GObject*) id_card, "pixbuf")), _g_object_unref0 (pixbuf), _tmp0_);
988 #line 265 "moonshot-identity-management-view.vala"
989 gtk_list_store_set (self->priv->listmodel, &iter, IDENTITY_MANAGER_VIEW_COLUMNS_IDCARD_COL, id_card, IDENTITY_MANAGER_VIEW_COLUMNS_LOGO_COL, pixbuf, IDENTITY_MANAGER_VIEW_COLUMNS_ISSUER_COL, id_card_get_issuer (id_card), IDENTITY_MANAGER_VIEW_COLUMNS_USERNAME_COL, id_card_get_username (id_card), IDENTITY_MANAGER_VIEW_COLUMNS_PASSWORD_COL, id_card_get_password (id_card), -1);
990 #line 991 "moonshot-identity-management-view.c"
991 _g_object_unref0 (pixbuf);
995 #line 273 "moonshot-identity-management-view.vala"
996 static void identity_manager_view_remove_id_card_data (IdentityManagerView* self, IdCard* id_card) {
997 #line 998 "moonshot-identity-management-view.c"
998 GtkTreeIter iter = {0};
1000 #line 273 "moonshot-identity-management-view.vala"
1001 g_return_if_fail (self != NULL);
1002 #line 273 "moonshot-identity-management-view.vala"
1003 g_return_if_fail (id_card != NULL);
1004 #line 1005 "moonshot-identity-management-view.c"
1006 #line 278 "moonshot-identity-management-view.vala"
1007 if (gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->listmodel, &iter)) {
1008 #line 1009 "moonshot-identity-management-view.c"
1011 #line 280 "moonshot-identity-management-view.vala"
1013 #line 280 "moonshot-identity-management-view.vala"
1015 #line 280 "moonshot-identity-management-view.vala"
1017 #line 291 "moonshot-identity-management-view.vala"
1018 if (!gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->listmodel, &iter)) {
1019 #line 291 "moonshot-identity-management-view.vala"
1021 #line 1022 "moonshot-identity-management-view.c"
1024 #line 280 "moonshot-identity-management-view.vala"
1026 #line 282 "moonshot-identity-management-view.vala"
1027 gtk_tree_model_get ((GtkTreeModel*) self->priv->listmodel, &iter, IDENTITY_MANAGER_VIEW_COLUMNS_ISSUER_COL, &issuer, -1);
1028 #line 285 "moonshot-identity-management-view.vala"
1029 if (_vala_strcmp0 (id_card_get_issuer (id_card), issuer) == 0) {
1030 #line 287 "moonshot-identity-management-view.vala"
1031 gtk_list_store_remove (self->priv->listmodel, &iter);
1032 #line 288 "moonshot-identity-management-view.vala"
1034 #line 1035 "moonshot-identity-management-view.c"
1043 #line 237 "moonshot-identity-management-view.vala"
1044 static void _identity_manager_view_details_identity_cb_id_card_widget_details_id (IdCardWidget* _sender, gpointer self) {
1045 #line 1046 "moonshot-identity-management-view.c"
1046 identity_manager_view_details_identity_cb (self, _sender);
1050 #line 424 "moonshot-identity-management-view.vala"
1051 static void _identity_manager_view_remove_identity_cb_id_card_widget_remove_id (IdCardWidget* _sender, gpointer self) {
1052 #line 1053 "moonshot-identity-management-view.c"
1053 identity_manager_view_remove_identity_cb (self, _sender);
1057 #line 301 "moonshot-identity-management-view.vala"
1058 static void _lambda2_ (IdCardWidget* w, IdentityManagerView* self) {
1059 #line 301 "moonshot-identity-management-view.vala"
1060 g_return_if_fail (w != NULL);
1061 #line 301 "moonshot-identity-management-view.vala"
1062 identity_manager_view_send_identity_cb (self, id_card_widget_get_id_card (w));
1063 #line 1064 "moonshot-identity-management-view.c"
1067 #line 301 "moonshot-identity-management-view.vala"
1068 static void __lambda2__id_card_widget_send_id (IdCardWidget* _sender, gpointer self) {
1069 #line 1070 "moonshot-identity-management-view.c"
1070 _lambda2_ (_sender, self);
1074 #line 15 "moonshot-custom-vbox.vala"
1075 static void _custom_vbox_receive_expanded_event_id_card_widget_expanded (IdCardWidget* _sender, gpointer self) {
1076 #line 1077 "moonshot-identity-management-view.c"
1077 custom_vbox_receive_expanded_event (self, _sender);
1081 #line 214 "moonshot-identity-management-view.vala"
1082 static void _identity_manager_view_fill_details_id_card_widget_expanded (IdCardWidget* _sender, gpointer self) {
1083 #line 1084 "moonshot-identity-management-view.c"
1084 identity_manager_view_fill_details (self, _sender);
1088 #line 295 "moonshot-identity-management-view.vala"
1089 static void identity_manager_view_add_id_card_widget (IdentityManagerView* self, IdCard* id_card) {
1090 #line 1091 "moonshot-identity-management-view.c"
1091 IdCardWidget* id_card_widget;
1092 #line 295 "moonshot-identity-management-view.vala"
1093 g_return_if_fail (self != NULL);
1094 #line 295 "moonshot-identity-management-view.vala"
1095 g_return_if_fail (id_card != NULL);
1096 #line 297 "moonshot-identity-management-view.vala"
1097 id_card_widget = g_object_ref_sink (id_card_widget_new (id_card));
1098 #line 298 "moonshot-identity-management-view.vala"
1099 custom_vbox_add_id_card_widget (self->priv->custom_vbox, id_card_widget);
1100 #line 299 "moonshot-identity-management-view.vala"
1101 g_signal_connect_object (id_card_widget, "details-id", (GCallback) _identity_manager_view_details_identity_cb_id_card_widget_details_id, self, 0);
1102 #line 300 "moonshot-identity-management-view.vala"
1103 g_signal_connect_object (id_card_widget, "remove-id", (GCallback) _identity_manager_view_remove_identity_cb_id_card_widget_remove_id, self, 0);
1104 #line 301 "moonshot-identity-management-view.vala"
1105 g_signal_connect_object (id_card_widget, "send-id", (GCallback) __lambda2__id_card_widget_send_id, self, 0);
1106 #line 302 "moonshot-identity-management-view.vala"
1107 g_signal_connect_object (id_card_widget, "expanded", (GCallback) _custom_vbox_receive_expanded_event_id_card_widget_expanded, self->priv->custom_vbox, 0);
1108 #line 303 "moonshot-identity-management-view.vala"
1109 g_signal_connect_object (id_card_widget, "expanded", (GCallback) _identity_manager_view_fill_details_id_card_widget_expanded, self, 0);
1110 #line 1111 "moonshot-identity-management-view.c"
1111 _g_object_unref0 (id_card_widget);
1115 #line 307 "moonshot-identity-management-view.vala"
1116 gboolean identity_manager_view_display_name_is_valid (IdentityManagerView* self, const char* name, char** candidate) {
1117 #line 1118 "moonshot-identity-management-view.c"
1118 gboolean result = FALSE;
1119 #line 307 "moonshot-identity-management-view.vala"
1120 g_return_val_if_fail (self != NULL, FALSE);
1121 #line 307 "moonshot-identity-management-view.vala"
1122 g_return_val_if_fail (name != NULL, FALSE);
1123 #line 1124 "moonshot-identity-management-view.c"
1124 if (candidate != NULL) {
1128 GeeLinkedList* _tmp0_;
1129 GeeIterator* _tmp1_;
1130 GeeIterator* _id_card_it;
1131 #line 310 "moonshot-identity-management-view.vala"
1132 _id_card_it = (_tmp1_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) (_tmp0_ = identity_manager_model_get_card_list (self->identities_manager))), _g_object_unref0 (_tmp0_), _tmp1_);
1133 #line 310 "moonshot-identity-management-view.vala"
1135 #line 1136 "moonshot-identity-management-view.c"
1137 #line 310 "moonshot-identity-management-view.vala"
1138 if (!gee_iterator_next (_id_card_it)) {
1139 #line 310 "moonshot-identity-management-view.vala"
1141 #line 1142 "moonshot-identity-management-view.c"
1143 #line 310 "moonshot-identity-management-view.vala"
1144 id_card = (IdCard*) gee_iterator_get (_id_card_it);
1145 #line 312 "moonshot-identity-management-view.vala"
1146 if (_vala_strcmp0 (id_card_get_display_name (id_card), name) == 0) {
1147 #line 314 "moonshot-identity-management-view.vala"
1148 if ((candidate) != NULL) {
1149 #line 1150 "moonshot-identity-management-view.c"
1152 #line 316 "moonshot-identity-management-view.vala"
1154 #line 1155 "moonshot-identity-management-view.c"
1157 #line 316 "moonshot-identity-management-view.vala"
1159 #line 316 "moonshot-identity-management-view.vala"
1161 #line 1162 "moonshot-identity-management-view.c"
1163 #line 316 "moonshot-identity-management-view.vala"
1165 #line 316 "moonshot-identity-management-view.vala"
1167 #line 1168 "moonshot-identity-management-view.c"
1169 #line 316 "moonshot-identity-management-view.vala"
1171 #line 316 "moonshot-identity-management-view.vala"
1173 #line 316 "moonshot-identity-management-view.vala"
1175 #line 1176 "moonshot-identity-management-view.c"
1177 #line 318 "moonshot-identity-management-view.vala"
1178 tmp = g_strdup_printf ("%s %d", name, i);
1179 #line 319 "moonshot-identity-management-view.vala"
1180 if (identity_manager_view_display_name_is_valid (self, tmp, NULL)) {
1181 #line 1182 "moonshot-identity-management-view.c"
1183 #line 321 "moonshot-identity-management-view.vala"
1184 *candidate = (_tmp3_ = g_strdup (tmp), _g_free0 (*candidate), _tmp3_);
1185 #line 1186 "moonshot-identity-management-view.c"
1187 #line 322 "moonshot-identity-management-view.vala"
1189 #line 1190 "moonshot-identity-management-view.c"
1197 _g_object_unref0 (id_card);
1198 _g_object_unref0 (_id_card_it);
1199 #line 326 "moonshot-identity-management-view.vala"
1201 #line 1202 "moonshot-identity-management-view.c"
1203 _g_object_unref0 (id_card);
1205 _g_object_unref0 (_id_card_it);
1208 #line 330 "moonshot-identity-management-view.vala"
1210 #line 1211 "moonshot-identity-management-view.c"
1214 #line 333 "moonshot-identity-management-view.vala"
1215 void identity_manager_view_insert_id_card (IdentityManagerView* self, IdCard* id_card) {
1216 #line 1217 "moonshot-identity-management-view.c"
1218 char* _tmp0_ = NULL;
1221 #line 333 "moonshot-identity-management-view.vala"
1222 g_return_if_fail (self != NULL);
1223 #line 333 "moonshot-identity-management-view.vala"
1224 g_return_if_fail (id_card != NULL);
1225 #line 1226 "moonshot-identity-management-view.c"
1227 #line 337 "moonshot-identity-management-view.vala"
1228 if (!(_tmp1_ = identity_manager_view_display_name_is_valid (self, id_card_get_display_name (id_card), &_tmp0_), candidate = (_tmp2_ = _tmp0_, _g_free0 (candidate), _tmp2_), _tmp1_)) {
1229 #line 339 "moonshot-identity-management-view.vala"
1230 id_card_set_display_name (id_card, candidate);
1231 #line 1232 "moonshot-identity-management-view.c"
1233 #line 342 "moonshot-identity-management-view.vala"
1234 identity_manager_model_add_card (self->identities_manager, id_card);
1235 #line 1236 "moonshot-identity-management-view.c"
1236 _g_free0 (candidate);
1240 #line 345 "moonshot-identity-management-view.vala"
1241 gboolean identity_manager_view_add_identity (IdentityManagerView* self, IdCard* id_card) {
1242 #line 1243 "moonshot-identity-management-view.c"
1243 gboolean result = FALSE;
1244 GtkMessageDialog* dialog;
1246 #line 345 "moonshot-identity-management-view.vala"
1247 g_return_val_if_fail (self != NULL, FALSE);
1248 #line 345 "moonshot-identity-management-view.vala"
1249 g_return_val_if_fail (id_card != NULL, FALSE);
1250 #line 355 "moonshot-identity-management-view.vala"
1251 dialog = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _ ("Would you like to add '%s' ID Card to the ID Card Organizer?"), id_card_get_display_name (id_card)));
1252 #line 362 "moonshot-identity-management-view.vala"
1253 ret = gtk_dialog_run ((GtkDialog*) dialog);
1254 #line 363 "moonshot-identity-management-view.vala"
1255 gtk_object_destroy ((GtkObject*) dialog);
1256 #line 366 "moonshot-identity-management-view.vala"
1257 if (ret == GTK_RESPONSE_YES) {
1258 #line 367 "moonshot-identity-management-view.vala"
1259 g_object_set_data_full ((GObject*) id_card, "pixbuf", find_icon ("avatar-default", 48), g_object_unref);
1260 #line 368 "moonshot-identity-management-view.vala"
1261 identity_manager_view_insert_id_card (self, id_card);
1262 #line 1263 "moonshot-identity-management-view.c"
1264 _g_object_unref0 (dialog);
1265 #line 369 "moonshot-identity-management-view.vala"
1267 #line 1268 "moonshot-identity-management-view.c"
1270 _g_object_unref0 (dialog);
1271 #line 372 "moonshot-identity-management-view.vala"
1273 #line 1274 "moonshot-identity-management-view.c"
1277 #line 375 "moonshot-identity-management-view.vala"
1278 static void identity_manager_view_add_identity_manual_cb (IdentityManagerView* self) {
1279 #line 1280 "moonshot-identity-management-view.c"
1280 AddIdentityDialog* dialog;
1282 #line 375 "moonshot-identity-management-view.vala"
1283 g_return_if_fail (self != NULL);
1284 #line 377 "moonshot-identity-management-view.vala"
1285 dialog = g_object_ref_sink (add_identity_dialog_new ());
1286 #line 378 "moonshot-identity-management-view.vala"
1287 _result_ = gtk_dialog_run ((GtkDialog*) dialog);
1288 #line 380 "moonshot-identity-management-view.vala"
1290 #line 1291 "moonshot-identity-management-view.c"
1291 case GTK_RESPONSE_OK:
1294 #line 382 "moonshot-identity-management-view.vala"
1295 identity_manager_view_insert_id_card (self, _tmp0_ = identity_manager_view_get_id_card_data (self, dialog));
1296 #line 1297 "moonshot-identity-management-view.c"
1297 _g_object_unref0 (_tmp0_);
1298 #line 383 "moonshot-identity-management-view.vala"
1300 #line 1301 "moonshot-identity-management-view.c"
1304 #line 385 "moonshot-identity-management-view.vala"
1306 #line 1307 "moonshot-identity-management-view.c"
1309 #line 387 "moonshot-identity-management-view.vala"
1310 gtk_object_destroy ((GtkObject*) dialog);
1311 #line 1312 "moonshot-identity-management-view.c"
1312 _g_object_unref0 (dialog);
1316 #line 390 "moonshot-identity-management-view.vala"
1317 static void identity_manager_view_remove_id_card_widget (IdentityManagerView* self, IdCardWidget* id_card_widget) {
1318 #line 390 "moonshot-identity-management-view.vala"
1319 g_return_if_fail (self != NULL);
1320 #line 390 "moonshot-identity-management-view.vala"
1321 g_return_if_fail (id_card_widget != NULL);
1322 #line 391 "moonshot-identity-management-view.vala"
1323 custom_vbox_remove_id_card_widget (self->priv->custom_vbox, id_card_widget);
1324 #line 1325 "moonshot-identity-management-view.c"
1328 #line 394 "moonshot-identity-management-view.vala"
1329 static void identity_manager_view_remove_identity (IdentityManagerView* self, IdCardWidget* id_card_widget) {
1330 #line 1331 "moonshot-identity-management-view.c"
1332 #line 394 "moonshot-identity-management-view.vala"
1333 g_return_if_fail (self != NULL);
1334 #line 394 "moonshot-identity-management-view.vala"
1335 g_return_if_fail (id_card_widget != NULL);
1336 #line 396 "moonshot-identity-management-view.vala"
1337 id_card = _g_object_ref0 (id_card_widget_get_id_card (id_card_widget));
1338 #line 397 "moonshot-identity-management-view.vala"
1339 identity_manager_view_remove_id_card_widget (self, id_card_widget);
1340 #line 399 "moonshot-identity-management-view.vala"
1341 identity_manager_model_remove_card (self->identities_manager, id_card);
1342 #line 1343 "moonshot-identity-management-view.c"
1343 _g_object_unref0 (id_card);
1347 #line 402 "moonshot-identity-management-view.vala"
1348 static void identity_manager_view_redraw_id_card_widgets (IdentityManagerView* self) {
1349 #line 1350 "moonshot-identity-management-view.c"
1350 GtkTreeIter iter = {0};
1353 #line 402 "moonshot-identity-management-view.vala"
1354 g_return_if_fail (self != NULL);
1355 #line 1356 "moonshot-identity-management-view.c"
1357 #line 407 "moonshot-identity-management-view.vala"
1358 children = gtk_container_get_children ((GtkContainer*) self->priv->custom_vbox);
1359 #line 1360 "moonshot-identity-management-view.c"
1361 GList* id_card_widget_collection;
1362 GList* id_card_widget_it;
1363 #line 408 "moonshot-identity-management-view.vala"
1364 id_card_widget_collection = children;
1365 #line 1366 "moonshot-identity-management-view.c"
1366 for (id_card_widget_it = id_card_widget_collection; id_card_widget_it != NULL; id_card_widget_it = id_card_widget_it->next) {
1367 GtkWidget* id_card_widget;
1368 #line 408 "moonshot-identity-management-view.vala"
1369 id_card_widget = (GtkWidget*) id_card_widget_it->data;
1370 #line 1371 "moonshot-identity-management-view.c"
1372 #line 409 "moonshot-identity-management-view.vala"
1373 gtk_object_destroy ((GtkObject*) id_card_widget);
1374 #line 1375 "moonshot-identity-management-view.c"
1378 #line 411 "moonshot-identity-management-view.vala"
1379 if (gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->filter, &iter)) {
1380 #line 1381 "moonshot-identity-management-view.c"
1383 #line 413 "moonshot-identity-management-view.vala"
1385 #line 413 "moonshot-identity-management-view.vala"
1387 #line 413 "moonshot-identity-management-view.vala"
1389 #line 420 "moonshot-identity-management-view.vala"
1390 if (!gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->filter, &iter)) {
1391 #line 420 "moonshot-identity-management-view.vala"
1393 #line 1394 "moonshot-identity-management-view.c"
1396 #line 413 "moonshot-identity-management-view.vala"
1398 #line 415 "moonshot-identity-management-view.vala"
1399 gtk_tree_model_get ((GtkTreeModel*) self->priv->filter, &iter, IDENTITY_MANAGER_VIEW_COLUMNS_IDCARD_COL, &id_card, -1);
1400 #line 418 "moonshot-identity-management-view.vala"
1401 identity_manager_view_add_id_card_widget (self, id_card);
1402 #line 1403 "moonshot-identity-management-view.c"
1406 _g_list_free0 (children);
1407 _g_object_unref0 (id_card);
1411 #line 424 "moonshot-identity-management-view.vala"
1412 static void identity_manager_view_remove_identity_cb (IdentityManagerView* self, IdCardWidget* id_card_widget) {
1413 #line 1414 "moonshot-identity-management-view.c"
1415 GtkMessageDialog* dialog;
1417 #line 424 "moonshot-identity-management-view.vala"
1418 g_return_if_fail (self != NULL);
1419 #line 424 "moonshot-identity-management-view.vala"
1420 g_return_if_fail (id_card_widget != NULL);
1421 #line 426 "moonshot-identity-management-view.vala"
1422 id_card = _g_object_ref0 (id_card_widget_get_id_card (id_card_widget));
1423 #line 428 "moonshot-identity-management-view.vala"
1424 dialog = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _ ("Are you sure you want to delete %s ID Card?"), id_card_get_issuer (id_card)));
1425 #line 433 "moonshot-identity-management-view.vala"
1426 _result_ = gtk_dialog_run ((GtkDialog*) dialog);
1427 #line 434 "moonshot-identity-management-view.vala"
1429 #line 1430 "moonshot-identity-management-view.c"
1430 case GTK_RESPONSE_YES:
1432 #line 436 "moonshot-identity-management-view.vala"
1433 identity_manager_view_remove_identity (self, id_card_widget);
1434 #line 437 "moonshot-identity-management-view.vala"
1436 #line 1437 "moonshot-identity-management-view.c"
1440 #line 439 "moonshot-identity-management-view.vala"
1442 #line 1443 "moonshot-identity-management-view.c"
1445 #line 441 "moonshot-identity-management-view.vala"
1446 gtk_object_destroy ((GtkObject*) dialog);
1447 #line 1448 "moonshot-identity-management-view.c"
1448 _g_object_unref0 (dialog);
1449 _g_object_unref0 (id_card);
1453 static void _g_slist_free_g_free (GSList* self) {
1454 g_slist_foreach (self, (GFunc) g_free, NULL);
1455 g_slist_free (self);
1459 #line 574 "moonshot-identity-management-view.vala"
1460 static gboolean _lambda3_ (Block1Data* _data1_) {
1461 #line 1462 "moonshot-identity-management-view.c"
1462 IdentityManagerView * self;
1463 gboolean result = FALSE;
1464 self = _data1_->self;
1465 #line 574 "moonshot-identity-management-view.vala"
1466 identity_manager_view_send_identity_cb (self, _data1_->identity);
1467 #line 1468 "moonshot-identity-management-view.c"
1469 #line 574 "moonshot-identity-management-view.vala"
1471 #line 1472 "moonshot-identity-management-view.c"
1475 #line 574 "moonshot-identity-management-view.vala"
1476 static gboolean __lambda3__gsource_func (gpointer self) {
1477 #line 1478 "moonshot-identity-management-view.c"
1479 result = _lambda3_ (self);
1484 static Block1Data* block1_data_ref (Block1Data* _data1_) {
1485 g_atomic_int_inc (&_data1_->_ref_count_);
1490 static void block1_data_unref (Block1Data* _data1_) {
1491 if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
1492 _g_object_unref0 (_data1_->self);
1493 _g_object_unref0 (_data1_->identity);
1494 g_slice_free (Block1Data, _data1_);
1499 #line 444 "moonshot-identity-management-view.vala"
1500 void identity_manager_view_select_identity (IdentityManagerView* self, IdentityRequest* request) {
1501 #line 1502 "moonshot-identity-management-view.c"
1502 Block1Data* _data1_;
1503 gboolean _tmp0_ = FALSE;
1504 #line 444 "moonshot-identity-management-view.vala"
1505 g_return_if_fail (self != NULL);
1506 #line 444 "moonshot-identity-management-view.vala"
1507 g_return_if_fail (request != NULL);
1508 #line 1509 "moonshot-identity-management-view.c"
1509 _data1_ = g_slice_new0 (Block1Data);
1510 _data1_->_ref_count_ = 1;
1511 _data1_->self = g_object_ref (self);
1512 _data1_->identity = NULL;
1513 #line 448 "moonshot-identity-management-view.vala"
1514 g_queue_push_tail (self->request_queue, _g_object_ref0 (request));
1515 #line 450 "moonshot-identity-management-view.vala"
1516 if (custom_vbox_get_current_idcard (self->priv->custom_vbox) != NULL) {
1517 #line 451 "moonshot-identity-management-view.vala"
1518 _tmp0_ = id_card_widget_get_send_button (custom_vbox_get_current_idcard (self->priv->custom_vbox)) != NULL;
1519 #line 1520 "moonshot-identity-management-view.c"
1521 #line 450 "moonshot-identity-management-view.vala"
1523 #line 1524 "moonshot-identity-management-view.c"
1525 #line 450 "moonshot-identity-management-view.vala"
1527 #line 452 "moonshot-identity-management-view.vala"
1528 gtk_widget_set_sensitive ((GtkWidget*) id_card_widget_get_send_button (custom_vbox_get_current_idcard (self->priv->custom_vbox)), TRUE);
1529 #line 1530 "moonshot-identity-management-view.c"
1531 #line 454 "moonshot-identity-management-view.vala"
1532 if (request->select_default) {
1533 #line 1534 "moonshot-identity-management-view.c"
1535 #line 456 "moonshot-identity-management-view.vala"
1536 _data1_->identity = (_tmp1_ = _g_object_ref0 (self->priv->default_id_card), _g_object_unref0 (_data1_->identity), _tmp1_);
1537 #line 1538 "moonshot-identity-management-view.c"
1539 #line 459 "moonshot-identity-management-view.vala"
1540 if (_data1_->identity == NULL) {
1541 #line 1542 "moonshot-identity-management-view.c"
1542 gboolean _tmp2_ = FALSE;
1544 gboolean _tmp3_ = FALSE;
1547 IdCard* nai_provided;
1548 gboolean _tmp9_ = FALSE;
1549 #line 461 "moonshot-identity-management-view.vala"
1550 if (request->nai != NULL) {
1551 #line 461 "moonshot-identity-management-view.vala"
1552 _tmp2_ = _vala_strcmp0 (request->nai, "") != 0;
1553 #line 1554 "moonshot-identity-management-view.c"
1555 #line 461 "moonshot-identity-management-view.vala"
1557 #line 1558 "moonshot-identity-management-view.c"
1559 #line 461 "moonshot-identity-management-view.vala"
1561 #line 462 "moonshot-identity-management-view.vala"
1562 if (request->service != NULL) {
1563 #line 462 "moonshot-identity-management-view.vala"
1564 _tmp3_ = _vala_strcmp0 (request->service, "") != 0;
1565 #line 1566 "moonshot-identity-management-view.c"
1567 #line 462 "moonshot-identity-management-view.vala"
1569 #line 1570 "moonshot-identity-management-view.c"
1571 #line 462 "moonshot-identity-management-view.vala"
1573 #line 463 "moonshot-identity-management-view.vala"
1575 #line 464 "moonshot-identity-management-view.vala"
1576 nai_provided = NULL;
1577 #line 1578 "moonshot-identity-management-view.c"
1579 GeeLinkedList* _tmp4_;
1580 GeeIterator* _tmp5_;
1581 GeeIterator* _id_it;
1582 #line 466 "moonshot-identity-management-view.vala"
1583 _id_it = (_tmp5_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) (_tmp4_ = identity_manager_model_get_card_list (self->identities_manager))), _g_object_unref0 (_tmp4_), _tmp5_);
1584 #line 466 "moonshot-identity-management-view.vala"
1586 #line 1587 "moonshot-identity-management-view.c"
1588 gboolean _tmp6_ = FALSE;
1589 #line 466 "moonshot-identity-management-view.vala"
1590 if (!gee_iterator_next (_id_it)) {
1591 #line 466 "moonshot-identity-management-view.vala"
1593 #line 1594 "moonshot-identity-management-view.c"
1595 #line 466 "moonshot-identity-management-view.vala"
1596 id = (IdCard*) gee_iterator_get (_id_it);
1597 #line 469 "moonshot-identity-management-view.vala"
1599 #line 469 "moonshot-identity-management-view.vala"
1600 _tmp6_ = _vala_strcmp0 (request->nai, id_card_get_nai (id)) == 0;
1601 #line 1602 "moonshot-identity-management-view.c"
1603 #line 469 "moonshot-identity-management-view.vala"
1605 #line 1606 "moonshot-identity-management-view.c"
1607 #line 469 "moonshot-identity-management-view.vala"
1609 #line 1610 "moonshot-identity-management-view.c"
1611 #line 471 "moonshot-identity-management-view.vala"
1612 nai_provided = (_tmp7_ = _g_object_ref0 (id), _g_object_unref0 (nai_provided), _tmp7_);
1613 #line 472 "moonshot-identity-management-view.vala"
1614 identity_manager_view_add_candidate (self, id);
1615 #line 1616 "moonshot-identity-management-view.c"
1616 _g_object_unref0 (id);
1617 #line 473 "moonshot-identity-management-view.vala"
1619 #line 1620 "moonshot-identity-management-view.c"
1621 #line 477 "moonshot-identity-management-view.vala"
1623 #line 1624 "moonshot-identity-management-view.c"
1626 char** srv_collection;
1627 int srv_collection_length1;
1629 #line 479 "moonshot-identity-management-view.vala"
1630 srv_collection = id_card_get_services (id, &_tmp8_);
1631 #line 1632 "moonshot-identity-management-view.c"
1632 srv_collection_length1 = _tmp8_;
1633 for (srv_it = 0; srv_it < _tmp8_; srv_it = srv_it + 1) {
1635 srv = g_strdup (srv_collection[srv_it]);
1637 #line 481 "moonshot-identity-management-view.vala"
1638 if (_vala_strcmp0 (request->service, srv) == 0) {
1639 #line 483 "moonshot-identity-management-view.vala"
1640 identity_manager_view_add_candidate (self, id);
1641 #line 1642 "moonshot-identity-management-view.c"
1643 #line 484 "moonshot-identity-management-view.vala"
1645 #line 1646 "moonshot-identity-management-view.c"
1652 _g_object_unref0 (id);
1654 _g_object_unref0 (_id_it);
1656 #line 491 "moonshot-identity-management-view.vala"
1658 #line 491 "moonshot-identity-management-view.vala"
1659 _tmp9_ = g_slist_length (self->priv->candidates) > 1;
1660 #line 1661 "moonshot-identity-management-view.c"
1662 #line 491 "moonshot-identity-management-view.vala"
1664 #line 1665 "moonshot-identity-management-view.c"
1666 #line 491 "moonshot-identity-management-view.vala"
1668 #line 1669 "moonshot-identity-management-view.c"
1670 GSList* id_collection;
1672 #line 493 "moonshot-identity-management-view.vala"
1673 id_collection = self->priv->candidates;
1674 #line 1675 "moonshot-identity-management-view.c"
1675 for (id_it = id_collection; id_it != NULL; id_it = id_it->next) {
1677 #line 493 "moonshot-identity-management-view.vala"
1678 id = _g_object_ref0 ((IdCard*) id_it->data);
1679 #line 1680 "moonshot-identity-management-view.c"
1682 GSList* services_list;
1683 gboolean has_service;
1684 gint services_length1;
1685 gint _services_size_;
1690 #line 495 "moonshot-identity-management-view.vala"
1692 #line 496 "moonshot-identity-management-view.vala"
1693 services_list = NULL;
1694 #line 497 "moonshot-identity-management-view.vala"
1695 has_service = FALSE;
1696 #line 1697 "moonshot-identity-management-view.c"
1699 char** srv_collection;
1700 int srv_collection_length1;
1702 #line 499 "moonshot-identity-management-view.vala"
1703 srv_collection = id_card_get_services (id, &_tmp10_);
1704 #line 1705 "moonshot-identity-management-view.c"
1705 srv_collection_length1 = _tmp10_;
1706 for (srv_it = 0; srv_it < _tmp10_; srv_it = srv_it + 1) {
1708 srv = g_strdup (srv_collection[srv_it]);
1710 #line 501 "moonshot-identity-management-view.vala"
1711 if (_vala_strcmp0 (srv, request->service) == 0) {
1712 #line 503 "moonshot-identity-management-view.vala"
1714 #line 1715 "moonshot-identity-management-view.c"
1716 #line 504 "moonshot-identity-management-view.vala"
1718 #line 1719 "moonshot-identity-management-view.c"
1720 #line 506 "moonshot-identity-management-view.vala"
1721 services_list = g_slist_append (services_list, g_strdup (srv));
1722 #line 1723 "moonshot-identity-management-view.c"
1727 #line 509 "moonshot-identity-management-view.vala"
1729 #line 1730 "moonshot-identity-management-view.c"
1730 __g_slist_free_g_free0 (services_list);
1731 _g_object_unref0 (id);
1732 #line 510 "moonshot-identity-management-view.vala"
1734 #line 1735 "moonshot-identity-management-view.c"
1736 #line 512 "moonshot-identity-management-view.vala"
1737 if (g_slist_length (services_list) == 0) {
1738 #line 1739 "moonshot-identity-management-view.c"
1739 char** _tmp11_ = NULL;
1741 gint _tmp12__length1;
1743 #line 514 "moonshot-identity-management-view.vala"
1744 _tmp13_ = (_tmp12_ = (_tmp11_ = g_new0 (char*, 0 + 1), _tmp11_), _tmp12__length1 = 0, _tmp12_);
1745 #line 514 "moonshot-identity-management-view.vala"
1746 id_card_set_services (id, _tmp13_, 0);
1747 #line 1748 "moonshot-identity-management-view.c"
1748 _tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
1749 __g_slist_free_g_free0 (services_list);
1750 _g_object_unref0 (id);
1751 #line 515 "moonshot-identity-management-view.vala"
1753 #line 1754 "moonshot-identity-management-view.c"
1755 services = (_tmp15_ = g_new0 (char*, (_tmp14_ = g_slist_length (services_list)) + 1), services_length1 = _tmp14_, _services_size_ = services_length1, _tmp15_);
1757 GSList* srv_collection;
1759 #line 519 "moonshot-identity-management-view.vala"
1760 srv_collection = services_list;
1761 #line 1762 "moonshot-identity-management-view.c"
1762 for (srv_it = srv_collection; srv_it != NULL; srv_it = srv_it->next) {
1764 #line 519 "moonshot-identity-management-view.vala"
1765 srv = g_strdup ((const char*) srv_it->data);
1766 #line 1767 "moonshot-identity-management-view.c"
1769 #line 521 "moonshot-identity-management-view.vala"
1770 services[i] = (_tmp16_ = g_strdup (srv), _g_free0 (services[i]), _tmp16_);
1771 #line 522 "moonshot-identity-management-view.vala"
1773 #line 1774 "moonshot-identity-management-view.c"
1778 #line 525 "moonshot-identity-management-view.vala"
1780 #line 525 "moonshot-identity-management-view.vala"
1781 id_card_set_services (id, _tmp17_, services_length1);
1782 #line 1783 "moonshot-identity-management-view.c"
1783 services = (_vala_array_free (services, services_length1, (GDestroyNotify) g_free), NULL);
1784 __g_slist_free_g_free0 (services_list);
1785 _g_object_unref0 (id);
1790 #line 532 "moonshot-identity-management-view.vala"
1791 if (g_slist_length (self->priv->candidates) == 0) {
1792 #line 1793 "moonshot-identity-management-view.c"
1794 GeeLinkedList* _tmp18_;
1795 GeeIterator* _tmp19_;
1796 GeeIterator* _id_it;
1797 #line 534 "moonshot-identity-management-view.vala"
1798 _id_it = (_tmp19_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) (_tmp18_ = identity_manager_model_get_card_list (self->identities_manager))), _g_object_unref0 (_tmp18_), _tmp19_);
1799 #line 534 "moonshot-identity-management-view.vala"
1801 #line 1802 "moonshot-identity-management-view.c"
1803 #line 534 "moonshot-identity-management-view.vala"
1804 if (!gee_iterator_next (_id_it)) {
1805 #line 534 "moonshot-identity-management-view.vala"
1807 #line 1808 "moonshot-identity-management-view.c"
1809 #line 534 "moonshot-identity-management-view.vala"
1810 id = (IdCard*) gee_iterator_get (_id_it);
1811 #line 1812 "moonshot-identity-management-view.c"
1814 Rule* rule_collection;
1815 int rule_collection_length1;
1817 #line 536 "moonshot-identity-management-view.vala"
1818 rule_collection = id_card_get_rules (id, &_tmp20_);
1819 #line 1820 "moonshot-identity-management-view.c"
1820 rule_collection_length1 = _tmp20_;
1821 for (rule_it = 0; rule_it < _tmp20_; rule_it = rule_it + 1) {
1824 rule = (rule_copy (&rule_collection[rule_it], &_tmp21_), _tmp21_);
1826 #line 538 "moonshot-identity-management-view.vala"
1827 if (!identity_manager_view_match_service_pattern (self, request->service, rule.pattern)) {
1828 #line 1829 "moonshot-identity-management-view.c"
1829 rule_destroy (&rule);
1830 #line 539 "moonshot-identity-management-view.vala"
1832 #line 1833 "moonshot-identity-management-view.c"
1834 #line 541 "moonshot-identity-management-view.vala"
1835 self->priv->candidates = g_slist_append (self->priv->candidates, _g_object_ref0 (id));
1836 #line 543 "moonshot-identity-management-view.vala"
1837 if (_vala_strcmp0 (rule.always_confirm, "true") == 0) {
1838 #line 544 "moonshot-identity-management-view.vala"
1840 #line 1841 "moonshot-identity-management-view.c"
1842 rule_destroy (&rule);
1846 _g_object_unref0 (id);
1848 _g_object_unref0 (_id_it);
1851 #line 549 "moonshot-identity-management-view.vala"
1852 if (g_slist_length (self->priv->candidates) > 1) {
1853 #line 1854 "moonshot-identity-management-view.c"
1854 gboolean _tmp22_ = FALSE;
1855 #line 551 "moonshot-identity-management-view.vala"
1857 #line 551 "moonshot-identity-management-view.vala"
1858 _tmp22_ = nai_provided != NULL;
1859 #line 1860 "moonshot-identity-management-view.c"
1861 #line 551 "moonshot-identity-management-view.vala"
1863 #line 1864 "moonshot-identity-management-view.c"
1865 #line 551 "moonshot-identity-management-view.vala"
1867 #line 1868 "moonshot-identity-management-view.c"
1869 #line 553 "moonshot-identity-management-view.vala"
1870 _data1_->identity = (_tmp23_ = _g_object_ref0 (nai_provided), _g_object_unref0 (_data1_->identity), _tmp23_);
1871 #line 554 "moonshot-identity-management-view.vala"
1873 #line 1874 "moonshot-identity-management-view.c"
1875 #line 557 "moonshot-identity-management-view.vala"
1877 #line 1878 "moonshot-identity-management-view.c"
1881 #line 560 "moonshot-identity-management-view.vala"
1882 _data1_->identity = (_tmp24_ = _g_object_ref0 ((IdCard*) g_slist_nth_data (self->priv->candidates, (guint) 0)), _g_object_unref0 (_data1_->identity), _tmp24_);
1883 #line 1884 "moonshot-identity-management-view.c"
1885 #line 564 "moonshot-identity-management-view.vala"
1887 #line 566 "moonshot-identity-management-view.vala"
1888 gtk_tree_model_filter_refilter (self->priv->filter);
1889 #line 567 "moonshot-identity-management-view.vala"
1890 identity_manager_view_redraw_id_card_widgets (self);
1891 #line 568 "moonshot-identity-management-view.vala"
1892 gtk_widget_show ((GtkWidget*) self);
1893 #line 1894 "moonshot-identity-management-view.c"
1894 _g_object_unref0 (nai_provided);
1895 block1_data_unref (_data1_);
1896 #line 569 "moonshot-identity-management-view.vala"
1898 #line 1899 "moonshot-identity-management-view.c"
1900 _g_object_unref0 (nai_provided);
1902 #line 574 "moonshot-identity-management-view.vala"
1903 g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda3__gsource_func, block1_data_ref (_data1_), block1_data_unref);
1904 #line 1905 "moonshot-identity-management-view.c"
1905 block1_data_unref (_data1_);
1906 #line 575 "moonshot-identity-management-view.vala"
1908 #line 1909 "moonshot-identity-management-view.c"
1912 #line 578 "moonshot-identity-management-view.vala"
1913 static gboolean identity_manager_view_match_service_pattern (IdentityManagerView* self, const char* service, const char* pattern) {
1914 #line 1915 "moonshot-identity-management-view.c"
1915 gboolean result = FALSE;
1916 GPatternSpec* pspec;
1917 #line 578 "moonshot-identity-management-view.vala"
1918 g_return_val_if_fail (self != NULL, FALSE);
1919 #line 578 "moonshot-identity-management-view.vala"
1920 g_return_val_if_fail (service != NULL, FALSE);
1921 #line 578 "moonshot-identity-management-view.vala"
1922 g_return_val_if_fail (pattern != NULL, FALSE);
1923 #line 580 "moonshot-identity-management-view.vala"
1924 pspec = g_pattern_spec_new (pattern);
1925 #line 1926 "moonshot-identity-management-view.c"
1926 result = g_pattern_match_string (pspec, service);
1927 _g_pattern_spec_free0 (pspec);
1928 #line 581 "moonshot-identity-management-view.vala"
1930 #line 1931 "moonshot-identity-management-view.c"
1934 #line 584 "moonshot-identity-management-view.vala"
1935 void identity_manager_view_send_identity_cb (IdentityManagerView* self, IdCard* identity) {
1936 #line 1937 "moonshot-identity-management-view.c"
1937 IdentityRequest* request;
1938 gboolean reset_password;
1939 gboolean _tmp0_ = FALSE;
1941 #line 584 "moonshot-identity-management-view.vala"
1942 g_return_if_fail (self != NULL);
1943 #line 584 "moonshot-identity-management-view.vala"
1944 g_return_if_fail (identity != NULL);
1945 #line 586 "moonshot-identity-management-view.vala"
1946 g_return_if_fail (self->request_queue->length > 0);
1947 #line 588 "moonshot-identity-management-view.vala"
1948 request = (IdentityRequest*) g_queue_pop_head (self->request_queue);
1949 #line 589 "moonshot-identity-management-view.vala"
1950 reset_password = FALSE;
1951 #line 591 "moonshot-identity-management-view.vala"
1952 if (request->service != NULL) {
1953 #line 591 "moonshot-identity-management-view.vala"
1954 _tmp0_ = _vala_strcmp0 (request->service, "") != 0;
1955 #line 1956 "moonshot-identity-management-view.c"
1957 #line 591 "moonshot-identity-management-view.vala"
1959 #line 1960 "moonshot-identity-management-view.c"
1961 #line 591 "moonshot-identity-management-view.vala"
1963 #line 1964 "moonshot-identity-management-view.c"
1964 gboolean duplicate_service;
1965 #line 593 "moonshot-identity-management-view.vala"
1966 duplicate_service = FALSE;
1967 #line 1968 "moonshot-identity-management-view.c"
1970 char** service_collection;
1971 int service_collection_length1;
1973 #line 595 "moonshot-identity-management-view.vala"
1974 service_collection = id_card_get_services (identity, &_tmp1_);
1975 #line 1976 "moonshot-identity-management-view.c"
1976 service_collection_length1 = _tmp1_;
1977 for (service_it = 0; service_it < _tmp1_; service_it = service_it + 1) {
1979 service = g_strdup (service_collection[service_it]);
1981 #line 597 "moonshot-identity-management-view.vala"
1982 if (_vala_strcmp0 (service, request->service) == 0) {
1983 #line 598 "moonshot-identity-management-view.vala"
1984 duplicate_service = TRUE;
1985 #line 1986 "moonshot-identity-management-view.c"
1991 #line 600 "moonshot-identity-management-view.vala"
1992 if (duplicate_service == FALSE) {
1993 #line 1994 "moonshot-identity-management-view.c"
1994 gint services_length1;
1995 gint _services_size_;
2003 services = (_tmp3_ = g_new0 (char*, (_tmp2_ + 1) + 1), services_length1 = _tmp2_ + 1, _services_size_ = services_length1, _tmp3_);
2006 #line 604 "moonshot-identity-management-view.vala"
2008 #line 2009 "moonshot-identity-management-view.c"
2011 #line 604 "moonshot-identity-management-view.vala"
2013 #line 604 "moonshot-identity-management-view.vala"
2015 #line 2016 "moonshot-identity-management-view.c"
2019 #line 604 "moonshot-identity-management-view.vala"
2021 #line 604 "moonshot-identity-management-view.vala"
2023 #line 2024 "moonshot-identity-management-view.c"
2025 #line 604 "moonshot-identity-management-view.vala"
2027 #line 604 "moonshot-identity-management-view.vala"
2028 if (!(i < _tmp5_)) {
2029 #line 604 "moonshot-identity-management-view.vala"
2031 #line 2032 "moonshot-identity-management-view.c"
2033 #line 605 "moonshot-identity-management-view.vala"
2034 services[i] = (_tmp7_ = g_strdup (id_card_get_services (identity, &_tmp6_)[i]), _g_free0 (services[i]), _tmp7_);
2035 #line 2036 "moonshot-identity-management-view.c"
2039 #line 607 "moonshot-identity-management-view.vala"
2040 services[_tmp8_] = (_tmp10_ = g_strdup (request->service), _g_free0 (services[_tmp8_]), _tmp10_);
2041 #line 608 "moonshot-identity-management-view.vala"
2043 #line 608 "moonshot-identity-management-view.vala"
2044 id_card_set_services (identity, _tmp11_, services_length1);
2045 #line 610 "moonshot-identity-management-view.vala"
2046 identity_manager_model_update_card (self->identities_manager, identity);
2047 #line 2048 "moonshot-identity-management-view.c"
2048 services = (_vala_array_free (services, services_length1, (GDestroyNotify) g_free), NULL);
2051 #line 614 "moonshot-identity-management-view.vala"
2052 if (id_card_get_password (identity) == NULL) {
2053 #line 2054 "moonshot-identity-management-view.c"
2054 AddPasswordDialog* dialog;
2056 #line 616 "moonshot-identity-management-view.vala"
2057 dialog = g_object_ref_sink (add_password_dialog_new ());
2058 #line 617 "moonshot-identity-management-view.vala"
2059 _result_ = gtk_dialog_run ((GtkDialog*) dialog);
2060 #line 619 "moonshot-identity-management-view.vala"
2062 #line 2063 "moonshot-identity-management-view.c"
2063 case GTK_RESPONSE_OK:
2065 #line 621 "moonshot-identity-management-view.vala"
2066 id_card_set_password (identity, add_password_dialog_get_password (dialog));
2067 #line 622 "moonshot-identity-management-view.vala"
2068 reset_password = !add_password_dialog_get_remember (dialog);
2069 #line 623 "moonshot-identity-management-view.vala"
2071 #line 2072 "moonshot-identity-management-view.c"
2075 #line 625 "moonshot-identity-management-view.vala"
2077 #line 626 "moonshot-identity-management-view.vala"
2079 #line 2080 "moonshot-identity-management-view.c"
2082 #line 629 "moonshot-identity-management-view.vala"
2083 gtk_object_destroy ((GtkObject*) dialog);
2084 #line 2085 "moonshot-identity-management-view.c"
2085 _g_object_unref0 (dialog);
2087 #line 632 "moonshot-identity-management-view.vala"
2088 if (g_queue_is_empty (self->request_queue)) {
2089 #line 633 "moonshot-identity-management-view.vala"
2091 #line 2092 "moonshot-identity-management-view.c"
2093 #line 635 "moonshot-identity-management-view.vala"
2094 if (identity != NULL) {
2095 #line 2096 "moonshot-identity-management-view.c"
2097 #line 636 "moonshot-identity-management-view.vala"
2098 self->priv->default_id_card = (_tmp12_ = _g_object_ref0 (identity), _g_object_unref0 (self->priv->default_id_card), _tmp12_);
2099 #line 2100 "moonshot-identity-management-view.c"
2101 #line 638 "moonshot-identity-management-view.vala"
2102 identity_request_return_identity (request, identity);
2103 #line 640 "moonshot-identity-management-view.vala"
2104 if (reset_password) {
2105 #line 641 "moonshot-identity-management-view.vala"
2106 id_card_set_password (identity, NULL);
2107 #line 2108 "moonshot-identity-management-view.c"
2109 #line 643 "moonshot-identity-management-view.vala"
2110 self->priv->candidates = (_tmp13_ = NULL, __g_slist_free_g_object_unref0 (self->priv->candidates), _tmp13_);
2111 #line 2112 "moonshot-identity-management-view.c"
2112 _g_object_unref0 (request);
2116 #line 646 "moonshot-identity-management-view.vala"
2117 static void identity_manager_view_label_make_bold (IdentityManagerView* self, GtkLabel* label) {
2118 #line 2119 "moonshot-identity-management-view.c"
2119 PangoFontDescription* font_desc;
2120 #line 646 "moonshot-identity-management-view.vala"
2121 g_return_if_fail (self != NULL);
2122 #line 646 "moonshot-identity-management-view.vala"
2123 g_return_if_fail (label != NULL);
2124 #line 648 "moonshot-identity-management-view.vala"
2125 font_desc = pango_font_description_new ();
2126 #line 650 "moonshot-identity-management-view.vala"
2127 pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
2128 #line 657 "moonshot-identity-management-view.vala"
2129 gtk_widget_modify_font ((GtkWidget*) label, font_desc);
2130 #line 2131 "moonshot-identity-management-view.c"
2131 _pango_font_description_free0 (font_desc);
2135 #line 685 "moonshot-identity-management-view.vala"
2136 static void _lambda1_ (GtkButton* remove_button, IdentityManagerView* self) {
2137 #line 2138 "moonshot-identity-management-view.c"
2138 GtkMessageDialog* dialog;
2140 #line 685 "moonshot-identity-management-view.vala"
2141 g_return_if_fail (remove_button != NULL);
2142 #line 687 "moonshot-identity-management-view.vala"
2143 dialog = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _ ("Are you sure you want to stop '%s' ID Card from being used with %s?"), id_card_get_display_name (id_card_widget_get_id_card (custom_vbox_get_current_idcard (self->priv->custom_vbox))), _ ("this service")));
2144 #line 694 "moonshot-identity-management-view.vala"
2145 ret = gtk_dialog_run ((GtkDialog*) dialog);
2146 #line 695 "moonshot-identity-management-view.vala"
2147 gtk_widget_hide ((GtkWidget*) dialog);
2148 #line 697 "moonshot-identity-management-view.vala"
2149 if (ret == GTK_RESPONSE_YES) {
2150 #line 2151 "moonshot-identity-management-view.c"
2156 gint _tmp2__length1;
2159 #line 699 "moonshot-identity-management-view.vala"
2160 idcard = _g_object_ref0 (id_card_widget_get_id_card (custom_vbox_get_current_idcard (self->priv->custom_vbox)));
2161 #line 700 "moonshot-identity-management-view.vala"
2162 candidate = g_strdup ((const char*) g_hash_table_lookup (self->priv->service_button_map, remove_button));
2163 #line 702 "moonshot-identity-management-view.vala"
2165 #line 2166 "moonshot-identity-management-view.c"
2168 char** srv_collection;
2169 int srv_collection_length1;
2171 #line 704 "moonshot-identity-management-view.vala"
2172 srv_collection = id_card_get_services (idcard, &_tmp0_);
2173 #line 2174 "moonshot-identity-management-view.c"
2174 srv_collection_length1 = _tmp0_;
2175 for (srv_it = 0; srv_it < _tmp0_; srv_it = srv_it + 1) {
2177 srv = g_strdup (srv_collection[srv_it]);
2179 #line 706 "moonshot-identity-management-view.vala"
2180 if (_vala_strcmp0 (srv, candidate) == 0) {
2181 #line 2182 "moonshot-identity-management-view.c"
2183 #line 707 "moonshot-identity-management-view.vala"
2185 #line 2186 "moonshot-identity-management-view.c"
2187 #line 708 "moonshot-identity-management-view.vala"
2188 services = g_slist_append (services, g_strdup (srv));
2189 #line 2190 "moonshot-identity-management-view.c"
2194 #line 711 "moonshot-identity-management-view.vala"
2195 _tmp3_ = (_tmp2_ = g_new0 (char*, (_tmp1_ = g_slist_length (services)) + 1), _tmp2__length1 = _tmp1_, _tmp2_);
2196 #line 711 "moonshot-identity-management-view.vala"
2197 id_card_set_services (idcard, _tmp3_, _tmp1_);
2198 #line 2199 "moonshot-identity-management-view.c"
2199 _tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
2202 #line 712 "moonshot-identity-management-view.vala"
2204 #line 2205 "moonshot-identity-management-view.c"
2207 #line 712 "moonshot-identity-management-view.vala"
2209 #line 712 "moonshot-identity-management-view.vala"
2211 #line 2212 "moonshot-identity-management-view.c"
2217 #line 712 "moonshot-identity-management-view.vala"
2219 #line 712 "moonshot-identity-management-view.vala"
2221 #line 2222 "moonshot-identity-management-view.c"
2223 #line 712 "moonshot-identity-management-view.vala"
2225 #line 712 "moonshot-identity-management-view.vala"
2226 if (!(j < _tmp5_)) {
2227 #line 712 "moonshot-identity-management-view.vala"
2229 #line 2230 "moonshot-identity-management-view.c"
2231 #line 714 "moonshot-identity-management-view.vala"
2232 _tmp8_ = &id_card_get_services (idcard, &_tmp7_)[j];
2233 #line 714 "moonshot-identity-management-view.vala"
2234 (*_tmp8_) = (_tmp9_ = g_strdup ((const char*) g_slist_nth_data (services, (guint) j)), _g_free0 ((*_tmp8_)), _tmp9_);
2235 #line 2236 "moonshot-identity-management-view.c"
2239 #line 717 "moonshot-identity-management-view.vala"
2240 children = gtk_container_get_children ((GtkContainer*) self->priv->services_internal_vbox);
2241 #line 2242 "moonshot-identity-management-view.c"
2243 GList* hbox_collection;
2245 #line 718 "moonshot-identity-management-view.vala"
2246 hbox_collection = children;
2247 #line 2248 "moonshot-identity-management-view.c"
2248 for (hbox_it = hbox_collection; hbox_it != NULL; hbox_it = hbox_it->next) {
2250 #line 718 "moonshot-identity-management-view.vala"
2251 hbox = (GtkWidget*) hbox_it->data;
2252 #line 2253 "moonshot-identity-management-view.c"
2254 #line 719 "moonshot-identity-management-view.vala"
2255 gtk_object_destroy ((GtkObject*) hbox);
2256 #line 2257 "moonshot-identity-management-view.c"
2260 #line 721 "moonshot-identity-management-view.vala"
2261 identity_manager_view_fill_services_vbox (self, idcard);
2262 #line 722 "moonshot-identity-management-view.vala"
2263 id_card_widget_update_id_card_label (custom_vbox_get_current_idcard (self->priv->custom_vbox));
2264 #line 2265 "moonshot-identity-management-view.c"
2265 _g_list_free0 (children);
2266 __g_slist_free_g_free0 (services);
2267 _g_free0 (candidate);
2268 _g_object_unref0 (idcard);
2270 _g_object_unref0 (dialog);
2274 #line 685 "moonshot-identity-management-view.vala"
2275 static void __lambda1__gtk_button_clicked (GtkButton* _sender, gpointer self) {
2276 #line 2277 "moonshot-identity-management-view.c"
2277 _lambda1_ (_sender, self);
2281 #line 660 "moonshot-identity-management-view.vala"
2282 static void identity_manager_view_fill_services_vbox (IdentityManagerView* self, IdCard* id_card) {
2283 #line 2284 "moonshot-identity-management-view.c"
2287 GtkTable* services_table;
2288 #line 660 "moonshot-identity-management-view.vala"
2289 g_return_if_fail (self != NULL);
2290 #line 660 "moonshot-identity-management-view.vala"
2291 g_return_if_fail (id_card != NULL);
2292 #line 662 "moonshot-identity-management-view.vala"
2294 #line 663 "moonshot-identity-management-view.vala"
2296 #line 665 "moonshot-identity-management-view.vala"
2297 services_table = g_object_ref_sink ((GtkTable*) gtk_table_new ((guint) n_columns, (guint) 2, FALSE));
2298 #line 666 "moonshot-identity-management-view.vala"
2299 gtk_table_set_col_spacings (services_table, (guint) 10);
2300 #line 667 "moonshot-identity-management-view.vala"
2301 gtk_table_set_row_spacings (services_table, (guint) 10);
2302 #line 668 "moonshot-identity-management-view.vala"
2303 gtk_container_add ((GtkContainer*) self->priv->services_internal_vbox, (GtkWidget*) services_table);
2304 #line 670 "moonshot-identity-management-view.vala"
2305 g_hash_table_remove_all (self->priv->service_button_map);
2306 #line 2307 "moonshot-identity-management-view.c"
2309 char** service_collection;
2310 int service_collection_length1;
2312 #line 672 "moonshot-identity-management-view.vala"
2313 service_collection = id_card_get_services (id_card, &_tmp1_);
2314 #line 2315 "moonshot-identity-management-view.c"
2315 service_collection_length1 = _tmp1_;
2316 for (service_it = 0; service_it < _tmp1_; service_it = service_it + 1) {
2318 service = g_strdup (service_collection[service_it]);
2321 GtkButton* remove_button;
2322 #line 674 "moonshot-identity-management-view.vala"
2323 label = g_object_ref_sink ((GtkLabel*) gtk_label_new (service));
2324 #line 675 "moonshot-identity-management-view.vala"
2325 gtk_misc_set_alignment ((GtkMisc*) label, (float) 0, (float) 0.5);
2326 #line 679 "moonshot-identity-management-view.vala"
2327 remove_button = g_object_ref_sink ((GtkButton*) gtk_button_new_from_stock (GTK_STOCK_REMOVE));
2328 #line 683 "moonshot-identity-management-view.vala"
2329 g_hash_table_insert (self->priv->service_button_map, _g_object_ref0 (remove_button), g_strdup (service));
2330 #line 685 "moonshot-identity-management-view.vala"
2331 g_signal_connect_object (remove_button, "clicked", (GCallback) __lambda1__gtk_button_clicked, self, 0);
2332 #line 726 "moonshot-identity-management-view.vala"
2333 gtk_table_attach_defaults (services_table, (GtkWidget*) label, (guint) 0, (guint) 1, (guint) i, (guint) (i + 1));
2334 #line 727 "moonshot-identity-management-view.vala"
2335 gtk_table_attach_defaults (services_table, (GtkWidget*) remove_button, (guint) 1, (guint) 2, (guint) i, (guint) (i + 1));
2336 #line 728 "moonshot-identity-management-view.vala"
2338 #line 2339 "moonshot-identity-management-view.c"
2339 _g_object_unref0 (remove_button);
2340 _g_object_unref0 (label);
2345 #line 730 "moonshot-identity-management-view.vala"
2346 gtk_widget_show_all ((GtkWidget*) self->priv->services_internal_vbox);
2347 #line 2348 "moonshot-identity-management-view.c"
2348 _g_object_unref0 (services_table);
2352 #line 733 "moonshot-identity-management-view.vala"
2353 static void identity_manager_view_on_about_action (IdentityManagerView* self) {
2354 #line 2355 "moonshot-identity-management-view.c"
2355 gint authors_length1;
2356 gint _authors_size_;
2358 char** _tmp0_ = NULL;
2362 #line 733 "moonshot-identity-management-view.vala"
2363 g_return_if_fail (self != NULL);
2364 #line 2365 "moonshot-identity-management-view.c"
2365 authors = (_tmp1_ = (_tmp0_ = g_new0 (char*, 4 + 1), _tmp0_[0] = g_strdup ("Javier Jardón <jjardon@codethink.co.uk>"), _tmp0_[1] = g_strdup ("Sam Thursfield <samthursfield@codethink.co.uk>"), _tmp0_[2] = g_strdup ("Alberto Ruiz <alberto.ruiz@codethink.co.uk>"), _tmp0_[3] = NULL, _tmp0_), authors_length1 = 4, _authors_size_ = authors_length1, _tmp1_);
2366 #line 742 "moonshot-identity-management-view.vala"
2367 copyright = g_strdup ("Copyright 2011 JANET");
2368 #line 745 "moonshot-identity-management-view.vala"
2369 license = g_strdup ("\n" \
2370 "Copyright (c) 2011, JANET(UK)\n" \
2371 "All rights reserved.\n" \
2373 "Redistribution and use in source and binary forms, with or without\n" \
2374 "modification, are permitted provided that the following conditions\n" \
2377 "1. Redistributions of source code must retain the above copyright\n" \
2378 " notice, this list of conditions and the following disclaimer.\n" \
2380 "2. Redistributions in binary form must reproduce the above copyright\n" \
2381 " notice, this list of conditions and the following disclaimer in the" \
2383 " documentation and/or other materials provided with the distribution" \
2386 "3. Neither the name of JANET(UK) nor the names of its contributors\n" \
2387 " may be used to endorse or promote products derived from this softwa" \
2389 " without specific prior written permission.\n" \
2391 "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\" \
2393 "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, " \
2395 "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PUR" \
2397 "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS" \
2399 "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN" \
2401 "DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOOD" \
2403 "OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n" \
2404 "HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ST" \
2406 "LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY " \
2408 "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF" \
2411 #line 777 "moonshot-identity-management-view.vala"
2412 gtk_show_about_dialog ((GtkWindow*) self, "comments", _ ("Moonshot project UI"), "copyright", copyright, "website", PACKAGE_URL, "version", PACKAGE_VERSION, "license", license, "website-label", _ ("Visit the Moonshot project web site"), "authors", authors, "translator-credits", _ ("translator-credits"), NULL, NULL);
2413 #line 2373 "moonshot-identity-management-view.c"
2415 _g_free0 (copyright);
2416 authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
2420 static void _vala_array_add1 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value) {
2421 if ((*length) == (*size)) {
2422 *size = (*size) ? (2 * (*size)) : 4;
2423 *array = g_renew (GtkActionEntry, *array, *size);
2425 (*array)[(*length)++] = *value;
2429 #line 375 "moonshot-identity-management-view.vala"
2430 static void _identity_manager_view_add_identity_manual_cb_gtk_action_callback (GtkAction* action, gpointer self) {
2431 #line 2391 "moonshot-identity-management-view.c"
2432 identity_manager_view_add_identity_manual_cb (self);
2436 static void _vala_array_add2 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value) {
2437 if ((*length) == (*size)) {
2438 *size = (*size) ? (2 * (*size)) : 4;
2439 *array = g_renew (GtkActionEntry, *array, *size);
2441 (*array)[(*length)++] = *value;
2445 #line 7766 "gtk+-2.0.vapi"
2446 static void _gtk_main_quit_gtk_action_callback (GtkAction* action, gpointer self) {
2447 #line 2407 "moonshot-identity-management-view.c"
2452 static void _vala_array_add3 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value) {
2453 if ((*length) == (*size)) {
2454 *size = (*size) ? (2 * (*size)) : 4;
2455 *array = g_renew (GtkActionEntry, *array, *size);
2457 (*array)[(*length)++] = *value;
2461 static void _vala_array_add4 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value) {
2462 if ((*length) == (*size)) {
2463 *size = (*size) ? (2 * (*size)) : 4;
2464 *array = g_renew (GtkActionEntry, *array, *size);
2466 (*array)[(*length)++] = *value;
2470 #line 733 "moonshot-identity-management-view.vala"
2471 static void _identity_manager_view_on_about_action_gtk_action_callback (GtkAction* action, gpointer self) {
2472 #line 2432 "moonshot-identity-management-view.c"
2473 identity_manager_view_on_about_action (self);
2477 static void _vala_array_add5 (GtkActionEntry** array, int* length, int* size, const GtkActionEntry* value) {
2478 if ((*length) == (*size)) {
2479 *size = (*size) ? (2 * (*size)) : 4;
2480 *array = g_renew (GtkActionEntry, *array, *size);
2482 (*array)[(*length)++] = *value;
2486 #line 790 "moonshot-identity-management-view.vala"
2487 static GtkActionEntry* identity_manager_view_create_actions (IdentityManagerView* self, int* result_length1) {
2488 #line 2448 "moonshot-identity-management-view.c"
2489 GtkActionEntry* result = NULL;
2490 gint actions_length1;
2491 gint _actions_size_;
2492 GtkActionEntry* _tmp0_;
2493 GtkActionEntry* actions;
2494 GtkActionEntry _tmp1_ = {0};
2495 GtkActionEntry filemenu;
2496 GtkActionEntry _tmp2_ = {0};
2498 GtkActionEntry _tmp3_ = {0};
2499 GtkActionEntry quit;
2500 GtkActionEntry _tmp4_ = {0};
2501 GtkActionEntry helpmenu;
2502 GtkActionEntry _tmp5_ = {0};
2503 GtkActionEntry about;
2504 GtkActionEntry* _tmp6_;
2505 #line 790 "moonshot-identity-management-view.vala"
2506 g_return_val_if_fail (self != NULL, NULL);
2507 #line 2467 "moonshot-identity-management-view.c"
2508 actions = (_tmp0_ = g_new0 (GtkActionEntry, 0), actions_length1 = 0, _actions_size_ = actions_length1, _tmp0_);
2509 #line 793 "moonshot-identity-management-view.vala"
2510 filemenu = (_tmp1_.name = "FileMenuAction", _tmp1_.stock_id = NULL, _tmp1_.label = N_ ("_File"), _tmp1_.accelerator = NULL, _tmp1_.tooltip = NULL, _tmp1_.callback = (GCallback) NULL, _tmp1_);
2511 #line 797 "moonshot-identity-management-view.vala"
2512 _vala_array_add1 (&actions, &actions_length1, &_actions_size_, &filemenu);
2513 #line 798 "moonshot-identity-management-view.vala"
2514 add = (_tmp2_.name = "AddIdCardAction", _tmp2_.stock_id = GTK_STOCK_ADD, _tmp2_.label = N_ ("Add ID Card"), _tmp2_.accelerator = NULL, _tmp2_.tooltip = N_ ("Add a new ID Card"), _tmp2_.callback = (GCallback) _identity_manager_view_add_identity_manual_cb_gtk_action_callback, _tmp2_);
2515 #line 808 "moonshot-identity-management-view.vala"
2516 _vala_array_add2 (&actions, &actions_length1, &_actions_size_, &add);
2517 #line 809 "moonshot-identity-management-view.vala"
2518 quit = (_tmp3_.name = "QuitAction", _tmp3_.stock_id = GTK_STOCK_QUIT, _tmp3_.label = N_ ("Quit"), _tmp3_.accelerator = "<control>Q", _tmp3_.tooltip = N_ ("Quit the application"), _tmp3_.callback = (GCallback) _gtk_main_quit_gtk_action_callback, _tmp3_);
2519 #line 819 "moonshot-identity-management-view.vala"
2520 _vala_array_add3 (&actions, &actions_length1, &_actions_size_, &quit);
2521 #line 821 "moonshot-identity-management-view.vala"
2522 helpmenu = (_tmp4_.name = "HelpMenuAction", _tmp4_.stock_id = NULL, _tmp4_.label = N_ ("_Help"), _tmp4_.accelerator = NULL, _tmp4_.tooltip = NULL, _tmp4_.callback = (GCallback) NULL, _tmp4_);
2523 #line 825 "moonshot-identity-management-view.vala"
2524 _vala_array_add4 (&actions, &actions_length1, &_actions_size_, &helpmenu);
2525 #line 826 "moonshot-identity-management-view.vala"
2526 about = (_tmp5_.name = "AboutAction", _tmp5_.stock_id = GTK_STOCK_ABOUT, _tmp5_.label = N_ ("About"), _tmp5_.accelerator = NULL, _tmp5_.tooltip = N_ ("About this application"), _tmp5_.callback = (GCallback) _identity_manager_view_on_about_action_gtk_action_callback, _tmp5_);
2527 #line 836 "moonshot-identity-management-view.vala"
2528 _vala_array_add5 (&actions, &actions_length1, &_actions_size_, &about);
2529 #line 2489 "moonshot-identity-management-view.c"
2530 result = (_tmp6_ = actions, *result_length1 = actions_length1, _tmp6_);
2531 #line 838 "moonshot-identity-management-view.vala"
2533 #line 2493 "moonshot-identity-management-view.c"
2534 actions = (g_free (actions), NULL);
2538 #line 842 "moonshot-identity-management-view.vala"
2539 static void identity_manager_view_create_ui_manager (IdentityManagerView* self) {
2540 #line 2500 "moonshot-identity-management-view.c"
2541 GtkActionGroup* action_group;
2543 GtkActionEntry* _tmp1_;
2544 gint _tmp1__length1;
2545 GtkActionEntry* _tmp2_;
2546 GError * _inner_error_ = NULL;
2547 #line 842 "moonshot-identity-management-view.vala"
2548 g_return_if_fail (self != NULL);
2549 #line 844 "moonshot-identity-management-view.vala"
2550 action_group = gtk_action_group_new ("GeneralActionGroup");
2551 #line 845 "moonshot-identity-management-view.vala"
2552 _tmp2_ = (_tmp1_ = identity_manager_view_create_actions (self, &_tmp0_), _tmp1__length1 = _tmp0_, _tmp1_);
2553 #line 845 "moonshot-identity-management-view.vala"
2554 gtk_action_group_add_actions (action_group, _tmp2_, _tmp0_, self);
2555 #line 2515 "moonshot-identity-management-view.c"
2556 _tmp1_ = (g_free (_tmp1_), NULL);
2557 #line 846 "moonshot-identity-management-view.vala"
2558 gtk_ui_manager_insert_action_group (self->priv->ui_manager, action_group, 0);
2559 #line 2519 "moonshot-identity-management-view.c"
2561 #line 849 "moonshot-identity-management-view.vala"
2562 gtk_ui_manager_add_ui_from_string (self->priv->ui_manager, IDENTITY_MANAGER_VIEW_layout, (gssize) (-1), &_inner_error_);
2563 #line 2523 "moonshot-identity-management-view.c"
2564 if (_inner_error_ != NULL) {
2565 goto __catch1_g_error;
2573 _inner_error_ = NULL;
2575 #line 853 "moonshot-identity-management-view.vala"
2576 fprintf (stderr, "%s\n", e->message);
2577 #line 2537 "moonshot-identity-management-view.c"
2582 if (_inner_error_ != NULL) {
2583 _g_object_unref0 (action_group);
2584 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2585 g_clear_error (&_inner_error_);
2588 #line 855 "moonshot-identity-management-view.vala"
2589 gtk_ui_manager_ensure_update (self->priv->ui_manager);
2590 #line 2550 "moonshot-identity-management-view.c"
2591 _g_object_unref0 (action_group);
2595 #line 158 "moonshot-identity-management-view.vala"
2596 static void _identity_manager_view_search_entry_icon_press_cb_gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
2597 #line 2557 "moonshot-identity-management-view.c"
2598 identity_manager_view_search_entry_icon_press_cb (self, p0, p1);
2602 #line 170 "moonshot-identity-management-view.vala"
2603 static void _identity_manager_view_search_entry_text_changed_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
2604 #line 2564 "moonshot-identity-management-view.c"
2605 identity_manager_view_search_entry_text_changed_cb (self);
2609 #line 182 "moonshot-identity-management-view.vala"
2610 static gboolean _identity_manager_view_search_entry_key_press_event_cb_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
2611 #line 2571 "moonshot-identity-management-view.c"
2613 result = identity_manager_view_search_entry_key_press_event_cb (self, event);
2618 #line 858 "moonshot-identity-management-view.vala"
2619 static void identity_manager_view_build_ui (IdentityManagerView* self) {
2620 #line 2580 "moonshot-identity-management-view.c"
2625 GtkViewport* viewport;
2626 GtkScrolledWindow* scroll;
2628 GtkLabel* login_vbox_title;
2629 GtkLabel* username_label;
2631 GtkLabel* password_label;
2633 GtkCheckButton* remember_checkbutton;
2634 GtkTable* login_table;
2635 GtkAlignment* login_vbox_alignment;
2636 GtkVBox* login_vbox;
2637 GtkLabel* services_vbox_title;
2638 GtkAlignment* services_vbox_alignment;
2640 GtkVBox* services_vbox;
2645 #line 858 "moonshot-identity-management-view.vala"
2646 g_return_if_fail (self != NULL);
2647 #line 860 "moonshot-identity-management-view.vala"
2648 identity_manager_view_create_ui_manager (self);
2649 #line 862 "moonshot-identity-management-view.vala"
2650 self->priv->search_entry = (_tmp0_ = g_object_ref_sink ((GtkEntry*) gtk_entry_new ()), _g_object_unref0 (self->priv->search_entry), _tmp0_);
2651 #line 864 "moonshot-identity-management-view.vala"
2652 identity_manager_view_set_atk_name_description (self, (GtkWidget*) self->priv->search_entry, _ ("Search entry"), _ ("Search for a specific ID Card"));
2653 #line 865 "moonshot-identity-management-view.vala"
2654 gtk_entry_set_icon_from_pixbuf (self->priv->search_entry, GTK_ENTRY_ICON_PRIMARY, _tmp1_ = find_icon_sized ("edit-find", GTK_ICON_SIZE_MENU));
2655 #line 2615 "moonshot-identity-management-view.c"
2656 _g_object_unref0 (_tmp1_);
2657 #line 868 "moonshot-identity-management-view.vala"
2658 gtk_entry_set_icon_tooltip_text (self->priv->search_entry, GTK_ENTRY_ICON_PRIMARY, _ ("Search identity or service"));
2659 #line 870 "moonshot-identity-management-view.vala"
2660 gtk_entry_set_icon_sensitive (self->priv->search_entry, GTK_ENTRY_ICON_PRIMARY, FALSE);
2661 #line 872 "moonshot-identity-management-view.vala"
2662 gtk_entry_set_icon_from_pixbuf (self->priv->search_entry, GTK_ENTRY_ICON_SECONDARY, _tmp2_ = find_icon_sized ("process-stop", GTK_ICON_SIZE_MENU));
2663 #line 2623 "moonshot-identity-management-view.c"
2664 _g_object_unref0 (_tmp2_);
2665 #line 875 "moonshot-identity-management-view.vala"
2666 gtk_entry_set_icon_tooltip_text (self->priv->search_entry, GTK_ENTRY_ICON_SECONDARY, _ ("Clear the current search"));
2667 #line 877 "moonshot-identity-management-view.vala"
2668 gtk_entry_set_icon_sensitive (self->priv->search_entry, GTK_ENTRY_ICON_SECONDARY, FALSE);
2669 #line 880 "moonshot-identity-management-view.vala"
2670 g_signal_connect_object (self->priv->search_entry, "icon-press", (GCallback) _identity_manager_view_search_entry_icon_press_cb_gtk_entry_icon_press, self, 0);
2671 #line 881 "moonshot-identity-management-view.vala"
2672 g_signal_connect_object ((GObject*) self->priv->search_entry, "notify::text", (GCallback) _identity_manager_view_search_entry_text_changed_cb_g_object_notify, self, 0);
2673 #line 882 "moonshot-identity-management-view.vala"
2674 g_signal_connect_object ((GtkWidget*) self->priv->search_entry, "key-press-event", (GCallback) _identity_manager_view_search_entry_key_press_event_cb_gtk_widget_key_press_event, self, 0);
2675 #line 884 "moonshot-identity-management-view.vala"
2676 self->priv->custom_vbox = (_tmp3_ = g_object_ref_sink (custom_vbox_new (self, FALSE, 6)), _g_object_unref0 (self->priv->custom_vbox), _tmp3_);
2677 #line 886 "moonshot-identity-management-view.vala"
2678 viewport = g_object_ref_sink ((GtkViewport*) gtk_viewport_new (NULL, NULL));
2679 #line 887 "moonshot-identity-management-view.vala"
2680 gtk_container_set_border_width ((GtkContainer*) viewport, (guint) 6);
2681 #line 888 "moonshot-identity-management-view.vala"
2682 gtk_viewport_set_shadow_type (viewport, GTK_SHADOW_NONE);
2683 #line 889 "moonshot-identity-management-view.vala"
2684 gtk_container_add ((GtkContainer*) viewport, (GtkWidget*) self->priv->custom_vbox);
2685 #line 890 "moonshot-identity-management-view.vala"
2686 scroll = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
2687 #line 891 "moonshot-identity-management-view.vala"
2688 gtk_scrolled_window_set_policy (scroll, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
2689 #line 892 "moonshot-identity-management-view.vala"
2690 gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN);
2691 #line 893 "moonshot-identity-management-view.vala"
2692 gtk_scrolled_window_add_with_viewport (scroll, (GtkWidget*) viewport);
2693 #line 895 "moonshot-identity-management-view.vala"
2694 vbox_left = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0));
2695 #line 896 "moonshot-identity-management-view.vala"
2696 gtk_box_pack_start ((GtkBox*) vbox_left, (GtkWidget*) self->priv->search_entry, FALSE, FALSE, (guint) 6);
2697 #line 897 "moonshot-identity-management-view.vala"
2698 gtk_box_pack_start ((GtkBox*) vbox_left, (GtkWidget*) scroll, TRUE, TRUE, (guint) 0);
2699 #line 898 "moonshot-identity-management-view.vala"
2700 gtk_widget_set_size_request ((GtkWidget*) vbox_left, IDENTITY_MANAGER_VIEW_WINDOW_WIDTH, 0);
2701 #line 900 "moonshot-identity-management-view.vala"
2702 login_vbox_title = g_object_ref_sink ((GtkLabel*) gtk_label_new (_ ("Login: ")));
2703 #line 901 "moonshot-identity-management-view.vala"
2704 identity_manager_view_label_make_bold (self, login_vbox_title);
2705 #line 902 "moonshot-identity-management-view.vala"
2706 gtk_misc_set_alignment ((GtkMisc*) login_vbox_title, (float) 0, (float) 0.5);
2707 #line 903 "moonshot-identity-management-view.vala"
2708 username_label = g_object_ref_sink ((GtkLabel*) gtk_label_new (_ ("Username:")));
2709 #line 904 "moonshot-identity-management-view.vala"
2710 gtk_misc_set_alignment ((GtkMisc*) username_label, (float) 1, (float) 0.5);
2711 #line 905 "moonshot-identity-management-view.vala"
2712 self->priv->username_entry = (_tmp4_ = g_object_ref_sink ((GtkEntry*) gtk_entry_new ()), _g_object_unref0 (self->priv->username_entry), _tmp4_);
2713 #line 906 "moonshot-identity-management-view.vala"
2714 password_label = g_object_ref_sink ((GtkLabel*) gtk_label_new (_ ("Password:")));
2715 #line 907 "moonshot-identity-management-view.vala"
2716 gtk_misc_set_alignment ((GtkMisc*) password_label, (float) 1, (float) 0.5);
2717 #line 908 "moonshot-identity-management-view.vala"
2718 self->priv->password_entry = (_tmp5_ = g_object_ref_sink ((GtkEntry*) gtk_entry_new ()), _g_object_unref0 (self->priv->password_entry), _tmp5_);
2719 #line 909 "moonshot-identity-management-view.vala"
2720 gtk_entry_set_invisible_char (self->priv->password_entry, (gunichar) '*');
2721 #line 910 "moonshot-identity-management-view.vala"
2722 gtk_entry_set_visibility (self->priv->password_entry, FALSE);
2723 #line 911 "moonshot-identity-management-view.vala"
2724 remember_checkbutton = g_object_ref_sink ((GtkCheckButton*) gtk_check_button_new_with_label (_ ("Remember password")));
2725 #line 912 "moonshot-identity-management-view.vala"
2726 login_table = g_object_ref_sink ((GtkTable*) gtk_table_new ((guint) 3, (guint) 3, FALSE));
2727 #line 913 "moonshot-identity-management-view.vala"
2728 gtk_table_set_col_spacings (login_table, (guint) 10);
2729 #line 914 "moonshot-identity-management-view.vala"
2730 gtk_table_set_row_spacings (login_table, (guint) 10);
2731 #line 915 "moonshot-identity-management-view.vala"
2732 gtk_table_attach_defaults (login_table, (GtkWidget*) username_label, (guint) 0, (guint) 1, (guint) 0, (guint) 1);
2733 #line 916 "moonshot-identity-management-view.vala"
2734 gtk_table_attach_defaults (login_table, (GtkWidget*) self->priv->username_entry, (guint) 1, (guint) 2, (guint) 0, (guint) 1);
2735 #line 917 "moonshot-identity-management-view.vala"
2736 gtk_table_attach_defaults (login_table, (GtkWidget*) password_label, (guint) 0, (guint) 1, (guint) 1, (guint) 2);
2737 #line 918 "moonshot-identity-management-view.vala"
2738 gtk_table_attach_defaults (login_table, (GtkWidget*) self->priv->password_entry, (guint) 1, (guint) 2, (guint) 1, (guint) 2);
2739 #line 919 "moonshot-identity-management-view.vala"
2740 gtk_table_attach_defaults (login_table, (GtkWidget*) remember_checkbutton, (guint) 1, (guint) 2, (guint) 2, (guint) 3);
2741 #line 920 "moonshot-identity-management-view.vala"
2742 login_vbox_alignment = g_object_ref_sink ((GtkAlignment*) gtk_alignment_new ((float) 0, (float) 0, (float) 0, (float) 0));
2743 #line 921 "moonshot-identity-management-view.vala"
2744 gtk_alignment_set_padding (login_vbox_alignment, (guint) 0, (guint) 0, (guint) 12, (guint) 0);
2745 #line 922 "moonshot-identity-management-view.vala"
2746 gtk_container_add ((GtkContainer*) login_vbox_alignment, (GtkWidget*) login_table);
2747 #line 923 "moonshot-identity-management-view.vala"
2748 login_vbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 6));
2749 #line 924 "moonshot-identity-management-view.vala"
2750 gtk_box_pack_start ((GtkBox*) login_vbox, (GtkWidget*) login_vbox_title, FALSE, TRUE, (guint) 0);
2751 #line 925 "moonshot-identity-management-view.vala"
2752 gtk_box_pack_start ((GtkBox*) login_vbox, (GtkWidget*) login_vbox_alignment, FALSE, TRUE, (guint) 0);
2753 #line 927 "moonshot-identity-management-view.vala"
2754 services_vbox_title = g_object_ref_sink ((GtkLabel*) gtk_label_new (_ ("Services:")));
2755 #line 928 "moonshot-identity-management-view.vala"
2756 identity_manager_view_label_make_bold (self, services_vbox_title);
2757 #line 929 "moonshot-identity-management-view.vala"
2758 gtk_misc_set_alignment ((GtkMisc*) services_vbox_title, (float) 0, (float) 0.5);
2759 #line 930 "moonshot-identity-management-view.vala"
2760 services_vbox_alignment = g_object_ref_sink ((GtkAlignment*) gtk_alignment_new ((float) 0, (float) 0, (float) 0, (float) 0));
2761 #line 931 "moonshot-identity-management-view.vala"
2762 gtk_alignment_set_padding (services_vbox_alignment, (guint) 0, (guint) 0, (guint) 12, (guint) 0);
2763 #line 932 "moonshot-identity-management-view.vala"
2764 self->priv->services_internal_vbox = (_tmp6_ = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (TRUE, 6)), _g_object_unref0 (self->priv->services_internal_vbox), _tmp6_);
2765 #line 933 "moonshot-identity-management-view.vala"
2766 gtk_container_add ((GtkContainer*) services_vbox_alignment, (GtkWidget*) self->priv->services_internal_vbox);
2767 #line 934 "moonshot-identity-management-view.vala"
2768 services_vbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 6));
2769 #line 935 "moonshot-identity-management-view.vala"
2770 gtk_box_pack_start ((GtkBox*) services_vbox, (GtkWidget*) services_vbox_title, FALSE, TRUE, (guint) 0);
2771 #line 936 "moonshot-identity-management-view.vala"
2772 gtk_box_pack_start ((GtkBox*) services_vbox, (GtkWidget*) services_vbox_alignment, FALSE, TRUE, (guint) 0);
2773 #line 938 "moonshot-identity-management-view.vala"
2774 self->priv->vbox_right = (_tmp7_ = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 18)), _g_object_unref0 (self->priv->vbox_right), _tmp7_);
2775 #line 939 "moonshot-identity-management-view.vala"
2776 gtk_box_pack_start ((GtkBox*) self->priv->vbox_right, (GtkWidget*) login_vbox, FALSE, TRUE, (guint) 0);
2777 #line 940 "moonshot-identity-management-view.vala"
2778 gtk_box_pack_start ((GtkBox*) self->priv->vbox_right, (GtkWidget*) services_vbox, FALSE, TRUE, (guint) 0);
2779 #line 942 "moonshot-identity-management-view.vala"
2780 hbox = g_object_ref_sink ((GtkHBox*) gtk_hbox_new (FALSE, 12));
2781 #line 943 "moonshot-identity-management-view.vala"
2782 gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) vbox_left, TRUE, TRUE, (guint) 0);
2783 #line 944 "moonshot-identity-management-view.vala"
2784 gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->vbox_right, FALSE, FALSE, (guint) 0);
2785 #line 946 "moonshot-identity-management-view.vala"
2786 main_vbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0));
2787 #line 947 "moonshot-identity-management-view.vala"
2788 gtk_container_set_border_width ((GtkContainer*) main_vbox, (guint) 12);
2789 #line 960 "moonshot-identity-management-view.vala"
2790 menubar = _g_object_ref0 (gtk_ui_manager_get_widget (self->priv->ui_manager, "/MenuBar"));
2791 #line 961 "moonshot-identity-management-view.vala"
2792 gtk_box_pack_start ((GtkBox*) main_vbox, menubar, FALSE, FALSE, (guint) 0);
2793 #line 963 "moonshot-identity-management-view.vala"
2794 gtk_box_pack_start ((GtkBox*) main_vbox, (GtkWidget*) hbox, TRUE, TRUE, (guint) 0);
2795 #line 964 "moonshot-identity-management-view.vala"
2796 gtk_container_add ((GtkContainer*) self, (GtkWidget*) main_vbox);
2797 #line 965 "moonshot-identity-management-view.vala"
2798 gtk_widget_show_all ((GtkWidget*) main_vbox);
2799 #line 966 "moonshot-identity-management-view.vala"
2800 gtk_widget_hide ((GtkWidget*) self->priv->vbox_right);
2801 #line 2761 "moonshot-identity-management-view.c"
2802 _g_object_unref0 (menubar);
2803 _g_object_unref0 (main_vbox);
2804 _g_object_unref0 (hbox);
2805 _g_object_unref0 (services_vbox);
2806 _g_object_unref0 (services_vbox_alignment);
2807 _g_object_unref0 (services_vbox_title);
2808 _g_object_unref0 (login_vbox);
2809 _g_object_unref0 (login_vbox_alignment);
2810 _g_object_unref0 (login_table);
2811 _g_object_unref0 (remember_checkbutton);
2812 _g_object_unref0 (password_label);
2813 _g_object_unref0 (username_label);
2814 _g_object_unref0 (login_vbox_title);
2815 _g_object_unref0 (vbox_left);
2816 _g_object_unref0 (scroll);
2817 _g_object_unref0 (viewport);
2821 #line 969 "moonshot-identity-management-view.vala"
2822 static void identity_manager_view_set_atk_name_description (IdentityManagerView* self, GtkWidget* widget, const char* name, const char* description) {
2823 #line 2783 "moonshot-identity-management-view.c"
2824 AtkObject* atk_widget;
2825 #line 969 "moonshot-identity-management-view.vala"
2826 g_return_if_fail (self != NULL);
2827 #line 969 "moonshot-identity-management-view.vala"
2828 g_return_if_fail (widget != NULL);
2829 #line 969 "moonshot-identity-management-view.vala"
2830 g_return_if_fail (name != NULL);
2831 #line 969 "moonshot-identity-management-view.vala"
2832 g_return_if_fail (description != NULL);
2833 #line 971 "moonshot-identity-management-view.vala"
2834 atk_widget = _g_object_ref0 (gtk_widget_get_accessible (widget));
2835 #line 973 "moonshot-identity-management-view.vala"
2836 atk_object_set_name (atk_widget, name);
2837 #line 974 "moonshot-identity-management-view.vala"
2838 atk_object_set_description (atk_widget, description);
2839 #line 2799 "moonshot-identity-management-view.c"
2840 _g_object_unref0 (atk_widget);
2844 #line 7766 "gtk+-2.0.vapi"
2845 static void _gtk_main_quit_gtk_object_destroy (GtkObject* _sender, gpointer self) {
2846 #line 2806 "moonshot-identity-management-view.c"
2851 #line 71 "moonshot-identity-management-view.vala"
2852 static void _identity_manager_view_on_card_list_changed_identity_manager_model_card_list_changed (IdentityManagerModel* _sender, gpointer self) {
2853 #line 2813 "moonshot-identity-management-view.c"
2854 identity_manager_view_on_card_list_changed (self);
2858 #line 977 "moonshot-identity-management-view.vala"
2859 static void identity_manager_view_connect_signals (IdentityManagerView* self) {
2860 #line 977 "moonshot-identity-management-view.vala"
2861 g_return_if_fail (self != NULL);
2862 #line 979 "moonshot-identity-management-view.vala"
2863 g_signal_connect ((GtkObject*) self, "destroy", (GCallback) _gtk_main_quit_gtk_object_destroy, NULL);
2864 #line 980 "moonshot-identity-management-view.vala"
2865 g_signal_connect_object (self->identities_manager, "card-list-changed", (GCallback) _identity_manager_view_on_card_list_changed_identity_manager_model_card_list_changed, self, 0);
2866 #line 2826 "moonshot-identity-management-view.c"
2870 static void identity_manager_view_class_init (IdentityManagerViewClass * klass) {
2871 identity_manager_view_parent_class = g_type_class_peek_parent (klass);
2872 g_type_class_add_private (klass, sizeof (IdentityManagerViewPrivate));
2873 G_OBJECT_CLASS (klass)->finalize = identity_manager_view_finalize;
2877 static void identity_manager_view_instance_init (IdentityManagerView * self) {
2878 self->priv = IDENTITY_MANAGER_VIEW_GET_PRIVATE (self);
2879 self->priv->ui_manager = gtk_ui_manager_new ();
2883 static void identity_manager_view_finalize (GObject* obj) {
2884 IdentityManagerView * self;
2885 self = IDENTITY_MANAGER_VIEW (obj);
2886 _identity_manager_app_unref0 (self->parent_app);
2887 _g_object_unref0 (self->priv->ui_manager);
2888 _g_object_unref0 (self->priv->search_entry);
2889 _g_object_unref0 (self->priv->vbox_right);
2890 _g_object_unref0 (self->priv->custom_vbox);
2891 _g_object_unref0 (self->priv->services_internal_vbox);
2892 _g_object_unref0 (self->priv->username_entry);
2893 _g_object_unref0 (self->priv->password_entry);
2894 _g_object_unref0 (self->priv->filter);
2895 _g_object_unref0 (self->identities_manager);
2896 __g_slist_free_g_object_unref0 (self->priv->candidates);
2897 _g_object_unref0 (self->priv->default_id_card);
2898 _g_queue_free0 (self->request_queue);
2899 _g_hash_table_unref0 (self->priv->service_button_map);
2900 G_OBJECT_CLASS (identity_manager_view_parent_class)->finalize (obj);
2904 GType identity_manager_view_get_type (void) {
2905 static volatile gsize identity_manager_view_type_id__volatile = 0;
2906 if (g_once_init_enter (&identity_manager_view_type_id__volatile)) {
2907 static const GTypeInfo g_define_type_info = { sizeof (IdentityManagerViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) identity_manager_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (IdentityManagerView), 0, (GInstanceInitFunc) identity_manager_view_instance_init, NULL };
2908 GType identity_manager_view_type_id;
2909 identity_manager_view_type_id = g_type_register_static (GTK_TYPE_WINDOW, "IdentityManagerView", &g_define_type_info, 0);
2910 g_once_init_leave (&identity_manager_view_type_id__volatile, identity_manager_view_type_id);
2912 return identity_manager_view_type_id__volatile;
2916 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2917 if ((array != NULL) && (destroy_func != NULL)) {
2919 for (i = 0; i < array_length; i = i + 1) {
2920 if (((gpointer*) array)[i] != NULL) {
2921 destroy_func (((gpointer*) array)[i]);
2928 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2929 _vala_array_destroy (array, array_length, destroy_func);
2934 static gint _vala_array_length (gpointer array) {
2938 while (((gpointer*) array)[length]) {
2946 static int _vala_strcmp0 (const char * str1, const char * str2) {
2948 return -(str1 != str2);
2951 return str1 != str2;
2953 return strcmp (str1, str2);