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

« back to all changes in this revision

Viewing changes to applets/unmaintained/stacks/stacks_gui_dialog.py

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-08-29 14:29:52 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20100829142952-rhvuetyms9bv5uu7
Tags: upstream-0.4.0+bzr1372
ImportĀ upstreamĀ versionĀ 0.4.0+bzr1372

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
18
# Boston, MA 02111-1307, USA.
19
19
 
20
 
import sys
21
 
import os
22
20
import gtk
23
21
from gtk import gdk
24
22
import gobject
25
23
import pango
26
24
import awn
27
 
import cairo
28
 
import gnome.ui
29
 
import gnomedesktop
30
 
import time
31
25
 
32
26
from stacks_backend import *
33
27
from stacks_backend_file import *
34
28
from stacks_backend_folder import *
35
 
from stacks_backend_plugger import *
36
 
from stacks_backend_trasher import *
37
29
from stacks_config import StacksConfig
38
30
from stacks_launcher import LaunchManager
39
31
from stacks_icons import IconFactory
142
134
    def item_activated_cb(self, widget, user_data):
143
135
        uri, mimetype = user_data
144
136
        if uri.as_string().endswith(".desktop"):
145
 
            item = gnomedesktop.item_new_from_uri(
146
 
                    uri.as_string(), gnomedesktop.LOAD_ONLY_IF_EXISTS)
147
 
            if item:
148
 
                command = item.get_string(gnomedesktop.KEY_EXEC)
149
 
                #LaunchManager().launch_command(command, uri.as_string())
150
 
                LaunchManager().launch_dot_desktop(uri.as_string())
 
137
            LaunchManager().launch_dot_desktop(uri.as_string())
151
138
        else:
152
139
            LaunchManager().launch_uri(uri.as_string(), mimetype)
153
140
        self._stacks_gui_hide_cb(widget)
161
148
        self.just_dragged = True
162
149
 
163
150
    def button_drag_motion(self, widget, context, x, y, time):
164
 
        
165
151
        return True
166
152
 
167
153
    def button_drag_leave(self, widget, context, time):
168
 
        self.applet.effects.stop("launching")
 
154
        self.applet.effects.stop(awn.EFFECT_LAUNCHING)
169
155
        return
170
156
 
171
157
    def button_drag_drop(self, widget, context, x, y,
172
158
                            selection, targetType, time, target_uri):
173
159
        self._stacks_gui_hide_cb(widget)
174
 
        self.applet.effects.stop("launching")
 
160
        self.applet.effects.stop(awn.EFFECT_LAUNCHING)
175
161
        vfs_uris = []
176
162
        for uri in selection.data.split():
177
163
                try:
178
164
                        vfs_uris.append(VfsUri(uri))
179
165
                except TypeError:
180
 
                        pass                                    
181
 
        
182
 
        if context.action == gtk.gdk.ACTION_LINK:
183
 
                options = gnomevfs.XFER_LINK_ITEMS
184
 
        elif context.action == gtk.gdk.ACTION_MOVE:
185
 
                options = gnomevfs.XFER_REMOVESOURCE
186
 
        elif context.action == gtk.gdk.ACTION_COPY:
187
 
                options = gnomevfs.XFER_DEFAULT
188
 
        else:
189
 
                return False
 
166
                        pass
190
167
 
191
168
        src_lst = []
192
169
        dst_lst = []
193
170
        vfs_uri_lst = []
194
171
        for vfs_uri in vfs_uris:
195
 
                dst_uri = target_uri.as_uri().append_path(vfs_uri.as_uri().short_name)
 
172
                dst_uri = target_uri.create_child(vfs_uri.as_uri())
196
173
                src_lst.append(vfs_uri.as_uri())
197
174
                dst_lst.append(dst_uri)
198
 
                
199
 
 
200
 
        GUITransfer(src_lst, dst_lst, options)
201
 
        
202
 
        
 
175
 
 
176
 
 
177
        GUITransfer(src_lst, dst_lst, context.action)
 
178
 
203
179
        return True
204
180
 
205
181
    def item_clear_cb(self, widget, uri):