def __init__(self, sync_manager, network_access_manager, url=None, username=None, password=None, certificate=""): self.sync_manager = sync_manager self.nam = network_access_manager self.certificate = certificate self.replies = set() super(SettingsWindow, self).__init__() self.setWindowIcon(QIcon(os.path.join('icons', 'Logo_sync.png'))) self.setGeometry(70, 60, 300, 250) self.setWindowTitle("c't SESAM Sync Settings") layout = QBoxLayout(QBoxLayout.TopToBottom) layout.setContentsMargins(0, 0, 0, 0) # Header bar header_bar = QFrame() header_bar.setStyleSheet("QWidget { background: rgb(40, 40, 40); } " + "QToolButton { background: rgb(40, 40, 40); }" + "QToolTip { color: rgb(255, 255, 255); background-color: rgb(20, 20, 20); " + "border: 1px solid white; }") header_bar.setAutoFillBackground(True) header_bar.setFixedHeight(45) header_bar_layout = QBoxLayout(QBoxLayout.RightToLeft) header_bar_layout.addStretch() header_bar.setLayout(header_bar_layout) layout.addWidget(header_bar) self.create_header_bar(header_bar_layout) self.certificate_loaded.connect(self.test_connection) # Main area main_area = QFrame() main_layout = QBoxLayout(QBoxLayout.TopToBottom) main_area.setLayout(main_layout) layout.addWidget(main_area) self.create_main_area(main_layout, url, username, password) # Show the window layout.addStretch() self.setLayout(layout) self.show()
def __init__(self): super(MainWindow, self).__init__() self.nam = QNetworkAccessManager() self.setWindowIcon(QIcon(os.path.join('icons', 'Logo_rendered_edited.png'))) layout = QBoxLayout(QBoxLayout.TopToBottom) layout.setContentsMargins(0, 0, 0, 0) self.preference_manager = PreferenceManager() self.kgk_manager = KgkManager() self.kgk_manager.set_preference_manager(self.preference_manager) self.settings_manager = PasswordSettingsManager(self.preference_manager) self.setting_dirty = True # Header bar header_bar = QFrame() header_bar.setStyleSheet( "QWidget { background: rgb(40, 40, 40); } " + "QToolButton { background: rgb(40, 40, 40); }" + "QToolTip { color: rgb(255, 255, 255); background-color: rgb(20, 20, 20); " + "border: 1px solid white; }") header_bar.setAutoFillBackground(True) header_bar.setFixedHeight(45) header_bar_layout = QBoxLayout(QBoxLayout.LeftToRight) header_bar_layout.addStretch() header_bar.setLayout(header_bar_layout) layout.addWidget(header_bar) self.create_header_bar(header_bar_layout) # Widget area main_area = QFrame() main_layout = QBoxLayout(QBoxLayout.TopToBottom) main_area.setLayout(main_layout) layout.addWidget(main_area) self.create_main_area(main_layout) # Window layout layout.addStretch() main_layout.addStretch() self.setLayout(layout) settings = QSettings() size = settings.value("MainWindow/size") if not size: size = QSize(350, 450) self.resize(size) position = settings.value("MainWindow/pos") if not position: position = QPoint(0, 24) self.move(position) self.setWindowTitle("c't SESAM") self.master_password_edit.setFocus() self.show()
def __init__(self, sync_manager, network_access_manager, url=None, username=None, password=None, certificate=""): self.sync_manager = sync_manager self.nam = network_access_manager self.certificate = certificate self.replies = set() super(SettingsWindow, self).__init__() self.setWindowIcon(QIcon(os.path.join('icons', 'Logo_sync.png'))) self.setGeometry(70, 60, 300, 250) self.setWindowTitle("c't SESAM Sync Settings") layout = QBoxLayout(QBoxLayout.TopToBottom) layout.setContentsMargins(0, 0, 0, 0) # Header bar header_bar = QFrame() header_bar.setStyleSheet( "QWidget { background: rgb(40, 40, 40); } " + "QToolButton { background: rgb(40, 40, 40); }" + "QToolTip { color: rgb(255, 255, 255); background-color: rgb(20, 20, 20); " + "border: 1px solid white; }") header_bar.setAutoFillBackground(True) header_bar.setFixedHeight(45) header_bar_layout = QBoxLayout(QBoxLayout.RightToLeft) header_bar_layout.addStretch() header_bar.setLayout(header_bar_layout) layout.addWidget(header_bar) self.create_header_bar(header_bar_layout) self.certificate_loaded.connect(self.test_connection) # Main area main_area = QFrame() main_layout = QBoxLayout(QBoxLayout.TopToBottom) main_area.setLayout(main_layout) layout.addWidget(main_area) self.create_main_area(main_layout, url, username, password) # Show the window layout.addStretch() self.setLayout(layout) self.show()