示例#1
0
文件: main.py 项目: yeyanchao/calibre
def option_parser():
    c = config()
    return c.option_parser(usage=_('''\
%prog [options] file

View an ebook.
'''))
示例#2
0
文件: main.py 项目: kobolabs/calibre
def option_parser():
    c = config()
    return c.option_parser(usage=_('''\
%prog [options] file

View an ebook.
'''))
示例#3
0
文件: main.py 项目: kmshi/calibre
def option_parser():
    c = config()
    parser = c.option_parser(usage=_('''\
%prog [options] file

View an ebook.
'''))
    setup_gui_option_parser(parser)
    return parser
示例#4
0
 def read_settings(self):
     c = config().parse()
     if c.remember_window_size:
         wg = vprefs.get('viewer_window_geometry', None)
         if wg is not None:
             self.restoreGeometry(wg)
     self.show_toc_on_open = vprefs.get('viewer_toc_isvisible', False)
     desktop  = QApplication.instance().desktop()
     av = desktop.availableGeometry(self).height() - 30
     if self.height() > av:
         self.resize(self.width(), av)
示例#5
0
 def read_settings(self):
     c = config().parse()
     if c.remember_window_size:
         wg = vprefs.get('viewer_window_geometry', None)
         if wg is not None:
             self.restoreGeometry(wg)
     self.show_toc_on_open = vprefs.get('viewer_toc_isvisible', False)
     desktop  = QApplication.instance().desktop()
     av = desktop.availableGeometry(self).height() - 30
     if self.height() > av:
         self.resize(self.width(), av)
示例#6
0
文件: main.py 项目: kmshi/calibre
 def lookup(self, word):
     from calibre.gui2.viewer.documentview import config
     opts = config().parse()
     settings = self.dictionary_view.page().settings()
     settings.setFontSize(settings.DefaultFontSize, opts.default_font_size)
     settings.setFontSize(settings.DefaultFixedFontSize, opts.mono_font_size)
     self.dictionary_view.setHtml('<html><body><p>'+
         _('Connecting to dict.org to lookup: <b>%s</b>&hellip;')%word +
         '</p></body></html>')
     self.dictionary_box.show()
     self._lookup = Lookup(word, parent=self)
     self._lookup.finished.connect(self.looked_up)
     self._lookup.start()
示例#7
0
文件: main.py 项目: Eksmo/calibre
 def read_settings(self):
     c = config().parse()
     self.splitter.setSizes([1, 300])
     if c.remember_window_size:
         wg = vprefs.get('viewer_window_geometry', None)
         if wg is not None:
             self.restoreGeometry(wg)
         ss = vprefs.get('viewer_splitter_state', None)
         if ss is not None:
             self.splitter.restoreState(ss)
         self.show_toc_on_open = vprefs.get('viewer_toc_isvisible', False)
     av = available_height() - 30
     if self.height() > av:
         self.resize(self.width(), av)
示例#8
0
 def read_settings(self):
     c = config().parse()
     self.splitter.setSizes([1, 300])
     if c.remember_window_size:
         wg = vprefs.get('viewer_window_geometry', None)
         if wg is not None:
             self.restoreGeometry(wg)
         ss = vprefs.get('viewer_splitter_state', None)
         if ss is not None:
             self.splitter.restoreState(ss)
         self.show_toc_on_open = vprefs.get('viewer_toc_isvisible', False)
     av = available_height() - 30
     if self.height() > av:
         self.resize(self.width(), av)
示例#9
0
文件: main.py 项目: kmshi/calibre
 def get_remember_current_page_opt(self):
     from calibre.gui2.viewer.documentview import config
     c = config().parse()
     return c.remember_current_page