Back to index

libunity  5.92.0
unity-tool-ui.c
Go to the documentation of this file.
00001 /* unity-tool-ui.c generated by valac 0.17.2, the Vala compiler
00002  * generated from unity-tool-ui.vala, do not modify */
00003 
00004 /*
00005  * Copyright (C) 2012 Canonical Ltd
00006  *
00007  * This program is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 3 as
00009  * published by the Free Software Foundation.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  * Authored by Pawel Stolowski <pawel.stolowski@canonical.com>
00020  *
00021  */
00022 
00023 #include <glib.h>
00024 #include <glib-object.h>
00025 #include <gtk/gtk.h>
00026 #include <dee.h>
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <gio/gio.h>
00030 #include <stdio.h>
00031 
00032 
00033 #define UNITY_TESTER_TYPE_UNITY_TOOL_UI (unity_tester_unity_tool_ui_get_type ())
00034 #define UNITY_TESTER_UNITY_TOOL_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TESTER_TYPE_UNITY_TOOL_UI, UnityTesterUnityToolUi))
00035 #define UNITY_TESTER_UNITY_TOOL_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TESTER_TYPE_UNITY_TOOL_UI, UnityTesterUnityToolUiClass))
00036 #define UNITY_TESTER_IS_UNITY_TOOL_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TESTER_TYPE_UNITY_TOOL_UI))
00037 #define UNITY_TESTER_IS_UNITY_TOOL_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TESTER_TYPE_UNITY_TOOL_UI))
00038 #define UNITY_TESTER_UNITY_TOOL_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TESTER_TYPE_UNITY_TOOL_UI, UnityTesterUnityToolUiClass))
00039 
00040 typedef struct _UnityTesterUnityToolUi UnityTesterUnityToolUi;
00041 typedef struct _UnityTesterUnityToolUiClass UnityTesterUnityToolUiClass;
00042 typedef struct _UnityTesterUnityToolUiPrivate UnityTesterUnityToolUiPrivate;
00043 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
00044 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
00045 #define _g_free0(var) (var = (g_free (var), NULL))
00046 
00047 #define UNITY_TESTER_TYPE_DBUS_LENS_UTIL (unity_tester_dbus_lens_util_get_type ())
00048 #define UNITY_TESTER_DBUS_LENS_UTIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TESTER_TYPE_DBUS_LENS_UTIL, UnityTesterDBusLensUtil))
00049 #define UNITY_TESTER_DBUS_LENS_UTIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TESTER_TYPE_DBUS_LENS_UTIL, UnityTesterDBusLensUtilClass))
00050 #define UNITY_TESTER_IS_DBUS_LENS_UTIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TESTER_TYPE_DBUS_LENS_UTIL))
00051 #define UNITY_TESTER_IS_DBUS_LENS_UTIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TESTER_TYPE_DBUS_LENS_UTIL))
00052 #define UNITY_TESTER_DBUS_LENS_UTIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TESTER_TYPE_DBUS_LENS_UTIL, UnityTesterDBusLensUtilClass))
00053 
00054 typedef struct _UnityTesterDBusLensUtil UnityTesterDBusLensUtil;
00055 typedef struct _UnityTesterDBusLensUtilClass UnityTesterDBusLensUtilClass;
00056 typedef struct _Block13Data Block13Data;
00057 #define _unity_tester_dbus_lens_util_unref0(var) ((var == NULL) ? NULL : (var = (unity_tester_dbus_lens_util_unref (var), NULL)))
00058 
00059 #define UNITY_TESTER_DBUS_LENS_UTIL_TYPE_DBUS_OBJECT_ADDRESS (unity_tester_dbus_lens_util_dbus_object_address_get_type ())
00060 typedef struct _UnityTesterDBusLensUtilDBusObjectAddress UnityTesterDBusLensUtilDBusObjectAddress;
00061 
00062 #define UNITY_TESTER_TYPE_LENS_INFO (unity_tester_lens_info_get_type ())
00063 typedef struct _UnityTesterLensInfo UnityTesterLensInfo;
00064 
00065 struct _UnityTesterUnityToolUi {
00066        GObject parent_instance;
00067        UnityTesterUnityToolUiPrivate * priv;
00068 };
00069 
00070 struct _UnityTesterUnityToolUiClass {
00071        GObjectClass parent_class;
00072 };
00073 
00074 struct _UnityTesterUnityToolUiPrivate {
00075        GtkRadioButton* search_type_global_rbutton;
00076        GtkDialog* lens_connect_dlg;
00077        GtkSpinner* spinner;
00078        GtkSpinner* lens_discovery_spinner;
00079        GtkButton* search_button;
00080        GtkStatusbar* statusbar;
00081        GtkTextBuffer* log_buffer;
00082        guint statusbar_info_ctx;
00083        guint statusbar_error_ctx;
00084        GtkEntry* search_entry;
00085        GtkEntry* dbus_name_entry;
00086        GtkEntry* dbus_path_entry;
00087        GtkComboBox* lens_list_combobox;
00088        GtkListStore* uimodel;
00089        GtkListStore* ui_filter_model;
00090        GtkListStore* lens_list_model;
00091        gulong model_sync_sig_id;
00092        gulong filters_model_sync_sig_id;
00093        DeeSharedModel* dee_results_model;
00094        DeeSharedModel* dee_filters_model;
00095 };
00096 
00097 struct _Block13Data {
00098        int _ref_count_;
00099        UnityTesterUnityToolUi * self;
00100        GtkTreeIter iter;
00101        UnityTesterDBusLensUtil* c;
00102 };
00103 
00104 struct _UnityTesterDBusLensUtilDBusObjectAddress {
00105        gchar* dbus_name;
00106        gchar* dbus_path;
00107 };
00108 
00109 struct _UnityTesterLensInfo {
00110        gchar* dbus_path;
00111        gboolean search_in_global;
00112        gboolean visible;
00113        gchar* search_hint;
00114        gchar* private_connection_name;
00115        gchar* results_model_name;
00116        gchar* global_results_model_name;
00117        gchar* categories_model_name;
00118        gchar* filters_model_name;
00119        GHashTable* hints;
00120 };
00121 
00122 
00123 static gpointer unity_tester_unity_tool_ui_parent_class = NULL;
00124 extern gchar* unity_tester_options_lens_dbus_path;
00125 extern gchar* unity_tester_options_lens_dbus_name;
00126 
00127 GType unity_tester_unity_tool_ui_get_type (void) G_GNUC_CONST;
00128 #define UNITY_TESTER_UNITY_TOOL_UI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TESTER_TYPE_UNITY_TOOL_UI, UnityTesterUnityToolUiPrivate))
00129 enum  {
00130        UNITY_TESTER_UNITY_TOOL_UI_DUMMY_PROPERTY
00131 };
00132 UnityTesterUnityToolUi* unity_tester_unity_tool_ui_new (void);
00133 UnityTesterUnityToolUi* unity_tester_unity_tool_ui_construct (GType object_type);
00134 gboolean unity_tester_unity_tool_ui_init_gui (UnityTesterUnityToolUi* self);
00135 static void _gtk_main_quit_gtk_widget_destroy (GtkWidget* _sender, gpointer self);
00136 static void unity_tester_unity_tool_ui_show_connect_dialog (UnityTesterUnityToolUi* self);
00137 static void unity_tester_unity_tool_ui_ui_load_error (UnityTesterUnityToolUi* self, const gchar* message);
00138 static void unity_tester_unity_tool_ui_discover_lens (UnityTesterUnityToolUi* self);
00139 gpointer unity_tester_dbus_lens_util_ref (gpointer instance);
00140 void unity_tester_dbus_lens_util_unref (gpointer instance);
00141 GParamSpec* unity_tester_param_spec_dbus_lens_util (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
00142 void unity_tester_value_set_dbus_lens_util (GValue* value, gpointer v_object);
00143 void unity_tester_value_take_dbus_lens_util (GValue* value, gpointer v_object);
00144 gpointer unity_tester_value_get_dbus_lens_util (const GValue* value);
00145 GType unity_tester_dbus_lens_util_get_type (void) G_GNUC_CONST;
00146 static Block13Data* block13_data_ref (Block13Data* _data13_);
00147 static void block13_data_unref (void * _userdata_);
00148 UnityTesterDBusLensUtil* unity_tester_dbus_lens_util_new (void);
00149 UnityTesterDBusLensUtil* unity_tester_dbus_lens_util_construct (GType object_type);
00150 void unity_tester_dbus_lens_util_findLenses (UnityTesterDBusLensUtil* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
00151 GType unity_tester_dbus_lens_util_dbus_object_address_get_type (void) G_GNUC_CONST;
00152 UnityTesterDBusLensUtilDBusObjectAddress* unity_tester_dbus_lens_util_dbus_object_address_dup (const UnityTesterDBusLensUtilDBusObjectAddress* self);
00153 void unity_tester_dbus_lens_util_dbus_object_address_free (UnityTesterDBusLensUtilDBusObjectAddress* self);
00154 void unity_tester_dbus_lens_util_dbus_object_address_copy (const UnityTesterDBusLensUtilDBusObjectAddress* self, UnityTesterDBusLensUtilDBusObjectAddress* dest);
00155 void unity_tester_dbus_lens_util_dbus_object_address_destroy (UnityTesterDBusLensUtilDBusObjectAddress* self);
00156 GList* unity_tester_dbus_lens_util_findLenses_finish (UnityTesterDBusLensUtil* self, GAsyncResult* _res_, GError** error);
00157 static void __lambda3_ (Block13Data* _data13_, GObject* obj, GAsyncResult* res);
00158 static void ___lambda3__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
00159 void unity_tester_unity_tool_ui_on_lens_combobox_clicked (GtkMenuItem* item, UnityTesterUnityToolUi* self);
00160 void unity_tester_unity_tool_ui_on_connect_clicked (GtkMenuItem* item, UnityTesterUnityToolUi* self);
00161 static void unity_tester_unity_tool_ui_results_row_added_cb (UnityTesterUnityToolUi* self, DeeModel* model, DeeModelIter* iter);
00162 static void unity_tester_unity_tool_ui_filters_row_added_cb (UnityTesterUnityToolUi* self, DeeModel* model, DeeModelIter* iter);
00163 static void unity_tester_unity_tool_ui_update_status (UnityTesterUnityToolUi* self);
00164 static void unity_tester_unity_tool_ui_model_synchronized_cb (UnityTesterUnityToolUi* self);
00165 static void unity_tester_unity_tool_ui_append_log_message (UnityTesterUnityToolUi* self, const gchar* message);
00166 static void unity_tester_unity_tool_ui_filter_model_synchronized_cb (UnityTesterUnityToolUi* self);
00167 void unity_tester_unity_tool_ui_on_lens_connect (GtkDialog* dlg, gint response, UnityTesterUnityToolUi* self);
00168 void unity_tester_unity_tool_ui_on_from_lens_clicked (GtkButton* btn, UnityTesterUnityToolUi* self);
00169 void unity_tester_get_lens_params_from_file (const gchar* filename, GError** error);
00170 static void unity_tester_unity_tool_ui_request_lens_info (UnityTesterUnityToolUi* self);
00171 GType unity_tester_lens_info_get_type (void) G_GNUC_CONST;
00172 UnityTesterLensInfo* unity_tester_lens_info_dup (const UnityTesterLensInfo* self);
00173 void unity_tester_lens_info_free (UnityTesterLensInfo* self);
00174 void unity_tester_lens_info_copy (const UnityTesterLensInfo* self, UnityTesterLensInfo* dest);
00175 void unity_tester_lens_info_destroy (UnityTesterLensInfo* self);
00176 void unity_tester_get_lens_info (GFunc error_cb, void* error_cb_target, UnityTesterLensInfo* result);
00177 static void __lambda6_ (UnityTesterUnityToolUi* self, const gchar* msg);
00178 static void unity_tester_unity_tool_ui_handle_error (UnityTesterUnityToolUi* self, const gchar* message);
00179 static void ___lambda6__gfunc (gconstpointer data, gpointer self);
00180 static void _unity_tester_unity_tool_ui_model_synchronized_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00181 static void _unity_tester_unity_tool_ui_results_row_added_cb_dee_model_row_added (DeeModel* _sender, DeeModelIter* iter, gpointer self);
00182 static void _unity_tester_unity_tool_ui_filter_model_synchronized_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
00183 static void _unity_tester_unity_tool_ui_filters_row_added_cb_dee_model_row_added (DeeModel* _sender, DeeModelIter* iter, gpointer self);
00184 void unity_tester_unity_tool_ui_on_results_button_clicked (GtkButton* btn, UnityTesterUnityToolUi* self);
00185 void unity_tester_unity_tool_ui_on_search_button_clicked (GtkButton* btn, UnityTesterUnityToolUi* self);
00186 void unity_tester_call_lens_search (const gchar* search_string, gint search_type, GFunc cb, void* cb_target, GFunc error_cb, void* error_cb_target);
00187 static void ____lambda8_ (UnityTesterUnityToolUi* self, GVariant* _result_);
00188 static void _____lambda8__gfunc (gconstpointer data, gpointer self);
00189 static void ____lambda9_ (UnityTesterUnityToolUi* self, const gchar* msg);
00190 static void _____lambda9__gfunc (gconstpointer data, gpointer self);
00191 static void unity_tester_unity_tool_ui_finalize (GObject* obj);
00192 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
00193 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
00194 static gint _vala_array_length (gpointer array);
00195 
00196 
00197 UnityTesterUnityToolUi* unity_tester_unity_tool_ui_construct (GType object_type) {
00198        UnityTesterUnityToolUi * self = NULL;
00199        self = (UnityTesterUnityToolUi*) g_object_new (object_type, NULL);
00200        return self;
00201 }
00202 
00203 
00204 UnityTesterUnityToolUi* unity_tester_unity_tool_ui_new (void) {
00205        return unity_tester_unity_tool_ui_construct (UNITY_TESTER_TYPE_UNITY_TOOL_UI);
00206 }
00207 
00208 
00209 static gpointer _g_object_ref0 (gpointer self) {
00210        return self ? g_object_ref (self) : NULL;
00211 }
00212 
00213 
00214 static void _gtk_main_quit_gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
00215        gtk_main_quit ();
00216 }
00217 
00218 
00219 gboolean unity_tester_unity_tool_ui_init_gui (UnityTesterUnityToolUi* self) {
00220        gboolean result = FALSE;
00221        GtkBuilder* _tmp0_;
00222        GtkBuilder* builder;
00223        GError * _inner_error_ = NULL;
00224        g_return_val_if_fail (self != NULL, FALSE);
00225        _tmp0_ = gtk_builder_new ();
00226        builder = _tmp0_;
00227        {
00228               GtkBuilder* _tmp1_;
00229               GtkBuilder* _tmp2_;
00230               GtkBuilder* _tmp3_;
00231               GObject* _tmp4_ = NULL;
00232               GtkSpinner* _tmp5_;
00233               GtkBuilder* _tmp6_;
00234               GObject* _tmp7_ = NULL;
00235               GtkWindow* _tmp8_;
00236               GtkWindow* window;
00237               GtkWindow* _tmp9_;
00238               GtkWindow* _tmp10_;
00239               GtkBuilder* _tmp11_;
00240               GObject* _tmp12_ = NULL;
00241               GtkListStore* _tmp13_;
00242               GtkBuilder* _tmp14_;
00243               GObject* _tmp15_ = NULL;
00244               GtkListStore* _tmp16_;
00245               GtkBuilder* _tmp17_;
00246               GObject* _tmp18_ = NULL;
00247               GtkEntry* _tmp19_;
00248               GtkBuilder* _tmp20_;
00249               GObject* _tmp21_ = NULL;
00250               GtkRadioButton* _tmp22_;
00251               GtkBuilder* _tmp23_;
00252               GObject* _tmp24_ = NULL;
00253               GtkButton* _tmp25_;
00254               GtkBuilder* _tmp26_;
00255               GObject* _tmp27_ = NULL;
00256               GtkStatusbar* _tmp28_;
00257               GtkBuilder* _tmp29_;
00258               GObject* _tmp30_ = NULL;
00259               GtkTextBuffer* _tmp31_;
00260               GtkStatusbar* _tmp32_;
00261               guint _tmp33_ = 0U;
00262               GtkStatusbar* _tmp34_;
00263               guint _tmp35_ = 0U;
00264               _tmp1_ = builder;
00265               gtk_builder_add_from_resource (_tmp1_, "/com/canonical/Unity/unity-tool/unity-tool.ui", &_inner_error_);
00266               if (_inner_error_ != NULL) {
00267                      goto __catch9_g_error;
00268               }
00269               _tmp2_ = builder;
00270               gtk_builder_connect_signals (_tmp2_, self);
00271               _tmp3_ = builder;
00272               _tmp4_ = gtk_builder_get_object (_tmp3_, "spinner");
00273               _tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, GTK_TYPE_SPINNER) ? ((GtkSpinner*) _tmp4_) : NULL);
00274               _g_object_unref0 (self->priv->spinner);
00275               self->priv->spinner = _tmp5_;
00276               _tmp6_ = builder;
00277               _tmp7_ = gtk_builder_get_object (_tmp6_, "window");
00278               _tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, GTK_TYPE_WINDOW) ? ((GtkWindow*) _tmp7_) : NULL);
00279               window = _tmp8_;
00280               _tmp9_ = window;
00281               g_signal_connect ((GtkWidget*) _tmp9_, "destroy", (GCallback) _gtk_main_quit_gtk_widget_destroy, NULL);
00282               _tmp10_ = window;
00283               gtk_widget_show_all ((GtkWidget*) _tmp10_);
00284               _tmp11_ = builder;
00285               _tmp12_ = gtk_builder_get_object (_tmp11_, "results_model");
00286               _tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GTK_TYPE_LIST_STORE) ? ((GtkListStore*) _tmp12_) : NULL);
00287               _g_object_unref0 (self->priv->uimodel);
00288               self->priv->uimodel = _tmp13_;
00289               _tmp14_ = builder;
00290               _tmp15_ = gtk_builder_get_object (_tmp14_, "filters_model");
00291               _tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, GTK_TYPE_LIST_STORE) ? ((GtkListStore*) _tmp15_) : NULL);
00292               _g_object_unref0 (self->priv->ui_filter_model);
00293               self->priv->ui_filter_model = _tmp16_;
00294               _tmp17_ = builder;
00295               _tmp18_ = gtk_builder_get_object (_tmp17_, "search_entry");
00296               _tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp18_) : NULL);
00297               _g_object_unref0 (self->priv->search_entry);
00298               self->priv->search_entry = _tmp19_;
00299               _tmp20_ = builder;
00300               _tmp21_ = gtk_builder_get_object (_tmp20_, "search_type_global");
00301               _tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, GTK_TYPE_RADIO_BUTTON) ? ((GtkRadioButton*) _tmp21_) : NULL);
00302               _g_object_unref0 (self->priv->search_type_global_rbutton);
00303               self->priv->search_type_global_rbutton = _tmp22_;
00304               _tmp23_ = builder;
00305               _tmp24_ = gtk_builder_get_object (_tmp23_, "search_button");
00306               _tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp24_) : NULL);
00307               _g_object_unref0 (self->priv->search_button);
00308               self->priv->search_button = _tmp25_;
00309               _tmp26_ = builder;
00310               _tmp27_ = gtk_builder_get_object (_tmp26_, "statusbar");
00311               _tmp28_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp27_, GTK_TYPE_STATUSBAR) ? ((GtkStatusbar*) _tmp27_) : NULL);
00312               _g_object_unref0 (self->priv->statusbar);
00313               self->priv->statusbar = _tmp28_;
00314               _tmp29_ = builder;
00315               _tmp30_ = gtk_builder_get_object (_tmp29_, "log_buffer");
00316               _tmp31_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp30_, GTK_TYPE_TEXT_BUFFER) ? ((GtkTextBuffer*) _tmp30_) : NULL);
00317               _g_object_unref0 (self->priv->log_buffer);
00318               self->priv->log_buffer = _tmp31_;
00319               _tmp32_ = self->priv->statusbar;
00320               _tmp33_ = gtk_statusbar_get_context_id (_tmp32_, "Info");
00321               self->priv->statusbar_info_ctx = _tmp33_;
00322               _tmp34_ = self->priv->statusbar;
00323               _tmp35_ = gtk_statusbar_get_context_id (_tmp34_, "Error");
00324               self->priv->statusbar_error_ctx = _tmp35_;
00325               unity_tester_unity_tool_ui_show_connect_dialog (self);
00326               _g_object_unref0 (window);
00327        }
00328        goto __finally9;
00329        __catch9_g_error:
00330        {
00331               GError* e = NULL;
00332               GError* _tmp36_;
00333               const gchar* _tmp37_;
00334               e = _inner_error_;
00335               _inner_error_ = NULL;
00336               _tmp36_ = e;
00337               _tmp37_ = _tmp36_->message;
00338               unity_tester_unity_tool_ui_ui_load_error (self, _tmp37_);
00339               result = FALSE;
00340               _g_error_free0 (e);
00341               _g_object_unref0 (builder);
00342               return result;
00343        }
00344        __finally9:
00345        if (_inner_error_ != NULL) {
00346               _g_object_unref0 (builder);
00347               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);
00348               g_clear_error (&_inner_error_);
00349               return FALSE;
00350        }
00351        result = TRUE;
00352        _g_object_unref0 (builder);
00353        return result;
00354 }
00355 
00356 
00357 static void unity_tester_unity_tool_ui_ui_load_error (UnityTesterUnityToolUi* self, const gchar* message) {
00358        const gchar* _tmp0_;
00359        gchar* _tmp1_ = NULL;
00360        gchar* _tmp2_;
00361        GtkMessageDialog* _tmp3_;
00362        GtkDialog* _tmp4_;
00363        GtkDialog* dlg;
00364        g_return_if_fail (self != NULL);
00365        g_return_if_fail (message != NULL);
00366        _tmp0_ = message;
00367        _tmp1_ = g_strdup_printf ("Error loading UI file:\n%s", _tmp0_);
00368        _tmp2_ = _tmp1_;
00369        _tmp3_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _tmp2_);
00370        g_object_ref_sink (_tmp3_);
00371        _tmp4_ = (GtkDialog*) _tmp3_;
00372        _g_free0 (_tmp2_);
00373        dlg = _tmp4_;
00374        gtk_window_set_title ((GtkWindow*) dlg, "Error creating UI");
00375        gtk_dialog_run (dlg);
00376        gtk_widget_destroy ((GtkWidget*) dlg);
00377        _g_object_unref0 (dlg);
00378 }
00379 
00380 
00381 static Block13Data* block13_data_ref (Block13Data* _data13_) {
00382        g_atomic_int_inc (&_data13_->_ref_count_);
00383        return _data13_;
00384 }
00385 
00386 
00387 static void block13_data_unref (void * _userdata_) {
00388        Block13Data* _data13_;
00389        _data13_ = (Block13Data*) _userdata_;
00390        if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
00391               UnityTesterUnityToolUi * self;
00392               self = _data13_->self;
00393               _unity_tester_dbus_lens_util_unref0 (_data13_->c);
00394               _g_object_unref0 (self);
00395               g_slice_free (Block13Data, _data13_);
00396        }
00397 }
00398 
00399 
00400 static void __lambda3_ (Block13Data* _data13_, GObject* obj, GAsyncResult* res) {
00401        UnityTesterUnityToolUi * self;
00402        GError * _inner_error_ = NULL;
00403        self = _data13_->self;
00404        g_return_if_fail (res != NULL);
00405        {
00406               GAsyncResult* _tmp0_;
00407               GList* _tmp1_ = NULL;
00408               GList* results;
00409               GtkSpinner* _tmp11_;
00410               _tmp0_ = res;
00411               _tmp1_ = unity_tester_dbus_lens_util_findLenses_finish (_data13_->c, _tmp0_, &_inner_error_);
00412               results = _tmp1_;
00413               if (_inner_error_ != NULL) {
00414                      goto __catch10_g_error;
00415               }
00416               {
00417                      GList* addr_collection = NULL;
00418                      GList* addr_it = NULL;
00419                      addr_collection = results;
00420                      for (addr_it = addr_collection; addr_it != NULL; addr_it = addr_it->next) {
00421                             UnityTesterDBusLensUtilDBusObjectAddress _tmp2_ = {0};
00422                             UnityTesterDBusLensUtilDBusObjectAddress addr = {0};
00423                             unity_tester_dbus_lens_util_dbus_object_address_copy ((UnityTesterDBusLensUtilDBusObjectAddress*) addr_it->data, &_tmp2_);
00424                             addr = _tmp2_;
00425                             {
00426                                    GtkListStore* _tmp3_;
00427                                    GtkTreeIter _tmp4_ = {0};
00428                                    GtkListStore* _tmp5_;
00429                                    GtkTreeIter _tmp6_;
00430                                    UnityTesterDBusLensUtilDBusObjectAddress _tmp7_;
00431                                    const gchar* _tmp8_;
00432                                    UnityTesterDBusLensUtilDBusObjectAddress _tmp9_;
00433                                    const gchar* _tmp10_;
00434                                    _tmp3_ = self->priv->lens_list_model;
00435                                    gtk_list_store_append (_tmp3_, &_tmp4_);
00436                                    _data13_->iter = _tmp4_;
00437                                    _tmp5_ = self->priv->lens_list_model;
00438                                    _tmp6_ = _data13_->iter;
00439                                    _tmp7_ = addr;
00440                                    _tmp8_ = _tmp7_.dbus_name;
00441                                    _tmp9_ = addr;
00442                                    _tmp10_ = _tmp9_.dbus_path;
00443                                    gtk_list_store_set (_tmp5_, &_tmp6_, 0, _tmp8_, 1, _tmp10_, -1, -1);
00444                                    unity_tester_dbus_lens_util_dbus_object_address_destroy (&addr);
00445                             }
00446                      }
00447               }
00448               _tmp11_ = self->priv->lens_discovery_spinner;
00449               gtk_spinner_stop (_tmp11_);
00450        }
00451        goto __finally10;
00452        __catch10_g_error:
00453        {
00454               GError* e = NULL;
00455               FILE* _tmp12_;
00456               GError* _tmp13_;
00457               const gchar* _tmp14_;
00458               GtkSpinner* _tmp15_;
00459               e = _inner_error_;
00460               _inner_error_ = NULL;
00461               _tmp12_ = stderr;
00462               _tmp13_ = e;
00463               _tmp14_ = _tmp13_->message;
00464               fprintf (_tmp12_, "DBus Lens auto-discovery failed %s\n", _tmp14_);
00465               _tmp15_ = self->priv->lens_discovery_spinner;
00466               gtk_spinner_stop (_tmp15_);
00467               _g_error_free0 (e);
00468        }
00469        __finally10:
00470        if (_inner_error_ != NULL) {
00471               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);
00472               g_clear_error (&_inner_error_);
00473               return;
00474        }
00475 }
00476 
00477 
00478 static void ___lambda3__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
00479        __lambda3_ (self, source_object, res);
00480        block13_data_unref (self);
00481 }
00482 
00483 
00484 static void unity_tester_unity_tool_ui_discover_lens (UnityTesterUnityToolUi* self) {
00485        Block13Data* _data13_;
00486        GtkSpinner* _tmp0_;
00487        GtkListStore* _tmp1_;
00488        GtkTreeIter _tmp2_ = {0};
00489        GtkListStore* _tmp3_;
00490        GtkTreeIter _tmp4_;
00491        UnityTesterDBusLensUtil* _tmp5_;
00492        g_return_if_fail (self != NULL);
00493        _data13_ = g_slice_new0 (Block13Data);
00494        _data13_->_ref_count_ = 1;
00495        _data13_->self = g_object_ref (self);
00496        _tmp0_ = self->priv->lens_discovery_spinner;
00497        gtk_spinner_start (_tmp0_);
00498        _tmp1_ = self->priv->lens_list_model;
00499        gtk_list_store_append (_tmp1_, &_tmp2_);
00500        _data13_->iter = _tmp2_;
00501        _tmp3_ = self->priv->lens_list_model;
00502        _tmp4_ = _data13_->iter;
00503        gtk_list_store_set (_tmp3_, &_tmp4_, 0, "", 1, "", -1, -1);
00504        _tmp5_ = unity_tester_dbus_lens_util_new ();
00505        _data13_->c = _tmp5_;
00506        unity_tester_dbus_lens_util_findLenses (_data13_->c, ___lambda3__gasync_ready_callback, block13_data_ref (_data13_));
00507        block13_data_unref (_data13_);
00508        _data13_ = NULL;
00509 }
00510 
00511 
00512 void unity_tester_unity_tool_ui_on_lens_combobox_clicked (GtkMenuItem* item, UnityTesterUnityToolUi* self) {
00513        GtkTreeIter iter = {0};
00514        GtkComboBox* _tmp0_;
00515        gint _tmp1_ = 0;
00516        g_return_if_fail (self != NULL);
00517        g_return_if_fail (item != NULL);
00518        _tmp0_ = self->priv->lens_list_combobox;
00519        _tmp1_ = gtk_combo_box_get_active (_tmp0_);
00520        if (_tmp1_ > 0) {
00521               GtkComboBox* _tmp2_;
00522               GtkTreeIter _tmp3_ = {0};
00523               gboolean _tmp4_ = FALSE;
00524               _tmp2_ = self->priv->lens_list_combobox;
00525               _tmp4_ = gtk_combo_box_get_active_iter (_tmp2_, &_tmp3_);
00526               iter = _tmp3_;
00527               if (_tmp4_) {
00528                      GValue val = {0};
00529                      GtkListStore* _tmp5_;
00530                      GtkTreeIter _tmp6_;
00531                      GValue _tmp7_ = {0};
00532                      GtkEntry* _tmp8_;
00533                      const gchar* _tmp9_ = NULL;
00534                      GtkListStore* _tmp10_;
00535                      GtkTreeIter _tmp11_;
00536                      GValue _tmp12_ = {0};
00537                      GtkEntry* _tmp13_;
00538                      const gchar* _tmp14_ = NULL;
00539                      _tmp5_ = self->priv->lens_list_model;
00540                      _tmp6_ = iter;
00541                      gtk_tree_model_get_value ((GtkTreeModel*) _tmp5_, &_tmp6_, 0, &_tmp7_);
00542                      G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
00543                      val = _tmp7_;
00544                      _tmp8_ = self->priv->dbus_name_entry;
00545                      _tmp9_ = g_value_get_string (&val);
00546                      gtk_entry_set_text (_tmp8_, _tmp9_);
00547                      _tmp10_ = self->priv->lens_list_model;
00548                      _tmp11_ = iter;
00549                      gtk_tree_model_get_value ((GtkTreeModel*) _tmp10_, &_tmp11_, 1, &_tmp12_);
00550                      G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
00551                      val = _tmp12_;
00552                      _tmp13_ = self->priv->dbus_path_entry;
00553                      _tmp14_ = g_value_get_string (&val);
00554                      gtk_entry_set_text (_tmp13_, _tmp14_);
00555                      G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
00556               }
00557        }
00558 }
00559 
00560 
00561 void unity_tester_unity_tool_ui_on_connect_clicked (GtkMenuItem* item, UnityTesterUnityToolUi* self) {
00562        g_return_if_fail (self != NULL);
00563        g_return_if_fail (item != NULL);
00564        unity_tester_unity_tool_ui_show_connect_dialog (self);
00565 }
00566 
00567 
00568 static void unity_tester_unity_tool_ui_show_connect_dialog (UnityTesterUnityToolUi* self) {
00569        GtkBuilder* _tmp0_;
00570        GtkBuilder* builder;
00571        GError * _inner_error_ = NULL;
00572        g_return_if_fail (self != NULL);
00573        _tmp0_ = gtk_builder_new ();
00574        builder = _tmp0_;
00575        {
00576               GObject* _tmp1_ = NULL;
00577               GtkSpinner* _tmp2_;
00578               GObject* _tmp3_ = NULL;
00579               GtkListStore* _tmp4_;
00580               GObject* _tmp5_ = NULL;
00581               GtkComboBox* _tmp6_;
00582               GObject* _tmp7_ = NULL;
00583               GtkEntry* _tmp8_;
00584               GObject* _tmp9_ = NULL;
00585               GtkEntry* _tmp10_;
00586               GObject* _tmp11_ = NULL;
00587               GtkDialog* _tmp12_;
00588               gboolean _tmp13_ = FALSE;
00589               gboolean _tmp14_ = FALSE;
00590               gboolean _tmp15_ = FALSE;
00591               const gchar* _tmp16_;
00592               gboolean _tmp18_;
00593               gboolean _tmp20_;
00594               gboolean _tmp22_;
00595               GtkDialog* _tmp27_;
00596               gtk_builder_add_from_resource (builder, "/com/canonical/Unity/unity-tool/dbus-lens-connect.ui", &_inner_error_);
00597               if (_inner_error_ != NULL) {
00598                      goto __catch11_g_error;
00599               }
00600               gtk_builder_connect_signals (builder, self);
00601               _tmp1_ = gtk_builder_get_object (builder, "lens_discovery_spinner");
00602               _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GTK_TYPE_SPINNER) ? ((GtkSpinner*) _tmp1_) : NULL);
00603               _g_object_unref0 (self->priv->lens_discovery_spinner);
00604               self->priv->lens_discovery_spinner = _tmp2_;
00605               _tmp3_ = gtk_builder_get_object (builder, "lens_list_model");
00606               _tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GTK_TYPE_LIST_STORE) ? ((GtkListStore*) _tmp3_) : NULL);
00607               _g_object_unref0 (self->priv->lens_list_model);
00608               self->priv->lens_list_model = _tmp4_;
00609               _tmp5_ = gtk_builder_get_object (builder, "lens_list_combobox");
00610               _tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GTK_TYPE_COMBO_BOX) ? ((GtkComboBox*) _tmp5_) : NULL);
00611               _g_object_unref0 (self->priv->lens_list_combobox);
00612               self->priv->lens_list_combobox = _tmp6_;
00613               _tmp7_ = gtk_builder_get_object (builder, "dbus_name_entry");
00614               _tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp7_) : NULL);
00615               _g_object_unref0 (self->priv->dbus_name_entry);
00616               self->priv->dbus_name_entry = _tmp8_;
00617               _tmp9_ = gtk_builder_get_object (builder, "dbus_path_entry");
00618               _tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp9_) : NULL);
00619               _g_object_unref0 (self->priv->dbus_path_entry);
00620               self->priv->dbus_path_entry = _tmp10_;
00621               _tmp11_ = gtk_builder_get_object (builder, "lens_connect_dialog");
00622               _tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, GTK_TYPE_DIALOG) ? ((GtkDialog*) _tmp11_) : NULL);
00623               _g_object_unref0 (self->priv->lens_connect_dlg);
00624               self->priv->lens_connect_dlg = _tmp12_;
00625               unity_tester_unity_tool_ui_discover_lens (self);
00626               _tmp16_ = unity_tester_options_lens_dbus_path;
00627               if (_tmp16_ != NULL) {
00628                      const gchar* _tmp17_;
00629                      _tmp17_ = unity_tester_options_lens_dbus_path;
00630                      _tmp15_ = g_strcmp0 (_tmp17_, "") != 0;
00631               } else {
00632                      _tmp15_ = FALSE;
00633               }
00634               _tmp18_ = _tmp15_;
00635               if (_tmp18_) {
00636                      const gchar* _tmp19_;
00637                      _tmp19_ = unity_tester_options_lens_dbus_name;
00638                      _tmp14_ = _tmp19_ != NULL;
00639               } else {
00640                      _tmp14_ = FALSE;
00641               }
00642               _tmp20_ = _tmp14_;
00643               if (_tmp20_) {
00644                      const gchar* _tmp21_;
00645                      _tmp21_ = unity_tester_options_lens_dbus_name;
00646                      _tmp13_ = g_strcmp0 (_tmp21_, "") != 0;
00647               } else {
00648                      _tmp13_ = FALSE;
00649               }
00650               _tmp22_ = _tmp13_;
00651               if (_tmp22_) {
00652                      GtkEntry* _tmp23_;
00653                      const gchar* _tmp24_;
00654                      GtkEntry* _tmp25_;
00655                      const gchar* _tmp26_;
00656                      _tmp23_ = self->priv->dbus_name_entry;
00657                      _tmp24_ = unity_tester_options_lens_dbus_name;
00658                      gtk_entry_set_text (_tmp23_, _tmp24_);
00659                      _tmp25_ = self->priv->dbus_path_entry;
00660                      _tmp26_ = unity_tester_options_lens_dbus_path;
00661                      gtk_entry_set_text (_tmp25_, _tmp26_);
00662               }
00663               _tmp27_ = self->priv->lens_connect_dlg;
00664               gtk_widget_show_all ((GtkWidget*) _tmp27_);
00665        }
00666        goto __finally11;
00667        __catch11_g_error:
00668        {
00669               GError* e = NULL;
00670               GError* _tmp28_;
00671               const gchar* _tmp29_;
00672               e = _inner_error_;
00673               _inner_error_ = NULL;
00674               _tmp28_ = e;
00675               _tmp29_ = _tmp28_->message;
00676               unity_tester_unity_tool_ui_ui_load_error (self, _tmp29_);
00677               _g_error_free0 (e);
00678        }
00679        __finally11:
00680        if (_inner_error_ != NULL) {
00681               _g_object_unref0 (builder);
00682               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);
00683               g_clear_error (&_inner_error_);
00684               return;
00685        }
00686        _g_object_unref0 (builder);
00687 }
00688 
00689 
00690 static void unity_tester_unity_tool_ui_results_row_added_cb (UnityTesterUnityToolUi* self, DeeModel* model, DeeModelIter* iter) {
00691        DeeModel* _tmp0_;
00692        DeeModelIter* _tmp1_;
00693        GVariant** _tmp2_;
00694        GVariant** _tmp3_ = NULL;
00695        GVariant** row;
00696        gint row_length1;
00697        gint _row_size_;
00698        GtkTreeIter uiiter = {0};
00699        GtkListStore* _tmp4_;
00700        GtkTreeIter _tmp5_ = {0};
00701        GtkListStore* _tmp6_;
00702        GtkTreeIter _tmp7_;
00703        GVariant* _tmp8_;
00704        const gchar* _tmp9_ = NULL;
00705        GVariant* _tmp10_;
00706        const gchar* _tmp11_ = NULL;
00707        GVariant* _tmp12_;
00708        guint32 _tmp13_ = 0U;
00709        GVariant* _tmp14_;
00710        const gchar* _tmp15_ = NULL;
00711        GVariant* _tmp16_;
00712        const gchar* _tmp17_ = NULL;
00713        GVariant* _tmp18_;
00714        const gchar* _tmp19_ = NULL;
00715        GVariant* _tmp20_;
00716        const gchar* _tmp21_ = NULL;
00717        g_return_if_fail (self != NULL);
00718        g_return_if_fail (model != NULL);
00719        g_return_if_fail (iter != NULL);
00720        _tmp0_ = model;
00721        _tmp1_ = iter;
00722        _tmp3_ = _tmp2_ = dee_model_get_row (_tmp0_, _tmp1_, NULL);
00723        row = _tmp3_;
00724        row_length1 = _vala_array_length (_tmp2_);
00725        _row_size_ = row_length1;
00726        _tmp4_ = self->priv->uimodel;
00727        gtk_list_store_append (_tmp4_, &_tmp5_);
00728        uiiter = _tmp5_;
00729        _tmp6_ = self->priv->uimodel;
00730        _tmp7_ = uiiter;
00731        _tmp8_ = row[0];
00732        _tmp9_ = g_variant_get_string (_tmp8_, NULL);
00733        _tmp10_ = row[1];
00734        _tmp11_ = g_variant_get_string (_tmp10_, NULL);
00735        _tmp12_ = row[2];
00736        _tmp13_ = g_variant_get_uint32 (_tmp12_);
00737        _tmp14_ = row[3];
00738        _tmp15_ = g_variant_get_string (_tmp14_, NULL);
00739        _tmp16_ = row[4];
00740        _tmp17_ = g_variant_get_string (_tmp16_, NULL);
00741        _tmp18_ = row[5];
00742        _tmp19_ = g_variant_get_string (_tmp18_, NULL);
00743        _tmp20_ = row[6];
00744        _tmp21_ = g_variant_get_string (_tmp20_, NULL);
00745        gtk_list_store_set (_tmp6_, &_tmp7_, 0, _tmp9_, 1, _tmp11_, 2, _tmp13_, 3, _tmp15_, 4, _tmp17_, 5, _tmp19_, 6, _tmp21_, -1, -1);
00746        row = (_vala_array_free (row, row_length1, (GDestroyNotify) g_variant_unref), NULL);
00747 }
00748 
00749 
00750 static void unity_tester_unity_tool_ui_filters_row_added_cb (UnityTesterUnityToolUi* self, DeeModel* model, DeeModelIter* iter) {
00751        DeeModel* _tmp0_;
00752        DeeModelIter* _tmp1_;
00753        GVariant** _tmp2_;
00754        GVariant** _tmp3_ = NULL;
00755        GVariant** row;
00756        gint row_length1;
00757        gint _row_size_;
00758        GtkTreeIter uiiter = {0};
00759        GtkListStore* _tmp4_;
00760        GtkTreeIter _tmp5_ = {0};
00761        GtkListStore* _tmp6_;
00762        GtkTreeIter _tmp7_;
00763        GVariant* _tmp8_;
00764        const gchar* _tmp9_ = NULL;
00765        GVariant* _tmp10_;
00766        const gchar* _tmp11_ = NULL;
00767        GVariant* _tmp12_;
00768        const gchar* _tmp13_ = NULL;
00769        GVariant* _tmp14_;
00770        const gchar* _tmp15_ = NULL;
00771        GVariant* _tmp16_;
00772        gchar* _tmp17_ = NULL;
00773        gchar* _tmp18_;
00774        GVariant* _tmp19_;
00775        gboolean _tmp20_ = FALSE;
00776        GVariant* _tmp21_;
00777        gboolean _tmp22_ = FALSE;
00778        GVariant* _tmp23_;
00779        gboolean _tmp24_ = FALSE;
00780        g_return_if_fail (self != NULL);
00781        g_return_if_fail (model != NULL);
00782        g_return_if_fail (iter != NULL);
00783        _tmp0_ = model;
00784        _tmp1_ = iter;
00785        _tmp3_ = _tmp2_ = dee_model_get_row (_tmp0_, _tmp1_, NULL);
00786        row = _tmp3_;
00787        row_length1 = _vala_array_length (_tmp2_);
00788        _row_size_ = row_length1;
00789        _tmp4_ = self->priv->ui_filter_model;
00790        gtk_list_store_append (_tmp4_, &_tmp5_);
00791        uiiter = _tmp5_;
00792        _tmp6_ = self->priv->ui_filter_model;
00793        _tmp7_ = uiiter;
00794        _tmp8_ = row[0];
00795        _tmp9_ = g_variant_get_string (_tmp8_, NULL);
00796        _tmp10_ = row[1];
00797        _tmp11_ = g_variant_get_string (_tmp10_, NULL);
00798        _tmp12_ = row[2];
00799        _tmp13_ = g_variant_get_string (_tmp12_, NULL);
00800        _tmp14_ = row[3];
00801        _tmp15_ = g_variant_get_string (_tmp14_, NULL);
00802        _tmp16_ = row[4];
00803        _tmp17_ = g_variant_print (_tmp16_, TRUE);
00804        _tmp18_ = _tmp17_;
00805        _tmp19_ = row[5];
00806        _tmp20_ = g_variant_get_boolean (_tmp19_);
00807        _tmp21_ = row[6];
00808        _tmp22_ = g_variant_get_boolean (_tmp21_);
00809        _tmp23_ = row[7];
00810        _tmp24_ = g_variant_get_boolean (_tmp23_);
00811        gtk_list_store_set (_tmp6_, &_tmp7_, 0, _tmp9_, 1, _tmp11_, 2, _tmp13_, 3, _tmp15_, 4, _tmp18_, 5, _tmp20_, 6, _tmp22_, 7, _tmp24_, -1, -1);
00812        _g_free0 (_tmp18_);
00813        row = (_vala_array_free (row, row_length1, (GDestroyNotify) g_variant_unref), NULL);
00814 }
00815 
00816 
00817 static void unity_tester_unity_tool_ui_update_status (UnityTesterUnityToolUi* self) {
00818        GtkStatusbar* _tmp0_;
00819        guint _tmp1_;
00820        GtkStatusbar* _tmp2_;
00821        guint _tmp3_;
00822        DeeSharedModel* _tmp4_;
00823        guint _tmp5_ = 0U;
00824        gchar* _tmp6_ = NULL;
00825        gchar* _tmp7_;
00826        gchar* _tmp8_;
00827        gchar* _tmp9_;
00828        const gchar* _tmp10_;
00829        gchar* _tmp11_;
00830        gchar* _tmp12_;
00831        gchar* _tmp13_;
00832        gchar* _tmp14_;
00833        const gchar* _tmp15_;
00834        gchar* _tmp16_;
00835        gchar* _tmp17_;
00836        g_return_if_fail (self != NULL);
00837        _tmp0_ = self->priv->statusbar;
00838        _tmp1_ = self->priv->statusbar_info_ctx;
00839        gtk_statusbar_pop (_tmp0_, _tmp1_);
00840        _tmp2_ = self->priv->statusbar;
00841        _tmp3_ = self->priv->statusbar_info_ctx;
00842        _tmp4_ = self->priv->dee_results_model;
00843        _tmp5_ = dee_model_get_n_rows ((DeeModel*) _tmp4_);
00844        _tmp6_ = g_strdup_printf ("%u records", _tmp5_);
00845        _tmp7_ = _tmp6_;
00846        _tmp8_ = g_strconcat (_tmp7_, ", DBus name: ", NULL);
00847        _tmp9_ = _tmp8_;
00848        _tmp10_ = unity_tester_options_lens_dbus_name;
00849        _tmp11_ = g_strconcat (_tmp9_, _tmp10_, NULL);
00850        _tmp12_ = _tmp11_;
00851        _tmp13_ = g_strconcat (_tmp12_, " path: ", NULL);
00852        _tmp14_ = _tmp13_;
00853        _tmp15_ = unity_tester_options_lens_dbus_path;
00854        _tmp16_ = g_strconcat (_tmp14_, _tmp15_, NULL);
00855        _tmp17_ = _tmp16_;
00856        gtk_statusbar_push (_tmp2_, _tmp3_, _tmp17_);
00857        _g_free0 (_tmp17_);
00858        _g_free0 (_tmp14_);
00859        _g_free0 (_tmp12_);
00860        _g_free0 (_tmp9_);
00861        _g_free0 (_tmp7_);
00862 }
00863 
00864 
00865 static void unity_tester_unity_tool_ui_model_synchronized_cb (UnityTesterUnityToolUi* self) {
00866        GtkSpinner* _tmp0_;
00867        DeeSharedModel* _tmp1_;
00868        guint _tmp2_ = 0U;
00869        gchar* _tmp3_ = NULL;
00870        gchar* _tmp4_;
00871        g_return_if_fail (self != NULL);
00872        _tmp0_ = self->priv->spinner;
00873        gtk_spinner_stop (_tmp0_);
00874        unity_tester_unity_tool_ui_update_status (self);
00875        _tmp1_ = self->priv->dee_results_model;
00876        _tmp2_ = dee_model_get_n_rows ((DeeModel*) _tmp1_);
00877        _tmp3_ = g_strdup_printf ("Search returned %u records\n", _tmp2_);
00878        _tmp4_ = _tmp3_;
00879        unity_tester_unity_tool_ui_append_log_message (self, _tmp4_);
00880        _g_free0 (_tmp4_);
00881        _g_object_unref0 (self->priv->dee_results_model);
00882        self->priv->dee_results_model = NULL;
00883 }
00884 
00885 
00886 static void unity_tester_unity_tool_ui_filter_model_synchronized_cb (UnityTesterUnityToolUi* self) {
00887        g_return_if_fail (self != NULL);
00888        _g_object_unref0 (self->priv->dee_filters_model);
00889        self->priv->dee_filters_model = NULL;
00890 }
00891 
00892 
00896 void unity_tester_unity_tool_ui_on_lens_connect (GtkDialog* dlg, gint response, UnityTesterUnityToolUi* self) {
00897        gint _tmp0_;
00898        gboolean _tmp9_ = FALSE;
00899        gboolean _tmp10_ = FALSE;
00900        gboolean _tmp11_ = FALSE;
00901        const gchar* _tmp12_;
00902        gboolean _tmp16_;
00903        gboolean _tmp18_;
00904        gboolean _tmp22_;
00905        GtkDialog* _tmp27_;
00906        g_return_if_fail (self != NULL);
00907        g_return_if_fail (dlg != NULL);
00908        _tmp0_ = response;
00909        if (_tmp0_ == 1) {
00910               GtkEntry* _tmp1_;
00911               const gchar* _tmp2_;
00912               const gchar* _tmp3_;
00913               gchar* _tmp4_;
00914               GtkEntry* _tmp5_;
00915               const gchar* _tmp6_;
00916               const gchar* _tmp7_;
00917               gchar* _tmp8_;
00918               _tmp1_ = self->priv->dbus_name_entry;
00919               _tmp2_ = gtk_entry_get_text (_tmp1_);
00920               _tmp3_ = _tmp2_;
00921               _tmp4_ = g_strdup (_tmp3_);
00922               _g_free0 (unity_tester_options_lens_dbus_name);
00923               unity_tester_options_lens_dbus_name = _tmp4_;
00924               _tmp5_ = self->priv->dbus_path_entry;
00925               _tmp6_ = gtk_entry_get_text (_tmp5_);
00926               _tmp7_ = _tmp6_;
00927               _tmp8_ = g_strdup (_tmp7_);
00928               _g_free0 (unity_tester_options_lens_dbus_path);
00929               unity_tester_options_lens_dbus_path = _tmp8_;
00930        }
00931        _tmp12_ = unity_tester_options_lens_dbus_path;
00932        if (_tmp12_ == NULL) {
00933               _tmp11_ = TRUE;
00934        } else {
00935               const gchar* _tmp13_;
00936               gint _tmp14_;
00937               gint _tmp15_;
00938               _tmp13_ = unity_tester_options_lens_dbus_path;
00939               _tmp14_ = strlen (_tmp13_);
00940               _tmp15_ = _tmp14_;
00941               _tmp11_ = _tmp15_ == 0;
00942        }
00943        _tmp16_ = _tmp11_;
00944        if (_tmp16_) {
00945               _tmp10_ = TRUE;
00946        } else {
00947               const gchar* _tmp17_;
00948               _tmp17_ = unity_tester_options_lens_dbus_name;
00949               _tmp10_ = _tmp17_ == NULL;
00950        }
00951        _tmp18_ = _tmp10_;
00952        if (_tmp18_) {
00953               _tmp9_ = TRUE;
00954        } else {
00955               const gchar* _tmp19_;
00956               gint _tmp20_;
00957               gint _tmp21_;
00958               _tmp19_ = unity_tester_options_lens_dbus_name;
00959               _tmp20_ = strlen (_tmp19_);
00960               _tmp21_ = _tmp20_;
00961               _tmp9_ = _tmp21_ == 0;
00962        }
00963        _tmp22_ = _tmp9_;
00964        if (_tmp22_) {
00965               GtkEntry* _tmp23_;
00966               GtkButton* _tmp24_;
00967               _tmp23_ = self->priv->search_entry;
00968               gtk_widget_set_sensitive ((GtkWidget*) _tmp23_, FALSE);
00969               _tmp24_ = self->priv->search_button;
00970               gtk_widget_set_sensitive ((GtkWidget*) _tmp24_, FALSE);
00971        } else {
00972               GtkEntry* _tmp25_;
00973               GtkButton* _tmp26_;
00974               _tmp25_ = self->priv->search_entry;
00975               gtk_widget_set_sensitive ((GtkWidget*) _tmp25_, TRUE);
00976               _tmp26_ = self->priv->search_button;
00977               gtk_widget_set_sensitive ((GtkWidget*) _tmp26_, TRUE);
00978        }
00979        _tmp27_ = dlg;
00980        gtk_widget_destroy ((GtkWidget*) _tmp27_);
00981 }
00982 
00983 
00988 void unity_tester_unity_tool_ui_on_from_lens_clicked (GtkButton* btn, UnityTesterUnityToolUi* self) {
00989        GtkFileFilter* _tmp0_;
00990        GtkFileFilter* filter;
00991        GtkFileFilter* _tmp1_;
00992        GtkFileFilter* _tmp2_;
00993        GtkFileChooserDialog* _tmp3_;
00994        GtkFileChooserDialog* file_chooser;
00995        GtkFileChooserDialog* _tmp4_;
00996        GtkFileFilter* _tmp5_;
00997        GtkFileChooserDialog* _tmp6_;
00998        gint _tmp7_ = 0;
00999        GtkFileChooserDialog* _tmp24_;
01000        GError * _inner_error_ = NULL;
01001        g_return_if_fail (self != NULL);
01002        g_return_if_fail (btn != NULL);
01003        _tmp0_ = gtk_file_filter_new ();
01004        g_object_ref_sink (_tmp0_);
01005        filter = _tmp0_;
01006        _tmp1_ = filter;
01007        gtk_buildable_set_name ((GtkBuildable*) _tmp1_, "Lens files");
01008        _tmp2_ = filter;
01009        gtk_file_filter_add_pattern (_tmp2_, "*.lens");
01010        _tmp3_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new ("Open Lens file", NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, 0, GTK_STOCK_OPEN, 1, NULL);
01011        g_object_ref_sink (_tmp3_);
01012        file_chooser = _tmp3_;
01013        _tmp4_ = file_chooser;
01014        _tmp5_ = filter;
01015        gtk_file_chooser_set_filter ((GtkFileChooser*) _tmp4_, _tmp5_);
01016        _tmp6_ = file_chooser;
01017        _tmp7_ = gtk_dialog_run ((GtkDialog*) _tmp6_);
01018        if (_tmp7_ == 1) {
01019               {
01020                      GtkFileChooserDialog* _tmp8_;
01021                      gchar* _tmp9_ = NULL;
01022                      gchar* _tmp10_;
01023                      GtkEntry* _tmp11_;
01024                      const gchar* _tmp12_;
01025                      GtkEntry* _tmp13_;
01026                      const gchar* _tmp14_;
01027                      _tmp8_ = file_chooser;
01028                      _tmp9_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp8_);
01029                      _tmp10_ = _tmp9_;
01030                      unity_tester_get_lens_params_from_file (_tmp10_, &_inner_error_);
01031                      _g_free0 (_tmp10_);
01032                      if (_inner_error_ != NULL) {
01033                             goto __catch12_g_error;
01034                      }
01035                      _tmp11_ = self->priv->dbus_name_entry;
01036                      _tmp12_ = unity_tester_options_lens_dbus_name;
01037                      gtk_entry_set_text (_tmp11_, _tmp12_);
01038                      _tmp13_ = self->priv->dbus_path_entry;
01039                      _tmp14_ = unity_tester_options_lens_dbus_path;
01040                      gtk_entry_set_text (_tmp13_, _tmp14_);
01041               }
01042               goto __finally12;
01043               __catch12_g_error:
01044               {
01045                      GError* e = NULL;
01046                      GError* _tmp15_;
01047                      const gchar* _tmp16_;
01048                      gchar* _tmp17_ = NULL;
01049                      gchar* _tmp18_;
01050                      GtkMessageDialog* _tmp19_;
01051                      GtkDialog* _tmp20_;
01052                      GtkDialog* dlg;
01053                      GtkDialog* _tmp21_;
01054                      GtkDialog* _tmp22_;
01055                      GtkDialog* _tmp23_;
01056                      e = _inner_error_;
01057                      _inner_error_ = NULL;
01058                      _tmp15_ = e;
01059                      _tmp16_ = _tmp15_->message;
01060                      _tmp17_ = g_strdup_printf ("Error loading lens parameters from file:\n%s", _tmp16_);
01061                      _tmp18_ = _tmp17_;
01062                      _tmp19_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _tmp18_);
01063                      g_object_ref_sink (_tmp19_);
01064                      _tmp20_ = (GtkDialog*) _tmp19_;
01065                      _g_free0 (_tmp18_);
01066                      dlg = _tmp20_;
01067                      _tmp21_ = dlg;
01068                      gtk_window_set_title ((GtkWindow*) _tmp21_, "Error loading lens file");
01069                      _tmp22_ = dlg;
01070                      gtk_dialog_run (_tmp22_);
01071                      _tmp23_ = dlg;
01072                      gtk_widget_destroy ((GtkWidget*) _tmp23_);
01073                      _g_object_unref0 (dlg);
01074                      _g_error_free0 (e);
01075               }
01076               __finally12:
01077               if (_inner_error_ != NULL) {
01078                      _g_object_unref0 (file_chooser);
01079                      _g_object_unref0 (filter);
01080                      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);
01081                      g_clear_error (&_inner_error_);
01082                      return;
01083               }
01084        }
01085        _tmp24_ = file_chooser;
01086        gtk_widget_destroy ((GtkWidget*) _tmp24_);
01087        _g_object_unref0 (file_chooser);
01088        _g_object_unref0 (filter);
01089 }
01090 
01091 
01095 static void unity_tester_unity_tool_ui_append_log_message (UnityTesterUnityToolUi* self, const gchar* message) {
01096        GtkTextIter iter = {0};
01097        GtkTextBuffer* _tmp0_;
01098        GtkTextIter _tmp1_ = {0};
01099        GtkTextBuffer* _tmp2_;
01100        const gchar* _tmp3_;
01101        g_return_if_fail (self != NULL);
01102        g_return_if_fail (message != NULL);
01103        _tmp0_ = self->priv->log_buffer;
01104        gtk_text_buffer_get_end_iter (_tmp0_, &_tmp1_);
01105        iter = _tmp1_;
01106        _tmp2_ = self->priv->log_buffer;
01107        _tmp3_ = message;
01108        gtk_text_buffer_insert (_tmp2_, &iter, _tmp3_, -1);
01109 }
01110 
01111 
01115 static void __lambda6_ (UnityTesterUnityToolUi* self, const gchar* msg) {
01116        const gchar* _tmp0_;
01117        _tmp0_ = msg;
01118        unity_tester_unity_tool_ui_handle_error (self, _tmp0_);
01119 }
01120 
01121 
01122 static void ___lambda6__gfunc (gconstpointer data, gpointer self) {
01123        __lambda6_ (self, data);
01124 }
01125 
01126 
01127 static void _unity_tester_unity_tool_ui_model_synchronized_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
01128        unity_tester_unity_tool_ui_model_synchronized_cb (self);
01129 }
01130 
01131 
01132 static void _unity_tester_unity_tool_ui_results_row_added_cb_dee_model_row_added (DeeModel* _sender, DeeModelIter* iter, gpointer self) {
01133        unity_tester_unity_tool_ui_results_row_added_cb (self, _sender, iter);
01134 }
01135 
01136 
01137 static void _unity_tester_unity_tool_ui_filter_model_synchronized_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
01138        unity_tester_unity_tool_ui_filter_model_synchronized_cb (self);
01139 }
01140 
01141 
01142 static void _unity_tester_unity_tool_ui_filters_row_added_cb_dee_model_row_added (DeeModel* _sender, DeeModelIter* iter, gpointer self) {
01143        unity_tester_unity_tool_ui_filters_row_added_cb (self, _sender, iter);
01144 }
01145 
01146 
01147 static void unity_tester_unity_tool_ui_request_lens_info (UnityTesterUnityToolUi* self) {
01148        GtkSpinner* _tmp0_;
01149        DeeSharedModel* _tmp1_;
01150        DeeSharedModel* _tmp2_;
01151        GtkListStore* _tmp3_;
01152        GtkListStore* _tmp4_;
01153        UnityTesterLensInfo _tmp5_ = {0};
01154        UnityTesterLensInfo info;
01155        const gchar* _tmp6_ = NULL;
01156        GtkRadioButton* _tmp7_;
01157        gboolean _tmp8_ = FALSE;
01158        const gchar* _tmp13_;
01159        gchar* _tmp14_;
01160        gchar* model_name;
01161        DeeSharedModel* _tmp15_;
01162        DeeSharedModel* _tmp16_;
01163        gulong _tmp17_ = 0UL;
01164        DeeSharedModel* _tmp18_;
01165        UnityTesterLensInfo _tmp19_;
01166        const gchar* _tmp20_;
01167        DeeSharedModel* _tmp21_;
01168        DeeSharedModel* _tmp22_;
01169        gulong _tmp23_ = 0UL;
01170        DeeSharedModel* _tmp24_;
01171        g_return_if_fail (self != NULL);
01172        _tmp0_ = self->priv->spinner;
01173        gtk_spinner_start (_tmp0_);
01174        _tmp1_ = self->priv->dee_filters_model;
01175        if (_tmp1_ != NULL) {
01176               _g_object_unref0 (self->priv->dee_filters_model);
01177               self->priv->dee_filters_model = NULL;
01178        }
01179        _tmp2_ = self->priv->dee_results_model;
01180        if (_tmp2_ != NULL) {
01181               _g_object_unref0 (self->priv->dee_results_model);
01182               self->priv->dee_results_model = NULL;
01183        }
01184        _tmp3_ = self->priv->uimodel;
01185        gtk_list_store_clear (_tmp3_);
01186        _tmp4_ = self->priv->ui_filter_model;
01187        gtk_list_store_clear (_tmp4_);
01188        unity_tester_get_lens_info (___lambda6__gfunc, self, &_tmp5_);
01189        info = _tmp5_;
01190        _tmp7_ = self->priv->search_type_global_rbutton;
01191        _tmp8_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp7_);
01192        if (_tmp8_) {
01193               UnityTesterLensInfo _tmp9_;
01194               const gchar* _tmp10_;
01195               _tmp9_ = info;
01196               _tmp10_ = _tmp9_.global_results_model_name;
01197               _tmp6_ = _tmp10_;
01198        } else {
01199               UnityTesterLensInfo _tmp11_;
01200               const gchar* _tmp12_;
01201               _tmp11_ = info;
01202               _tmp12_ = _tmp11_.results_model_name;
01203               _tmp6_ = _tmp12_;
01204        }
01205        _tmp13_ = _tmp6_;
01206        _tmp14_ = g_strdup (_tmp13_);
01207        model_name = _tmp14_;
01208        _tmp15_ = (DeeSharedModel*) dee_shared_model_new (model_name);
01209        _g_object_unref0 (self->priv->dee_results_model);
01210        self->priv->dee_results_model = _tmp15_;
01211        _tmp16_ = self->priv->dee_results_model;
01212        _tmp17_ = g_signal_connect_object ((GObject*) _tmp16_, "notify::synchronized", (GCallback) _unity_tester_unity_tool_ui_model_synchronized_cb_g_object_notify, self, 0);
01213        self->priv->model_sync_sig_id = _tmp17_;
01214        _tmp18_ = self->priv->dee_results_model;
01215        g_signal_connect_object ((DeeModel*) _tmp18_, "row-added", (GCallback) _unity_tester_unity_tool_ui_results_row_added_cb_dee_model_row_added, self, 0);
01216        _tmp19_ = info;
01217        _tmp20_ = _tmp19_.filters_model_name;
01218        _tmp21_ = (DeeSharedModel*) dee_shared_model_new (_tmp20_);
01219        _g_object_unref0 (self->priv->dee_filters_model);
01220        self->priv->dee_filters_model = _tmp21_;
01221        _tmp22_ = self->priv->dee_filters_model;
01222        _tmp23_ = g_signal_connect_object ((GObject*) _tmp22_, "notify::synchronized", (GCallback) _unity_tester_unity_tool_ui_filter_model_synchronized_cb_g_object_notify, self, 0);
01223        self->priv->filters_model_sync_sig_id = _tmp23_;
01224        _tmp24_ = self->priv->dee_filters_model;
01225        g_signal_connect_object ((DeeModel*) _tmp24_, "row-added", (GCallback) _unity_tester_unity_tool_ui_filters_row_added_cb_dee_model_row_added, self, 0);
01226        _g_free0 (model_name);
01227        unity_tester_lens_info_destroy (&info);
01228 }
01229 
01230 
01231 void unity_tester_unity_tool_ui_on_results_button_clicked (GtkButton* btn, UnityTesterUnityToolUi* self) {
01232        g_return_if_fail (self != NULL);
01233        g_return_if_fail (btn != NULL);
01234        unity_tester_unity_tool_ui_request_lens_info (self);
01235 }
01236 
01237 
01241 static void ____lambda8_ (UnityTesterUnityToolUi* self, GVariant* _result_) {
01242        GVariant* _tmp0_;
01243        gchar* _tmp1_ = NULL;
01244        gchar* _tmp2_;
01245        gchar* _tmp3_;
01246        gchar* _tmp4_;
01247        _tmp0_ = _result_;
01248        _tmp1_ = g_variant_print (_tmp0_, TRUE);
01249        _tmp2_ = _tmp1_;
01250        _tmp3_ = g_strconcat (_tmp2_, "\n", NULL);
01251        _tmp4_ = _tmp3_;
01252        unity_tester_unity_tool_ui_append_log_message (self, _tmp4_);
01253        _g_free0 (_tmp4_);
01254        _g_free0 (_tmp2_);
01255        unity_tester_unity_tool_ui_request_lens_info (self);
01256 }
01257 
01258 
01259 static void _____lambda8__gfunc (gconstpointer data, gpointer self) {
01260        ____lambda8_ (self, data);
01261 }
01262 
01263 
01264 static void ____lambda9_ (UnityTesterUnityToolUi* self, const gchar* msg) {
01265        const gchar* _tmp0_;
01266        _tmp0_ = msg;
01267        unity_tester_unity_tool_ui_handle_error (self, _tmp0_);
01268 }
01269 
01270 
01271 static void _____lambda9__gfunc (gconstpointer data, gpointer self) {
01272        ____lambda9_ (self, data);
01273 }
01274 
01275 
01276 void unity_tester_unity_tool_ui_on_search_button_clicked (GtkButton* btn, UnityTesterUnityToolUi* self) {
01277        GtkEntry* _tmp0_;
01278        const gchar* _tmp1_;
01279        const gchar* _tmp2_;
01280        gchar* _tmp3_;
01281        gchar* text;
01282        const gchar* _tmp4_;
01283        g_return_if_fail (self != NULL);
01284        g_return_if_fail (btn != NULL);
01285        _tmp0_ = self->priv->search_entry;
01286        _tmp1_ = gtk_entry_get_text (_tmp0_);
01287        _tmp2_ = _tmp1_;
01288        _tmp3_ = g_strdup (_tmp2_);
01289        text = _tmp3_;
01290        _tmp4_ = text;
01291        if (g_strcmp0 (_tmp4_, "") != 0) {
01292               GtkSpinner* _tmp5_;
01293               gboolean _tmp6_ = FALSE;
01294               const gchar* _tmp7_;
01295               gboolean _tmp8_ = FALSE;
01296               gboolean _tmp11_;
01297               _tmp5_ = self->priv->spinner;
01298               gtk_spinner_start (_tmp5_);
01299               _tmp7_ = unity_tester_options_lens_dbus_name;
01300               _tmp8_ = g_dbus_is_name (_tmp7_);
01301               if (_tmp8_) {
01302                      const gchar* _tmp9_;
01303                      gboolean _tmp10_ = FALSE;
01304                      _tmp9_ = unity_tester_options_lens_dbus_path;
01305                      _tmp10_ = g_variant_is_object_path (_tmp9_);
01306                      _tmp6_ = _tmp10_;
01307               } else {
01308                      _tmp6_ = FALSE;
01309               }
01310               _tmp11_ = _tmp6_;
01311               if (_tmp11_) {
01312                      const gchar* _tmp12_ = NULL;
01313                      GtkRadioButton* _tmp13_;
01314                      gboolean _tmp14_ = FALSE;
01315                      const gchar* _tmp15_;
01316                      const gchar* _tmp16_;
01317                      const gchar* _tmp17_;
01318                      const gchar* _tmp18_;
01319                      gchar* _tmp19_ = NULL;
01320                      gchar* _tmp20_;
01321                      gint _tmp21_ = 0;
01322                      GtkRadioButton* _tmp22_;
01323                      gboolean _tmp23_ = FALSE;
01324                      const gchar* _tmp24_;
01325                      gint _tmp25_;
01326                      _tmp13_ = self->priv->search_type_global_rbutton;
01327                      _tmp14_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp13_);
01328                      if (_tmp14_) {
01329                             _tmp12_ = "global";
01330                      } else {
01331                             _tmp12_ = "local";
01332                      }
01333                      _tmp15_ = text;
01334                      _tmp16_ = _tmp12_;
01335                      _tmp17_ = unity_tester_options_lens_dbus_name;
01336                      _tmp18_ = unity_tester_options_lens_dbus_path;
01337                      _tmp19_ = g_strdup_printf ("Query: '%s' (%s), DBus name: %s, DBus path: %s\n", _tmp15_, _tmp16_, _tmp17_, _tmp18_);
01338                      _tmp20_ = _tmp19_;
01339                      unity_tester_unity_tool_ui_append_log_message (self, _tmp20_);
01340                      _g_free0 (_tmp20_);
01341                      _tmp22_ = self->priv->search_type_global_rbutton;
01342                      _tmp23_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp22_);
01343                      if (_tmp23_) {
01344                             _tmp21_ = 1;
01345                      } else {
01346                             _tmp21_ = 0;
01347                      }
01348                      _tmp24_ = text;
01349                      _tmp25_ = _tmp21_;
01350                      unity_tester_call_lens_search (_tmp24_, _tmp25_, _____lambda8__gfunc, self, _____lambda9__gfunc, self);
01351               } else {
01352                      unity_tester_unity_tool_ui_handle_error (self, "Invalid DBus name/path");
01353               }
01354        }
01355        _g_free0 (text);
01356 }
01357 
01358 
01362 static void unity_tester_unity_tool_ui_handle_error (UnityTesterUnityToolUi* self, const gchar* message) {
01363        GtkSpinner* _tmp0_;
01364        GtkStatusbar* _tmp1_;
01365        guint _tmp2_;
01366        GtkStatusbar* _tmp3_;
01367        guint _tmp4_;
01368        const gchar* _tmp5_;
01369        const gchar* _tmp6_;
01370        gchar* _tmp7_;
01371        gchar* _tmp8_;
01372        g_return_if_fail (self != NULL);
01373        g_return_if_fail (message != NULL);
01374        _tmp0_ = self->priv->spinner;
01375        gtk_spinner_stop (_tmp0_);
01376        _tmp1_ = self->priv->statusbar;
01377        _tmp2_ = self->priv->statusbar_error_ctx;
01378        gtk_statusbar_pop (_tmp1_, _tmp2_);
01379        _tmp3_ = self->priv->statusbar;
01380        _tmp4_ = self->priv->statusbar_error_ctx;
01381        _tmp5_ = message;
01382        gtk_statusbar_push (_tmp3_, _tmp4_, _tmp5_);
01383        _tmp6_ = message;
01384        _tmp7_ = g_strconcat (_tmp6_, "\n", NULL);
01385        _tmp8_ = _tmp7_;
01386        unity_tester_unity_tool_ui_append_log_message (self, _tmp8_);
01387        _g_free0 (_tmp8_);
01388 }
01389 
01390 
01391 static void unity_tester_unity_tool_ui_class_init (UnityTesterUnityToolUiClass * klass) {
01392        unity_tester_unity_tool_ui_parent_class = g_type_class_peek_parent (klass);
01393        g_type_class_add_private (klass, sizeof (UnityTesterUnityToolUiPrivate));
01394        G_OBJECT_CLASS (klass)->finalize = unity_tester_unity_tool_ui_finalize;
01395 }
01396 
01397 
01398 static void unity_tester_unity_tool_ui_instance_init (UnityTesterUnityToolUi * self) {
01399        self->priv = UNITY_TESTER_UNITY_TOOL_UI_GET_PRIVATE (self);
01400        self->priv->search_type_global_rbutton = NULL;
01401        self->priv->lens_connect_dlg = NULL;
01402        self->priv->spinner = NULL;
01403        self->priv->lens_discovery_spinner = NULL;
01404        self->priv->search_button = NULL;
01405        self->priv->statusbar = NULL;
01406        self->priv->log_buffer = NULL;
01407        self->priv->search_entry = NULL;
01408        self->priv->dbus_name_entry = NULL;
01409        self->priv->dbus_path_entry = NULL;
01410        self->priv->lens_list_combobox = NULL;
01411        self->priv->uimodel = NULL;
01412        self->priv->ui_filter_model = NULL;
01413        self->priv->lens_list_model = NULL;
01414        self->priv->dee_results_model = NULL;
01415        self->priv->dee_filters_model = NULL;
01416 }
01417 
01418 
01419 static void unity_tester_unity_tool_ui_finalize (GObject* obj) {
01420        UnityTesterUnityToolUi * self;
01421        self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_TESTER_TYPE_UNITY_TOOL_UI, UnityTesterUnityToolUi);
01422        _g_object_unref0 (self->priv->search_type_global_rbutton);
01423        _g_object_unref0 (self->priv->lens_connect_dlg);
01424        _g_object_unref0 (self->priv->spinner);
01425        _g_object_unref0 (self->priv->lens_discovery_spinner);
01426        _g_object_unref0 (self->priv->search_button);
01427        _g_object_unref0 (self->priv->statusbar);
01428        _g_object_unref0 (self->priv->log_buffer);
01429        _g_object_unref0 (self->priv->search_entry);
01430        _g_object_unref0 (self->priv->dbus_name_entry);
01431        _g_object_unref0 (self->priv->dbus_path_entry);
01432        _g_object_unref0 (self->priv->lens_list_combobox);
01433        _g_object_unref0 (self->priv->uimodel);
01434        _g_object_unref0 (self->priv->ui_filter_model);
01435        _g_object_unref0 (self->priv->lens_list_model);
01436        _g_object_unref0 (self->priv->dee_results_model);
01437        _g_object_unref0 (self->priv->dee_filters_model);
01438        G_OBJECT_CLASS (unity_tester_unity_tool_ui_parent_class)->finalize (obj);
01439 }
01440 
01441 
01442 GType unity_tester_unity_tool_ui_get_type (void) {
01443        static volatile gsize unity_tester_unity_tool_ui_type_id__volatile = 0;
01444        if (g_once_init_enter (&unity_tester_unity_tool_ui_type_id__volatile)) {
01445               static const GTypeInfo g_define_type_info = { sizeof (UnityTesterUnityToolUiClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_tester_unity_tool_ui_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityTesterUnityToolUi), 0, (GInstanceInitFunc) unity_tester_unity_tool_ui_instance_init, NULL };
01446               GType unity_tester_unity_tool_ui_type_id;
01447               unity_tester_unity_tool_ui_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityTesterUnityToolUi", &g_define_type_info, 0);
01448               g_once_init_leave (&unity_tester_unity_tool_ui_type_id__volatile, unity_tester_unity_tool_ui_type_id);
01449        }
01450        return unity_tester_unity_tool_ui_type_id__volatile;
01451 }
01452 
01453 
01454 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
01455        if ((array != NULL) && (destroy_func != NULL)) {
01456               int i;
01457               for (i = 0; i < array_length; i = i + 1) {
01458                      if (((gpointer*) array)[i] != NULL) {
01459                             destroy_func (((gpointer*) array)[i]);
01460                      }
01461               }
01462        }
01463 }
01464 
01465 
01466 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
01467        _vala_array_destroy (array, array_length, destroy_func);
01468        g_free (array);
01469 }
01470 
01471 
01472 static gint _vala_array_length (gpointer array) {
01473        int length;
01474        length = 0;
01475        if (array) {
01476               while (((gpointer*) array)[length]) {
01477                      length++;
01478               }
01479        }
01480        return length;
01481 }
01482 
01483 
01484