~mitya57/ubuntu/precise/nautilus/desktop-window-fixes

« back to all changes in this revision

Viewing changes to libnautilus-private/nautilus-progress-info-manager.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-05-16 18:53:51 UTC
  • mfrom: (1.17.16 upstream) (2.2.10 experimental)
  • Revision ID: james.westby@ubuntu.com-20110516185351-9mpn1rya1t645ixq
Tags: 1:3.0.1.1-0ubuntu1
* Resynchronize on Debian using the GNOME3 ppa work, thanks to those who
  contributed there
* Known issues:
  - the indicator-application patch needs to be updated or dropped
    (design recommended to use a normal dialog for copies so maybe drop it)
  - the indicator-appmenu export patch needs to be updated
  - desktop icons are not displayed by default in GNOME3, you can set
    org.gnome.desktop.background show-desktop-icons to true in dconf-editor
    or using the gsettings command to get those back 
* New upstream version
* Remaining diffs:
* debian/changelog, debian/rules: set epoch number (which was added by error)
* debian/control.in:
  - Build-Depend on liblaunchpad-integration-dev, libappindicator-dev
  - Don't recommends desktop-base, don't suggests tracker
* debian/mount-archive.desktop:
* debian/mount-archive.desktop.in:
  - New nautilus context menu item to allow mounting zip, iso, etc
* debian/nautilus.gschema.override:
  - Change the default desktop icon configuration
* debian/nautilus-data.install:
  - Install Apport hook
* debian/nautilus.install:
  - Install mount-archive menu
* nautilus-desktop.desktop
* debian/source_nautilus.py:
  - Apport hook to list versions of files in /usr/lib/nautilus and reassign
    the crashes when there are not due to nautilus code directly
* debian/patches/00_do_not_require_unpackage_libexif.patch:
  - dropped, not required in Ubuntu since libexif is recent enough
* debian/patches/01_lpi.patch:
  - Launchpad changes.
* debian/patches/02_additional_marge_for_unity.patch:
  - ensure we don't move desktop icons when locking or unlocking the unity
    launcher 
* debian/patches/03_translations_list_update.patch:
  - Translate the mount-archive menu entry
* debian/patches/04_suppress_umount_in_ltsp.patch:
  - Don't list unmount and eject actions on LTSP clients
* debian/patches/05_desktop_menu_export.patch:
  - export the desktop menus for appmenu (lp #624274), commented for now
* debian/patches/06_never_exec_nonexec_launchers.patch:
  - Implement non-exec policy for .desktop handler.
* debian/patches/07_use_application_indicator.patch:
  - Use the application-indicator, needs to be updated
* debian/patches/08_fix_nautilus_desktop_autostart.patch
  - git commit, remove obsolete autostart code so that Nautilus windows
    can still be opened when desktop icons are shown
* debian/patches/09_no-initial-fade.patch:
  - Patch to disable the initial fade-in of the background without disabling 
    crossfades when the background is changed.
* debian/watch:
  - Watch unstable series
* Dropped:
* debian/patches/02_dont_set_default.patch:
  - deprecated in the new version
* debian/patches/03_menu_entry.patch:
  - no menu simplication needed with unity or gnome-shell
* debian/patches/17_disable_locked_automounting.patch:
  - the change is in the new upstream version
* debian/patches/82_gnome-app-install.patch:
  - don't use gnome-app-install it's deprecated
* debian/patches/90_git_audio_preview_url.patch:
  - the change is in the new version
* debian/patches/91_correct_rgba_use.patch:
  - the gtk rgba ubuntu specific work never landed no need to keep that one
* debian/patches/97_keyboard_nav_in_sidebar.patch:
  - the change is in the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
2
/*
 
3
 * Nautilus
 
4
 *
 
5
 * Copyright (C) 2011 Red Hat, Inc.
 
6
 *
 
7
 * Nautilus is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU General Public License as
 
9
 * published by the Free Software Foundation; either version 2 of the
 
10
 * License, or (at your option) any later version.
 
11
 *
 
12
 * Nautilus is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public
 
18
 * License along with this program; see the file COPYING.  If not,
 
19
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
20
 * Boston, MA 02111-1307, USA.
 
21
 *
 
22
 * Author: Cosimo Cecchi <cosimoc@redhat.com>
 
23
 */
 
24
 
 
25
#include <config.h>
 
26
 
 
27
#include "nautilus-progress-info-manager.h"
 
28
 
 
29
struct _NautilusProgressInfoManagerPriv {
 
30
        GList *progress_infos;
 
31
};
 
32
 
 
33
enum {
 
34
        NEW_PROGRESS_INFO,
 
35
        LAST_SIGNAL
 
36
};
 
37
 
 
38
static NautilusProgressInfoManager *singleton = NULL;
 
39
 
 
40
static guint signals[LAST_SIGNAL] = { 0, };
 
41
 
 
42
G_DEFINE_TYPE (NautilusProgressInfoManager, nautilus_progress_info_manager,
 
43
               G_TYPE_OBJECT);
 
44
 
 
45
static void
 
46
nautilus_progress_info_manager_finalize (GObject *obj)
 
47
{
 
48
        NautilusProgressInfoManager *self = NAUTILUS_PROGRESS_INFO_MANAGER (obj);
 
49
 
 
50
        if (self->priv->progress_infos != NULL) {
 
51
                g_list_free_full (self->priv->progress_infos, g_object_unref);
 
52
        }
 
53
 
 
54
        G_OBJECT_CLASS (nautilus_progress_info_manager_parent_class)->finalize (obj);
 
55
}
 
56
 
 
57
static GObject *
 
58
nautilus_progress_info_manager_constructor (GType type,
 
59
                                            guint n_props,
 
60
                                            GObjectConstructParam *props)
 
61
{
 
62
        GObject *retval;
 
63
 
 
64
        if (singleton != NULL) {
 
65
                return g_object_ref (singleton);
 
66
        }
 
67
 
 
68
        retval = G_OBJECT_CLASS (nautilus_progress_info_manager_parent_class)->constructor
 
69
                (type, n_props, props);
 
70
 
 
71
        singleton = NAUTILUS_PROGRESS_INFO_MANAGER (retval);
 
72
        g_object_add_weak_pointer (retval, (gpointer) &singleton);
 
73
 
 
74
        return retval;
 
75
}
 
76
 
 
77
static void
 
78
nautilus_progress_info_manager_init (NautilusProgressInfoManager *self)
 
79
{
 
80
        self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NAUTILUS_TYPE_PROGRESS_INFO_MANAGER,
 
81
                                                  NautilusProgressInfoManagerPriv);
 
82
}
 
83
 
 
84
static void
 
85
nautilus_progress_info_manager_class_init (NautilusProgressInfoManagerClass *klass)
 
86
{
 
87
        GObjectClass *oclass;
 
88
 
 
89
        oclass = G_OBJECT_CLASS (klass);
 
90
        oclass->constructor = nautilus_progress_info_manager_constructor;
 
91
        oclass->finalize = nautilus_progress_info_manager_finalize;
 
92
 
 
93
        signals[NEW_PROGRESS_INFO] =
 
94
                g_signal_new ("new-progress-info",
 
95
                              G_TYPE_FROM_CLASS (klass),
 
96
                              G_SIGNAL_RUN_LAST,
 
97
                              0, NULL, NULL,
 
98
                              g_cclosure_marshal_VOID__OBJECT,
 
99
                              G_TYPE_NONE,
 
100
                              1,
 
101
                              NAUTILUS_TYPE_PROGRESS_INFO);
 
102
 
 
103
        g_type_class_add_private (klass, sizeof (NautilusProgressInfoManagerPriv));
 
104
}
 
105
 
 
106
static void
 
107
progress_info_finished_cb (NautilusProgressInfo *info,
 
108
                           NautilusProgressInfoManager *self)
 
109
{
 
110
        self->priv->progress_infos =
 
111
                g_list_remove (self->priv->progress_infos, info);
 
112
}
 
113
 
 
114
NautilusProgressInfoManager *
 
115
nautilus_progress_info_manager_new (void)
 
116
{
 
117
        return g_object_new (NAUTILUS_TYPE_PROGRESS_INFO_MANAGER, NULL);
 
118
}
 
119
 
 
120
void
 
121
nautilus_progress_info_manager_add_new_info (NautilusProgressInfoManager *self,
 
122
                                             NautilusProgressInfo *info)
 
123
{
 
124
        if (g_list_find (self->priv->progress_infos, info) != NULL) {
 
125
                g_warning ("Adding two times the same progress info object to the manager");
 
126
                return;
 
127
        }
 
128
        
 
129
        self->priv->progress_infos =
 
130
                g_list_prepend (self->priv->progress_infos, g_object_ref (info));
 
131
 
 
132
        g_signal_connect (info, "finished",
 
133
                          G_CALLBACK (progress_info_finished_cb), self);
 
134
 
 
135
        g_signal_emit (self, signals[NEW_PROGRESS_INFO], 0, info);
 
136
}
 
137
 
 
138
GList *
 
139
nautilus_progress_info_manager_get_all_infos (NautilusProgressInfoManager *self)
 
140
{
 
141
        return self->priv->progress_infos;
 
142
}