コード例 #1
0
ファイル: user_profiles.py プロジェクト: Hainish/calibre
    def __init__(self, parent, recipe_model):
        ResizableDialog.__init__(self, parent)

        self._model = self.model = CustomRecipeModel(recipe_model)
        self.available_profiles.setModel(self._model)
        self.available_profiles.currentChanged = self.current_changed
        f = QFont()
        f.setStyleHint(f.Monospace)
        self.source_code.setFont(f)

        self.remove_feed_button.clicked[(bool)].connect(self.added_feeds.remove_selected_items)
        self.remove_profile_button.clicked[(bool)].connect(self.remove_selected_items)
        self.add_feed_button.clicked[(bool)].connect(self.add_feed)
        self.load_button.clicked[()].connect(self.load)
        self.opml_button.clicked[()].connect(self.opml_import)
        self.builtin_recipe_button.clicked[()].connect(self.add_builtin_recipe)
        self.share_button.clicked[()].connect(self.share)
        self.show_recipe_files_button.clicked.connect(self.show_recipe_files)
        self.down_button.clicked[()].connect(self.down)
        self.up_button.clicked[()].connect(self.up)
        self.add_profile_button.clicked[(bool)].connect(self.add_profile)
        self.feed_url.returnPressed[()].connect(self.add_feed)
        self.feed_title.returnPressed[()].connect(self.add_feed)
        self.toggle_mode_button.clicked[(bool)].connect(self.toggle_mode)
        self.clear()
コード例 #2
0
    def __init__(self, parent, recipe_model):
        ResizableDialog.__init__(self, parent)

        self._model = self.model = CustomRecipeModel(recipe_model)
        self.available_profiles.setModel(self._model)
        self.available_profiles.currentChanged = self.current_changed
        f = QFont()
        f.setStyleHint(f.Monospace)
        self.source_code.setFont(f)

        self.remove_feed_button.clicked[(bool)].connect(
            self.added_feeds.remove_selected_items)
        self.remove_profile_button.clicked[(bool)].connect(
            self.remove_selected_items)
        self.add_feed_button.clicked[(bool)].connect(self.add_feed)
        self.load_button.clicked[()].connect(self.load)
        self.opml_button.clicked[()].connect(self.opml_import)
        self.builtin_recipe_button.clicked[()].connect(self.add_builtin_recipe)
        self.share_button.clicked[()].connect(self.share)
        self.show_recipe_files_button.clicked.connect(self.show_recipe_files)
        self.down_button.clicked[()].connect(self.down)
        self.up_button.clicked[()].connect(self.up)
        self.add_profile_button.clicked[(bool)].connect(self.add_profile)
        self.feed_url.returnPressed[()].connect(self.add_feed)
        self.feed_title.returnPressed[()].connect(self.add_feed)
        self.toggle_mode_button.clicked[(bool)].connect(self.toggle_mode)
        self.clear()
コード例 #3
0
ファイル: main_window.py プロジェクト: Eksmo/calibre
 def __init__(self, parent):
     ConversionErrorDialog.__init__(self, parent, 'Console output', '')
     self.setModal(Qt.NonModal)
     font = QFont()
     font.setStyleHint(QFont.TypeWriter)
     self.text.setFont(font)
コード例 #4
0
    def initialize(self, parent):
        '''
        __init__ is called on SizePersistedDialog()
        '''
        #self.connected_device = parent.opts.gui.device_manager.device
        self.parent = parent
        self.prefs = parent.prefs
        self.verbose = parent.verbose

        self.setupUi(self)
        self._log_location()

        # Subscribe to Marvin driver change events
        #self.connected_device.marvin_device_signals.reader_app_status_changed.connect(
        #    self.marvin_status_changed)

        self.setWindowTitle("Edit CSS")

        # Remove the placeholder
        self.placeholder.setParent(None)
        self.placeholder.deleteLater()
        self.placeholder = None

        # Replace the placeholder
        self.html_wv = QWebView()
        self.html_wv.sizeHint = self.wv_sizeHint
        self.html_wv.setSizePolicy(QSizePolicy.MinimumExpanding,
                                   QSizePolicy.MinimumExpanding)
        self.html_wv.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
        self.html_wv.linkClicked.connect(self.link_clicked)
        self.splitter.insertWidget(0, self.html_wv)

        # Add the Accept button
        self.accept_button = self.bb.addButton('Update',
                                               QDialogButtonBox.AcceptRole)
        self.accept_button.setDefault(True)

        # ~~~~~~~~ Configure the CSS control ~~~~~~~~
        if isosx:
            FONT = QFont('Monaco', 11)
        elif iswindows:
            FONT = QFont('Lucida Console', 9)
        elif islinux:
            FONT = QFont('Monospace', 9)
            FONT.setStyleHint(QFont.TypeWriter)
        self.css_pte.setFont(FONT)

        # Tab width
        width = QFontMetrics(FONT).width(" ") * 4
        self.css_pte.setTabStopWidth(width)

        # Restore/init the stored CSS
        self.css_pte.setPlainText(self.prefs.get('injected_css', ''))

        # Populate the HTML content
        rendered_html = self.inject_css(SAMPLE_HTML)
        self.html_wv.setHtml(rendered_html)

        # Restore the splitter
        split_points = self.prefs.get('css_editor_split_points')
        if split_points:
            self.splitter.setSizes(split_points)

        # Hook the QPlainTextEdit box
        self.css_pte.textChanged.connect(self.preview_css)

        # Hook the button events
        self.bb.clicked.connect(self.dispatch_button_click)

        self.resize_dialog()
コード例 #5
0
    def initialize(self, parent):
        '''
        __init__ is called on SizePersistedDialog()
        '''
        #self.connected_device = parent.opts.gui.device_manager.device
        self.parent = parent
        self.prefs = parent.prefs
        self.verbose = parent.verbose

        self.setupUi(self)
        self._log_location()

        # Subscribe to Marvin driver change events
        #self.connected_device.marvin_device_signals.reader_app_status_changed.connect(
        #    self.marvin_status_changed)

        self.setWindowTitle("Edit CSS")

        # Remove the placeholder
        self.placeholder.setParent(None)
        self.placeholder.deleteLater()
        self.placeholder = None

        # Replace the placeholder
        self.html_wv = QWebView()
        self.html_wv.sizeHint = self.wv_sizeHint
        self.html_wv.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
        self.html_wv.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
        self.html_wv.linkClicked.connect(self.link_clicked)
        self.splitter.insertWidget(0, self.html_wv)

        # Add the Accept button
        self.accept_button = self.bb.addButton('Update', QDialogButtonBox.AcceptRole)
        self.accept_button.setDefault(True)

        # ~~~~~~~~ Configure the CSS control ~~~~~~~~
        if isosx:
            FONT = QFont('Monaco', 11)
        elif iswindows:
            FONT = QFont('Lucida Console', 9)
        elif islinux:
            FONT = QFont('Monospace', 9)
            FONT.setStyleHint(QFont.TypeWriter)
        self.css_pte.setFont(FONT)

        # Tab width
        width = QFontMetrics(FONT).width(" ") * 4
        self.css_pte.setTabStopWidth(width)

        # Restore/init the stored CSS
        self.css_pte.setPlainText(self.prefs.get('injected_css', ''))

        # Populate the HTML content
        rendered_html = self.inject_css(SAMPLE_HTML)
        self.html_wv.setHtml(rendered_html)

        # Restore the splitter
        split_points = self.prefs.get('css_editor_split_points')
        if split_points:
            self.splitter.setSizes(split_points)

        # Hook the QPlainTextEdit box
        self.css_pte.textChanged.connect(self.preview_css)

        # Hook the button events
        self.bb.clicked.connect(self.dispatch_button_click)

        self.resize_dialog()
コード例 #6
0
 def __init__(self, parent):
     ConversionErrorDialog.__init__(self, parent, 'Console output', '')
     self.setModal(Qt.NonModal)
     font = QFont()
     font.setStyleHint(QFont.TypeWriter)
     self.text.setFont(font)