Пример #1
0
    def drag_data_src_received(self, widget, context, x, y, selection, targetType, timestamp):
        #filename = selection.data.strip()
        #tmp = unquote(filename.strip('[\']'))
        #self.load_src_file(tmp[7:])

        uri = selection.data.strip('\r\n\x00')
        uri_splitted = uri.split()
        for uri in uri_splitted:
            path = utils.get_file_path_from_dnd_dropped_uri(uri)
            self.load_src_file(path)
Пример #2
0
 def on_drag_data_received(self, view, context, x, y, selection, target_type, time):
     if target_type != TARGET_TYPE_URI_LIST:
         print target_type, 'is not supported.'
         return
     uri = selection.data.strip('\r\n\x00')
     # print 'uri', uri
     uri_splitted = uri.split()
     if len(uri_splitted) >= 1:
         path =utils.get_file_path_from_dnd_dropped_uri(uri_splitted[0])
     else:
         return
     if os.path.isfile(path):
         gobject.idle_add(view.execute_script, '''
             ui.ImageUploader.pyload("%s");
             ui.ImageUploader.show();
             ''' % path)
Пример #3
0
 def on_drag_data_received(self, view, context, x, y, selection, target_type, time):
     if target_type != TARGET_TYPE_URI_LIST:
         print target_type, 'is not supported.'
         return
     uri = selection.data.strip('\r\n\x00')
     # print 'uri', uri
     uri_splitted = uri.split()
     if len(uri_splitted) >= 1:
         path =utils.get_file_path_from_dnd_dropped_uri(uri_splitted[0])
     else:
         return
     if os.path.isfile(path):
         gobject.idle_add(view.execute_script, '''
             ui.ImageUploader.pyload("%s");
             ui.ImageUploader.show();
             ''' % path)
Пример #4
0
 def drag_data_dst_received(self, widget, context, x, y, selection, targetType, timestamp):
     uri = selection.data.strip('\r\n\x00')
     uri_splitted = uri.split()
     for uri in uri_splitted:
         path = utils.get_file_path_from_dnd_dropped_uri(uri)
         self.load_dst_file(path)