~ubuntu-branches/ubuntu/oneiric/gwibber/oneiric-proposed-201111142328

« back to all changes in this revision

Viewing changes to client/searches-item.c

  • Committer: Package Import Robot
  • Author(s): Ken VanDine, Jeremy Bicha
  • Date: 2011-09-27 15:54:26 UTC
  • mfrom: (1.1.61 upstream)
  • Revision ID: package-import@ubuntu.com-20110927155426-g2fz0rqo781l9j2q
Tags: 3.1.92-0ubuntu1
* New upstream release
  - Reflect changes in updated libunity API, from Mikkel Kamstrup 
    Erlandsen (LP: #844779)
  - Mark some strings for translation, thanks to Gabor Kelemen (LP: #846032)
  - Don't clean the pkgconfig files, thanks to Aaron Borden (LP: #846144)
  - nick and hashtag parsing is not unicode aware, thanks to 
    Tom Callaway (LP: #812482)
  - Don't claim to handle image mimetypes
  - foursquare: actually include content from version 3 of the 
    foursquare API, thanks to Teester!
  - Make sure we display valid menus for each service
  - queue a redraw after showing the entry, thanks to Neil Patel (LP: #812039)
* debian/patches/new_libunity_API.patch
  - Dropped, merged upstream

[Jeremy Bicha]
* debian/control
* debian/rules
  - Port to dh_python2
* debian/pycompat: Dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <gtk/gtk.h>
25
25
#include <gwibber-gtk.h>
26
26
#include <gwibber.h>
 
27
#include <glib/gi18n-lib.h>
27
28
#include <gdk/gdk.h>
28
29
#include <stdlib.h>
29
30
#include <string.h>
30
31
#include <gee.h>
31
32
#include <dee.h>
32
 
#include <glib/gi18n-lib.h>
33
33
 
34
34
 
35
35
#define TYPE_TAB_BAR_ITEM (tab_bar_item_get_type ())
131
131
void searches_item_raise (SearchesItem* self, TabBarItem* item);
132
132
static void searches_item_real_raise (SearchesItem* self, TabBarItem* item);
133
133
static GObject * searches_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
134
 
static void _lambda21_ (SearchesItem* self);
135
 
static void __lambda21__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
136
 
static void _lambda22_ (GtkEntryIconPosition pos, GdkEvent* event, SearchesItem* self);
137
 
static void __lambda22__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
138
 
static gboolean _lambda23_ (GtkWidget* t, GdkEventKey* e, SearchesItem* self);
139
 
static gboolean __lambda23__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
140
 
static void _lambda24_ (SearchesItem* self);
141
 
static void __lambda24__gtk_entry_activate (GtkEntry* _sender, gpointer self);
 
134
static void _lambda22_ (SearchesItem* self);
 
135
static void __lambda22__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 
136
static void _lambda23_ (GtkEntryIconPosition pos, GdkEvent* event, SearchesItem* self);
 
137
static void __lambda23__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
 
138
static gboolean _lambda24_ (GtkWidget* t, GdkEventKey* e, SearchesItem* self);
 
139
static gboolean __lambda24__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
142
140
static void _lambda25_ (SearchesItem* self);
143
 
static void __lambda25__gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self);
144
 
static void _lambda26_ (const gchar* id, SearchesItem* self);
 
141
static void __lambda25__gtk_entry_activate (GtkEntry* _sender, gpointer self);
 
142
static void _lambda26_ (SearchesItem* self);
 
143
static void __lambda26__gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self);
 
144
static void _lambda27_ (const gchar* id, SearchesItem* self);
145
145
const gchar* tab_bar_item_get_stream (TabBarItem* self);
146
 
static void __lambda26__gwibber_searches_updated (GwibberSearches* _sender, const gchar* id, gpointer self);
147
 
static void _lambda27_ (const gchar* id, const gchar* name, SearchesItem* self);
148
 
static void __lambda27__gwibber_gtk_search_view_show_transient (GwibberGtkSearchView* _sender, const gchar* id, const gchar* name, gpointer self);
 
146
static void __lambda27__gwibber_searches_updated (GwibberSearches* _sender, const gchar* id, gpointer self);
 
147
static void _lambda28_ (const gchar* id, const gchar* name, SearchesItem* self);
 
148
static void __lambda28__gwibber_gtk_search_view_show_transient (GwibberGtkSearchView* _sender, const gchar* id, const gchar* name, gpointer self);
149
149
TabWidgetsButton* tab_widgets_button_new (const gchar* text);
150
150
TabWidgetsButton* tab_widgets_button_construct (GType object_type, const gchar* text);
151
151
GType tab_widgets_button_get_type (void) G_GNUC_CONST;
152
 
static void _lambda28_ (SearchesItem* self);
153
 
static void __lambda28__gtk_button_clicked (GtkButton* _sender, gpointer self);
154
152
static void _lambda29_ (SearchesItem* self);
 
153
static void __lambda29__gtk_button_clicked (GtkButton* _sender, gpointer self);
 
154
static void _lambda30_ (SearchesItem* self);
155
155
gboolean tab_bar_item_get_active (TabBarItem* self);
156
 
static void __lambda29__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
157
 
static void _lambda30_ (SearchesItem* self);
158
156
static void __lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
159
157
static void _lambda31_ (SearchesItem* self);
160
158
static void __lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 
159
static void _lambda32_ (SearchesItem* self);
 
160
static void __lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
161
161
static void searches_item_finalize (GObject* obj);
162
162
static void _vala_searches_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
163
163
static void _vala_searches_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
165
165
 
166
166
SearchesItem* searches_item_construct (GType object_type, GwibberStreams* streams) {
167
167
        SearchesItem * self = NULL;
 
168
        const gchar* _tmp0_ = NULL;
168
169
        g_return_val_if_fail (streams != NULL, NULL);
169
 
        self = (SearchesItem*) g_object_new (object_type, "stream", "search", "icon-name", "stock_search", "tooltip", "Searches", "streams", streams, NULL);
 
170
        _tmp0_ = _ ("Searches");
 
171
        self = (SearchesItem*) g_object_new (object_type, "stream", "search", "icon-name", "stock_search", "tooltip", _tmp0_, "streams", streams, NULL);
170
172
        return self;
171
173
}
172
174
 
227
229
}
228
230
 
229
231
 
230
 
static void _lambda21_ (SearchesItem* self) {
 
232
static void _lambda22_ (SearchesItem* self) {
231
233
        gtk_widget_set_no_show_all ((GtkWidget*) self->priv->_stream_view, FALSE);
232
234
        gtk_widget_show_all ((GtkWidget*) self->priv->_stream_view);
233
235
}
234
236
 
235
237
 
236
 
static void __lambda21__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
237
 
        _lambda21_ (self);
 
238
static void __lambda22__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
239
        _lambda22_ (self);
238
240
}
239
241
 
240
242
 
241
 
static void _lambda22_ (GtkEntryIconPosition pos, GdkEvent* event, SearchesItem* self) {
 
243
static void _lambda23_ (GtkEntryIconPosition pos, GdkEvent* event, SearchesItem* self) {
242
244
        g_return_if_fail (event != NULL);
243
245
        if (pos == GTK_ENTRY_ICON_SECONDARY) {
244
246
                gtk_entry_set_text (self->priv->_entry, "");
246
248
}
247
249
 
248
250
 
249
 
static void __lambda22__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
250
 
        _lambda22_ (p0, p1, self);
 
251
static void __lambda23__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
 
252
        _lambda23_ (p0, p1, self);
251
253
}
252
254
 
253
255
 
254
 
static gboolean _lambda23_ (GtkWidget* t, GdkEventKey* e, SearchesItem* self) {
 
256
static gboolean _lambda24_ (GtkWidget* t, GdkEventKey* e, SearchesItem* self) {
255
257
        gboolean result = FALSE;
256
258
        g_return_val_if_fail (t != NULL, FALSE);
257
259
        if ((*e).keyval == 65307) {
264
266
}
265
267
 
266
268
 
267
 
static gboolean __lambda23__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
 
269
static gboolean __lambda24__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
268
270
        gboolean result;
269
 
        result = _lambda23_ (_sender, event, self);
 
271
        result = _lambda24_ (_sender, event, self);
270
272
        return result;
271
273
}
272
274
 
273
275
 
274
 
static void _lambda24_ (SearchesItem* self) {
 
276
static void _lambda25_ (SearchesItem* self) {
275
277
        const gchar* _tmp0_ = NULL;
276
278
        gchar* _tmp1_;
277
279
        gchar* query;
296
298
}
297
299
 
298
300
 
299
 
static void __lambda24__gtk_entry_activate (GtkEntry* _sender, gpointer self) {
300
 
        _lambda24_ (self);
 
301
static void __lambda25__gtk_entry_activate (GtkEntry* _sender, gpointer self) {
 
302
        _lambda25_ (self);
301
303
}
302
304
 
303
305
 
304
 
static void _lambda25_ (SearchesItem* self) {
 
306
static void _lambda26_ (SearchesItem* self) {
305
307
        gtk_widget_queue_draw ((GtkWidget*) self);
306
308
}
307
309
 
308
310
 
309
 
static void __lambda25__gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self) {
310
 
        _lambda25_ (self);
 
311
static void __lambda26__gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self) {
 
312
        _lambda26_ (self);
311
313
}
312
314
 
313
315
 
314
 
static void _lambda26_ (const gchar* id, SearchesItem* self) {
 
316
static void _lambda27_ (const gchar* id, SearchesItem* self) {
315
317
        GeeHashMap* _tmp0_ = NULL;
316
318
        GeeHashMap* search_map;
317
319
        gpointer _tmp1_ = NULL;
354
356
}
355
357
 
356
358
 
357
 
static void __lambda26__gwibber_searches_updated (GwibberSearches* _sender, const gchar* id, gpointer self) {
358
 
        _lambda26_ (id, self);
 
359
static void __lambda27__gwibber_searches_updated (GwibberSearches* _sender, const gchar* id, gpointer self) {
 
360
        _lambda27_ (id, self);
359
361
}
360
362
 
361
363
 
362
 
static void _lambda27_ (const gchar* id, const gchar* name, SearchesItem* self) {
 
364
static void _lambda28_ (const gchar* id, const gchar* name, SearchesItem* self) {
363
365
        DeeModel* _tmp0_ = NULL;
364
366
        DeeModel* _tmp1_ = NULL;
365
367
        DeeModel* filtered_model;
393
395
}
394
396
 
395
397
 
396
 
static void __lambda27__gwibber_gtk_search_view_show_transient (GwibberGtkSearchView* _sender, const gchar* id, const gchar* name, gpointer self) {
397
 
        _lambda27_ (id, name, self);
 
398
static void __lambda28__gwibber_gtk_search_view_show_transient (GwibberGtkSearchView* _sender, const gchar* id, const gchar* name, gpointer self) {
 
399
        _lambda28_ (id, name, self);
398
400
}
399
401
 
400
402
 
401
 
static void _lambda28_ (SearchesItem* self) {
 
403
static void _lambda29_ (SearchesItem* self) {
402
404
        gtk_widget_hide ((GtkWidget*) self->priv->_stream_view);
403
405
        gtk_widget_show_all ((GtkWidget*) self->priv->_search_view);
404
406
        gtk_widget_hide ((GtkWidget*) self->priv->_title);
405
407
}
406
408
 
407
409
 
408
 
static void __lambda28__gtk_button_clicked (GtkButton* _sender, gpointer self) {
409
 
        _lambda28_ (self);
 
410
static void __lambda29__gtk_button_clicked (GtkButton* _sender, gpointer self) {
 
411
        _lambda29_ (self);
410
412
}
411
413
 
412
414
 
413
 
static void _lambda29_ (SearchesItem* self) {
 
415
static void _lambda30_ (SearchesItem* self) {
414
416
        gboolean _tmp0_;
415
417
        _tmp0_ = tab_bar_item_get_active ((TabBarItem*) self);
416
418
        if (_tmp0_) {
420
422
}
421
423
 
422
424
 
423
 
static void __lambda29__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
424
 
        _lambda29_ (self);
425
 
}
426
 
 
427
 
 
428
 
static void _lambda30_ (SearchesItem* self) {
429
 
        gboolean _tmp0_;
430
 
        _tmp0_ = gwibber_gtk_stream_view_get_showing (self->priv->_stream_view);
431
 
        if (_tmp0_) {
432
 
                gtk_widget_hide ((GtkWidget*) self->priv->_search_view);
433
 
        }
434
 
}
435
 
 
436
 
 
437
425
static void __lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
438
426
        _lambda30_ (self);
439
427
}
441
429
 
442
430
static void _lambda31_ (SearchesItem* self) {
443
431
        gboolean _tmp0_;
 
432
        _tmp0_ = gwibber_gtk_stream_view_get_showing (self->priv->_stream_view);
 
433
        if (_tmp0_) {
 
434
                gtk_widget_hide ((GtkWidget*) self->priv->_search_view);
 
435
        }
 
436
}
 
437
 
 
438
 
 
439
static void __lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
440
        _lambda31_ (self);
 
441
}
 
442
 
 
443
 
 
444
static void _lambda32_ (SearchesItem* self) {
 
445
        gboolean _tmp0_;
444
446
        _tmp0_ = gwibber_gtk_search_view_get_showing (self->priv->_search_view);
445
447
        if (_tmp0_) {
446
448
                gtk_widget_hide ((GtkWidget*) self->priv->_stream_view);
448
450
}
449
451
 
450
452
 
451
 
static void __lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
452
 
        _lambda31_ (self);
 
453
static void __lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
454
        _lambda32_ (self);
453
455
}
454
456
 
455
457
 
487
489
        _g_object_unref0 (self->priv->_stream_view);
488
490
        self->priv->_stream_view = g_object_ref_sink (_tmp2_);
489
491
        gtk_widget_set_no_show_all ((GtkWidget*) self->priv->_stream_view, TRUE);
490
 
        g_signal_connect_object ((GObject*) self->priv->_stream_view, "notify::prepared", (GCallback) __lambda21__g_object_notify, self, 0);
 
492
        g_signal_connect_object ((GObject*) self->priv->_stream_view, "notify::prepared", (GCallback) __lambda22__g_object_notify, self, 0);
491
493
        _tmp3_ = gwibber_searches_new ();
492
494
        _g_object_unref0 (self->priv->_searches);
493
495
        self->priv->_searches = _tmp3_;
504
506
        _g_object_unref0 (self->priv->_entry);
505
507
        self->priv->_entry = g_object_ref_sink (_tmp6_);
506
508
        gtk_entry_set_icon_from_stock (self->priv->_entry, GTK_ENTRY_ICON_SECONDARY, "gtk-clear");
507
 
        g_signal_connect_object (self->priv->_entry, "icon-press", (GCallback) __lambda22__gtk_entry_icon_press, self, 0);
508
 
        g_signal_connect_object ((GtkWidget*) self->priv->_entry, "key-press-event", (GCallback) __lambda23__gtk_widget_key_press_event, self, 0);
 
509
        g_signal_connect_object (self->priv->_entry, "icon-press", (GCallback) __lambda23__gtk_entry_icon_press, self, 0);
 
510
        g_signal_connect_object ((GtkWidget*) self->priv->_entry, "key-press-event", (GCallback) __lambda24__gtk_widget_key_press_event, self, 0);
509
511
        gdk_color_parse ("black", &_tmp7_);
510
512
        fg_color = _tmp7_;
511
513
        gtk_widget_modify_fg ((GtkWidget*) self->priv->_entry, GTK_STATE_NORMAL, &fg_color);
512
 
        g_signal_connect_object (self->priv->_entry, "activate", (GCallback) __lambda24__gtk_entry_activate, self, 0);
 
514
        g_signal_connect_object (self->priv->_entry, "activate", (GCallback) __lambda25__gtk_entry_activate, self, 0);
513
515
        gtk_widget_show_all ((GtkWidget*) self->priv->_entry);
514
516
        gtk_box_pack_start ((GtkBox*) self->priv->box, (GtkWidget*) self->priv->_entry, FALSE, FALSE, (guint) 0);
515
 
        g_signal_connect_object ((GtkWidget*) self->priv->_entry, "size-allocate", (GCallback) __lambda25__gtk_widget_size_allocate, self, G_CONNECT_AFTER);
 
517
        g_signal_connect_object ((GtkWidget*) self->priv->_entry, "size-allocate", (GCallback) __lambda26__gtk_widget_size_allocate, self, G_CONNECT_AFTER);
516
518
        _tmp8_ = (GtkLabel*) gtk_label_new ("");
517
519
        _g_object_unref0 (self->priv->_title);
518
520
        self->priv->_title = g_object_ref_sink (_tmp8_);
519
521
        gtk_box_pack_start ((GtkBox*) self->priv->box, (GtkWidget*) self->priv->_title, FALSE, FALSE, (guint) 4);
520
 
        g_signal_connect_object (self->priv->_searches, "updated", (GCallback) __lambda26__gwibber_searches_updated, self, 0);
521
 
        g_signal_connect_object (self->priv->_search_view, "show-transient", (GCallback) __lambda27__gwibber_gtk_search_view_show_transient, self, 0);
 
522
        g_signal_connect_object (self->priv->_searches, "updated", (GCallback) __lambda27__gwibber_searches_updated, self, 0);
 
523
        g_signal_connect_object (self->priv->_search_view, "show-transient", (GCallback) __lambda28__gwibber_gtk_search_view_show_transient, self, 0);
522
524
        _tmp9_ = _ ("Saved Searches");
523
525
        _tmp10_ = tab_widgets_button_new (_tmp9_);
524
526
        but = g_object_ref_sink (_tmp10_);
525
 
        g_signal_connect_object ((GtkButton*) but, "clicked", (GCallback) __lambda28__gtk_button_clicked, self, 0);
 
527
        g_signal_connect_object ((GtkButton*) but, "clicked", (GCallback) __lambda29__gtk_button_clicked, self, 0);
526
528
        gtk_box_pack_end ((GtkBox*) self->priv->box, (GtkWidget*) but, FALSE, FALSE, (guint) 0);
527
 
        _tmp11_ = g_signal_connect_object ((GObject*) self, "notify::active", (GCallback) __lambda29__g_object_notify, self, 0);
 
529
        _tmp11_ = g_signal_connect_object ((GObject*) self, "notify::active", (GCallback) __lambda30__g_object_notify, self, 0);
528
530
        self->priv->active_hander_id = _tmp11_;
529
 
        g_signal_connect_object ((GObject*) self->priv->_stream_view, "notify::showing", (GCallback) __lambda30__g_object_notify, self, 0);
530
 
        g_signal_connect_object ((GObject*) self->priv->_search_view, "notify::showing", (GCallback) __lambda31__g_object_notify, self, 0);
 
531
        g_signal_connect_object ((GObject*) self->priv->_stream_view, "notify::showing", (GCallback) __lambda31__g_object_notify, self, 0);
 
532
        g_signal_connect_object ((GObject*) self->priv->_search_view, "notify::showing", (GCallback) __lambda32__g_object_notify, self, 0);
531
533
        gtk_widget_show_all ((GtkWidget*) self->priv->_align);
532
534
        _g_object_unref0 (but);
533
535
        return obj;