コード例 #1
0
    def get_columns(self):
        """
        Return all the columns we support.

        """

        return (
            Caja.Column(
                name="RabbitVCS::status_column",
                attribute="status",
                label=_("RVCS Status"),
                description=""
            ),
            Caja.Column(
                name="RabbitVCS::revision_column",
                attribute="revision",
                label=_("RVCS Revision"),
                description=""
            ),
            Caja.Column(
                name="RabbitVCS::author_column",
                attribute="author",
                label=_("RVCS Author"),
                description=""
            ),
            Caja.Column(
                name="RabbitVCS::age_column",
                attribute="age",
                label=_("RVCS Age"),
                description=""
            )
        )
コード例 #2
0
    def get_file_items(self, window, files):
        """Ensure there are reachable devices"""
        try:
            devices = self.get_reachable_devices()
        except Exception as e:
            raise Exception("Error while getting reachable devices")
        """if there is no reacheable devices don't show this on context menu"""
        if not devices:
            return
        """Ensure that user only select files"""
        for file in files:
            if file.get_uri_scheme() != 'file' or file.is_directory(
            ) and os.path.isfile(file):
                return

        self.setup_gettext()
        """If user only select file(s) create menu and sub menu"""
        menu = Caja.MenuItem(name='KdeConnectSendExtension::KDEConnect_Send',
                             label=_('KDEConnect Send To'),
                             tip=_('send file(s) with kdeconnect'),
                             icon='kdeconnect')

        sub_menu = Caja.Menu()

        menu.set_submenu(sub_menu)

        for device in devices:
            item = Caja.MenuItem(name="KDEConnectSendExtension::Send_File_To",
                                 label=device["name"])
            item.connect('activate', self.menu_activate_cb, files,
                         device["id"], device["name"])
            sub_menu.append_item(item)

        return menu,
コード例 #3
0
    def get_file_items(self, window, files):
        if len(files) != 1:
            return

        file = files[0]
        filename = file.get_name()

        if file.is_directory() or file.get_uri_scheme() != 'file':
            return

        encryption_item = Caja.MenuItem(
            name='CajaPython::ccencrypt_file_item',
            label=encrypt_loc.get(loc, 'Encrypt') + '...',
            tip='Encrypt this file using ccencrypt')

        encryption_item.connect('activate', self.menu_activate_encryption,
                                file)

        # Check if file is .cpt or otherwise
        is_encrypted = file.get_name().endswith('.cpt')

        if not is_encrypted:
            return encryption_item,

        # Otherwise, include a decryption option
        decryption_item = Caja.MenuItem(
            name='CajaPython::ccdecrypt_file_item',
            label=decrypt_loc.get(loc, 'Decrypt') + '...',
            tip='Decrypt this file using ccdecrypt')

        decryption_item.connect('activate', self.menu_activate_decryption,
                                file)

        return (encryption_item, decryption_item)
コード例 #4
0
 def get_file_items(self, window, sel_items):
     """Adds the 'Add To Audacious Playlist' menu item to the Caja right-click menu,
        connects its 'activate' signal to the 'run' method passing the list of selected Audio items"""
     num_paths = len(sel_items)
     if num_paths == 0 or num_paths > 2: return
     uri_raw = sel_items[0].get_uri()
     if len(uri_raw) < 7: return
     element_1 = urllib.unquote(uri_raw[7:])
     if num_paths == 2:
         uri_raw = sel_items[1].get_uri()
         if len(uri_raw) < 7: return
         element_2 = urllib.unquote(uri_raw[7:])
         if os.path.isfile(element_1):
             if not os.path.isfile(element_2): return
             element_1 = re.escape(element_1)
             filetype = subprocess.Popen("file -i %s" % element_1, shell=True, stdout=subprocess.PIPE).communicate()[0]
             if "text" not in filetype and "xml" not in filetype: return
             element_2 = re.escape(element_2)
             filetype = subprocess.Popen("file -i %s" % element_2, shell=True, stdout=subprocess.PIPE).communicate()[0]
             if "text" not in filetype and "xml" not in filetype: return
         elif os.path.isdir(element_1):
             if not os.path.isdir(element_2): return
             element_1 = re.escape(element_1)
             element_2 = re.escape(element_2)
         else: return
         item = Caja.MenuItem(name='Meld::meld',
                                  label=_('Meld Compare'),
                                  tip=_('Compare the selected Files/Folders using Meld (Diff and merge tool)'),
                                  icon='meld')
         item.connect('activate', self.run, element_1, element_2)
         return item,
     # only one item selected
     if os.path.isfile(element_1):
         filetype = subprocess.Popen("file -i %s" % re.escape(element_1), shell=True, stdout=subprocess.PIPE).communicate()[0]
         if "text" not in filetype and "xml" not in filetype: return
     # top menuitem
     top_menuitem = Caja.MenuItem(name='Meld::actions',
                                      label=_('Meld Actions'),
                                      tip=_('Meld (Diff and merge tool) Actions'),
                                      icon='meld')
     # creation of submenus
     submenu = Caja.Menu()
     top_menuitem.set_submenu(submenu)
     # submenu items save
     sub_menuitem_save = Caja.MenuItem(name='Meld::save',
                                           label=_('Save Path for Future Use'),
                                           tip=_('Save the Selected File/Dir Path for Future Use'),
                                           icon='gtk-save')
     sub_menuitem_save.connect('activate', self.meld_save, element_1)
     submenu.append_item(sub_menuitem_save)
     # submenu items compare with saved
     stored_path = os.environ[NAUPYEXT_MELD] if NAUPYEXT_MELD in os.environ else ""
     if stored_path and stored_path != element_1 and ( (os.path.isfile(stored_path) and os.path.isfile(element_1) ) or (os.path.isdir(stored_path) and os.path.isdir(element_1) ) ):
         sub_menuitem_compare_saved = Caja.MenuItem(name='Meld::compare_saved',
                                                        label=_('Compare with %s' % stored_path.replace("_", " ") ),
                                                        tip=_('Compare the Selected File/Dir with %s' % stored_path),
                                                        icon='gtk-execute')
         sub_menuitem_compare_saved.connect('activate', self.run, re.escape(element_1), re.escape(stored_path))
         submenu.append_item(sub_menuitem_compare_saved)
     return top_menuitem,
コード例 #5
0
    def get_file_items(self, window, items_selected):
        if not items_selected:
            # No items selected
            return

        locale.setlocale(locale.LC_ALL, '')
        gettext.bindtextdomain('folder-color-switcher')
        gettext.textdomain('folder-color-switcher')

        directories = []
        directories_selected = []

        for item in items_selected:
            # Only folders
            if not item.is_directory():
                logger.info("A selected item is not a directory, skipping")
                continue

            logger.debug('URI "%s" is in selection', item.get_uri())

            if item.get_uri_scheme() != 'file':
                return

            directory = item.get_location()
            logger.debug('Valid path selected: "%s"', directory.get_path())
            directories.append(directory)
            directories_selected.append(item)

        if not directories_selected:
            return

        supported_colors = self.theme.get_supported_colors(directories)

        if supported_colors:
            logger.debug("At least one color supported: creating menu entry")
            top_menuitem = Caja.MenuItem(name='ChangeFolderColorMenu::Top', label=_("Change color"))
            submenu = Caja.Menu()
            top_menuitem.set_submenu(submenu)

            for color in supported_colors:
                name = ''.join(['ChangeFolderColorMenu::"', color, '"'])
                label = _(color)
                item = Caja.MenuItem(name=name, label=label, icon='folder-color-switcher-%s' % color.lower())
                item.connect('activate', self.menu_activate_cb, color, directories_selected)
                submenu.append_item(item)

            # Separator
            item_sep = Caja.MenuItem(name='ChangeFolderColorMenu::Sep1', label=self.SEPARATOR, sensitive=False)
            submenu.append_item(item_sep)

            # Restore
            item_restore = Caja.MenuItem(name='ChangeFolderColorMenu::Restore', label=_("Default"))
            item_restore.connect('activate', self.menu_activate_cb, None, directories_selected)
            submenu.append_item(item_restore)

            return top_menuitem,
コード例 #6
0
    def _update_file_info(self, provider, handle, closure, item):
        path = self.uri_to_path(item.get_uri())
        state = self.file_states.get(path)
        item.connect('changed', self.changed_cb)

        self.fetch_file_state(path)
        Caja.info_provider_update_complete_invoke(
            closure, provider, handle, Caja.OperationResult.COMPLETE)

        return False
コード例 #7
0
    def get_file_items(self, window, items_selected):
        if not items_selected:
            # No items selected
            return

        locale.setlocale(locale.LC_ALL, '')
        gettext.bindtextdomain('folder-color-switcher')
        gettext.textdomain('folder-color-switcher')

        paths = []
        for item in items_selected:
            # Only folders
            if not item.is_directory():
                logger.info("A selected item is not a directory, exiting")
                return

            item_uri = item.get_uri()
            logger.debug('URI "%s" is in selection', item_uri)
            uri_tuple = urlparse.urlparse(item_uri)
            # GNOME can only handle "file" URI scheme
            # break if the file URI has weired components (such as params)
            if uri_tuple[0] != 'file' or uri_tuple[1] or uri_tuple[3] or uri_tuple[4] or uri_tuple[5]:
                logger.info("A selected item as a weired URI, exiting")
                return
            path = uri_tuple[2]
            logger.debug('Valid path selected: "%s"', path)
            paths.append(path)

        supported_colors = self.theme.get_supported_colors(paths)

        if supported_colors:
            top_menuitem = Caja.MenuItem(name='ChangeFolderColorMenu::Top', label=_("Change color"), tip='', icon='')
            submenu = Caja.Menu()
            top_menuitem.set_submenu(submenu)

            for color in supported_colors:
                name = ''.join(['ChangeFolderColorMenu::"', color, '"'])
                label = _(color)
                item = Caja.MenuItem(name=name, label=label, icon='folder-color-switcher-%s' % color.lower())
                item.connect('activate', self.menu_activate_cb, color, items_selected)
                submenu.append_item(item)

            # Separator
            item_sep = Caja.MenuItem(name='ChangeFolderColorMenu::Sep1', label=self.SEPARATOR, sensitive=False)
            submenu.append_item(item_sep)

            # Restore
            item_restore = Caja.MenuItem(name='ChangeFolderColorMenu::Restore', label=_("Default"))
            item_restore.connect('activate', self.menu_activate_cb, None, items_selected)
            submenu.append_item(item_restore)

            return top_menuitem,
コード例 #8
0
ファイル: submenu.py プロジェクト: tamplan/python-caja
    def get_background_items(self, window, file):
        submenu = Caja.Menu()
        submenu.append_item(
            Caja.MenuItem(name='ExampleMenuProvider::Bar2',
                          label='Bar2',
                          tip='',
                          icon=''))

        menuitem = Caja.MenuItem(name='ExampleMenuProvider::Foo2',
                                 label='Foo2',
                                 tip='',
                                 icon='')
        menuitem.set_submenu(submenu)

        return menuitem,
コード例 #9
0
 def get_background_items(self, window, current_directory):
     item = Caja.MenuItem(name=name,
                          label=_(label),
                          tip=_(tip),
                          icon=icon)
     item.connect('activate', self.run, current_directory)
     return [item]
コード例 #10
0
ファイル: submenu.py プロジェクト: tamplan/python-caja
    def get_file_items(self, window, files):
        top_menuitem = Caja.MenuItem(name='ExampleMenuProvider::Foo',
                                     label='Foo',
                                     tip='',
                                     icon='')

        submenu = Caja.Menu()
        top_menuitem.set_submenu(submenu)

        sub_menuitem = Caja.MenuItem(name='ExampleMenuProvider::Bar',
                                     label='Bar',
                                     tip='',
                                     icon='')
        submenu.append_item(sub_menuitem)

        return top_menuitem,
コード例 #11
0
ファイル: mixed.py プロジェクト: tamplan/python-caja
 def get_columns(self):
     return [
         Caja.Column(name='Mixed::mixed_column',
                     attribute='mixed',
                     label='Mixed',
                     description='Column added by the mixed extension')
     ]
コード例 #12
0
    def get_property_pages(self, files):

        if len(files) != 1:
            return

        file = files[0]
        if file.get_uri_scheme() != 'file':
            return

        if file.is_directory():
            return

        filename = unquote(file.get_uri()[7:]).decode(
            sys.getfilesystemencoding())

        MI = MediaInfo()
        MI.Option_Static("Complete")
        MI.Option_Static("Inform", "Nothing")
        MI.Option_Static("Language", "file://{}".format(locale_file))
        MI.Open(filename)
        info = MI.Inform().splitlines()
        MI.Close()
        if len(info) < 8:
            return

        self.property_label = Gtk.Label('Media Info')
        self.property_label.show()

        self.builder = Gtk.Builder()
        self.builder.add_from_string(GUI)

        self.mainWindow = self.builder.get_object("mainWindow")
        self.grid = self.builder.get_object("grid")

        top = 0
        for line in info:
            tag = line[:41].strip()
            if tag not in excludeList:
                label = Gtk.Label()
                label.set_markup("<b>" + tag + "</b>")
                label.set_justify(Gtk.Justification.LEFT)
                label.set_halign(Gtk.Align.START)
                label.show()
                self.grid.attach(label, 0, top, 1, 1)
                label = Gtk.Label()
                label.set_text(line[42:].strip())
                label.set_justify(Gtk.Justification.LEFT)
                label.set_halign(Gtk.Align.START)
                label.set_selectable(True)
                label.set_line_wrap(True)
                label.show()
                self.grid.attach(label, 1, top, 1, 1)
                top += 1

        return Caja.PropertyPage(name="CajaPython::mediainfo",
                                 label=self.property_label,
                                 page=self.mainWindow),
コード例 #13
0
 def _create_hide_item(self, files, hidden_path, hidden):
     """Creates the 'Hide file(s)' menu item."""
     item = Caja.MenuItem(name="CajaHide::HideFile",
                          label=ngettext("_Hide File", "_Hide Files",
                                         len(files)),
                          tip=ngettext("Hide this file", "Hide these files",
                                       len(files)))
     item.connect("activate", self._hide_run, files, hidden_path, hidden)
     return item
コード例 #14
0
 def get_file_items(self, window, sel_items):
     if len(sel_items) != 1 or sel_items[0].get_uri_scheme() != 'file':
         return
     item = Caja.MenuItem(name=name,
                          label=_(label),
                          tip=_(tip),
                          icon=icon)
     item.connect('activate', self.run, sel_items[0])
     return [item]
コード例 #15
0
    def get_background_items(self, window, current_directory):
        if not self._is_server_online():
            return

        synced_dirs = _get_synced_dirs(_get_conf())
        dir_path = _get_item_path(current_directory)
        if dir_path in synced_dirs.values():
            item = Caja.MenuItem(name='CajaSyncthing::curr_dir_rm',
                                     label='Remove Current Directory from Syncthing',
                                     tip='Remove current directory from syncthing',
                                     icon='emblem-synchronizing')
            item.connect('activate', self.on_dir_rm, current_directory)
        else:
            item = Caja.MenuItem(name='CajaSyncthing::curr_dir_add',
                                     label='Add Current Directory to Syncthing',
                                     tip='Add current directory to syncthing',
                                     icon='emblem-synchronizing')
            item.connect('activate', self.on_dir_add, current_directory)
        return [item]
コード例 #16
0
    def get_property_pages(self, files):

        if len(files) != 1:
            return

        file = files[0]
        if file.get_uri_scheme() != 'file':
            return

        if file.is_directory():
            return

        filename = unquote(file.get_uri()[7:])

        MI = MediaInfo()
        MI.Open(filename.decode("utf-8"))
        MI.Option_Static("Complete")
        info = MI.Inform().splitlines()
        if len(info) < 8:
            return

        self.property_label = Gtk.Label('Media Info')
        self.property_label.show()

        self.builder = Gtk.Builder()
        self.builder.add_from_string(GUI)

        self.mainWindow = self.builder.get_object("mainWindow")
        self.viewport = self.builder.get_object("viewport1")
        self.grid = Gtk.VBox()
        self.grid.show()
        self.viewport.add(self.grid)

        for line in info:
            box = Gtk.HBox(homogeneous=True, spacing=8)
            box.show()
            label = Gtk.Label()
            label.set_markup("<b>" + line[:41].strip() + "</b>")
            label.set_justify(Gtk.Justification.LEFT)
            label.set_alignment(0, 0.5)
            label.show()
            box.pack_start(label, True, True, 0)
            label = Gtk.Label()
            label.set_text(line[42:].strip())
            label.set_justify(Gtk.Justification.LEFT)
            label.set_alignment(0, 0.5)
            label.set_selectable(True)
            label.set_line_wrap(True)
            label.show()
            box.pack_start(label, True, True, 0)
            self.grid.pack_start(box, True, True, 0)

        return Caja.PropertyPage(name="CajaPython::mediainfo",
                                 label=self.property_label,
                                 page=self.mainWindow),
コード例 #17
0
    def get_background_items(self, window, file):
        item = Caja.MenuItem(
            name='CajaPython::openscanner_directory',
            label=_('Scan directory for threats...'),
            tip=_('Scan this directory for threats...'),
            icon='clamtk')
        # - the tooltips are not shown any longer in Caja
        # (the code is kept here in case this changes again for Caja
        item.connect('activate', self.menu_background_activate_cb, file)

        return [item]
コード例 #18
0
    def get_file_items(self, window, files):
        """Ensure there are reachable devices"""
        try:
            devices = self.get_reachable_devices()
        except Exception as e:
            raise Exception("Error while getting reachable devices")

        """if there is no reacheable devices don't show this on context menu"""
        if len(devices) == 0:
            return

        """Ensure that user only select files"""
        for file in files:
            if file.get_uri_scheme() != 'file' or file.is_directory():
                return

        self.setup_gettext()
        """If user only select file(s) create menu and sub menu"""
        menu = Caja.MenuItem(name = 'SendViaExtension::SendViaKDEConnect',
                             label = _('KDEConnect Send To'),
                             tip = _('send file(s) with kdeconnect'),
                             icon = 'kdeconnect')

        sub_menu = Caja.Menu()

        menu.set_submenu(sub_menu)

        for deviceId, deviceName in devices.items():
            item = Caja.MenuItem(name='SendViaExtension::SendFileTo'+deviceId,
                                 label=deviceName)
            item.connect('activate', self.send_files, files, deviceId, deviceName)
            sub_menu.append_item(item)

        if len(devices) > 1:
            item = Caja.MenuItem(name='SendViaExtension::SendFileToMultipleDevices',
            			         label='Multiple Devices')
            item.connect('activate', self.send_to_multiple_devices, files)
     	
            sub_menu.append_item(item)
        
        return menu,
コード例 #19
0
    def get_file_items(self, oWindow, lstItems):

        if len(lstItems) > 1:

            oMenuItem = Caja.MenuItem(name='cajarename',
                                      label=_('Rename All...'),
                                      icon='font')
            oMenuItem.connect('activate', self.onActivate, lstItems)

            self.oWindow = oWindow

            return [oMenuItem]
コード例 #20
0
    def get_file_items(self, window, files):
        # Keep only the files we want (right type and file)
        files = [ f for f in files if self.is_valid(f)]
        if len(files) == 0:
            return

        item = Caja.MenuItem(name='Caja::download_subtitles',
                                 label=_('Find subtitles for this video'),
                                 tip=_('Download subtitles for this video'),
                                 icon=Gtk.STOCK_FIND_AND_REPLACE)
        item.connect('activate', self.menu_activate_cb, files)
        return item,
コード例 #21
0
    def get_file_items(self, window, sel_items):
        if len(sel_items) != 1 or sel_items[0].get_uri_scheme() != 'file':
            return
        if not self._is_server_online():
            return

        synced_dirs = _get_synced_dirs(_get_conf())
        dir_path = _get_item_path(sel_items[0])
        if dir_path in synced_dirs.values():
            item = Caja.MenuItem(name='CajaSyncthing::dir_rm',
                                     label='Remove Directory from Syncthing',
                                     tip='Remove selected directory from syncthing',
                                     icon='emblem-synchronizing')
            item.connect('activate', self.on_dir_rm, sel_items[0])
        else:
            item = Caja.MenuItem(name='CajaSyncthing::dir_add',
                                     label='Add Directory to Syncthing',
                                     tip='Add selected directory to syncthing',
                                     icon='emblem-synchronizing')
            item.connect('activate', self.on_dir_add, sel_items[0])
        return [item]
コード例 #22
0
ファイル: mixed.py プロジェクト: tamplan/python-caja
 def get_background_items(self, window, folder):
     mixed = self._file_has_mixed_name(folder)
     if not mixed:
         return []
     return [
         Caja.MenuItem(
             name='Mixed::BackgroundMenu',
             label=
             'Mixed: you are browsing a directory with a mixed case name',
             tip='',
             icon='')
     ]
コード例 #23
0
    def make_menu_item(self, item, id_magic):
        identifier = item.make_magic_id(id_magic)

        menuitem = Caja.MenuItem(name=identifier,
                                 label=item.make_label(),
                                 tip=item.tooltip,
                                 icon=item.icon)

        if type(item) is MenuSeparator:
            item.make_insensitive(menuitem)

        return menuitem
コード例 #24
0
 def get_background_items(self, window, current_directory):
     """Adds the 'Open VScode Here' menu item to the Caja right-click menu,
        connects its 'activate' signal to the 'run' method passing the current Directory"""
     item = Caja.MenuItem(
         name='CajaPython::vscode',
         label=_('Open VScode Here'),
         tip=_(
             'Open the Visual Studio code on the Current/Selected Directory'
         ),
         icon='code')
     item.connect('activate', self.run, current_directory)
     return [item]
コード例 #25
0
ファイル: open-terminal.py プロジェクト: tamplan/python-caja
 def get_file_items(self, window, files):
     if len(files) != 1:
         return
     
     file = files[0]
     if not file.is_directory() or file.get_uri_scheme() != 'file':
         return
     
     item = Caja.MenuItem(name='CajaPython::openterminal_file_item',
                              label='Open Terminal' ,
                              tip='Open Terminal In %s' % file.get_name())
     item.connect('activate', self.menu_activate_cb, file)
     return [item]
コード例 #26
0
    def _buildMenu(self, menus, files):
        '''Build one level of a menu'''
        items = []
        if files:
            passcwd = None
        else:  #bg
            passcwd = self.cwd

        for menu_info in menus:
            idstr = '%s::%02d%s' % (idstr_prefix, self.pos, menu_info.hgcmd)
            self.pos += 1
            if menu_info.isSep():
                # can not insert a separator till now
                pass
            elif menu_info.isSubmenu():
                if hasattr(Nautilus, 'Menu'):
                    item = Nautilus.MenuItem(name=idstr,
                                             label=menu_info.menutext,
                                             tip=menu_info.helptext)
                    submenu = Nautilus.Menu()
                    item.set_submenu(submenu)
                    for subitem in self._buildMenu(menu_info.get_menus(),
                                                   files):
                        submenu.append_item(subitem)
                    items.append(item)
                else:  #submenu not suported
                    for subitem in self._buildMenu(menu_info.get_menus(),
                                                   files):
                        items.append(subitem)
            else:
                if menu_info.state:
                    item = Nautilus.MenuItem.new(idstr, menu_info.menutext,
                                                 menu_info.helptext,
                                                 self.icon(menu_info.icon))
                    item.connect('activate', self.run_dialog, menu_info.hgcmd,
                                 passcwd, files)
                    items.append(item)
        return items
コード例 #27
0
 def get_file_items(self, window, sel_items):
     """Adds the 'Open VScode Here' menu item to the Caja right-click menu,
        connects its 'activate' signal to the 'run' method passing the selected Directory/File"""
     if len(sel_items) != 1 or sel_items[0].get_uri_scheme() != 'file':
         return
     item = Caja.MenuItem(
         name='CajaPython::vscode',
         label=_('Open VScode Here'),
         tip=_(
             'Open the Visual Studio code on the Current/Selected Directory'
         ),
         icon='code')
     item.connect('activate', self.run, sel_items[0])
     return [item]
コード例 #28
0
 def get_file_items(self, window, sel_items):
     """Adds the 'Replace in Filenames' menu item to the FileBrowser
     right-click menu,
        connects its 'activate' signal to the 'run' method passing the
         selected Directory/File"""
     sel_items = get_files(sel_items)
     if not len(sel_items) > 0:
         return
     item = FileBrowser.MenuItem(
         name='AntiviralMenuProvider::Gtk-antiviral-tools',
         label=_('Scan folder'),
         tip=_('Scan this folder'),
         icon='Gtk-find-and-replace')
     item.connect('activate', self.addfolders, sel_items)
     return item,
コード例 #29
0
ファイル: mixed.py プロジェクト: tamplan/python-caja
    def get_file_items(self, window, cajafiles):
        menuitems = []
        if len(cajafiles) == 1:
            for cajafile in cajafiles:
                mixed = cajafile.get_string_attribute('mixed')
                if mixed:
                    filename = cajafile.get_name()
                    menuitem = Caja.MenuItem(
                        name='Mixed::FileMenu',
                        label='Mixed: %s has a mixed case name' % filename,
                        tip='',
                        icon='')
                    menuitems.append(menuitem)

        return menuitems
コード例 #30
0
    def get_file_items(self, window, files):
        if len(files) != 1:
            return
        file = files[0]

        item = Caja.MenuItem(
            name='CajaPython::openscanner',
            label=_('Scan for threats...') ,
            tip=_('Scan %s for threats...') % file.get_name(),
            icon='clamtk')
        # - the tooltips are not shown any longer in Caja
        # (the code is kept here in case this changes again for Caja
        item.connect('activate', self.menu_activate_cb, file)

        return [item]
コード例 #31
0
 def update_cb(self, provider, handle, closure):
     print "update_cb"
     Caja.info_provider_update_complete_invoke(closure, provider, handle, Caja.OperationResult.FAILED)