def __init__(self, parent): QWizard.__init__(self, parent) self.setWindowTitle(__appname__+' '+_('welcome wizard')) p = QPixmap() p.loadFromData(open(P('content_server/calibre.png'), 'rb').read()) self.setPixmap(self.LogoPixmap, p.scaledToHeight(80, Qt.SmoothTransformation)) self.setPixmap(self.WatermarkPixmap, QPixmap(I('welcome_wizard.png'))) self.setPixmap(self.BackgroundPixmap, QPixmap(I('wizard.png'))) self.device_page = DevicePage() self.library_page = LibraryPage() self.library_page.retranslate.connect(self.retranslate) self.finish_page = FinishPage() self.set_finish_text() self.kindle_page = KindlePage() self.stanza_page = StanzaPage() self.setPage(self.library_page.ID, self.library_page) self.setPage(self.device_page.ID, self.device_page) self.setPage(self.finish_page.ID, self.finish_page) self.setPage(self.kindle_page.ID, self.kindle_page) self.setPage(self.stanza_page.ID, self.stanza_page) self.device_extra_page = None nh, nw = min_available_height()-75, available_width()-30 if nh < 0: nh = 580 if nw < 0: nw = 400 nh = min(400, nh) nw = min(580, nw) self.resize(nw, nh) self.set_button_texts()
def __init__(self, parent): QWizard.__init__(self, parent) self.setWindowTitle(__appname__ + ' ' + _('welcome wizard')) p = QPixmap() p.loadFromData(open(P('content_server/calibre.png'), 'rb').read()) self.setPixmap(self.LogoPixmap, p.scaledToHeight(80, Qt.SmoothTransformation)) self.setPixmap(self.WatermarkPixmap, QPixmap(I('welcome_wizard.png'))) self.setPixmap(self.BackgroundPixmap, QPixmap(I('wizard.png'))) self.device_page = DevicePage() self.library_page = LibraryPage() self.library_page.retranslate.connect(self.retranslate) self.finish_page = FinishPage() self.set_finish_text() self.kindle_page = KindlePage() self.stanza_page = StanzaPage() self.setPage(self.library_page.ID, self.library_page) self.setPage(self.device_page.ID, self.device_page) self.setPage(self.finish_page.ID, self.finish_page) self.setPage(self.kindle_page.ID, self.kindle_page) self.setPage(self.stanza_page.ID, self.stanza_page) self.device_extra_page = None nh, nw = min_available_height() - 75, available_width() - 30 if nh < 0: nh = 580 if nw < 0: nw = 400 nh = min(400, nh) nw = min(580, nw) self.resize(nw, nh) self.set_button_texts()
def __init__(self, db, parent=None): QWizard.__init__(self, parent) self.setModal(True) self.setWindowTitle(_('Add books to calibre')) self.setWindowIcon(QIcon(I('add_book.png'))) self.setPixmap(self.LogoPixmap, QPixmap(P('content_server/calibre.png')).scaledToHeight(80, Qt.SmoothTransformation)) self.setPixmap(self.WatermarkPixmap, QPixmap(I('welcome_wizard.png'))) self.register = {} for attr, cls in [ ('welcome_page', WelcomePage), ('scan_page', ScanPage), ]: setattr(self, attr, cls(db, self)) self.setPage(getattr(cls, 'ID'), getattr(self, attr))
def __init__(self, db, parent=None): QWizard.__init__(self, parent) self.setModal(True) self.setWindowTitle(_('Add books to calibre')) self.setWindowIcon(QIcon(I('add_book.png'))) self.setPixmap( self.LogoPixmap, QPixmap(P('content_server/calibre.png')).scaledToHeight( 80, Qt.SmoothTransformation)) self.setPixmap(self.WatermarkPixmap, QPixmap(I('welcome_wizard.png'))) self.register = {} for attr, cls in [ ('welcome_page', WelcomePage), ('scan_page', ScanPage), ]: setattr(self, attr, cls(db, self)) self.setPage(getattr(cls, 'ID'), getattr(self, attr))
def __init__(self, parent): QWizard.__init__(self, parent) self.setWindowTitle(__appname__+' '+_('welcome wizard')) self.setPixmap(self.LogoPixmap, QIcon(I('library.png')).pixmap(48, 48)) self.setWizardStyle(self.ModernStyle) self.device_page = DevicePage() self.library_page = LibraryPage() self.library_page.retranslate.connect(self.retranslate) self.finish_page = FinishPage() self.set_finish_text() self.kindle_page = KindlePage() self.stanza_page = StanzaPage() self.setPage(self.library_page.ID, self.library_page) self.setPage(self.device_page.ID, self.device_page) self.setPage(self.finish_page.ID, self.finish_page) self.setPage(self.kindle_page.ID, self.kindle_page) self.setPage(self.stanza_page.ID, self.stanza_page) self.device_extra_page = None self.set_button_texts() self.resize(600, 520)
def accept(self): pages = map(self.page, self.visitedPages()) for page in pages: page.commit() QWizard.accept(self)
def completed(self, newloc): return QWizard.accept(self)