regenerate artifacts
[moonshot-ui.git] / src / moonshot-identity-management-view.c
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 */
3
4
5 #include <glib.h>
6 #include <glib-object.h>
7 #include <gtk/gtk.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <gdk-pixbuf/gdk-pixdata.h>
11 #include <gdk/gdk.h>
12 #include <gee.h>
13 #include <glib/gi18n-lib.h>
14 #include <pango/pango.h>
15 #include <float.h>
16 #include <math.h>
17 #include <config.h>
18 #include <stdio.h>
19 #include <atk/atk.h>
20
21
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))
28
29 typedef struct _IdentityManagerView IdentityManagerView;
30 typedef struct _IdentityManagerViewClass IdentityManagerViewClass;
31 typedef struct _IdentityManagerViewPrivate IdentityManagerViewPrivate;
32
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))
39
40 typedef struct _IdentityManagerApp IdentityManagerApp;
41 typedef struct _IdentityManagerAppClass IdentityManagerAppClass;
42
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))
49
50 typedef struct _IdentityManagerModel IdentityManagerModel;
51 typedef struct _IdentityManagerModelClass IdentityManagerModelClass;
52
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))
59
60 typedef struct _IdentityRequest IdentityRequest;
61 typedef struct _IdentityRequestClass IdentityRequestClass;
62
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))
69
70 typedef struct _CustomVBox CustomVBox;
71 typedef struct _CustomVBoxClass CustomVBoxClass;
72
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))
79
80 typedef struct _IdCard IdCard;
81 typedef struct _IdCardClass IdCardClass;
82
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))
91
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))
98
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)))
102
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))
109
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)))
114
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)))
119
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))
126
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)))
131
132 struct _IdentityManagerView {
133         GtkWindow parent_instance;
134         IdentityManagerViewPrivate * priv;
135         IdentityManagerApp* parent_app;
136         IdentityManagerModel* identities_manager;
137         GQueue* request_queue;
138 };
139
140 struct _IdentityManagerViewClass {
141         GtkWindowClass parent_class;
142 };
143
144 struct _IdentityManagerViewPrivate {
145         GtkUIManager* ui_manager;
146         GtkEntry* search_entry;
147         GtkVBox* vbox_right;
148         CustomVBox* custom_vbox;
149         GtkVBox* services_internal_vbox;
150         GtkEntry* username_entry;
151         GtkEntry* password_entry;
152         GtkListStore* listmodel;
153         GtkTreeModelFilter* filter;
154         GSList* candidates;
155         IdCard* default_id_card;
156         GHashTable* service_button_map;
157 };
158
159 typedef enum  {
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;
167
168 struct _IdentityManagerApp {
169         GTypeInstance parent_instance;
170         volatile int ref_count;
171         IdentityManagerAppPrivate * priv;
172         IdentityManagerModel* model;
173 };
174
175 struct _IdentityManagerAppClass {
176         GTypeClass parent_class;
177         void (*finalize) (IdentityManagerApp *self);
178 };
179
180 struct _IdentityRequest {
181         GObject parent_instance;
182         IdentityRequestPrivate * priv;
183         IdCard* id_card;
184         gboolean complete;
185         gboolean select_default;
186         char* nai;
187         char* password;
188         char* service;
189 };
190
191 struct _IdentityRequestClass {
192         GObjectClass parent_class;
193 };
194
195 struct _Rule {
196         char* pattern;
197         char* always_confirm;
198 };
199
200 struct _Block1Data {
201         int _ref_count_;
202         IdentityManagerView * self;
203         IdCard* identity;
204 };
205
206
207 static gpointer identity_manager_view_parent_class = NULL;
208
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))
222 enum  {
223         IDENTITY_MANAGER_VIEW_DUMMY_PROPERTY
224 };
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);
348
349
350
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);
358         }
359         return identity_manager_view_columns_type_id__volatile;
360 }
361
362
363 static void _g_slist_free_g_object_unref (GSList* self) {
364         g_slist_foreach (self, (GFunc) g_object_unref, NULL);
365         g_slist_free (self);
366 }
367
368
369 static gpointer _identity_manager_app_ref0 (gpointer self) {
370         return self ? identity_manager_app_ref (self) : NULL;
371 }
372
373
374 static gpointer _g_object_ref0 (gpointer self) {
375         return self ? g_object_ref (self) : NULL;
376 }
377
378
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_;
385         GQueue* _tmp2_;
386         GHashTable* _tmp3_;
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"
414         return self;
415 }
416
417
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"
423 }
424
425
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"
433 }
434
435
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"
445 }
446
447
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"
459         return result;
460 #line 461 "moonshot-identity-management-view.c"
461 }
462
463
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;
468         IdCard* id_card;
469         char* entry_text;
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"
476         id_card = NULL;
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"
482                 result = FALSE;
483                 _g_object_unref0 (id_card);
484 #line 88 "moonshot-identity-management-view.vala"
485                 return result;
486 #line 487 "moonshot-identity-management-view.c"
487         }
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"
495                 {
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) {
502                                 IdCard* candidate;
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"
506                                 {
507 #line 95 "moonshot-identity-management-view.vala"
508                                         if (candidate == id_card) {
509 #line 96 "moonshot-identity-management-view.vala"
510                                                 is_candidate = TRUE;
511 #line 512 "moonshot-identity-management-view.c"
512                                         }
513                                         _g_object_unref0 (candidate);
514                                 }
515                         }
516                 }
517 #line 98 "moonshot-identity-management-view.vala"
518                 if (!is_candidate) {
519 #line 520 "moonshot-identity-management-view.c"
520                         result = FALSE;
521                         _g_object_unref0 (id_card);
522 #line 99 "moonshot-identity-management-view.vala"
523                         return result;
524 #line 525 "moonshot-identity-management-view.c"
525                 }
526         }
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"
532                 _tmp0_ = TRUE;
533 #line 534 "moonshot-identity-management-view.c"
534         } else {
535 #line 103 "moonshot-identity-management-view.vala"
536                 _tmp0_ = _vala_strcmp0 (entry_text, "") == 0;
537 #line 538 "moonshot-identity-management-view.c"
538         }
539 #line 103 "moonshot-identity-management-view.vala"
540         if (_tmp0_) {
541 #line 542 "moonshot-identity-management-view.c"
542                 result = TRUE;
543                 _g_free0 (entry_text);
544                 _g_object_unref0 (id_card);
545 #line 105 "moonshot-identity-management-view.vala"
546                 return result;
547 #line 548 "moonshot-identity-management-view.c"
548         }
549         {
550                 char** _tmp1_;
551                 char** search_text_collection;
552                 int search_text_collection_length1;
553                 int search_text_it;
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) {
559                         char* search_text;
560                         search_text = g_strdup (search_text_collection[search_text_it]);
561                         {
562                                 char* search_text_casefold;
563                                 gint _tmp2_;
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"
569                                         continue;
570 #line 571 "moonshot-identity-management-view.c"
571                                 }
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"
583                                                 result = TRUE;
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"
591                                                 return result;
592 #line 593 "moonshot-identity-management-view.c"
593                                         }
594                                         _g_free0 (issuer_casefold);
595                                 }
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"
605                                                 result = TRUE;
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"
613                                                 return result;
614 #line 615 "moonshot-identity-management-view.c"
615                                         }
616                                         _g_free0 (display_name_casefold);
617                                 }
618 #line 132 "moonshot-identity-management-view.vala"
619                                 if (_tmp2_ > 0) {
620 #line 621 "moonshot-identity-management-view.c"
621                                         {
622                                                 gint _tmp3_;
623                                                 char** service_collection;
624                                                 int service_collection_length1;
625                                                 int service_it;
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) {
631                                                         char* service;
632                                                         service = g_strdup (service_collection[service_it]);
633                                                         {
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"
640                                                                         result = TRUE;
641                                                                         _g_free0 (service_casefold);
642                                                                         _g_free0 (service);
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"
649                                                                         return result;
650 #line 651 "moonshot-identity-management-view.c"
651                                                                 }
652                                                                 _g_free0 (service_casefold);
653                                                                 _g_free0 (service);
654                                                         }
655                                                 }
656                                         }
657                                 }
658                                 _g_free0 (search_text_casefold);
659                                 _g_free0 (search_text);
660                         }
661                 }
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"
665         }
666         result = FALSE;
667         _g_free0 (entry_text);
668         _g_object_unref0 (id_card);
669 #line 143 "moonshot-identity-management-view.vala"
670         return result;
671 #line 672 "moonshot-identity-management-view.c"
672 }
673
674
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"
678         gboolean result;
679         result = identity_manager_view_visible_func (self, model, iter);
680         return result;
681 }
682
683
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"
697 }
698
699
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"
711         } else {
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"
715         }
716 }
717
718
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"
722         gboolean has_text;
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"
738 }
739
740
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"
752         }
753         result = FALSE;
754 #line 189 "moonshot-identity-management-view.vala"
755         return result;
756 #line 757 "moonshot-identity-management-view.c"
757 }
758
759
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"
763         GList* children;
764         IdCard* _tmp0_;
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"
771         {
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"
782                         {
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"
786                         }
787                 }
788         }
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"
799                 return;
800 #line 801 "moonshot-identity-management-view.c"
801         }
802         {
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"
807                 while (TRUE) {
808 #line 809 "moonshot-identity-management-view.c"
809                         IdCard* id_card;
810 #line 204 "moonshot-identity-management-view.vala"
811                         if (!gee_iterator_next (_id_card_it)) {
812 #line 204 "moonshot-identity-management-view.vala"
813                                 break;
814 #line 815 "moonshot-identity-management-view.c"
815                         }
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);
824                 }
825                 _g_object_unref0 (_id_card_it);
826         }
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"
830                 IdCard* _tmp1_;
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"
834         }
835         _g_object_unref0 (card_list);
836         _g_list_free0 (children);
837 }
838
839
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"
843         IdCard* id_card;
844         char* _tmp0_;
845         GList* children;
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"
859                 char* _tmp1_;
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"
863         }
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"
869         {
870                 GList* hbox_collection;
871                 GList* hbox_it;
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) {
876                         GtkWidget* hbox;
877 #line 221 "moonshot-identity-management-view.vala"
878                         hbox = (GtkWidget*) hbox_it->data;
879 #line 880 "moonshot-identity-management-view.c"
880                         {
881 #line 222 "moonshot-identity-management-view.vala"
882                                 gtk_object_destroy ((GtkObject*) hbox);
883 #line 884 "moonshot-identity-management-view.c"
884                         }
885                 }
886         }
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);
891         _g_free0 (_tmp0_);
892         _g_object_unref0 (id_card);
893 }
894
895
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"
909         }
910 }
911
912
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"
924 }
925
926
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;
931         IdCard* id_card;
932         char** _tmp0_ = NULL;
933         char** _tmp1_;
934         gint _tmp1__length1;
935         char** _tmp2_;
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"
951         }
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"
965         result = id_card;
966 #line 256 "moonshot-identity-management-view.vala"
967         return result;
968 #line 969 "moonshot-identity-management-view.c"
969 }
970
971
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};
976         GdkPixbuf* pixbuf;
977         GdkPixbuf* _tmp0_;
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"
983         pixbuf = NULL;
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);
992 }
993
994
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};
999         char* issuer;
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"
1005         issuer = NULL;
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"
1009                 {
1010                         gboolean _tmp0_;
1011 #line 280 "moonshot-identity-management-view.vala"
1012                         _tmp0_ = TRUE;
1013 #line 280 "moonshot-identity-management-view.vala"
1014                         while (TRUE) {
1015 #line 280 "moonshot-identity-management-view.vala"
1016                                 if (!_tmp0_) {
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"
1020                                                 break;
1021 #line 1022 "moonshot-identity-management-view.c"
1022                                         }
1023                                 }
1024 #line 280 "moonshot-identity-management-view.vala"
1025                                 _tmp0_ = FALSE;
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"
1033                                         break;
1034 #line 1035 "moonshot-identity-management-view.c"
1035                                 }
1036                         }
1037                 }
1038         }
1039         _g_free0 (issuer);
1040 }
1041
1042
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);
1047 }
1048
1049
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);
1054 }
1055
1056
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"
1064 }
1065
1066
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);
1071 }
1072
1073
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);
1078 }
1079
1080
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);
1085 }
1086
1087
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);
1112 }
1113
1114
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) {
1125                 *candidate = NULL;
1126         }
1127         {
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"
1134                 while (TRUE) {
1135 #line 1136 "moonshot-identity-management-view.c"
1136                         IdCard* id_card;
1137 #line 310 "moonshot-identity-management-view.vala"
1138                         if (!gee_iterator_next (_id_card_it)) {
1139 #line 310 "moonshot-identity-management-view.vala"
1140                                 break;
1141 #line 1142 "moonshot-identity-management-view.c"
1142                         }
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"
1150                                         {
1151                                                 gint i;
1152 #line 316 "moonshot-identity-management-view.vala"
1153                                                 i = 0;
1154 #line 1155 "moonshot-identity-management-view.c"
1155                                                 {
1156                                                         gboolean _tmp2_;
1157 #line 316 "moonshot-identity-management-view.vala"
1158                                                         _tmp2_ = TRUE;
1159 #line 316 "moonshot-identity-management-view.vala"
1160                                                         while (TRUE) {
1161 #line 1162 "moonshot-identity-management-view.c"
1162                                                                 char* tmp;
1163 #line 316 "moonshot-identity-management-view.vala"
1164                                                                 if (!_tmp2_) {
1165 #line 316 "moonshot-identity-management-view.vala"
1166                                                                         i++;
1167 #line 1168 "moonshot-identity-management-view.c"
1168                                                                 }
1169 #line 316 "moonshot-identity-management-view.vala"
1170                                                                 _tmp2_ = FALSE;
1171 #line 316 "moonshot-identity-management-view.vala"
1172                                                                 if (!(i < 1000)) {
1173 #line 316 "moonshot-identity-management-view.vala"
1174                                                                         break;
1175 #line 1176 "moonshot-identity-management-view.c"
1176                                                                 }
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"
1182                                                                         char* _tmp3_;
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"
1186                                                                         _g_free0 (tmp);
1187 #line 322 "moonshot-identity-management-view.vala"
1188                                                                         break;
1189 #line 1190 "moonshot-identity-management-view.c"
1190                                                                 }
1191                                                                 _g_free0 (tmp);
1192                                                         }
1193                                                 }
1194                                         }
1195                                 }
1196                                 result = FALSE;
1197                                 _g_object_unref0 (id_card);
1198                                 _g_object_unref0 (_id_card_it);
1199 #line 326 "moonshot-identity-management-view.vala"
1200                                 return result;
1201 #line 1202 "moonshot-identity-management-view.c"
1202                         }
1203                         _g_object_unref0 (id_card);
1204                 }
1205                 _g_object_unref0 (_id_card_it);
1206         }
1207         result = TRUE;
1208 #line 330 "moonshot-identity-management-view.vala"
1209         return result;
1210 #line 1211 "moonshot-identity-management-view.c"
1211 }
1212
1213
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"
1217         char* candidate;
1218         char* _tmp0_ = NULL;
1219         gboolean _tmp1_;
1220         char* _tmp2_;
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"
1226         candidate = NULL;
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"
1232         }
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);
1237 }
1238
1239
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;
1245         gint ret;
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"
1263                 result = TRUE;
1264                 _g_object_unref0 (dialog);
1265 #line 369 "moonshot-identity-management-view.vala"
1266                 return result;
1267 #line 1268 "moonshot-identity-management-view.c"
1268         }
1269         result = FALSE;
1270         _g_object_unref0 (dialog);
1271 #line 372 "moonshot-identity-management-view.vala"
1272         return result;
1273 #line 1274 "moonshot-identity-management-view.c"
1274 }
1275
1276
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;
1281         gint _result_;
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"
1289         switch (_result_) {
1290 #line 1291 "moonshot-identity-management-view.c"
1291                 case GTK_RESPONSE_OK:
1292                 {
1293                         IdCard* _tmp0_;
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"
1299                         break;
1300 #line 1301 "moonshot-identity-management-view.c"
1301                 }
1302                 default:
1303                 {
1304 #line 385 "moonshot-identity-management-view.vala"
1305                         break;
1306 #line 1307 "moonshot-identity-management-view.c"
1307                 }
1308         }
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);
1313 }
1314
1315
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"
1325 }
1326
1327
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"
1331         IdCard* id_card;
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);
1344 }
1345
1346
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};
1351         IdCard* id_card;
1352         GList* children;
1353 #line 402 "moonshot-identity-management-view.vala"
1354         g_return_if_fail (self != NULL);
1355 #line 1356 "moonshot-identity-management-view.c"
1356         id_card = NULL;
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"
1360         {
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"
1371                         {
1372 #line 409 "moonshot-identity-management-view.vala"
1373                                 gtk_object_destroy ((GtkObject*) id_card_widget);
1374 #line 1375 "moonshot-identity-management-view.c"
1375                         }
1376                 }
1377         }
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"
1381                 {
1382                         gboolean _tmp0_;
1383 #line 413 "moonshot-identity-management-view.vala"
1384                         _tmp0_ = TRUE;
1385 #line 413 "moonshot-identity-management-view.vala"
1386                         while (TRUE) {
1387 #line 413 "moonshot-identity-management-view.vala"
1388                                 if (!_tmp0_) {
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"
1392                                                 break;
1393 #line 1394 "moonshot-identity-management-view.c"
1394                                         }
1395                                 }
1396 #line 413 "moonshot-identity-management-view.vala"
1397                                 _tmp0_ = FALSE;
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"
1403                         }
1404                 }
1405         }
1406         _g_list_free0 (children);
1407         _g_object_unref0 (id_card);
1408 }
1409
1410
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"
1414         IdCard* id_card;
1415         GtkMessageDialog* dialog;
1416         gint _result_;
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"
1428         switch (_result_) {
1429 #line 1430 "moonshot-identity-management-view.c"
1430                 case GTK_RESPONSE_YES:
1431                 {
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"
1435                         break;
1436 #line 1437 "moonshot-identity-management-view.c"
1437                 }
1438                 default:
1439                 {
1440 #line 439 "moonshot-identity-management-view.vala"
1441                         break;
1442 #line 1443 "moonshot-identity-management-view.c"
1443                 }
1444         }
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);
1450 }
1451
1452
1453 static void _g_slist_free_g_free (GSList* self) {
1454         g_slist_foreach (self, (GFunc) g_free, NULL);
1455         g_slist_free (self);
1456 }
1457
1458
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"
1468         result = FALSE;
1469 #line 574 "moonshot-identity-management-view.vala"
1470         return result;
1471 #line 1472 "moonshot-identity-management-view.c"
1472 }
1473
1474
1475 #line 574 "moonshot-identity-management-view.vala"
1476 static gboolean __lambda3__gsource_func (gpointer self) {
1477 #line 1478 "moonshot-identity-management-view.c"
1478         gboolean result;
1479         result = _lambda3_ (self);
1480         return result;
1481 }
1482
1483
1484 static Block1Data* block1_data_ref (Block1Data* _data1_) {
1485         g_atomic_int_inc (&_data1_->_ref_count_);
1486         return _data1_;
1487 }
1488
1489
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_);
1495         }
1496 }
1497
1498
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"
1520         } else {
1521 #line 450 "moonshot-identity-management-view.vala"
1522                 _tmp0_ = FALSE;
1523 #line 1524 "moonshot-identity-management-view.c"
1524         }
1525 #line 450 "moonshot-identity-management-view.vala"
1526         if (_tmp0_) {
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"
1530         }
1531 #line 454 "moonshot-identity-management-view.vala"
1532         if (request->select_default) {
1533 #line 1534 "moonshot-identity-management-view.c"
1534                 IdCard* _tmp1_;
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"
1538         }
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;
1543                 gboolean has_nai;
1544                 gboolean _tmp3_ = FALSE;
1545                 gboolean has_srv;
1546                 gboolean confirm;
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"
1554                 } else {
1555 #line 461 "moonshot-identity-management-view.vala"
1556                         _tmp2_ = FALSE;
1557 #line 1558 "moonshot-identity-management-view.c"
1558                 }
1559 #line 461 "moonshot-identity-management-view.vala"
1560                 has_nai = _tmp2_;
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"
1566                 } else {
1567 #line 462 "moonshot-identity-management-view.vala"
1568                         _tmp3_ = FALSE;
1569 #line 1570 "moonshot-identity-management-view.c"
1570                 }
1571 #line 462 "moonshot-identity-management-view.vala"
1572                 has_srv = _tmp3_;
1573 #line 463 "moonshot-identity-management-view.vala"
1574                 confirm = FALSE;
1575 #line 464 "moonshot-identity-management-view.vala"
1576                 nai_provided = NULL;
1577 #line 1578 "moonshot-identity-management-view.c"
1578                 {
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"
1585                         while (TRUE) {
1586 #line 1587 "moonshot-identity-management-view.c"
1587                                 IdCard* id;
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"
1592                                         break;
1593 #line 1594 "moonshot-identity-management-view.c"
1594                                 }
1595 #line 466 "moonshot-identity-management-view.vala"
1596                                 id = (IdCard*) gee_iterator_get (_id_it);
1597 #line 469 "moonshot-identity-management-view.vala"
1598                                 if (has_nai) {
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"
1602                                 } else {
1603 #line 469 "moonshot-identity-management-view.vala"
1604                                         _tmp6_ = FALSE;
1605 #line 1606 "moonshot-identity-management-view.c"
1606                                 }
1607 #line 469 "moonshot-identity-management-view.vala"
1608                                 if (_tmp6_) {
1609 #line 1610 "moonshot-identity-management-view.c"
1610                                         IdCard* _tmp7_;
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"
1618                                         continue;
1619 #line 1620 "moonshot-identity-management-view.c"
1620                                 }
1621 #line 477 "moonshot-identity-management-view.vala"
1622                                 if (has_srv) {
1623 #line 1624 "moonshot-identity-management-view.c"
1624                                         {
1625                                                 gint _tmp8_;
1626                                                 char** srv_collection;
1627                                                 int srv_collection_length1;
1628                                                 int srv_it;
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) {
1634                                                         char* srv;
1635                                                         srv = g_strdup (srv_collection[srv_it]);
1636                                                         {
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"
1642                                                                         _g_free0 (srv);
1643 #line 484 "moonshot-identity-management-view.vala"
1644                                                                         continue;
1645 #line 1646 "moonshot-identity-management-view.c"
1646                                                                 }
1647                                                                 _g_free0 (srv);
1648                                                         }
1649                                                 }
1650                                         }
1651                                 }
1652                                 _g_object_unref0 (id);
1653                         }
1654                         _g_object_unref0 (_id_it);
1655                 }
1656 #line 491 "moonshot-identity-management-view.vala"
1657                 if (has_srv) {
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"
1661                 } else {
1662 #line 491 "moonshot-identity-management-view.vala"
1663                         _tmp9_ = FALSE;
1664 #line 1665 "moonshot-identity-management-view.c"
1665                 }
1666 #line 491 "moonshot-identity-management-view.vala"
1667                 if (_tmp9_) {
1668 #line 1669 "moonshot-identity-management-view.c"
1669                         {
1670                                 GSList* id_collection;
1671                                 GSList* id_it;
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) {
1676                                         IdCard* id;
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"
1680                                         {
1681                                                 gint i;
1682                                                 GSList* services_list;
1683                                                 gboolean has_service;
1684                                                 gint services_length1;
1685                                                 gint _services_size_;
1686                                                 char** _tmp15_;
1687                                                 gint _tmp14_;
1688                                                 char** services;
1689                                                 char** _tmp17_;
1690 #line 495 "moonshot-identity-management-view.vala"
1691                                                 i = 0;
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"
1697                                                 {
1698                                                         gint _tmp10_;
1699                                                         char** srv_collection;
1700                                                         int srv_collection_length1;
1701                                                         int srv_it;
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) {
1707                                                                 char* srv;
1708                                                                 srv = g_strdup (srv_collection[srv_it]);
1709                                                                 {
1710 #line 501 "moonshot-identity-management-view.vala"
1711                                                                         if (_vala_strcmp0 (srv, request->service) == 0) {
1712 #line 503 "moonshot-identity-management-view.vala"
1713                                                                                 has_service = TRUE;
1714 #line 1715 "moonshot-identity-management-view.c"
1715                                                                                 _g_free0 (srv);
1716 #line 504 "moonshot-identity-management-view.vala"
1717                                                                                 continue;
1718 #line 1719 "moonshot-identity-management-view.c"
1719                                                                         }
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"
1723                                                                         _g_free0 (srv);
1724                                                                 }
1725                                                         }
1726                                                 }
1727 #line 509 "moonshot-identity-management-view.vala"
1728                                                 if (!has_service) {
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"
1733                                                         continue;
1734 #line 1735 "moonshot-identity-management-view.c"
1735                                                 }
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;
1740                                                         char** _tmp12_;
1741                                                         gint _tmp12__length1;
1742                                                         char** _tmp13_;
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"
1752                                                         continue;
1753 #line 1754 "moonshot-identity-management-view.c"
1754                                                 }
1755                                                 services = (_tmp15_ = g_new0 (char*, (_tmp14_ = g_slist_length (services_list)) + 1), services_length1 = _tmp14_, _services_size_ = services_length1, _tmp15_);
1756                                                 {
1757                                                         GSList* srv_collection;
1758                                                         GSList* srv_it;
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) {
1763                                                                 char* srv;
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"
1767                                                                 {
1768                                                                         char* _tmp16_;
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"
1772                                                                         i++;
1773 #line 1774 "moonshot-identity-management-view.c"
1774                                                                         _g_free0 (srv);
1775                                                                 }
1776                                                         }
1777                                                 }
1778 #line 525 "moonshot-identity-management-view.vala"
1779                                                 _tmp17_ = services;
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);
1786                                         }
1787                                 }
1788                         }
1789                 }
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"
1793                         {
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"
1800                                 while (TRUE) {
1801 #line 1802 "moonshot-identity-management-view.c"
1802                                         IdCard* id;
1803 #line 534 "moonshot-identity-management-view.vala"
1804                                         if (!gee_iterator_next (_id_it)) {
1805 #line 534 "moonshot-identity-management-view.vala"
1806                                                 break;
1807 #line 1808 "moonshot-identity-management-view.c"
1808                                         }
1809 #line 534 "moonshot-identity-management-view.vala"
1810                                         id = (IdCard*) gee_iterator_get (_id_it);
1811 #line 1812 "moonshot-identity-management-view.c"
1812                                         {
1813                                                 gint _tmp20_;
1814                                                 Rule* rule_collection;
1815                                                 int rule_collection_length1;
1816                                                 int rule_it;
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) {
1822                                                         Rule _tmp21_ = {0};
1823                                                         Rule rule;
1824                                                         rule = (rule_copy (&rule_collection[rule_it], &_tmp21_), _tmp21_);
1825                                                         {
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"
1831                                                                         continue;
1832 #line 1833 "moonshot-identity-management-view.c"
1833                                                                 }
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"
1839                                                                         confirm = TRUE;
1840 #line 1841 "moonshot-identity-management-view.c"
1841                                                                 }
1842                                                                 rule_destroy (&rule);
1843                                                         }
1844                                                 }
1845                                         }
1846                                         _g_object_unref0 (id);
1847                                 }
1848                                 _g_object_unref0 (_id_it);
1849                         }
1850                 }
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"
1856                         if (has_nai) {
1857 #line 551 "moonshot-identity-management-view.vala"
1858                                 _tmp22_ = nai_provided != NULL;
1859 #line 1860 "moonshot-identity-management-view.c"
1860                         } else {
1861 #line 551 "moonshot-identity-management-view.vala"
1862                                 _tmp22_ = FALSE;
1863 #line 1864 "moonshot-identity-management-view.c"
1864                         }
1865 #line 551 "moonshot-identity-management-view.vala"
1866                         if (_tmp22_) {
1867 #line 1868 "moonshot-identity-management-view.c"
1868                                 IdCard* _tmp23_;
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"
1872                                 confirm = FALSE;
1873 #line 1874 "moonshot-identity-management-view.c"
1874                         } else {
1875 #line 557 "moonshot-identity-management-view.vala"
1876                                 confirm = TRUE;
1877 #line 1878 "moonshot-identity-management-view.c"
1878                         }
1879                 } else {
1880                         IdCard* _tmp24_;
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"
1884                 }
1885 #line 564 "moonshot-identity-management-view.vala"
1886                 if (confirm) {
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"
1897                         return;
1898 #line 1899 "moonshot-identity-management-view.c"
1899                 }
1900                 _g_object_unref0 (nai_provided);
1901         }
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"
1907         return;
1908 #line 1909 "moonshot-identity-management-view.c"
1909 }
1910
1911
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"
1929         return result;
1930 #line 1931 "moonshot-identity-management-view.c"
1931 }
1932
1933
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;
1940         GSList* _tmp13_;
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"
1956         } else {
1957 #line 591 "moonshot-identity-management-view.vala"
1958                 _tmp0_ = FALSE;
1959 #line 1960 "moonshot-identity-management-view.c"
1960         }
1961 #line 591 "moonshot-identity-management-view.vala"
1962         if (_tmp0_) {
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"
1968                 {
1969                         gint _tmp1_;
1970                         char** service_collection;
1971                         int service_collection_length1;
1972                         int service_it;
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) {
1978                                 char* service;
1979                                 service = g_strdup (service_collection[service_it]);
1980                                 {
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"
1986                                         }
1987                                         _g_free0 (service);
1988                                 }
1989                         }
1990                 }
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_;
1996                         char** _tmp3_;
1997                         gint _tmp2_;
1998                         char** services;
1999                         gint _tmp8_;
2000                         gint _tmp9_;
2001                         char* _tmp10_;
2002                         char** _tmp11_;
2003                         services = (_tmp3_ = g_new0 (char*, (_tmp2_ + 1) + 1), services_length1 = _tmp2_ + 1, _services_size_ = services_length1, _tmp3_);
2004                         {
2005                                 gint i;
2006 #line 604 "moonshot-identity-management-view.vala"
2007                                 i = 0;
2008 #line 2009 "moonshot-identity-management-view.c"
2009                                 {
2010                                         gboolean _tmp4_;
2011 #line 604 "moonshot-identity-management-view.vala"
2012                                         _tmp4_ = TRUE;
2013 #line 604 "moonshot-identity-management-view.vala"
2014                                         while (TRUE) {
2015 #line 2016 "moonshot-identity-management-view.c"
2016                                                 gint _tmp5_;
2017                                                 gint _tmp6_;
2018                                                 char* _tmp7_;
2019 #line 604 "moonshot-identity-management-view.vala"
2020                                                 if (!_tmp4_) {
2021 #line 604 "moonshot-identity-management-view.vala"
2022                                                         i++;
2023 #line 2024 "moonshot-identity-management-view.c"
2024                                                 }
2025 #line 604 "moonshot-identity-management-view.vala"
2026                                                 _tmp4_ = FALSE;
2027 #line 604 "moonshot-identity-management-view.vala"
2028                                                 if (!(i < _tmp5_)) {
2029 #line 604 "moonshot-identity-management-view.vala"
2030                                                         break;
2031 #line 2032 "moonshot-identity-management-view.c"
2032                                                 }
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"
2036                                         }
2037                                 }
2038                         }
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"
2042                         _tmp11_ = services;
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);
2049                 }
2050         }
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;
2055                 gint _result_;
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"
2061                 switch (_result_) {
2062 #line 2063 "moonshot-identity-management-view.c"
2063                         case GTK_RESPONSE_OK:
2064                         {
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"
2070                                 break;
2071 #line 2072 "moonshot-identity-management-view.c"
2072                         }
2073                         default:
2074                         {
2075 #line 625 "moonshot-identity-management-view.vala"
2076                                 identity = NULL;
2077 #line 626 "moonshot-identity-management-view.vala"
2078                                 break;
2079 #line 2080 "moonshot-identity-management-view.c"
2080                         }
2081                 }
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);
2086         }
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"
2090                 gtk_main_quit ();
2091 #line 2092 "moonshot-identity-management-view.c"
2092         }
2093 #line 635 "moonshot-identity-management-view.vala"
2094         if (identity != NULL) {
2095 #line 2096 "moonshot-identity-management-view.c"
2096                 IdCard* _tmp12_;
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"
2100         }
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"
2108         }
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);
2113 }
2114
2115
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);
2132 }
2133
2134
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;
2139         gint ret;
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"
2151                 IdCard* idcard;
2152                 char* candidate;
2153                 GSList* services;
2154                 gint _tmp1_;
2155                 char** _tmp2_;
2156                 gint _tmp2__length1;
2157                 char** _tmp3_;
2158                 GList* children;
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"
2164                 services = NULL;
2165 #line 2166 "moonshot-identity-management-view.c"
2166                 {
2167                         gint _tmp0_;
2168                         char** srv_collection;
2169                         int srv_collection_length1;
2170                         int srv_it;
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) {
2176                                 char* srv;
2177                                 srv = g_strdup (srv_collection[srv_it]);
2178                                 {
2179 #line 706 "moonshot-identity-management-view.vala"
2180                                         if (_vala_strcmp0 (srv, candidate) == 0) {
2181 #line 2182 "moonshot-identity-management-view.c"
2182                                                 _g_free0 (srv);
2183 #line 707 "moonshot-identity-management-view.vala"
2184                                                 continue;
2185 #line 2186 "moonshot-identity-management-view.c"
2186                                         }
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"
2190                                         _g_free0 (srv);
2191                                 }
2192                         }
2193                 }
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);
2200                 {
2201                         gint j;
2202 #line 712 "moonshot-identity-management-view.vala"
2203                         j = 0;
2204 #line 2205 "moonshot-identity-management-view.c"
2205                         {
2206                                 gboolean _tmp4_;
2207 #line 712 "moonshot-identity-management-view.vala"
2208                                 _tmp4_ = TRUE;
2209 #line 712 "moonshot-identity-management-view.vala"
2210                                 while (TRUE) {
2211 #line 2212 "moonshot-identity-management-view.c"
2212                                         gint _tmp5_;
2213                                         gint _tmp6_;
2214                                         gint _tmp7_;
2215                                         char* *_tmp8_;
2216                                         char* _tmp9_;
2217 #line 712 "moonshot-identity-management-view.vala"
2218                                         if (!_tmp4_) {
2219 #line 712 "moonshot-identity-management-view.vala"
2220                                                 j++;
2221 #line 2222 "moonshot-identity-management-view.c"
2222                                         }
2223 #line 712 "moonshot-identity-management-view.vala"
2224                                         _tmp4_ = FALSE;
2225 #line 712 "moonshot-identity-management-view.vala"
2226                                         if (!(j < _tmp5_)) {
2227 #line 712 "moonshot-identity-management-view.vala"
2228                                                 break;
2229 #line 2230 "moonshot-identity-management-view.c"
2230                                         }
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"
2236                                 }
2237                         }
2238                 }
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"
2242                 {
2243                         GList* hbox_collection;
2244                         GList* hbox_it;
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) {
2249                                 GtkWidget* hbox;
2250 #line 718 "moonshot-identity-management-view.vala"
2251                                 hbox = (GtkWidget*) hbox_it->data;
2252 #line 2253 "moonshot-identity-management-view.c"
2253                                 {
2254 #line 719 "moonshot-identity-management-view.vala"
2255                                         gtk_object_destroy ((GtkObject*) hbox);
2256 #line 2257 "moonshot-identity-management-view.c"
2257                                 }
2258                         }
2259                 }
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);
2269         }
2270         _g_object_unref0 (dialog);
2271 }
2272
2273
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);
2278 }
2279
2280
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"
2284         gint i;
2285         gint _tmp0_;
2286         gint n_columns;
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"
2293         i = 0;
2294 #line 663 "moonshot-identity-management-view.vala"
2295         n_columns = _tmp0_;
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"
2307         {
2308                 gint _tmp1_;
2309                 char** service_collection;
2310                 int service_collection_length1;
2311                 int service_it;
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) {
2317                         char* service;
2318                         service = g_strdup (service_collection[service_it]);
2319                         {
2320                                 GtkLabel* label;
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"
2337                                 i++;
2338 #line 2339 "moonshot-identity-management-view.c"
2339                                 _g_object_unref0 (remove_button);
2340                                 _g_object_unref0 (label);
2341                                 _g_free0 (service);
2342                         }
2343                 }
2344         }
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);
2349 }
2350
2351
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_;
2357         char** _tmp1_;
2358         char** _tmp0_ = NULL;
2359         char** authors;
2360         char* copyright;
2361         char* license;
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" \
2372 "\n" \
2373 "Redistribution and use in source and binary forms, with or without\n" \
2374 "modification, are permitted provided that the following conditions\n" \
2375 "are met:\n" \
2376 "\n" \
2377 "1. Redistributions of source code must retain the above copyright\n" \
2378 "   notice, this list of conditions and the following disclaimer.\n" \
2379 "\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" \
2382 "\n" \
2383 "   documentation and/or other materials provided with the distribution" \
2384 ".\n" \
2385 "\n" \
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" \
2388 "re\n" \
2389 "   without specific prior written permission.\n" \
2390 "\n" \
2391 "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\" \
2392 "\"AS IS\\\"\n" \
2393 "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, " \
2394 "THE\n" \
2395 "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PUR" \
2396 "POSE\n" \
2397 "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS" \
2398 " BE LIABLE\n" \
2399 "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN" \
2400 "TIAL\n" \
2401 "DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOOD" \
2402 "S\n" \
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" \
2405 "RICT\n" \
2406 "LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY " \
2407 "WAY\n" \
2408 "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF" \
2409 "\n" \
2410 "SUCH DAMAGE.\n");
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"
2414         _g_free0 (license);
2415         _g_free0 (copyright);
2416         authors = (_vala_array_free (authors, authors_length1, (GDestroyNotify) g_free), NULL);
2417 }
2418
2419
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);
2424         }
2425         (*array)[(*length)++] = *value;
2426 }
2427
2428
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);
2433 }
2434
2435
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);
2440         }
2441         (*array)[(*length)++] = *value;
2442 }
2443
2444
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"
2448         gtk_main_quit ();
2449 }
2450
2451
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);
2456         }
2457         (*array)[(*length)++] = *value;
2458 }
2459
2460
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);
2465         }
2466         (*array)[(*length)++] = *value;
2467 }
2468
2469
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);
2474 }
2475
2476
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);
2481         }
2482         (*array)[(*length)++] = *value;
2483 }
2484
2485
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};
2497         GtkActionEntry add;
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"
2532         return result;
2533 #line 2493 "moonshot-identity-management-view.c"
2534         actions = (g_free (actions), NULL);
2535 }
2536
2537
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;
2542         gint _tmp0_;
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"
2560         {
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;
2566                 }
2567         }
2568         goto __finally1;
2569         __catch1_g_error:
2570         {
2571                 GError * e;
2572                 e = _inner_error_;
2573                 _inner_error_ = NULL;
2574                 {
2575 #line 853 "moonshot-identity-management-view.vala"
2576                         fprintf (stderr, "%s\n", e->message);
2577 #line 2537 "moonshot-identity-management-view.c"
2578                         _g_error_free0 (e);
2579                 }
2580         }
2581         __finally1:
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_);
2586                 return;
2587         }
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);
2592 }
2593
2594
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);
2599 }
2600
2601
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);
2606 }
2607
2608
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"
2612         gboolean result;
2613         result = identity_manager_view_search_entry_key_press_event_cb (self, event);
2614         return result;
2615 }
2616
2617
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"
2621         GtkEntry* _tmp0_;
2622         GdkPixbuf* _tmp1_;
2623         GdkPixbuf* _tmp2_;
2624         CustomVBox* _tmp3_;
2625         GtkViewport* viewport;
2626         GtkScrolledWindow* scroll;
2627         GtkVBox* vbox_left;
2628         GtkLabel* login_vbox_title;
2629         GtkLabel* username_label;
2630         GtkEntry* _tmp4_;
2631         GtkLabel* password_label;
2632         GtkEntry* _tmp5_;
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;
2639         GtkVBox* _tmp6_;
2640         GtkVBox* services_vbox;
2641         GtkVBox* _tmp7_;
2642         GtkHBox* hbox;
2643         GtkVBox* main_vbox;
2644         GtkWidget* menubar;
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);
2818 }
2819
2820
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);
2841 }
2842
2843
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"
2847         gtk_main_quit ();
2848 }
2849
2850
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);
2855 }
2856
2857
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"
2867 }
2868
2869
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;
2874 }
2875
2876
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 ();
2880 }
2881
2882
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);
2901 }
2902
2903
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);
2911         }
2912         return identity_manager_view_type_id__volatile;
2913 }
2914
2915
2916 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2917         if ((array != NULL) && (destroy_func != NULL)) {
2918                 int i;
2919                 for (i = 0; i < array_length; i = i + 1) {
2920                         if (((gpointer*) array)[i] != NULL) {
2921                                 destroy_func (((gpointer*) array)[i]);
2922                         }
2923                 }
2924         }
2925 }
2926
2927
2928 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2929         _vala_array_destroy (array, array_length, destroy_func);
2930         g_free (array);
2931 }
2932
2933
2934 static gint _vala_array_length (gpointer array) {
2935         int length;
2936         length = 0;
2937         if (array) {
2938                 while (((gpointer*) array)[length]) {
2939                         length++;
2940                 }
2941         }
2942         return length;
2943 }
2944
2945
2946 static int _vala_strcmp0 (const char * str1, const char * str2) {
2947         if (str1 == NULL) {
2948                 return -(str1 != str2);
2949         }
2950         if (str2 == NULL) {
2951                 return str1 != str2;
2952         }
2953         return strcmp (str1, str2);
2954 }
2955
2956
2957
2958