本文整理汇总了Python中calibre.gui2.widgets.ProgressIndicator.stop方法的典型用法代码示例。如果您正苦于以下问题:Python ProgressIndicator.stop方法的具体用法?Python ProgressIndicator.stop怎么用?Python ProgressIndicator.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calibre.gui2.widgets.ProgressIndicator
的用法示例。
在下文中一共展示了ProgressIndicator.stop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EbookViewer
# 需要导入模块: from calibre.gui2.widgets import ProgressIndicator [as 别名]
# 或者: from calibre.gui2.widgets.ProgressIndicator import stop [as 别名]
#.........这里部分代码省略.........
def show_pos_label(self):
self.pos_label.setVisible(True)
self.pos_label.setStyleSheet(self.info_label_style%(
'rgba(0, 0, 0, 0)', self.view.document.colors()[1]))
self.update_pos_label()
def relayout_fullscreen_labels(self):
vswidth = (self.vertical_scrollbar.width() if
self.vertical_scrollbar.isVisible() else 0)
p = self.pos_label
p.move(15, p.parent().height() - p.height()-10)
c = self.clock_label
c.move(c.parent().width() - vswidth - 15 - c.width(), c.parent().height() - c.height() - 10)
f = self.full_screen_label
f.move((f.parent().width() - f.width())//2, (f.parent().height() - f.final_height)//2)
def update_clock(self):
self.clock_label.setText(QTime.currentTime().toString(Qt.SystemLocaleShortDate))
def update_pos_label(self, *args):
if self.pos_label.isVisible():
try:
value, maximum = args
except:
value, maximum = self.pos.value(), self.pos.maximum()
text = '%g/%g'%(value, maximum)
self.pos_label.setText(text)
self.pos_label.resize(self.pos_label.sizeHint())
def showNormal(self):
self.view.document.page_position.save()
self.clock_label.setVisible(False)
self.pos_label.setVisible(False)
self.clock_timer.stop()
self.vertical_scrollbar.setVisible(True)
self.window_mode_changed = 'normal'
self.settings_changed()
self.full_screen_label.setVisible(False)
if self.was_maximized:
super(EbookViewer, self).showMaximized()
else:
super(EbookViewer, self).showNormal()
def goto(self, ref):
if ref:
tokens = ref.split('.')
if len(tokens) > 1:
spine_index = int(tokens[0]) -1
if spine_index == self.current_index:
self.view.goto(ref)
else:
self.pending_reference = ref
self.load_path(self.iterator.spine[spine_index])
def goto_bookmark(self, bm):
spine_index = bm['spine']
if spine_index > -1 and self.current_index == spine_index:
if self.resize_in_progress:
self.view.document.page_position.set_pos(bm['pos'])
else:
self.view.goto_bookmark(bm)
# Going to a bookmark does not call scrolled() so we update the
# page position explicitly. Use a timer to ensure it is
# accurate.
QTimer.singleShot(100, self.update_page_number)
else:
示例2: EbookViewer
# 需要导入模块: from calibre.gui2.widgets import ProgressIndicator [as 别名]
# 或者: from calibre.gui2.widgets.ProgressIndicator import stop [as 别名]
#.........这里部分代码省略.........
self.vertical_scrollbar.isVisible() else 0)
self.clock_label.move(sw.width() - vswidth - 15
- self.clock_label.width(), sw.height() -
self.clock_label.height()-10)
self.update_clock()
def show_pos_label(self):
self.pos_label.setVisible(True)
self.pos_label.setStyleSheet(self.info_label_style%(
'rgba(0, 0, 0, 0)', self.view.document.colors()[1]))
sw = QApplication.desktop().screenGeometry(self.view)
self.pos_label.move(15, sw.height() - self.pos_label.height()-10)
self.update_pos_label()
def update_clock(self):
self.clock_label.setText(QTime.currentTime().toString(Qt.SystemLocaleShortDate))
def update_pos_label(self, *args):
if self.pos_label.isVisible():
try:
value, maximum = args
except:
value, maximum = self.pos.value(), self.pos.maximum()
text = '%g/%g'%(value, maximum)
self.pos_label.setText(text)
self.pos_label.resize(self.pos_label.sizeHint())
def showNormal(self):
self.view.document.page_position.save()
self.clock_label.setVisible(False)
self.pos_label.setVisible(False)
self.frame.setFrameStyle(self.original_frame_style)
self.frame.layout().setSpacing(-1)
self.clock_timer.stop()
self.vertical_scrollbar.setVisible(True)
self.window_mode_changed = 'normal'
self.settings_changed()
self.full_screen_label.setVisible(False)
if hasattr(self, '_original_frame_margins'):
om = self._original_frame_margins
self.centralwidget.layout().setContentsMargins(om[0])
self.frame.layout().setContentsMargins(om[1])
if self.was_maximized:
super(EbookViewer, self).showMaximized()
else:
super(EbookViewer, self).showNormal()
def handle_window_mode_toggle(self):
if self.window_mode_changed:
fs = self.window_mode_changed == 'fullscreen'
self.window_mode_changed = None
if fs:
self.show_full_screen_label()
else:
self.view.document.switch_to_window_mode()
self.view.document.page_position.restore()
self.scrolled(self.view.scroll_fraction)
def goto(self, ref):
if ref:
tokens = ref.split('.')
if len(tokens) > 1:
spine_index = int(tokens[0]) -1
if spine_index == self.current_index:
self.view.goto(ref)
else:
示例3: EbookViewer
# 需要导入模块: from calibre.gui2.widgets import ProgressIndicator [as 别名]
# 或者: from calibre.gui2.widgets.ProgressIndicator import stop [as 别名]
#.........这里部分代码省略.........
self.update_clock()
def show_pos_label(self):
self.pos_label.setVisible(True)
self.pos_label.setStyleSheet(self.info_label_style % ("rgba(0, 0, 0, 0)", self.view.document.colors()[1]))
self.update_pos_label()
def relayout_fullscreen_labels(self):
vswidth = self.vertical_scrollbar.width() if self.vertical_scrollbar.isVisible() else 0
p = self.pos_label
p.move(15, p.parent().height() - p.height() - 10)
c = self.clock_label
c.move(c.parent().width() - vswidth - 15 - c.width(), c.parent().height() - c.height() - 10)
f = self.full_screen_label
f.move((f.parent().width() - f.width()) // 2, (f.parent().height() - f.final_height) // 2)
def update_clock(self):
self.clock_label.setText(QTime.currentTime().toString(Qt.SystemLocaleShortDate))
def update_pos_label(self, *args):
if self.pos_label.isVisible():
try:
value, maximum = args
except:
value, maximum = self.pos.value(), self.pos.maximum()
text = "%g/%g" % (value, maximum)
self.pos_label.setText(text)
self.pos_label.resize(self.pos_label.sizeHint())
def showNormal(self):
self.view.document.page_position.save()
self.clock_label.setVisible(False)
self.pos_label.setVisible(False)
self.clock_timer.stop()
self.vertical_scrollbar.setVisible(True)
self.window_mode_changed = "normal"
self.settings_changed()
self.full_screen_label.setVisible(False)
if self.was_maximized:
super(EbookViewer, self).showMaximized()
else:
super(EbookViewer, self).showNormal()
def handle_window_mode_toggle(self):
if self.window_mode_changed:
fs = self.window_mode_changed == "fullscreen"
self.window_mode_changed = None
if fs:
self.show_full_screen_label()
else:
self.view.document.switch_to_window_mode()
self.view.document.page_position.restore()
self.scrolled(self.view.scroll_fraction)
def goto(self, ref):
if ref:
tokens = ref.split(".")
if len(tokens) > 1:
spine_index = int(tokens[0]) - 1
if spine_index == self.current_index:
self.view.goto(ref)
else:
self.pending_reference = ref
self.load_path(self.iterator.spine[spine_index])
def goto_bookmark(self, bm):