Exemplo n.º 1
0
    def _show_info_plugin(self, name_plugin):
        '''Вызывается при клике на имя плагина из списка.'''

        if not os.path.exists(
                os.path.join(
                    self._app.directory, 'libs', 'plugins', name_plugin,
                    'README.rst')):
            dialog(
                text=self._app.translation._('Нет информации о плагине!'),
                title=name_plugin
            )
        else:
            info_plugin = \
                open(os.path.join(
                    self._app.directory, 'libs', 'plugins', name_plugin,
                    'README.rst'), encoding='utf-8').read()
            info_plugin = info_plugin.format(
                NAME_APP=self._app.title,
                VERSION=self._app.started_plugins[name_plugin]['plugin-version'],
                AUTHOR=self._app.started_plugins[name_plugin]['plugin-author'],
                MAIL=self._app.started_plugins[name_plugin]['plugin-mail'],
                DESC=self._app.started_plugins[name_plugin]['plugin-desc']
            )
            dialog(
                text=info_plugin, title=self._app.title
            )
Exemplo n.º 2
0
    def show_plugins(self):
        '''Выводит на экран список установленных плагинов.'''

        if not self.window_user_plugins:
            dict_info_plugins = self._get_info_plugins()
            if not dict_info_plugins.__len__():
                dialog(text=self._app.translation._(
                    'Нет установленных плагинов!'),
                       title=self._app.title)
                return

            self._list_plugins = Lists(dict_items=dict_info_plugins,
                                       events_callback=self._action_plugin,
                                       flag='two_list_icon_check')
            self.window_user_plugins = card(self._list_plugins,
                                            size=(.85, .55))
        self.window_user_plugins.open()
Exemplo n.º 3
0
    def show_plugins(self):
        '''Выводит на экран список установленных плагинов.'''

        if not self.window_user_plugins:
            dict_info_plugins = self._get_info_plugins()
            if not dict_info_plugins.__len__():
                dialog(
                    text=self._app.translation._('Нет установленных плагинов!'),
                    title=self._app.title
                )
                return

            self._list_plugins = Lists(
                dict_items=dict_info_plugins,
                events_callback=self._action_plugin, flag='two_list_icon_check'
            )
            self.window_user_plugins = card(self._list_plugins, size=(.85, .55))
        self.window_user_plugins.open()
Exemplo n.º 4
0
    def _show_info_plugin(self, name_plugin):
        '''Вызывается при клике на имя плагина из списка.'''

        if not os.path.exists(
                os.path.join(self._app.directory, 'libs', 'plugins',
                             name_plugin, 'README.rst')):
            dialog(text=self._app.translation._('Нет информации о плагине!'),
                   title=name_plugin)
        else:
            info_plugin = \
                open(os.path.join(self._app.directory, 'libs', 'plugins', name_plugin, 'README.rst'), encoding='utf-8').read()
            info_plugin = info_plugin.format(
                NAME_APP=self._app.title,
                VERSION=self._app.started_plugins[name_plugin]
                ['plugin-version'],
                AUTHOR=self._app.started_plugins[name_plugin]['plugin-author'],
                MAIL=self._app.started_plugins[name_plugin]['plugin-mail'],
                DESC=self._app.started_plugins[name_plugin]['plugin-desc'])
            dialog(text=info_plugin, title=self._app.title)
Exemplo n.º 5
0
    def dialog_download_attach(self, select_directory, link):
        def on_buttons(instance_button):
            dlg.dismiss()
            if instance_button.text == self._app.translation._('Да'):
                self.download_attach(select_directory, link)

        def on_check(check_state):
            self._app.config.set('General', 'show_dialog_on_download', 1)
            self._app.config.write()
            self._app.show_dialog_on_download = check_state

        dlg = None
        if not self._app.show_dialog_on_download:
            dlg = dialog(
                text=self._app.translation._('Загрузить файл в %s' % select_directory), use_check=True,
                text_check=self._app.translation._('Больше не спрашивать'), title=self._app.title,
                check_callback=on_check,
                buttons=[
                    [self._app.translation._('Да'), on_buttons],
                    [self._app.translation._('Отмена'), on_buttons]
                ]
            )
        else:
            self.download_attach(select_directory, link)
Exemplo n.º 6
0
 def quit(self):
     """Shutdown application."""
     if dialogs.dialog('Close EZ Checksum?', choice=True):
         prefs.write_settings(self)
         sys.exit()
Exemplo n.º 7
0
 def callback_on_item_click(name_item, mode):
     description_group, logo_group, id_group = groups_user[name_item]
     dialog(title=name_item,
            text='%s\nID - %s' % (description_group, str(id_group)))