def __init__(self, first_time=False): QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.logger = get_logger() self.setWindowIcon(QIcon(LOGO_PATH)) self.logo_label.setPixmap(get_pixmap(LOGO_PATH, 20, 20)) self.computer_label.setPixmap(get_pixmap(COMPUTER_PATH, 20, 20)) self.arrow_label.setPixmap(get_pixmap(ARROW_PATH, 20, 20)) self.cloud_label.setPixmap(get_pixmap(CLOUD_PATH, 20, 20)) self.settings_button.pressed.connect(self.open_settings) self.backup_now_button.pressed.connect(self.toggle_backup) self.restore_button.pressed.connect(self.open_restore_files) self.privacy_label.linkActivated.connect( lambda: webbrowser.open(PRIVACY_URL)) self.support_label.linkActivated.connect( lambda: webbrowser.open(SUPPORT_URL)) self.launch_status_thread() self.launch_backup_thread() if first_time: dialog = BackupStartedDialog() dialog.exec()
def __init__(self): QMainWindow.__init__(self) self.initGui()
def __init__(self, is_private=False, restart_state=None): QMainWindow.__init__(self) self.saved_scroll = None self.setWindowIcon(get_icon('vise.svg')) self.setWindowRole('browser') self.current_tab = None self.quickmark_pending = self.choose_tab_pending = None self.window_id = next(window_id) self.is_private = is_private self.deleted_tabs_cache = deque(maxlen=200) self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose, True) self.downloads_indicator = Indicator(self) self.status_bar = StatusBar(self.downloads_indicator, self) self.start_search_signal.connect( self.show_search, type=Qt.ConnectionType.QueuedConnection) self.start_search = lambda forward=True: self.start_search_signal.emit( forward) self.status_bar.do_search.connect(self.do_search) self.status_bar.change_passthrough.connect(self.change_passthrough) self.status_bar.search_bar_hidden.connect( self.restore_state_after_popup) self.setStatusBar(self.status_bar) self.main_splitter = w = QSplitter(self) self.setCentralWidget(w) self.tabs = [] self.tab_tree = tt = TabTree(self) tt.tab_activated.connect(self.show_tab) tt.tab_close_requested.connect(self.close_tab) tt.delete_tabs.connect(self.delete_removed_tabs) w.addWidget(tt) self.stack = s = StackedWidget(self) s.currentChanged.connect(self.current_tab_changed) w.addWidget(s) self.dev_tools_container = d = DevToolsContainer(self) self.before_devtools_splitter_state = None self.prev_devtools_splitter_state = None w.addWidget(d) d.setVisible(False) w.setCollapsible(0, True), w.setCollapsible(1, False), w.setCollapsible( 2, True) self._ask = a = Ask(s) a.setVisible(False), a.run_command.connect(self.run_command) a.hidden.connect(self.restore_state_after_popup) self.profile = create_profile( private=True) if is_private else profile() if is_private: # TODO: delete this profile on window close rather than application # close self.profile.setParent(None) if restart_state is None: self.open_url(WELCOME_URL) else: self.unserialize_state(restart_state) self.restore_state() self.current_tab_changed()
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle('Hola PyQt6') self.setFixedSize(500, 400)