~ubuntu-branches/ubuntu/maverick/awn-extras-applets/maverick

« back to all changes in this revision

Viewing changes to applets/maintained/garbage/applet.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-04-11 22:38:55 UTC
  • mto: (2.2.5 sid)
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: james.westby@ubuntu.com-20100411223855-bb0ovgd1kerhtyv8
Tags: upstream-0.4.0
ImportĀ upstreamĀ versionĀ 0.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
139
139
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
140
140
 
141
 
static const GtkTargetEntry GARBAGE_APPLET_targets[] = {{"text/uri-list", (guint) 0, (guint) 0}, {"text/plain", (guint) 0, (guint) 0}};
 
141
static const GtkTargetEntry GARBAGE_APPLET_targets[2] = {{"text/uri-list", (guint) 0, (guint) 0}, {"text/plain", (guint) 0, (guint) 0}};
142
142
 
143
143
 
144
144
static gpointer _g_object_ref0 (gpointer self) {
261
261
 
262
262
 
263
263
static gboolean garbage_applet_on_map_event (GarbageApplet* self, GdkEvent* evt) {
264
 
        gboolean result;
 
264
        gboolean result = FALSE;
265
265
        GtkWidget* icon;
266
266
        g_return_val_if_fail (self != NULL, FALSE);
267
267
        g_return_val_if_fail (evt != NULL, FALSE);
281
281
        g_return_if_fail (self != NULL);
282
282
        g_return_if_fail (msg != NULL);
283
283
        dialog = NULL;
284
 
        dialog = (_tmp0_ = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, msg)), _g_object_unref0 (dialog), _tmp0_);
 
284
        dialog = (_tmp0_ = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", msg)), _g_object_unref0 (dialog), _tmp0_);
285
285
        gtk_dialog_run ((GtkDialog*) dialog);
286
286
        gtk_object_destroy ((GtkObject*) dialog);
287
287
        _g_object_unref0 (dialog);
367
367
        _inner_error_ = NULL;
368
368
        {
369
369
                char** _tmp1_;
370
 
                gint argv_size;
 
370
                gint _argv_size_;
371
371
                gint argv_length1;
372
372
                char** _tmp0_ = NULL;
373
373
                char** argv;
374
 
                argv = (_tmp1_ = (_tmp0_ = g_new0 (char*, 2 + 1), _tmp0_[0] = g_strdup ("xdg-open"), _tmp0_[1] = g_strdup ("trash:"), _tmp0_), argv_length1 = 2, argv_size = argv_length1, _tmp1_);
 
374
                argv = (_tmp1_ = (_tmp0_ = g_new0 (char*, 2 + 1), _tmp0_[0] = g_strdup ("xdg-open"), _tmp0_[1] = g_strdup ("trash:"), _tmp0_), argv_length1 = 2, _argv_size_ = argv_length1, _tmp1_);
375
375
                gdk_spawn_on_screen (gtk_window_get_screen ((GtkWindow*) self), NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &_inner_error_);
376
376
                if (_inner_error_ != NULL) {
377
377
                        argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
457
457
                char* msg;
458
458
                GtkMessageDialog* dialog;
459
459
                gint response;
460
 
                msg = g_strdup_printf (_ ("Are you sure you want to empty your trash? It currently contains %u item(s)."), desktop_agnostic_vfs_trash_get_file_count (self->trash));
461
 
                dialog = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new (GTK_WINDOW (self), 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, msg));
 
460
                msg = g_strdup_printf (_ ("Are you sure you want to empty your trash? It currently contains %u it" \
 
461
"em(s)."), desktop_agnostic_vfs_trash_get_file_count (self->trash));
 
462
                dialog = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new (GTK_WINDOW (self), 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", msg));
462
463
                response = gtk_dialog_run ((GtkDialog*) dialog);
463
464
                gtk_object_destroy ((GtkObject*) dialog);
464
465
                do_empty = response == GTK_RESPONSE_YES;
504
505
 
505
506
 
506
507
static gboolean garbage_applet_on_drag_motion (GarbageApplet* self, GdkDragContext* context, gint x, gint y, guint time) {
507
 
        gboolean result;
 
508
        gboolean result = FALSE;
508
509
        g_return_val_if_fail (self != NULL, FALSE);
509
510
        g_return_val_if_fail (context != NULL, FALSE);
510
511
        if (!self->priv->highlighted) {
738
739
 
739
740
 
740
741
GType garbage_applet_get_type (void) {
741
 
        static GType garbage_applet_type_id = 0;
742
 
        if (garbage_applet_type_id == 0) {
 
742
        static volatile gsize garbage_applet_type_id__volatile = 0;
 
743
        if (g_once_init_enter (&garbage_applet_type_id__volatile)) {
743
744
                static const GTypeInfo g_define_type_info = { sizeof (GarbageAppletClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) garbage_applet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GarbageApplet), 0, (GInstanceInitFunc) garbage_applet_instance_init, NULL };
 
745
                GType garbage_applet_type_id;
744
746
                garbage_applet_type_id = g_type_register_static (AWN_TYPE_APPLET_SIMPLE, "GarbageApplet", &g_define_type_info, 0);
 
747
                g_once_init_leave (&garbage_applet_type_id__volatile, garbage_applet_type_id);
745
748
        }
746
 
        return garbage_applet_type_id;
 
749
        return garbage_applet_type_id__volatile;
747
750
}
748
751
 
749
752
 
782
785
 
783
786
 
784
787
AwnApplet* awn_applet_factory_initp (const char* canonical_name, const char* uid, gint panel_id) {
785
 
        AwnApplet* result;
 
788
        AwnApplet* result = NULL;
786
789
        g_return_val_if_fail (canonical_name != NULL, NULL);
787
790
        g_return_val_if_fail (uid != NULL, NULL);
788
791
        setlocale (LC_ALL, "");