""" def __init__(self, parent, device=None, title=_("Unknown")): QGroupBox.__init__(self, parent) self.device = device self.setTitle(title) if __name__ == '__main__': from calibre.gui2 import Application from calibre.devices.kobo.driver import KOBO from calibre.devices.scanner import DeviceScanner s = DeviceScanner() s.scan() app = Application([]) dev = KOBO(None) debug_print("KOBO:", KOBO) # dev.startup() # cd = dev.detect_managed_devices(s.devices) # dev.open(cd, 'test') cw = dev.config_widget() d = QDialog() d.l = QVBoxLayout() d.setLayout(d.l) d.l.addWidget(cw) bb = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) d.l.addWidget(bb) bb.accepted.connect(d.accept) bb.rejected.connect(d.reject) if d.exec_() == d.Accepted: cw.commit()
def __init__(self, parent, device=None, title=_("Unknown")): QGroupBox.__init__(self, parent) self.device = device self.setTitle(title) if __name__ == '__main__': from calibre.gui2 import Application from calibre.devices.kobo.driver import KOBO from calibre.devices.scanner import DeviceScanner s = DeviceScanner() s.scan() app = Application([]) dev = KOBO(None) debug_print("KOBO:", KOBO) # dev.startup() # cd = dev.detect_managed_devices(s.devices) # dev.open(cd, 'test') cw = dev.config_widget() d = QDialog() d.l = QVBoxLayout() d.setLayout(d.l) d.l.addWidget(cw) bb = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel) d.l.addWidget(bb) bb.accepted.connect(d.accept) bb.rejected.connect(d.reject) if d.exec_() == d.Accepted: cw.commit()