From bc6135f215858ed49fda3ed1c8b52ff369274701 Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Sun, 6 Feb 2022 16:47:19 +0100 Subject: [PATCH 01/12] Renamed 'OneDriveGUI' dir to 'src' --- {OneDriveGUI => src}/OneDriveGUI.py | 0 src/__thrash/OneDriveGUI-backup.py | 307 ++++++++++++++++++ src/__thrash/OneDriveGUI-bob-Manja.py | 262 +++++++++++++++ src/__thrash/config | 47 +++ src/__thrash/dict_parser_test.py | 120 +++++++ src/__thrash/file_dialog_test.py | 50 +++ src/__thrash/form.ui | 22 ++ src/__thrash/list_test.py | 106 ++++++ src/__thrash/mainwindow.py | 52 +++ src/__thrash/message_box_test.py | 39 +++ src/__thrash/new_window_test.py | 43 +++ src/__thrash/output_parser_test.py | 136 ++++++++ src/__thrash/re_test.py | 58 ++++ src/__thrash/system_tray.py | 39 +++ src/__thrash/test.py | 13 + src/__thrash/ui/settings-good-backup.ui | 223 +++++++++++++ src/__thrash/ui/settings2.ui | 236 ++++++++++++++ src/__thrash/ui/settings_qt5_web-test.ui | 245 ++++++++++++++ src/__thrash/ui/settings_ui.py | 229 +++++++++++++ src/__thrash/ui/ui_OneDriveGUI.py | 127 ++++++++ src/__thrash/ui/ui_settings-good-backup.py | 229 +++++++++++++ src/__thrash/ui/ui_settings2.py | 240 ++++++++++++++ src/__thrash/ui/ui_settings_qt5_web-test.py | 229 +++++++++++++ src/__thrash/ui/ui_settings_web.py | 229 +++++++++++++ src/__thrash/ui_list_item_widget.py_ | 83 +++++ src/__thrash/version2.py | 20 ++ src/__thrash/wizard_test.py | 81 +++++ src/__thrash/wizard_test2.py | 95 ++++++ {OneDriveGUI => src}/resources/default_config | 0 .../images/icons8-cloud-cross-40_2.png | Bin .../images/icons8-cloud-done-40_2.png | Bin .../images/icons8-cloud-sync-40_2.png | Bin .../resources/images/icons8-clouds-48.png | Bin .../images/icons8-documents-folder-50.png | Bin .../images/icons8-green-circle-48.png | Bin .../resources/images/icons8-play-48.png | Bin .../resources/images/icons8-red-circle-48.png | Bin .../resources/images/icons8-settings-50.png | Bin .../resources/images/icons8-stop-50.png | Bin {OneDriveGUI => src}/setup_wizard.py | 0 {OneDriveGUI => src}/ui/create_new_profile.ui | 0 .../ui/import_existing_profile.ui | 0 {OneDriveGUI => src}/ui/list_item_widget.ui | 0 {OneDriveGUI => src}/ui/login.ui | 0 {OneDriveGUI => src}/ui/mainwindow.ui | 0 .../ui/mainwindow.ui.autosave | 0 .../ui/process_status_page.ui | 0 .../ui/profile_settings_page.ui | 0 {OneDriveGUI => src}/ui/settings.ui | 0 {OneDriveGUI => src}/ui/setup_wizard.ui | 0 {OneDriveGUI => src}/ui/test.ui | 0 .../ui/ui_create_new_profile.py | 0 .../ui/ui_import_existing_profile.py | 0 .../ui/ui_list_item_widget.py | 0 {OneDriveGUI => src}/ui/ui_login.py | 0 {OneDriveGUI => src}/ui/ui_mainwindow.py | 0 .../ui/ui_process_status_page.py | 0 .../ui/ui_profile_settings_page.py | 0 {OneDriveGUI => src}/ui/ui_settings.py | 0 {OneDriveGUI => src}/ui/ui_setup_wizard.py | 0 .../ui/ui_wizardPage_welcome.py | 0 {OneDriveGUI => src}/ui/wizardPage_welcome.ui | 0 62 files changed, 3560 insertions(+) rename {OneDriveGUI => src}/OneDriveGUI.py (100%) create mode 100644 src/__thrash/OneDriveGUI-backup.py create mode 100644 src/__thrash/OneDriveGUI-bob-Manja.py create mode 100644 src/__thrash/config create mode 100644 src/__thrash/dict_parser_test.py create mode 100644 src/__thrash/file_dialog_test.py create mode 100644 src/__thrash/form.ui create mode 100644 src/__thrash/list_test.py create mode 100644 src/__thrash/mainwindow.py create mode 100644 src/__thrash/message_box_test.py create mode 100644 src/__thrash/new_window_test.py create mode 100644 src/__thrash/output_parser_test.py create mode 100644 src/__thrash/re_test.py create mode 100644 src/__thrash/system_tray.py create mode 100644 src/__thrash/test.py create mode 100644 src/__thrash/ui/settings-good-backup.ui create mode 100644 src/__thrash/ui/settings2.ui create mode 100644 src/__thrash/ui/settings_qt5_web-test.ui create mode 100644 src/__thrash/ui/settings_ui.py create mode 100644 src/__thrash/ui/ui_OneDriveGUI.py create mode 100644 src/__thrash/ui/ui_settings-good-backup.py create mode 100644 src/__thrash/ui/ui_settings2.py create mode 100644 src/__thrash/ui/ui_settings_qt5_web-test.py create mode 100644 src/__thrash/ui/ui_settings_web.py create mode 100644 src/__thrash/ui_list_item_widget.py_ create mode 100644 src/__thrash/version2.py create mode 100644 src/__thrash/wizard_test.py create mode 100644 src/__thrash/wizard_test2.py rename {OneDriveGUI => src}/resources/default_config (100%) rename {OneDriveGUI => src}/resources/images/icons8-cloud-cross-40_2.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-cloud-done-40_2.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-cloud-sync-40_2.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-clouds-48.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-documents-folder-50.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-green-circle-48.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-play-48.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-red-circle-48.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-settings-50.png (100%) rename {OneDriveGUI => src}/resources/images/icons8-stop-50.png (100%) rename {OneDriveGUI => src}/setup_wizard.py (100%) rename {OneDriveGUI => src}/ui/create_new_profile.ui (100%) rename {OneDriveGUI => src}/ui/import_existing_profile.ui (100%) rename {OneDriveGUI => src}/ui/list_item_widget.ui (100%) rename {OneDriveGUI => src}/ui/login.ui (100%) rename {OneDriveGUI => src}/ui/mainwindow.ui (100%) rename {OneDriveGUI => src}/ui/mainwindow.ui.autosave (100%) rename {OneDriveGUI => src}/ui/process_status_page.ui (100%) rename {OneDriveGUI => src}/ui/profile_settings_page.ui (100%) rename {OneDriveGUI => src}/ui/settings.ui (100%) rename {OneDriveGUI => src}/ui/setup_wizard.ui (100%) rename {OneDriveGUI => src}/ui/test.ui (100%) rename {OneDriveGUI => src}/ui/ui_create_new_profile.py (100%) rename {OneDriveGUI => src}/ui/ui_import_existing_profile.py (100%) rename {OneDriveGUI => src}/ui/ui_list_item_widget.py (100%) rename {OneDriveGUI => src}/ui/ui_login.py (100%) rename {OneDriveGUI => src}/ui/ui_mainwindow.py (100%) rename {OneDriveGUI => src}/ui/ui_process_status_page.py (100%) rename {OneDriveGUI => src}/ui/ui_profile_settings_page.py (100%) rename {OneDriveGUI => src}/ui/ui_settings.py (100%) rename {OneDriveGUI => src}/ui/ui_setup_wizard.py (100%) rename {OneDriveGUI => src}/ui/ui_wizardPage_welcome.py (100%) rename {OneDriveGUI => src}/ui/wizardPage_welcome.ui (100%) diff --git a/OneDriveGUI/OneDriveGUI.py b/src/OneDriveGUI.py similarity index 100% rename from OneDriveGUI/OneDriveGUI.py rename to src/OneDriveGUI.py diff --git a/src/__thrash/OneDriveGUI-backup.py b/src/__thrash/OneDriveGUI-backup.py new file mode 100644 index 0000000..a882da4 --- /dev/null +++ b/src/__thrash/OneDriveGUI-backup.py @@ -0,0 +1,307 @@ +import sys, psutil, os, subprocess, signal +from configparser import ConfigParser + +from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) +from PySide6.QtGui import QIcon +from PySide6.QtCore import QTimer, QUrl + +from ui.ui_mainwindow import Ui_MainWindow +from ui.ui_settings import Ui_Form +from ui.ui_login import Ui_LoginWindow + +CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') + +class MainWindow(QMainWindow, Ui_MainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.setupUi(self) + + # Open Settings window + self.pushButton_3.clicked.connect(lambda: self.show_settings()) + + # Update OneDrive Status + self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) + + # Start OneDrive service + self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) + + # Stop OneDrive service + self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) + + # Restart OneDrive service + self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) + + # Start OneDrive monitoring + self.pushButton_5.clicked.connect(lambda: self.oneDriveMonitor('onedrive --monitor')) + + # Stop OneDrive monitoring + self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + + # Force OneDrive resync + # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + # + + # Open login form TODO: testing + self.pushButton_2.setText("login") + self.pushButton_2.clicked.connect(lambda: self.show_login()) + + + # Refresh Sync Status + self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) + self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) + + self.text_timer = QTimer() + self.text_timer.setSingleShot(False) + self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) + self.text_timer.start(1000) + + + + # System Tray + + self.tray = QSystemTrayIcon() + if self.tray.isSystemTrayAvailable(): + + icon = QIcon("icons8-clouds-48.png") + menu = QMenu() + + actionshow = menu.addAction("Show/Hide") + actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) + settingAction = menu.addAction("Settings") + settingAction.triggered.connect(self.show_settings) + quitAction = menu.addAction("Quit") + quitAction.triggered.connect(sys.exit) + + self.tray.setIcon(icon) + self.tray.setContextMenu(menu) + self.tray.show() + self.tray.setToolTip("This is OneDriveGUI") + # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") + else: + self.tray = None + + # Check OneDrive status + def oneDriveProcessStatus(self): + for onedrive_process in psutil.process_iter(): + if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': + # print("OneDrive is running.") + self.label_3.setText("running") + return True + # print("OneDrive is NOT running.") + self.label_3.setText("not running") + return False + + def oneDriveSyncStatus(self): + + status = subprocess.check_output(['onedrive', '--display-sync-status']) + if 'in sync' in str(status): + self.label_4.setText("In Sync") + return True + else: + self.label_4.setText("Out of Sync") + return False + + # def oneDriveMonitor(self, state): + # if state == 'start': + # self.onedrive_process = subprocess.Popen('onedrive --monitor -v', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) + # while True: + # onedrive_output = self.onedrive_process.communicate() + # print(onedrive_output) + # elif state == 'stop': + # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) + + + + # # def status_checker(): + # # timer = QTimer() + # # timer.setSingleShot(True) + # # timer.timeout.connect(status_checker) + # # timer.start(1000) + + # # status_checker() + + async def oneDriveMonitor(self, command): + self.onedrive_process = subprocess.Popen(command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True, + universal_newlines=True) + + + while self.onedrive_process.poll() == None: + + if self.onedrive_process.stdout: + stdout = self.onedrive_process.stdout.readline() + + if 'Authorize this app visiting' in stdout: + # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) + self.onedrive_process.kill() + self.show_login() + if 'time' in stdout: + print('# ' + stdout) + else: + print('@@ ' + stdout.strip()) + + + if self.onedrive_process.stderr: + stderr = self.onedrive_process.stderr.readline() + print('!!!!ERROR ' + stderr) + + if 'command not found' in stderr: + print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") + elif '--resync is required' in stderr: + print(stderr.decode() + " Starting resync.") + self.oneDriveMonitor("onedrive --monitor --resync") + else: + print('@@ERROR' + stderr) + + + + def show_login(self): + self.window1 = QWidget() + self.lw = Ui_LoginWindow() + self.lw.setupUi(self.window1) + self.window1.show() + + # use static URL for now. TODO: use auth files in the future + url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + self.lw.loginFrame.setUrl(QUrl(url)) + + # Wait for user to login and obtain response URL + self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) + + + def getResponseUrl(self, response_url): + if 'nativeclient?code=' in response_url: + os.system(f'onedrive --auth-response "{response_url}"') + print("Login performed") + else: + pass + + + + + + def show_settings(self): + self.window2 = QWidget() + self.ui = Ui_Form() + self.ui.setupUi(self.window2) + + self.window2.show() + + self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) + self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) + + self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) + self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) + + + skip_files = settings['onedrive']['skip_file'].strip('"').split('|') + self.ui.listWidget.addItems(skip_files) + self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) + self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) + self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) + + # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) + # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) + + + skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') + self.ui.listWidget_2.addItems(skip_dirs) + self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) + self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) + self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) + + # self.button2 = QtWidgets.QPushButton("save") + # self.pushButton_4.setText("save") + # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) + self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) + + # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + # self.ui.webEngineView.setUrl(QUrl(url)) + # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) + # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) + + # Rate limit + self.ui.lineEdit_5.setText(settings['onedrive']['rate_limit'].strip('"')) + self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s") + self.ui.lineEdit_5.textChanged.connect(lambda: settings.set('onedrive', 'rate_limit', f'"{self.ui.lineEdit_5.text()}"')) + self.ui.lineEdit_5.textChanged.connect(lambda: self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s")) + + + + + def add_item_to_Qlist(self, source_widget, destination_widget, list): + if source_widget.text() == "": + print("Inoring empty value.") + elif source_widget.text() in list: + print("Item already in exemption list.") + else: + list.append(source_widget.text()) + destination_widget.addItem(source_widget.text()) + + + + def remove_item_from_Qlist(self, QListWidget_name): + for item in QListWidget_name.selectedItems(): + print("Removing: " + item.text()) + items.remove(item.text()) + QListWidget_name.takeItem(QListWidget_name.row(item)) + + + + + + + +def read_config(config_file): + with open(config_file, 'r') as f: + config_string = '[onedrive]\n' + f.read() + + config = ConfigParser() + config.read_string(config_string) + + return config + + +def save_config(new_settings): + # config = ConfigParser() + # config.read_dict + + new_settings.write + print(new_settings) + print(new_settings['onedrive']['sync_dir']) + print('saved') + + # new_settings.set('onedrive', 'testoption', '"QQQQQ"') + + with open(CONFIG_FILE, 'w') as configfile: + new_settings.write(configfile) + + # remove first line (section) from config file + with open(CONFIG_FILE, 'r') as fin: + data = fin.read().splitlines(True) + with open(CONFIG_FILE, 'w') as fout: + fout.writelines(data[1:]) + + + config = ConfigParser() + config.read(new_settings) + # print(config['onedrive']['skip_dir']) + + + + + + + +if __name__ == "__main__": + settings = read_config(CONFIG_FILE) + + app = QApplication(sys.argv) + window = MainWindow() + + window.show() + app.exec() + + diff --git a/src/__thrash/OneDriveGUI-bob-Manja.py b/src/__thrash/OneDriveGUI-bob-Manja.py new file mode 100644 index 0000000..d48aaee --- /dev/null +++ b/src/__thrash/OneDriveGUI-bob-Manja.py @@ -0,0 +1,262 @@ +import sys, psutil, os, subprocess, signal +from configparser import ConfigParser + +from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) +from PySide6.QtGui import QIcon +from PySide6.QtCore import QTimer, QUrl + +from ui.ui_mainwindow import Ui_MainWindow +from ui.ui_settings import Ui_Form +from ui.ui_login import Ui_LoginWindow + +CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') + +class MainWindow(QMainWindow, Ui_MainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.setupUi(self) + + # Open Settings window + self.pushButton_3.clicked.connect(lambda: self.show_settings()) + + # Update OneDrive Status + self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) + + # Start OneDrive service + self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) + + # Stop OneDrive service + self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) + + # Restart OneDrive service + self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) + + # Start OneDrive monitoring + self.pushButton_5.clicked.connect(lambda: subprocess.Popen('onedrive --monitor', shell=True)) + + # Stop OneDrive monitoring + self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + + # Force OneDrive resync + # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + # + + # Open login form TODO: testing + self.pushButton_2.setText("login") + self.pushButton_2.clicked.connect(lambda: self.show_login()) + + + # Refresh Sync Status + self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) + self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) + + self.text_timer = QTimer() + self.text_timer.setSingleShot(False) + self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) + self.text_timer.start(1000) + + + + # System Tray + + self.tray = QSystemTrayIcon() + if self.tray.isSystemTrayAvailable(): + + icon = QIcon("icons8-clouds-48.png") + menu = QMenu() + + actionshow = menu.addAction("Show/Hide") + actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) + settingAction = menu.addAction("Settings") + settingAction.triggered.connect(self.show_settings) + quitAction = menu.addAction("Quit") + quitAction.triggered.connect(sys.exit) + + self.tray.setIcon(icon) + self.tray.setContextMenu(menu) + self.tray.show() + self.tray.setToolTip("This is OneDriveGUI") + # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") + else: + self.tray = None + + # Check OneDrive status + def oneDriveProcessStatus(self): + for onedrive_process in psutil.process_iter(): + if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': + # print("OneDrive is running.") + self.label_3.setText("running") + return True + # print("OneDrive is NOT running.") + self.label_3.setText("not running") + return False + + def oneDriveSyncStatus(self): + + status = subprocess.check_output(['onedrive', '--display-sync-status']) + if 'in sync' in str(status): + self.label_4.setText("In Sync") + return True + else: + self.label_4.setText("Out of Sync") + return False + + def startOneDriveMonitor(self, state): + if state == 'start': + self.onedrive_process = subprocess.Popen('onedrive --monitor', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) + elif state == 'stop': + os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) + + + + # def status_checker(): + # timer = QTimer() + # timer.setSingleShot(True) + # timer.timeout.connect(status_checker) + # timer.start(1000) + + # status_checker() + + def show_login(self): + self.window1 = QWidget() + self.lw = Ui_LoginWindow() + self.lw.setupUi(self.window1) + self.window1.show() + + # use static URL for now. TODO: use auth files in the future + url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + self.lw.loginFrame.setUrl(QUrl(url)) + + # Wait for user to login and obtain response URL + self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) + + + def getResponseUrl(self, response_url): + if 'nativeclient?code=' in response_url: + os.system(f'onedrive --auth-response "{response_url}"') + print("Login performed") + else: + pass + + + + + + def show_settings(self): + self.window2 = QWidget() + self.ui = Ui_Form() + self.ui.setupUi(self.window2) + + self.window2.show() + + self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) + self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) + + self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) + self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) + + + skip_files = settings['onedrive']['skip_file'].strip('"').split('|') + self.ui.listWidget.addItems(skip_files) + self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) + self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) + self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) + + # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) + # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) + + + skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') + self.ui.listWidget_2.addItems(skip_dirs) + self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) + self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) + self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) + + # self.button2 = QtWidgets.QPushButton("save") + # self.pushButton_4.setText("save") + # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) + self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) + + # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + # self.ui.webEngineView.setUrl(QUrl(url)) + # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) + # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) + + + + + + def add_item_to_Qlist(self, source_widget, destination_widget, list): + if source_widget.text() == "": + print("Inoring empty value.") + elif source_widget.text() in list: + print("Item already in exemption list.") + else: + list.append(source_widget.text()) + destination_widget.addItem(source_widget.text()) + + + + def remove_item_from_Qlist(self, QListWidget_name): + for item in QListWidget_name.selectedItems(): + print("Removing: " + item.text()) + items.remove(item.text()) + QListWidget_name.takeItem(QListWidget_name.row(item)) + + + + + + + +def read_config(config_file): + with open(config_file, 'r') as f: + config_string = '[onedrive]\n' + f.read() + + config = ConfigParser() + config.read_string(config_string) + + return config + + +def save_config(new_settings): + # config = ConfigParser() + # config.read_dict + + new_settings.write + print(new_settings) + print(new_settings['onedrive']['sync_dir']) + print('saved') + + # new_settings.set('onedrive', 'testoption', '"QQQQQ"') + + with open(CONFIG_FILE, 'w') as configfile: + new_settings.write(configfile) + + # remove first line (section) from config file + with open(CONFIG_FILE, 'r') as fin: + data = fin.read().splitlines(True) + with open(CONFIG_FILE, 'w') as fout: + fout.writelines(data[1:]) + + + config = ConfigParser() + config.read(new_settings) + # print(config['onedrive']['skip_dir']) + + + + + + + +if __name__ == "__main__": + settings = read_config(CONFIG_FILE) + + app = QApplication(sys.argv) + window = MainWindow() + + window.show() + app.exec() + + diff --git a/src/__thrash/config b/src/__thrash/config new file mode 100644 index 0000000..e1cc097 --- /dev/null +++ b/src/__thrash/config @@ -0,0 +1,47 @@ +sync_dir = ""~/OneDrive2"" +skip_file = "~*|.~*|*.tmp" +monitor_interval = "300" +skip_dir = "akjshdaskhdsakjh" +log_dir = "/var/log/onedrive/" +drive_id = "" +upload_only = "false" +check_nomount = "false" +check_nosync = "false" +download_only = "false" +disable_notifications = "false" +disable_upload_validation = "false" +enable_logging = ""true1"" +force_http_2 = "false" +local_first = "false" +no_remote_delete = "false" +skip_symlinks = "false" +debug_https = "false" +skip_dotfiles = "false" +dry_run = "false" +min_notify_changes = "5" +monitor_log_frequency = "5" +monitor_fullscan_frequency = "10" +sync_root_files = "false" +classify_as_big_delete = "1000" +user_agent = "" +remove_source_files = "false" +skip_dir_strict_match = "false" +application_id = "" +resync = "false" +bypass_data_preservation = "false" +azure_ad_endpoint = "" +azure_tenant_id = "common" +sync_business_shared_folders = "false" +sync_dir_permissions = "700" +sync_file_permissions = "600" +rate_limit = "131072" +webhook_enabled = "false" +webhook_public_url = "" +webhook_listening_host = "" +webhook_listening_port = "8888" +webhook_expiration_interval = "86400" +webhook_renewal_interval = "43200" +operation_timeout = "3600" +testoption = "QQQQQ" +testoption2 = "testvalueCC2a" + diff --git a/src/__thrash/dict_parser_test.py b/src/__thrash/dict_parser_test.py new file mode 100644 index 0000000..e06fb1b --- /dev/null +++ b/src/__thrash/dict_parser_test.py @@ -0,0 +1,120 @@ +from configparser import ConfigParser + +global_config = { + "boris@pozdena.eu": { + "config_file": "/home/bob/.config/onedrive/accounts/boris@pozdena.eu/config", + "enable_debug": "True", + "mode": "monitor", + "onedrive": { + "sync_dir": '"/home/bob/OneDrive/"', + "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe|.testfile"', + "monitor_interval": '"15"', + "skip_dir": '"__pycache__|env|venv"', + "log_dir": '"/var/log/onedrive/"', + "drive_id": '""', + "upload_only": '"false"', + "check_nomount": '"false"', + "check_nosync": '"false"', + "download_only": '"false"', + "disable_notifications": '"false"', + "disable_upload_validation": '"false"', + "enable_logging": '"false"', + "force_http_2": '"false"', + "local_first": '"false"', + "no_remote_delete": '"false"', + "skip_symlinks": '"false"', + "debug_https": '"false"', + "skip_dotfiles": '"false"', + "dry_run": '"false"', + "min_notify_changes": '"5"', + "monitor_log_frequency": '"5"', + "monitor_fullscan_frequency": '"1"', + "sync_root_files": '"false"', + "classify_as_big_delete": '"1000"', + "user_agent": '""', + "remove_source_files": '"false"', + "skip_dir_strict_match": '"false"', + "application_id": '""', + "resync": '"false"', + "bypass_data_preservation": '"false"', + "azure_ad_endpoint": '""', + "azure_tenant_id": '"common"', + "sync_business_shared_folders": '"false"', + "sync_dir_permissions": '"700"', + "sync_file_permissions": '"600"', + "rate_limit": '"185700000"', + "operation_timeout": '"3600"', + "webhook_enabled": '"false"', + "webhook_public_url": '""', + "webhook_listening_host": '""', + "webhook_listening_port": '"8888"', + "webhook_expiration_interval": '"86400"', + "webhook_renewal_interval": '"43200"', + }, + }, + "bpozdena@gmail.com": { + "config_file": "/home/bob/.config/onedrive/accounts/pozdenab@gmail.com/config", + "enable_debug": "True", + "mode": "monitor", + "onedrive": { + "sync_dir": '"~/OneDrive222"', + "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe"', + "monitor_interval": '"15"', + "skip_dir": '"__pycache__|env|venv|ignore_filder"', + "log_dir": '"/var/log/onedrive/"', + "drive_id": '""', + "upload_only": '"false"', + "check_nomount": '"false"', + "check_nosync": '"false"', + "download_only": '"false"', + "disable_notifications": '"false"', + "disable_upload_validation": '"false"', + "enable_logging": '"false"', + "force_http_2": '"false"', + "local_first": '"false"', + "no_remote_delete": '"false"', + "skip_symlinks": '"false"', + "debug_https": '"false"', + "skip_dotfiles": '"false"', + "dry_run": '"false"', + "min_notify_changes": '"5"', + "monitor_log_frequency": '"5"', + "monitor_fullscan_frequency": '"1"', + "sync_root_files": '"false"', + "classify_as_big_delete": '"1000"', + "user_agent": '""', + "remove_source_files": '"false"', + "skip_dir_strict_match": '"false"', + "application_id": '""', + "resync": '"false"', + "bypass_data_preservation": '"false"', + "azure_ad_endpoint": '""', + "azure_tenant_id": '"common"', + "sync_business_shared_folders": '"false"', + "sync_dir_permissions": '"700"', + "sync_file_permissions": '"600"', + "rate_limit": '"185700000"', + "operation_timeout": '"3600"', + "webhook_enabled": '"false"', + "webhook_public_url": '""', + "webhook_listening_host": '""', + "webhook_listening_port": '"8888"', + "webhook_expiration_interval": '"86400"', + "webhook_renewal_interval": '"43200"', + }, + }, +} + + + +test = {} +test['onedrive'] = global_config['boris@pozdena.eu'] + +od_config = ConfigParser() + +print(test) + + +od_config.read_dict(test) + +print(od_config) \ No newline at end of file diff --git a/src/__thrash/file_dialog_test.py b/src/__thrash/file_dialog_test.py new file mode 100644 index 0000000..530f467 --- /dev/null +++ b/src/__thrash/file_dialog_test.py @@ -0,0 +1,50 @@ +import sys +from PySide6.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog +from PySide6.QtGui import QIcon + +class App(QWidget): + + def __init__(self): + super().__init__() + self.title = 'PyQt5 file dialogs - pythonspot.com' + self.left = 10 + self.top = 10 + self.width = 640 + self.height = 480 + self.initUI() + + def initUI(self): + self.setWindowTitle(self.title) + self.setGeometry(self.left, self.top, self.width, self.height) + + self.openFileNameDialog() + # self.openFileNamesDialog() + # self.saveFileDialog() + + self.show() + + def openFileNameDialog(self): + options = QFileDialog.Options() + options |= QFileDialog.DontUseNativeDialog + fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options) + if fileName: + print(fileName) + + # def openFileNamesDialog(self): + # options = QFileDialog.Options() + # options |= QFileDialog.DontUseNativeDialog + # files, _ = QFileDialog.getOpenFileNames(self,"QFileDialog.getOpenFileNames()", "","All Files (*);;Python Files (*.py)", options=options) + # if files: + # print(files) + + # def saveFileDialog(self): + # options = QFileDialog.Options() + # options |= QFileDialog.DontUseNativeDialog + # fileName, _ = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","All Files (*);;Text Files (*.txt)", options=options) + # if fileName: + # print(fileName) + +if __name__ == '__main__': + app = QApplication(sys.argv) + ex = App() + sys.exit(app.exec_()) diff --git a/src/__thrash/form.ui b/src/__thrash/form.ui new file mode 100644 index 0000000..b232854 --- /dev/null +++ b/src/__thrash/form.ui @@ -0,0 +1,22 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/src/__thrash/list_test.py b/src/__thrash/list_test.py new file mode 100644 index 0000000..78a7dbf --- /dev/null +++ b/src/__thrash/list_test.py @@ -0,0 +1,106 @@ +import sys +from PySide6 import QtGui, QtCore +from PySide6.QtWidgets import * + + +class LayerObject(object): + + def __init__(self, **kwargs): + self.name = kwargs.get('name', '') + self.enabled = kwargs.get('enabled', False) + + +class LayerManager(QtGui.QWidget): + def __init__(self): + super(LayerManager, self).__init__() + self.resize(400, 300) + self.list_widget = QtGui.QListWidget() + main_layout = QtGui.QHBoxLayout(self) + main_layout.addWidget(self.list_widget) + self.add_layers() + + def add_layers(self): + layers = [ + LayerObject(name='Layer001', enabled=False), + LayerObject(name='Layer002', enabled=False), + LayerObject(name='Layer003', enabled=True), + LayerObject(name='Layer004', enabled=False), + LayerObject(name='Layer005', enabled=True), + LayerObject(name='Layer006', enabled=False), + LayerObject(name='Layer007', enabled=False), + LayerObject(name='Layer008', enabled=True), + LayerObject(name='Layer009', enabled=False), + LayerObject(name='Layer010', enabled=True) + ] + + for x in layers: + widget = LayerWidget(layer=x) + item = QtGui.QListWidgetItem() + self.list_widget.insertItem(self.list_widget.count(), item) + self.list_widget.setItemWidget(item, widget) + item.setSizeHint(widget.sizeHint()) + + + # properties + @property + def layer(self): + return self._layer + + @layer.setter + def layer(self, value): + self._layer== value + self.ui_layername.setText(value.name) + self.ui_enabled.setChecked(value.enabled) + + +class LayerManager(QWidget): + def __init__(self): + super(LayerManager, self).__init__() + self.resize(400, 300) + + # controls + self.ui_scroll = QWidget() + self.ui_scroll_layout = QtGui.QVBoxLayout() + self.ui_scroll.setLayout(self.ui_scroll_layout) + + self.ui_scroll_area = QtGui.QScrollArea() + self.ui_scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) + self.ui_scroll_area.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.ui_scroll_area.setWidgetResizable(True) + self.ui_scroll_area.setWidget(self.ui_scroll) + + main_layout = QtGui.QHBoxLayout() + main_layout.addWidget(self.ui_scroll_area) + self.setLayout(main_layout) + + + self.add_layers() + + def add_layers(self): + layers = [ + LayerObject(name='Layer001', enabled=False), + LayerObject(name='Layer002', enabled=False), + LayerObject(name='Layer003', enabled=True), + LayerObject(name='Layer004', enabled=False), + LayerObject(name='Layer005', enabled=True), + LayerObject(name='Layer006', enabled=False), + LayerObject(name='Layer007', enabled=False), + LayerObject(name='Layer008', enabled=True), + LayerObject(name='Layer009', enabled=False), + LayerObject(name='Layer010', enabled=True) + ] + + for x in layers: + widget = LayerWidget(layer=x) + self.ui_scroll_layout.addWidget(widget) + + +def main(): + app = QtGui.QApplication(sys.argv) + ex = LayerManager() + ex.show() + sys.exit(app.exec_()) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/src/__thrash/mainwindow.py b/src/__thrash/mainwindow.py new file mode 100644 index 0000000..e74898b --- /dev/null +++ b/src/__thrash/mainwindow.py @@ -0,0 +1,52 @@ +# This Python file uses the following encoding: utf-8 +import os +from pathlib import Path +import sys + +from PySide6.QtWidgets import QApplication, QMainWindow, QListWidgetItem, QWidget, QLabel, QPushButton, QHBoxLayout, QLayout, QListWidget +from PySide6.QtCore import QFile +from PySide6.QtUiTools import QUiLoader + + +class MainWindow(QMainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.load_ui() + + funList = QListWidget() + + itemN = QListWidgetItem() + # Create widget + widget = QWidget() + widgetText = QLabel("I love PyQt!") + widgetButton = QPushButton("Push Me") + widgetLayout = QHBoxLayout() + widgetLayout.addWidget(widgetText) + widgetLayout.addWidget(widgetButton) + widgetLayout.addStretch() + + widgetLayout.setSizeConstraint(QLayout.SetFixedSize) + widget.setLayout(widgetLayout) + itemN.setSizeHint(widget.sizeHint()) + + # Add widget to QListWidget funList + funList.addItem(itemN) + funList.setItemWidget(itemN, widget) + + funList.show() + + + def load_ui(self): + loader = QUiLoader() + path = os.fspath(Path(__file__).resolve().parent / "form.ui") + ui_file = QFile(path) + ui_file.open(QFile.ReadOnly) + loader.load(ui_file, self) + ui_file.close() + + +if __name__ == "__main__": + app = QApplication([]) + widget = MainWindow() + widget.show() + sys.exit(app.exec_()) diff --git a/src/__thrash/message_box_test.py b/src/__thrash/message_box_test.py new file mode 100644 index 0000000..0d45f27 --- /dev/null +++ b/src/__thrash/message_box_test.py @@ -0,0 +1,39 @@ +import sys + +from PySide6.QtWidgets import QApplication, QDialog, QMainWindow, QMessageBox, QPushButton + + +class MainWindow(QMainWindow): + def __init__(self): + super().__init__() + + self.setWindowTitle("My App") + + button = QPushButton("Press me for a dialog!") + button.clicked.connect(self.button_clicked) + self.setCentralWidget(button) + + def button_clicked(self, s): + + button = QMessageBox.critical( + self, + "Oh dear!", + "Something went very wrong.", + buttons=QMessageBox.Discard | QMessageBox.NoToAll | QMessageBox.Ignore, + defaultButton=QMessageBox.Discard, + ) + + if button == QMessageBox.Discard: + print("Discard!") + elif button == QMessageBox.NoToAll: + print("No to all!") + else: + print("Ignore!") + + +app = QApplication(sys.argv) + +window = MainWindow() +window.show() + +app.exec() \ No newline at end of file diff --git a/src/__thrash/new_window_test.py b/src/__thrash/new_window_test.py new file mode 100644 index 0000000..184a086 --- /dev/null +++ b/src/__thrash/new_window_test.py @@ -0,0 +1,43 @@ +from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel, QVBoxLayout, QWidget + +import sys + +from random import randint + + +class AnotherWindow(QWidget): + """ + This "window" is a QWidget. If it has no parent, it + will appear as a free-floating window as we want. + """ + def __init__(self): + super().__init__() + layout = QVBoxLayout() + self.label = QLabel("Another Window % d" % randint(0,100)) + layout.addWidget(self.label) + self.setLayout(layout) + + +class MainWindow(QMainWindow): + + def __init__(self): + super().__init__() + self.w = None # No external window yet. + self.button = QPushButton("Push for Window") + self.button.clicked.connect(self.show_new_window) + self.setCentralWidget(self.button) + + def show_new_window(self, checked): + if self.w is None: + self.w = AnotherWindow() + self.w.show() + + else: + self.w.close() # Close window. + self.w = None # Discard reference. + + +app = QApplication(sys.argv) +w = MainWindow() +w.show() +app.exec() \ No newline at end of file diff --git a/src/__thrash/output_parser_test.py b/src/__thrash/output_parser_test.py new file mode 100644 index 0000000..2c93f53 --- /dev/null +++ b/src/__thrash/output_parser_test.py @@ -0,0 +1,136 @@ +import subprocess, os, signal, time, shlex, sys, re + + +# def run_command(command): +# process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) +# while True: +# output = process.stdout.readline() +# if output == '' and process.poll() is not None: +# break +# # if 'one' in str(output): +# # print("MATCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") +# if output: +# print(output.strip()) + +# rc = process.poll() +# return rc + +# run_command("sudo -S tcpdump -i homebr0 proto 1 <<< C@rnival1") + + + + +# app = subprocess.Popen("journalctl -f", shell=True, stdout = subprocess.PIPE, universal_newlines = True) + +# while True: +# print(app.communicate()[0]) + +# invoke process +# command = 'sudo -S tcpdump -i homebr0 "proto 1" <<< C@rnival1' +# process = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE) + +# # Poll process.stdout to show stdout live +# while True: +# output = process.stdout.readline() +# print(output) +# if process.poll() is not None: +# break +# if output: +# print(output.strip()) +# rc = process.poll() + + +###################### + + + + +# command = shlex.split("ping -c 5 asdasdasdsad.com") + +# def oneDriveMonitor(command="onedrive --monitor"): + +# process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, universal_newlines=False) + +# # while True: +# while process.poll() == None: +# stdout = process.stdout.readline() +# try: +# stderr = process.stderr.readline() +# except: +# pass +# if stdout != '': +# if '1.1.1.1' in stdout: +# print('pinging one.one.one') +# if 'time' in stdout: +# print('# ' + stdout) +# else: +# print('@@ ' + stdout.strip()) + +# if stderr != '': +# if 'command not found' in stderr: +# print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") +# elif '--resync is required' in stderr: +# print(str(stderr) + " Starting resync.") +# # oneDriveMonitor("onedrive --monitor --resync") +# else: +# print('@@ERROR' + stderr) + + + # match line: + # case "1.1.1.1" in line: + # print(line) + + +# oneDriveMonitor() + + + +# else: +# break + + + +# output, err = process.communicate() +# print(output) + + + + + + +def oneDriveMonitor(command): + # command = "onedrive --monitor -v" + process = subprocess.Popen( command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True, + universal_newlines=True) + + + while process.poll() == None: + + if process.stdout: + stdout = process.stdout.readline() + + if 'Authorize this app visiting' in stdout: + self.show_login() + if 'time' in stdout: + print('# ' + stdout) + else: + print('@@ ' + stdout.strip()) + + + if process.stderr: + stderr = process.stderr.readline() + print('!!!!ERROR ' + stderr) + + if 'command not found' in stderr: + print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") + elif '--resync is required' in stderr: + print(stderr.decode() + " Starting resync.") + oneDriveMonitor("onedrive --monitor --resync") + else: + print('@@ERROR' + stderr) + + +oneDriveMonitor("onedrive --monitor") diff --git a/src/__thrash/re_test.py b/src/__thrash/re_test.py new file mode 100644 index 0000000..da63189 --- /dev/null +++ b/src/__thrash/re_test.py @@ -0,0 +1,58 @@ +import re + +file_path = '/home/bob/OneDrive/Python/One DriveGUI_POC/OneDri veGUI.spec' + +root_folder = re.search(r".+/([^/]+)/.+$", file_path) + +print(root_folder.group(1)) + + +# stdout = '# Uploading new file Hitchhiking _italy/New Folder/ui_s)(+ěš+ěčšř čýřý*&^&*(etting@#$%^&*s_qt5_$web-test.py ... done.' +# stdout = 'Uploading new file ./config ... done.' + +# file_operation = re.search(r'\b([Uploading|Downloading]+)*', stdout) +# file_path = re.search(r'^.*[a-zA-Z]+\s[a-zA-Z]+_([a-zA-Z]+( [a-zA-Z]+)+)/)[a-zA-Z]+\s\.+$', stdout) +# file_path = re.search(r'.*\b[file](.*)/[a-zA-Z0-9.-_]+\s+\.+$', stdout) +# file_name = re.search(r".*/([a-zA-Z0-9.-_]+)\s+\.+", stdout) + +# file_name = re.search(r".*/(.+)\s+\.\.\.", stdout) + + +# transfer_complete = 'done.' in stdout +# print(transfer_complete) + + +# file_path = re.search(r"\b[file]+\s(.+)\s+\.\.\.", stdout) +# print(file_path) +# print(file_path.group(1)) + + +# print("Operation is: " + file_operation.group(1)) +# # print("Path is: " + file_path.group(1)) +# # print(file_name) +# # print("Filename is: " + file_name.group(1)) +# print(transfer_complete) + + +# progress = re.search(r'\s([0-9]+)%', stdout) +# print(progress.group(1)) + +# # transfer_complete = progress.group(1) == '100' + +# # print(progress.group(1)) +# # print(transfer_complete) + +# # print("test") +# # matches = ['Downloading1 file', 'Downloading2 file', 'Uploading new file', 'Downloading new file'] +# # test = any(x in stdout for x in matches) +# # print(test) + + +# transfer_progress = { +# "file_operation": file_operation.group(1), +# "file_name": 'Resuming last file...' if file_name is None else file_name.group(1), +# # "progress": progress, +# "transfer_complete": transfer_complete +# } + +# print(transfer_progress) \ No newline at end of file diff --git a/src/__thrash/system_tray.py b/src/__thrash/system_tray.py new file mode 100644 index 0000000..110d3b9 --- /dev/null +++ b/src/__thrash/system_tray.py @@ -0,0 +1,39 @@ +import sys +from PySide6.QtCore import * +from PySide6.QtGui import * +from PySide6.QtWidgets import * + + +class App: + def __init__(self): + # Create a Qt application + self.app = QApplication(sys.argv) + + icon = QIcon("icons8-clouds-48.png") + menu = QMenu() + settingAction = menu.addAction("setting") + settingAction.triggered.connect(self.setting) + exitAction = menu.addAction("exit") + exitAction.triggered.connect(sys.exit) + + self.tray = QSystemTrayIcon() + self.tray.setIcon(icon) + self.tray.setContextMenu(menu) + self.tray.show() + self.tray.setToolTip("unko!") + self.tray.showMessage("hoge", "moge") + self.tray.showMessage("fuga", "moge") + + def run(self): + # Enter Qt application main loop + self.app.exec_() + sys.exit() + + def setting(self): + self.dialog = QDialog() + self.dialog.setWindowTitle("Setting Dialog") + self.dialog.show() + +if __name__ == "__main__": + app = App() + app.run() \ No newline at end of file diff --git a/src/__thrash/test.py b/src/__thrash/test.py new file mode 100644 index 0000000..b356047 --- /dev/null +++ b/src/__thrash/test.py @@ -0,0 +1,13 @@ +import psutil + +def OneDriveStatus(): + for proc in psutil.process_iter(): + if proc.name().lower() == 'onedrive' and proc.status() != 'zombie': + print("OneDrive is running.") + return True + print("OneDrive is NOT running.") + return False + + + +OneDriveStatus() \ No newline at end of file diff --git a/src/__thrash/ui/settings-good-backup.ui b/src/__thrash/ui/settings-good-backup.ui new file mode 100644 index 0000000..00c0575 --- /dev/null +++ b/src/__thrash/ui/settings-good-backup.ui @@ -0,0 +1,223 @@ + + + Form + + + + 0 + 0 + 437 + 718 + + + + Form + + + + + + + + 0 + + + + Monitored Files + + + + + + + + Skip Hidden Files + + + + + + + Sync Folder: + + + + + + + + + + Browse + + + + + + + + + Skip files: + + + + + + + + + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + + + + + Skip directories: + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + + + Logging + + + + + + + + Enable Logging + + + + + + + Log location: + + + + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Page + + + + + Page + + + + + + + + + + + + Save + + + + + + + + + + diff --git a/src/__thrash/ui/settings2.ui b/src/__thrash/ui/settings2.ui new file mode 100644 index 0000000..24284c2 --- /dev/null +++ b/src/__thrash/ui/settings2.ui @@ -0,0 +1,236 @@ + + + settings_new + + + + 0 + 0 + 619 + 892 + + + + MainWindow + + + + + + + + + Save + + + + + + + + + + + 0 + + + + Monitored Files + + + + + + + + Skip Hidden Files + + + + + + + Sync Folder: + + + + + + + + + + Browse + + + + + + + + + Skip files: + + + + + + + + + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + + + + + Skip directories: + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + + + Logging + + + + + + + + Enable Logging + + + + + + + Log location: + + + + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Page + + + + + Page + + + + + + + + + + + + 0 + 0 + 619 + 19 + + + + + + + + diff --git a/src/__thrash/ui/settings_qt5_web-test.ui b/src/__thrash/ui/settings_qt5_web-test.ui new file mode 100644 index 0000000..632a9d2 --- /dev/null +++ b/src/__thrash/ui/settings_qt5_web-test.ui @@ -0,0 +1,245 @@ + + + Form + + + + 0 + 0 + 697 + 846 + + + + Form + + + + + + + + 3 + + + + Monitored Files + + + + + + + + Skip Hidden Files + + + + + + + Sync Folder: + + + + + + + + + + Browse + + + + + + + + + Skip files: + + + + + + + + + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + + + + + Skip directories: + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + + + Logging + + + + + + + + Enable Logging + + + + + + + Log location: + + + + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Page + + + + + Page + + + + + 30 + 150 + 611 + 461 + + + + + https://www.seznam.cz/ + + + + + + + + + + + + + + Save + + + + + + + + + + QWebEngineView + QWidget +
QtWebEngineWidgets/QWebEngineView
+
+
+ + +
diff --git a/src/__thrash/ui/settings_ui.py b/src/__thrash/ui/settings_ui.py new file mode 100644 index 0000000..054379b --- /dev/null +++ b/src/__thrash/ui/settings_ui.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settings.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, + QLabel, QLineEdit, QListWidget, QListWidgetItem, + QPushButton, QSizePolicy, QSpacerItem, QTabWidget, + QVBoxLayout, QWidget) + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(878, 1011) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_OneDriveGUI.py b/src/__thrash/ui/ui_OneDriveGUI.py new file mode 100644 index 0000000..988b6ee --- /dev/null +++ b/src/__thrash/ui/ui_OneDriveGUI.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'OneDriveGUIAnUifJ.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide2.QtCore import * +from PySide2.QtGui import * +from PySide2.QtWidgets import * + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + if not MainWindow.objectName(): + MainWindow.setObjectName(u"MainWindow") + MainWindow.resize(1115, 781) + self.centralwidget = QWidget(MainWindow) + self.centralwidget.setObjectName(u"centralwidget") + self.listView = QListView(self.centralwidget) + self.listView.setObjectName(u"listView") + self.listView.setGeometry(QRect(10, 70, 401, 531)) + self.pushButton = QPushButton(self.centralwidget) + self.pushButton.setObjectName(u"pushButton") + self.pushButton.setGeometry(QRect(20, 623, 101, 81)) + self.pushButton_2 = QPushButton(self.centralwidget) + self.pushButton_2.setObjectName(u"pushButton_2") + self.pushButton_2.setGeometry(QRect(150, 620, 101, 81)) + self.pushButton_3 = QPushButton(self.centralwidget) + self.pushButton_3.setObjectName(u"pushButton_3") + self.pushButton_3.setGeometry(QRect(290, 620, 101, 81)) + self.toolButton = QToolButton(self.centralwidget) + self.toolButton.setObjectName(u"toolButton") + self.toolButton.setGeometry(QRect(240, 640, 32, 33)) + self.toolButton_2 = QToolButton(self.centralwidget) + self.toolButton_2.setObjectName(u"toolButton_2") + self.toolButton_2.setGeometry(QRect(20, 20, 32, 33)) + self.label = QLabel(self.centralwidget) + self.label.setObjectName(u"label") + self.label.setGeometry(QRect(80, 20, 191, 31)) + self.frame = QFrame(self.centralwidget) + self.frame.setObjectName(u"frame") + self.frame.setGeometry(QRect(440, 10, 661, 721)) + self.frame.setFrameShape(QFrame.StyledPanel) + self.frame.setFrameShadow(QFrame.Raised) + self.tabWidget = QTabWidget(self.frame) + self.tabWidget.setObjectName(u"tabWidget") + self.tabWidget.setGeometry(QRect(20, 40, 621, 631)) + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.textEdit = QTextEdit(self.exemptions_tab) + self.textEdit.setObjectName(u"textEdit") + self.textEdit.setGeometry(QRect(40, 340, 501, 231)) + self.textEdit_2 = QTextEdit(self.exemptions_tab) + self.textEdit_2.setObjectName(u"textEdit_2") + self.textEdit_2.setGeometry(QRect(40, 50, 501, 241)) + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + self.label_4.setGeometry(QRect(40, 20, 58, 18)) + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + self.label_5.setGeometry(QRect(40, 310, 111, 18)) + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + self.checkBox.setGeometry(QRect(150, 30, 88, 22)) + self.label_2 = QLabel(self.logging_tab) + self.label_2.setObjectName(u"label_2") + self.label_2.setGeometry(QRect(30, 30, 101, 18)) + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + self.lineEdit.setGeometry(QRect(150, 60, 421, 32)) + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + self.label_3.setGeometry(QRect(30, 70, 101, 18)) + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + self.pushButton_4 = QPushButton(self.frame) + self.pushButton_4.setObjectName(u"pushButton_4") + self.pushButton_4.setGeometry(QRect(540, 680, 88, 34)) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QMenuBar(MainWindow) + self.menubar.setObjectName(u"menubar") + self.menubar.setGeometry(QRect(0, 0, 1115, 30)) + MainWindow.setMenuBar(self.menubar) + self.statusbar = QStatusBar(MainWindow) + self.statusbar.setObjectName(u"statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(MainWindow) + # setupUi + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) + self.pushButton.setText(QCoreApplication.translate("MainWindow", u"Open Folder", None)) + self.pushButton_2.setText(QCoreApplication.translate("MainWindow", u"Sync", None)) + self.pushButton_3.setText(QCoreApplication.translate("MainWindow", u"Settings", None)) + self.toolButton.setText(QCoreApplication.translate("MainWindow", u"...", None)) + self.toolButton_2.setText(QCoreApplication.translate("MainWindow", u"...", None)) + self.label.setText(QCoreApplication.translate("MainWindow", u"Status", None)) + self.label_4.setText(QCoreApplication.translate("MainWindow", u"Skip files:", None)) + self.label_5.setText(QCoreApplication.translate("MainWindow", u"Skip directories:", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("MainWindow", u"Exemptions", None)) + self.checkBox.setText("") + self.label_2.setText(QCoreApplication.translate("MainWindow", u"Enable logging:", None)) + self.label_3.setText(QCoreApplication.translate("MainWindow", u"Log location:", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("MainWindow", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("MainWindow", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("MainWindow", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("MainWindow", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings-good-backup.py b/src/__thrash/ui/ui_settings-good-backup.py new file mode 100644 index 0000000..31b648f --- /dev/null +++ b/src/__thrash/ui/ui_settings-good-backup.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settingsfQdOxi.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, + QLabel, QLineEdit, QListWidget, QListWidgetItem, + QPushButton, QSizePolicy, QSpacerItem, QTabWidget, + QVBoxLayout, QWidget) + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(437, 718) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings2.py b/src/__thrash/ui/ui_settings2.py new file mode 100644 index 0000000..a048186 --- /dev/null +++ b/src/__thrash/ui/ui_settings2.py @@ -0,0 +1,240 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settings2DclElV.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, + QLabel, QLineEdit, QListWidget, QListWidgetItem, + QMainWindow, QMenuBar, QPushButton, QSizePolicy, + QSpacerItem, QStatusBar, QTabWidget, QVBoxLayout, + QWidget) + +class Ui_settings_new(object): + def setupUi(self, settings_new): + if not settings_new.objectName(): + settings_new.setObjectName(u"settings_new") + settings_new.resize(619, 892) + self.centralwidget = QWidget(settings_new) + self.centralwidget.setObjectName(u"centralwidget") + self.verticalLayout_2 = QVBoxLayout(self.centralwidget) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(self.centralwidget) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(self.centralwidget) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + settings_new.setCentralWidget(self.centralwidget) + self.menubar = QMenuBar(settings_new) + self.menubar.setObjectName(u"menubar") + self.menubar.setGeometry(QRect(0, 0, 619, 19)) + settings_new.setMenuBar(self.menubar) + self.statusbar = QStatusBar(settings_new) + self.statusbar.setObjectName(u"statusbar") + settings_new.setStatusBar(self.statusbar) + + self.retranslateUi(settings_new) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(settings_new) + # setupUi + + def retranslateUi(self, settings_new): + settings_new.setWindowTitle(QCoreApplication.translate("settings_new", u"MainWindow", None)) + self.pushButton_4.setText(QCoreApplication.translate("settings_new", u"Save", None)) + self.checkBox_2.setText(QCoreApplication.translate("settings_new", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("settings_new", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("settings_new", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("settings_new", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("settings_new", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("settings_new", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("settings_new", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("settings_new", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("settings_new", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("settings_new", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("settings_new", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("settings_new", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("settings_new", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("settings_new", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("settings_new", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("settings_new", u"Page", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings_qt5_web-test.py b/src/__thrash/ui/ui_settings_qt5_web-test.py new file mode 100644 index 0000000..0b8a514 --- /dev/null +++ b/src/__thrash/ui/ui_settings_qt5_web-test.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settings_qt5_web-testdOxRon.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide2.QtCore import * +from PySide2.QtGui import * +from PySide2.QtWidgets import * + +from PySide2.QtWebEngineWidgets import QWebEngineView + + + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(697, 846) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.webEngineView = QWebEngineView(self.tab_4) + self.webEngineView.setObjectName(u"webEngineView") + self.webEngineView.setGeometry(QRect(30, 150, 611, 461)) + self.webEngineView.setUrl(QUrl(u"https://www.seznam.cz/")) + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(3) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings_web.py b/src/__thrash/ui/ui_settings_web.py new file mode 100644 index 0000000..8d75edd --- /dev/null +++ b/src/__thrash/ui/ui_settings_web.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settingsHGXEPD.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import * +from PySide6.QtGui import * +from PySide6.QtWidgets import * + +from PySide6.QtWebEngineWidgets import QWebEngineView + + + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(647, 732) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.webEngineView = QWebEngineView(self.tab_4) + self.webEngineView.setObjectName(u"webEngineView") + self.webEngineView.setGeometry(QRect(10, 40, 611, 501)) + self.webEngineView.setUrl(QUrl(u"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite Files.ReadWrite.all Sites.Read.All Sites.ReadWrite.All offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient")) + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(3) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui_list_item_widget.py_ b/src/__thrash/ui_list_item_widget.py_ new file mode 100644 index 0000000..e2c4779 --- /dev/null +++ b/src/__thrash/ui_list_item_widget.py_ @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'list_item_widget.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QProgressBar, + QSizePolicy, QToolButton, QWidget) + +class Ui_list_item_widget(object): + def setupUi(self, list_item_widget): + if not list_item_widget.objectName(): + list_item_widget.setObjectName(u"list_item_widget") + list_item_widget.resize(426, 79) + list_item_widget.setMinimumSize(QSize(50, 60)) + self.gridLayout = QGridLayout(list_item_widget) + self.gridLayout.setObjectName(u"gridLayout") + self.toolButton = QToolButton(list_item_widget) + self.toolButton.setObjectName(u"toolButton") + self.toolButton.setEnabled(True) + self.toolButton.setMinimumSize(QSize(40, 65)) + self.toolButton.setAutoFillBackground(False) + icon = QIcon() + icon.addFile(u"../resources/images/icons8-clouds-48.png", QSize(), QIcon.Normal, QIcon.Off) + self.toolButton.setIcon(icon) + self.toolButton.setIconSize(QSize(50, 75)) + + self.gridLayout.addWidget(self.toolButton, 0, 0, 5, 1) + + self.ls_label_file_name = QLabel(list_item_widget) + self.ls_label_file_name.setObjectName(u"ls_label_file_name") + + self.gridLayout.addWidget(self.ls_label_file_name, 0, 1, 1, 1) + + self.ls_label_task = QLabel(list_item_widget) + self.ls_label_task.setObjectName(u"ls_label_task") + + self.gridLayout.addWidget(self.ls_label_task, 2, 1, 1, 1) + + self.ls_label_dir = QLabel(list_item_widget) + self.ls_label_dir.setObjectName(u"ls_label_dir") + + self.gridLayout.addWidget(self.ls_label_dir, 4, 1, 1, 1) + + self.ls_label_status = QLabel(list_item_widget) + self.ls_label_status.setObjectName(u"ls_label_status") + + self.gridLayout.addWidget(self.ls_label_status, 2, 2, 1, 1) + + self.ls_progressBar = QProgressBar(list_item_widget) + self.ls_progressBar.setObjectName(u"ls_progressBar") + self.ls_progressBar.setMaximumSize(QSize(16777215, 5)) + self.ls_progressBar.setValue(24) + self.ls_progressBar.setTextVisible(False) + + self.gridLayout.addWidget(self.ls_progressBar, 1, 1, 1, 2) + + + self.retranslateUi(list_item_widget) + + QMetaObject.connectSlotsByName(list_item_widget) + # setupUi + + def retranslateUi(self, list_item_widget): + list_item_widget.setWindowTitle(QCoreApplication.translate("list_item_widget", u"Form", None)) + self.toolButton.setText(QCoreApplication.translate("list_item_widget", u"...", None)) + self.ls_label_file_name.setText(QCoreApplication.translate("list_item_widget", u"FileName", None)) + self.ls_label_task.setText(QCoreApplication.translate("list_item_widget", u"Downloading/Uploading ", None)) + self.ls_label_dir.setText(QCoreApplication.translate("list_item_widget", u"Uploaded to Downloads", None)) + self.ls_label_status.setText(QCoreApplication.translate("list_item_widget", u"60KB of 100KB", None)) + # retranslateUi + diff --git a/src/__thrash/version2.py b/src/__thrash/version2.py new file mode 100644 index 0000000..8472f7f --- /dev/null +++ b/src/__thrash/version2.py @@ -0,0 +1,20 @@ +import sys +from PySide6.QtWidgets import QApplication, QMainWindow +from PySide6.QtCore import QFile +from ui.ui_mainwindow import Ui_MainWindow + +class MainWindow(QMainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.ui = Ui_MainWindow() + self.ui.setupUi(self) + + self.ui.label.setText("test text") + +if __name__ == "__main__": + app = QApplication(sys.argv) + + window = MainWindow() + window.show() + + sys.exit(app.exec()) \ No newline at end of file diff --git a/src/__thrash/wizard_test.py b/src/__thrash/wizard_test.py new file mode 100644 index 0000000..67c81d2 --- /dev/null +++ b/src/__thrash/wizard_test.py @@ -0,0 +1,81 @@ +from PySide6.QtGui import QPixmap, QIcon +from PySide6.QtCore import Property, Qt +from PySide6.QtWidgets import ( + QWizard, + QGridLayout, + QLineEdit, + QWizardPage, + QLabel, + QVBoxLayout, + QComboBox, + QApplication, +) + + +class QIComboBox(QComboBox): + def __init__(self, parent=None): + super(QIComboBox, self).__init__(parent) + + +class MagicWizard(QWizard): + def __init__(self, parent=None): + super(MagicWizard, self).__init__(parent) + self.addPage(WizardPage_welcome(self)) + self.addPage(wizardPage_version_check(self)) + self.setWindowTitle("OneDriveGUI Setup Wizard") + self.resize(640, 480) + self.setWindowIcon(QIcon("resources/images/icons8-clouds-48.png")) + + +class WizardPage_welcome(QWizardPage): + def __init__(self, parent=None): + super(WizardPage_welcome, self).__init__(parent) + self.setTitle("Welcome to OneDriveGUI") + # self.setSubTitle("SubTitle") + + # self.label1 = QLabel() + # self.label1.setText("Welcome to OneDriveGUI") + + self.label_2 = QLabel() + self.label_2.setText("This wizard will help you with initial OneDrive profile creation/import.") + + layout = QVBoxLayout() + # layout.addWidget(self.label1) + layout.addWidget(self.label_2) + self.setLayout(layout) + + +class wizardPage_version_check(QWizardPage): + def __init__(self, parent=None): + super(wizardPage_version_check, self).__init__(parent) + self.setTitle("OneDrive version check") + + # self.label_3 = QLabel() + # self.label_3.setText("Installed OneDrive version:") + + self.label_4 = QLabel() + self.label_4.setText("Installed/Not Installed/ version") + + self.label_5 = QLabel() + self.label_5.setWordWrap(True) + self.label_5.setText( + "OneDrive Client for Linux does not seem to be installed. Please install it by following " \ + "instructions for your distro. " + ) + + layout = QVBoxLayout() + # layout.addWidget(self.label_3) + layout.addWidget(self.label_4) + layout.addWidget(self.label_5) + self.setLayout(layout) + + + + +if __name__ == "__main__": + import sys + + app = QApplication(sys.argv) + wizard = MagicWizard() + wizard.show() + sys.exit(app.exec_()) diff --git a/src/__thrash/wizard_test2.py b/src/__thrash/wizard_test2.py new file mode 100644 index 0000000..4d8af46 --- /dev/null +++ b/src/__thrash/wizard_test2.py @@ -0,0 +1,95 @@ +from PySide6.QtCore import QImage +from PySide6.QtGui import QImage, QPixmap +from PySide6.QtCore import Property, QImage, QPixmap, Qt +from PySide6.QtWidgets import QWizard, QGridLayout, QPixmap, QLineEdit, QWizardPage, QLabel, QVBoxLayout, QgsProjectionSelectionTreeWidget + +icon_path = '/home/nyall/nr_logo.png' + +class ProjectWizard(QWizard): + + def __init__(self, parent=None): + super().__init__(parent) + + self.addPage(Page1(self)) + self.addPage(Page2(self)) + self.setWindowTitle("New Project") + + logo_image=QImage('path_to_logo.png') + self.setPixmap(QWizard.LogoPixmap, QPixmap.fromImage(logo_image)) + + self.setOption(QWizard.NoCancelButton, True) + self.setWindowFlags(self.windowFlags() | Qt.CustomizeWindowHint) + self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) + def reject(self): + pass + +class Page1(QWizardPage): + + def __init__(self, parent=None): + super().__init__(parent) + self.setTitle('General Properties') + self.setSubTitle('Enter general properties for this project.') + + # create some widgets + self.project_number_line_edit = QLineEdit() + self.project_title_line_edit = QLineEdit() + self.author_line_edit = QLineEdit() + + # set the page layout + layout = QGridLayout() + layout.addWidget(QLabel('Project Number'),0,0) + layout.addWidget(self.project_number_line_edit,0,1) + layout.addWidget(QLabel('Title'),1,0) + layout.addWidget(self.project_title_line_edit,1,1) + layout.addWidget(QLabel('Author'),2,0) + layout.addWidget(self.author_line_edit,2,1) + self.setLayout(layout) + + self.registerField('number*',self.project_number_line_edit) + self.registerField('title*',self.project_title_line_edit) + self.registerField('author*',self.author_line_edit) + + +class Page2(QWizardPage): + + def __init__(self, parent=None): + super().__init__(parent) + self.setTitle('Project Coordinate System') + self.setSubTitle('Choosing an appropriate projection is important to ensure accurate distance and area measurements.') + + self.proj_selector = QgsProjectionSelectionTreeWidget() + layout = QVBoxLayout() + layout.addWidget(self.proj_selector) + self.setLayout(layout) + + self.registerField('crs',self.proj_selector) + self.proj_selector.crsSelected.connect(self.crs_selected) + + def crs_selected(self): + self.setField('crs',self.proj_selector.crs()) + self.completeChanged.emit() + + def isComplete(self): + return self.proj_selector.crs().isValid() + + +def runNewProjectWizard(): + d=ProjectWizard() + d.exec() + + # Set the project crs + crs=d.field('crs') + QgsProject.instance().setCrs(crs) + + # Set the project title + title=d.field('title') + QgsProject.instance().setTitle(d.field('title')) + + # Create expression variables for the author and project number + number=d.field('number') + QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_number', number) + author=d.field('author') + QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_author', author) + + +iface.newProjectCreated.connect(runNewProjectWizard) \ No newline at end of file diff --git a/OneDriveGUI/resources/default_config b/src/resources/default_config similarity index 100% rename from OneDriveGUI/resources/default_config rename to src/resources/default_config diff --git a/OneDriveGUI/resources/images/icons8-cloud-cross-40_2.png b/src/resources/images/icons8-cloud-cross-40_2.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-cloud-cross-40_2.png rename to src/resources/images/icons8-cloud-cross-40_2.png diff --git a/OneDriveGUI/resources/images/icons8-cloud-done-40_2.png b/src/resources/images/icons8-cloud-done-40_2.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-cloud-done-40_2.png rename to src/resources/images/icons8-cloud-done-40_2.png diff --git a/OneDriveGUI/resources/images/icons8-cloud-sync-40_2.png b/src/resources/images/icons8-cloud-sync-40_2.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-cloud-sync-40_2.png rename to src/resources/images/icons8-cloud-sync-40_2.png diff --git a/OneDriveGUI/resources/images/icons8-clouds-48.png b/src/resources/images/icons8-clouds-48.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-clouds-48.png rename to src/resources/images/icons8-clouds-48.png diff --git a/OneDriveGUI/resources/images/icons8-documents-folder-50.png b/src/resources/images/icons8-documents-folder-50.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-documents-folder-50.png rename to src/resources/images/icons8-documents-folder-50.png diff --git a/OneDriveGUI/resources/images/icons8-green-circle-48.png b/src/resources/images/icons8-green-circle-48.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-green-circle-48.png rename to src/resources/images/icons8-green-circle-48.png diff --git a/OneDriveGUI/resources/images/icons8-play-48.png b/src/resources/images/icons8-play-48.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-play-48.png rename to src/resources/images/icons8-play-48.png diff --git a/OneDriveGUI/resources/images/icons8-red-circle-48.png b/src/resources/images/icons8-red-circle-48.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-red-circle-48.png rename to src/resources/images/icons8-red-circle-48.png diff --git a/OneDriveGUI/resources/images/icons8-settings-50.png b/src/resources/images/icons8-settings-50.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-settings-50.png rename to src/resources/images/icons8-settings-50.png diff --git a/OneDriveGUI/resources/images/icons8-stop-50.png b/src/resources/images/icons8-stop-50.png similarity index 100% rename from OneDriveGUI/resources/images/icons8-stop-50.png rename to src/resources/images/icons8-stop-50.png diff --git a/OneDriveGUI/setup_wizard.py b/src/setup_wizard.py similarity index 100% rename from OneDriveGUI/setup_wizard.py rename to src/setup_wizard.py diff --git a/OneDriveGUI/ui/create_new_profile.ui b/src/ui/create_new_profile.ui similarity index 100% rename from OneDriveGUI/ui/create_new_profile.ui rename to src/ui/create_new_profile.ui diff --git a/OneDriveGUI/ui/import_existing_profile.ui b/src/ui/import_existing_profile.ui similarity index 100% rename from OneDriveGUI/ui/import_existing_profile.ui rename to src/ui/import_existing_profile.ui diff --git a/OneDriveGUI/ui/list_item_widget.ui b/src/ui/list_item_widget.ui similarity index 100% rename from OneDriveGUI/ui/list_item_widget.ui rename to src/ui/list_item_widget.ui diff --git a/OneDriveGUI/ui/login.ui b/src/ui/login.ui similarity index 100% rename from OneDriveGUI/ui/login.ui rename to src/ui/login.ui diff --git a/OneDriveGUI/ui/mainwindow.ui b/src/ui/mainwindow.ui similarity index 100% rename from OneDriveGUI/ui/mainwindow.ui rename to src/ui/mainwindow.ui diff --git a/OneDriveGUI/ui/mainwindow.ui.autosave b/src/ui/mainwindow.ui.autosave similarity index 100% rename from OneDriveGUI/ui/mainwindow.ui.autosave rename to src/ui/mainwindow.ui.autosave diff --git a/OneDriveGUI/ui/process_status_page.ui b/src/ui/process_status_page.ui similarity index 100% rename from OneDriveGUI/ui/process_status_page.ui rename to src/ui/process_status_page.ui diff --git a/OneDriveGUI/ui/profile_settings_page.ui b/src/ui/profile_settings_page.ui similarity index 100% rename from OneDriveGUI/ui/profile_settings_page.ui rename to src/ui/profile_settings_page.ui diff --git a/OneDriveGUI/ui/settings.ui b/src/ui/settings.ui similarity index 100% rename from OneDriveGUI/ui/settings.ui rename to src/ui/settings.ui diff --git a/OneDriveGUI/ui/setup_wizard.ui b/src/ui/setup_wizard.ui similarity index 100% rename from OneDriveGUI/ui/setup_wizard.ui rename to src/ui/setup_wizard.ui diff --git a/OneDriveGUI/ui/test.ui b/src/ui/test.ui similarity index 100% rename from OneDriveGUI/ui/test.ui rename to src/ui/test.ui diff --git a/OneDriveGUI/ui/ui_create_new_profile.py b/src/ui/ui_create_new_profile.py similarity index 100% rename from OneDriveGUI/ui/ui_create_new_profile.py rename to src/ui/ui_create_new_profile.py diff --git a/OneDriveGUI/ui/ui_import_existing_profile.py b/src/ui/ui_import_existing_profile.py similarity index 100% rename from OneDriveGUI/ui/ui_import_existing_profile.py rename to src/ui/ui_import_existing_profile.py diff --git a/OneDriveGUI/ui/ui_list_item_widget.py b/src/ui/ui_list_item_widget.py similarity index 100% rename from OneDriveGUI/ui/ui_list_item_widget.py rename to src/ui/ui_list_item_widget.py diff --git a/OneDriveGUI/ui/ui_login.py b/src/ui/ui_login.py similarity index 100% rename from OneDriveGUI/ui/ui_login.py rename to src/ui/ui_login.py diff --git a/OneDriveGUI/ui/ui_mainwindow.py b/src/ui/ui_mainwindow.py similarity index 100% rename from OneDriveGUI/ui/ui_mainwindow.py rename to src/ui/ui_mainwindow.py diff --git a/OneDriveGUI/ui/ui_process_status_page.py b/src/ui/ui_process_status_page.py similarity index 100% rename from OneDriveGUI/ui/ui_process_status_page.py rename to src/ui/ui_process_status_page.py diff --git a/OneDriveGUI/ui/ui_profile_settings_page.py b/src/ui/ui_profile_settings_page.py similarity index 100% rename from OneDriveGUI/ui/ui_profile_settings_page.py rename to src/ui/ui_profile_settings_page.py diff --git a/OneDriveGUI/ui/ui_settings.py b/src/ui/ui_settings.py similarity index 100% rename from OneDriveGUI/ui/ui_settings.py rename to src/ui/ui_settings.py diff --git a/OneDriveGUI/ui/ui_setup_wizard.py b/src/ui/ui_setup_wizard.py similarity index 100% rename from OneDriveGUI/ui/ui_setup_wizard.py rename to src/ui/ui_setup_wizard.py diff --git a/OneDriveGUI/ui/ui_wizardPage_welcome.py b/src/ui/ui_wizardPage_welcome.py similarity index 100% rename from OneDriveGUI/ui/ui_wizardPage_welcome.py rename to src/ui/ui_wizardPage_welcome.py diff --git a/OneDriveGUI/ui/wizardPage_welcome.ui b/src/ui/wizardPage_welcome.ui similarity index 100% rename from OneDriveGUI/ui/wizardPage_welcome.ui rename to src/ui/wizardPage_welcome.ui From bb3dfe45fb803654bb999a1c7cfeaa788fd6b59d Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Sun, 6 Feb 2022 16:54:56 +0100 Subject: [PATCH 02/12] Added docs with simple insall steps --- docs/INSTALL.md | 20 +++++++++++++++++++ requirements.txt | 3 +-- src/{ => __thrash}/setup_wizard.py | 0 src/{ui => __thrash}/ui_setup_wizard.py | 0 src/{ui => __thrash}/ui_wizardPage_welcome.py | 0 src/{ui => __thrash}/wizardPage_welcome.ui | 0 6 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 docs/INSTALL.md rename src/{ => __thrash}/setup_wizard.py (100%) rename src/{ui => __thrash}/ui_setup_wizard.py (100%) rename src/{ui => __thrash}/ui_wizardPage_welcome.py (100%) rename src/{ui => __thrash}/wizardPage_welcome.ui (100%) diff --git a/docs/INSTALL.md b/docs/INSTALL.md new file mode 100644 index 0000000..96137b2 --- /dev/null +++ b/docs/INSTALL.md @@ -0,0 +1,20 @@ + # Installation steps + +1) Ensure [OneDrive for Linux](https://abraunegg.github.io/) is instelled based on [instructions](https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md) for your distro. +1) Ensure Python3 and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your system. +1) Clone or download content this repository. +1) (Optional) Create and activate a Python virtual environment: +```sh +python3 -m venv venv +source venv/bin/activate +``` +1) Install dependencies: +```sh +python3 -m pip install -r requirements.txt +``` +1) Start OneDrive GUI: +```sh +cd OneDriveGUI/ +python3 OneDriveGUI.py +``` + diff --git a/requirements.txt b/requirements.txt index 4fce7fe..7fa34f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -psutil==5.9.0 -PySide6==6.2.2.1 +PySide6 diff --git a/src/setup_wizard.py b/src/__thrash/setup_wizard.py similarity index 100% rename from src/setup_wizard.py rename to src/__thrash/setup_wizard.py diff --git a/src/ui/ui_setup_wizard.py b/src/__thrash/ui_setup_wizard.py similarity index 100% rename from src/ui/ui_setup_wizard.py rename to src/__thrash/ui_setup_wizard.py diff --git a/src/ui/ui_wizardPage_welcome.py b/src/__thrash/ui_wizardPage_welcome.py similarity index 100% rename from src/ui/ui_wizardPage_welcome.py rename to src/__thrash/ui_wizardPage_welcome.py diff --git a/src/ui/wizardPage_welcome.ui b/src/__thrash/wizardPage_welcome.ui similarity index 100% rename from src/ui/wizardPage_welcome.ui rename to src/__thrash/wizardPage_welcome.ui From c6ab3fb929c8ba145376e3ece82e5cf000de988e Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Sun, 6 Feb 2022 16:55:59 +0100 Subject: [PATCH 03/12] update pip requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7fa34f0..8bd6ba7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -PySide6 +PySide6==6.2.2.1 From ee331846c2c8851dab83c2c205d3243b75a3ea5e Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Sun, 6 Feb 2022 16:58:15 +0100 Subject: [PATCH 04/12] update install steps --- docs/INSTALL.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 96137b2..fe2ecb9 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -1,20 +1,20 @@ - # Installation steps +# Installation steps 1) Ensure [OneDrive for Linux](https://abraunegg.github.io/) is instelled based on [instructions](https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md) for your distro. 1) Ensure Python3 and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your system. 1) Clone or download content this repository. 1) (Optional) Create and activate a Python virtual environment: -```sh -python3 -m venv venv -source venv/bin/activate -``` + ```sh + python3 -m venv venv + source venv/bin/activate + ``` 1) Install dependencies: -```sh -python3 -m pip install -r requirements.txt -``` -1) Start OneDrive GUI: -```sh -cd OneDriveGUI/ -python3 OneDriveGUI.py -``` + ```sh + python3 -m pip install -r requirements.txt + ``` +1) Start OneDrive GUI: + ```sh + cd OneDriveGUI/ + python3 OneDriveGUI.py + ``` From d9b2bc79c08be40815cbb2911750c1609485d1e0 Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Mon, 7 Feb 2022 17:12:51 +0100 Subject: [PATCH 05/12] -implemented 'Browse' button functionality -several small GUI adjustments --- .gitignore | 2 +- docs/INSTALL.md | 4 +- src/OneDriveGUI.py | 61 ++++++++++++++++++++++++++---- src/ui/login.ui | 4 +- src/ui/mainwindow.ui | 14 ++++++- src/ui/process_status_page.ui | 4 +- src/ui/profile_settings_page.ui | 6 +-- src/ui/settings.ui | 7 ++++ src/ui/ui_login.py | 4 +- src/ui/ui_mainwindow.py | 4 +- src/ui/ui_process_status_page.py | 12 +++--- src/ui/ui_profile_settings_page.py | 18 ++++----- src/ui/ui_settings.py | 6 +++ 13 files changed, 109 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 566a8d0..bfcf15b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ venv/ .qt_for_python/ -OneDriveGUI/__thrash/ +scr/__thrash/ __pycache__/ diff --git a/docs/INSTALL.md b/docs/INSTALL.md index fe2ecb9..ae32059 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -1,6 +1,6 @@ # Installation steps -1) Ensure [OneDrive for Linux](https://abraunegg.github.io/) is instelled based on [instructions](https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md) for your distro. +1) Ensure [OneDrive for Linux](https://abraunegg.github.io/) is installed based on [instructions](https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md) for your distro. 1) Ensure Python3 and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your system. 1) Clone or download content this repository. 1) (Optional) Create and activate a Python virtual environment: @@ -15,6 +15,6 @@ 1) Start OneDrive GUI: ```sh - cd OneDriveGUI/ + cd src/ python3 OneDriveGUI.py ``` diff --git a/src/OneDriveGUI.py b/src/OneDriveGUI.py index 5702f86..43b3f2d 100644 --- a/src/OneDriveGUI.py +++ b/src/OneDriveGUI.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +from optparse import Option import os import re import subprocess @@ -7,7 +8,7 @@ import sys from configparser import ConfigParser from PySide6.QtCore import QThread, QTimer, QUrl, Signal, QFileInfo, Qt, QDir -from PySide6.QtGui import QIcon, QPixmap +from PySide6.QtGui import QIcon, QPixmap, QDesktopServices from PySide6.QtWidgets import ( QWidget, QApplication, @@ -248,12 +249,9 @@ class wizardPage_create(QWizardPage): return False def get_dir_name(self): - self.file_dialog = QFileDialog.getExistingDirectory( - dir=os.path.expanduser("~/") - ) # getOpenFileName(self, dir=os.path.expanduser("~/.config/")) + self.file_dialog = QFileDialog.getExistingDirectory(dir=os.path.expanduser("~/")) dir_name = self.file_dialog - print(dir_name) self.lineEdit_sync_dir.setText(dir_name) @@ -468,14 +466,27 @@ class SettingsWindow(QWidget, Ui_settings_window): self.horizontalLayout.addLayout(self.stackedLayout) self.listWidget_profiles.itemSelectionChanged.connect(self.switch_account_settings_page) + self.pushButton_open_create.clicked.connect(self.create_new_profile_window) + self.pushButton_open_create.hide() self.pushButton_open_import.clicked.connect(self.import_profile_window) + self.pushButton_open_import.hide() + self.pushButton_remove.clicked.connect(self.remove_profile) + self.pushButton_create_import.clicked.connect(self.show_setup_wizard) self.show() + def closeEvent(self, event): + event.ignore() + self.hide() + def switch_account_settings_page(self): self.stackedLayout.setCurrentIndex(self.listWidget_profiles.currentRow()) + def show_setup_wizard(self): + self.setup_wizard = SetupWizard() + self.setup_wizard.show() + def create_new_profile_window(self): # Show profile creation window self.create_window = QWidget() @@ -646,11 +657,20 @@ class ProfileStatusPage(QWidget, Ui_status_page): self.toolButton_start.clicked.connect(self.start_monitor) self.toolButton_stop.clicked.connect(self.stop_monitor) + # Open Sync Dir + self.pushButton_open_dir.clicked.connect(self.open_sync_dir) + # Open Settings window self.pushButton_settings.clicked.connect(lambda: settings_window.show()) self.pushButton_2.setText("Wizard") self.pushButton_2.clicked.connect(self.show_setup_wizard) + self.pushButton_2.hide() + + def open_sync_dir(self): + sync_dir = global_config[self.profile_name]["onedrive"]["sync_dir"].strip('"') + url = QUrl(os.path.expanduser(sync_dir)) + QDesktopServices.openUrl(url) def show_setup_wizard(self): self.setup_wizard = SetupWizard() @@ -696,6 +716,8 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): self.checkBox_sync_root_files.setChecked(self.get_check_box_state("sync_root_files")) self.checkBox_sync_root_files.stateChanged.connect(self.set_check_box_state) + self.pushButton_sync_dir_browse.clicked.connect(self.get_sync_dir_name) + # # Excluded files tab # @@ -798,7 +820,7 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): self.lineEdit_azure_tenant_id.setText(self.temp_profile_config["azure_tenant_id"].strip('"')) self.lineEdit_azure_tenant_id.textChanged.connect(self.set_line_edit_value) - # Rate limit tab + # Rate limit self.spinBox_rate_limit.setValue(int(self.temp_profile_config["rate_limit"].strip('"'))) self.horizontalSlider_rate_limit.setValue(int(self.temp_profile_config["rate_limit"].strip('"'))) self.label_rate_limit_mbps.setText( @@ -846,6 +868,8 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): self.lineEdit_log_dir.setText(self.temp_profile_config["log_dir"].strip('"')) self.lineEdit_log_dir.textChanged.connect(self.set_log_dir) + self.pushButton_log_dir_browse.clicked.connect(self.get_log_dir_name) + self.checkBox_enable_logging.setChecked(self.get_check_box_state("enable_logging")) self.checkBox_enable_logging.stateChanged.connect(self.set_check_box_state) @@ -879,9 +903,24 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): # self.pushButton_discart.clicked.connect(self.discart_changes) self.pushButton_save.clicked.connect(self.save_profile_settings) + def str2bool(self, value): return value.lower() in "true" + def get_sync_dir_name(self): + self.file_dialog = QFileDialog.getExistingDirectory(dir=os.path.expanduser("~/")) + + sync_dir = self.file_dialog + print(sync_dir) + self.lineEdit_sync_dir.setText(sync_dir) + + def get_log_dir_name(self): + self.file_dialog = QFileDialog.getExistingDirectory(dir=os.path.expanduser("~/")) + + log_dir = self.file_dialog + print(log_dir) + self.lineEdit_log_dir.setText(log_dir) + def set_line_edit_value(self, value): _property = self.sender().objectName() property = re.search(r"lineEdit_(.+)", _property).group(1) @@ -1259,14 +1298,15 @@ class MainWindow(QMainWindow, Ui_MainWindow): actionshow = menu.addAction("Show/Hide") actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) setting_action = menu.addAction("Settings") - # setting_action.triggered.connect(self.show_settings) + setting_action.triggered.connect(self.show_settings_window) quit_action = menu.addAction("Quit") quit_action.triggered.connect(sys.exit) + self.tray.activated.connect(lambda: self.hide() if self.isVisible() else self.show()) self.tray.setIcon(icon) self.tray.setContextMenu(menu) self.tray.show() - self.tray.setToolTip("This is OneDriveGUI") + self.tray.setToolTip("OneDriveGUI") else: self.tray = None @@ -1276,6 +1316,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.refresh_process_status.timeout.connect(lambda: self.onedrive_process_status()) self.refresh_process_status.start(500) + def closeEvent(self, event): + event.ignore() + self.hide() + def show_setup_wizard(self): self.setup_wizard = SetupWizard() self.setup_wizard.show() @@ -1440,6 +1484,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.lw = Ui_LoginWindow() self.lw.setupUi(self.window1) self.window1.show() + self.window1.setWindowTitle(f"OneDrive login for profile {profile}") self.config_file = global_config[profile]["config_file"].strip('"') self.config_dir = re.search(r"(.+)/.+$", self.config_file).group(1) diff --git a/src/ui/login.ui b/src/ui/login.ui index c4291dd..fbe4f7e 100644 --- a/src/ui/login.ui +++ b/src/ui/login.ui @@ -29,7 +29,7 @@ - Form + OneDrive Login @@ -51,7 +51,7 @@ - https://www.seznam.cz/ + about:blank diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index 78efc7d..b9e93f6 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -7,9 +7,21 @@ 0 0 420 - 807 + 800 + + + 420 + 0 + + + + + 420 + 16777215 + + OneDriveGUI diff --git a/src/ui/process_status_page.ui b/src/ui/process_status_page.ui index e64aa71..f41f4e9 100644 --- a/src/ui/process_status_page.ui +++ b/src/ui/process_status_page.ui @@ -154,7 +154,7 @@ - + 0 @@ -162,7 +162,7 @@ - Open Folder + Open Sync Directory diff --git a/src/ui/profile_settings_page.ui b/src/ui/profile_settings_page.ui index 4982af6..41f469f 100644 --- a/src/ui/profile_settings_page.ui +++ b/src/ui/profile_settings_page.ui @@ -48,7 +48,7 @@ - 5 + 3 @@ -64,7 +64,7 @@ - + Browse @@ -608,7 +608,7 @@ - + Browse diff --git a/src/ui/settings.ui b/src/ui/settings.ui index e0c8442..a5c3dd0 100644 --- a/src/ui/settings.ui +++ b/src/ui/settings.ui @@ -51,6 +51,13 @@ + + + + Create/Import wizard + + + diff --git a/src/ui/ui_login.py b/src/ui/ui_login.py index a8b5ebe..04063e6 100644 --- a/src/ui/ui_login.py +++ b/src/ui/ui_login.py @@ -36,7 +36,7 @@ class Ui_LoginWindow(object): self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.loginFrame = QWebEngineView(LoginWindow) self.loginFrame.setObjectName(u"loginFrame") - self.loginFrame.setUrl(QUrl(u"http://www.seznam.cz")) + self.loginFrame.setUrl(QUrl(u"about:blank")) self.horizontalLayout.addWidget(self.loginFrame) @@ -47,6 +47,6 @@ class Ui_LoginWindow(object): # setupUi def retranslateUi(self, LoginWindow): - LoginWindow.setWindowTitle(QCoreApplication.translate("LoginWindow", u"Form", None)) + LoginWindow.setWindowTitle(QCoreApplication.translate("LoginWindow", u"OneDrive Login", None)) # retranslateUi diff --git a/src/ui/ui_mainwindow.py b/src/ui/ui_mainwindow.py index d576d90..d9f13d6 100644 --- a/src/ui/ui_mainwindow.py +++ b/src/ui/ui_mainwindow.py @@ -24,7 +24,9 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") - MainWindow.resize(420, 807) + MainWindow.resize(420, 800) + MainWindow.setMinimumSize(QSize(420, 0)) + MainWindow.setMaximumSize(QSize(420, 16777215)) icon = QIcon() icon.addFile(u"../../../OneDriveGUI_POC_recovered-multi/icons8-clouds-48.png", QSize(), QIcon.Normal, QIcon.Off) MainWindow.setWindowIcon(icon) diff --git a/src/ui/ui_process_status_page.py b/src/ui/ui_process_status_page.py index a14cc1d..bcb1f11 100644 --- a/src/ui/ui_process_status_page.py +++ b/src/ui/ui_process_status_page.py @@ -94,15 +94,15 @@ class Ui_status_page(object): self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton = QPushButton(status_page) - self.pushButton.setObjectName(u"pushButton") + self.pushButton_open_dir = QPushButton(status_page) + self.pushButton_open_dir.setObjectName(u"pushButton_open_dir") sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) - self.pushButton.setSizePolicy(sizePolicy) + sizePolicy.setHeightForWidth(self.pushButton_open_dir.sizePolicy().hasHeightForWidth()) + self.pushButton_open_dir.setSizePolicy(sizePolicy) - self.horizontalLayout.addWidget(self.pushButton) + self.horizontalLayout.addWidget(self.pushButton_open_dir) self.pushButton_2 = QPushButton(status_page) self.pushButton_2.setObjectName(u"pushButton_2") @@ -135,7 +135,7 @@ class Ui_status_page(object): self.toolButton_stop.setText(QCoreApplication.translate("status_page", u"Stop", None)) self.label_account_type.setText("") self.label_free_space.setText("") - self.pushButton.setText(QCoreApplication.translate("status_page", u"Open Folder", None)) + self.pushButton_open_dir.setText(QCoreApplication.translate("status_page", u"Open Sync Directory", None)) self.pushButton_2.setText(QCoreApplication.translate("status_page", u"Sync", None)) self.pushButton_settings.setText(QCoreApplication.translate("status_page", u"Settings", None)) # retranslateUi diff --git a/src/ui/ui_profile_settings_page.py b/src/ui/ui_profile_settings_page.py index c16196d..0c8cd6a 100644 --- a/src/ui/ui_profile_settings_page.py +++ b/src/ui/ui_profile_settings_page.py @@ -54,10 +54,10 @@ class Ui_profile_settings(object): self.gridLayout_9.setObjectName(u"gridLayout_9") self.gridLayout_5 = QGridLayout() self.gridLayout_5.setObjectName(u"gridLayout_5") - self.pushButton_3 = QPushButton(self.groupBox_8) - self.pushButton_3.setObjectName(u"pushButton_3") + self.pushButton_sync_dir_browse = QPushButton(self.groupBox_8) + self.pushButton_sync_dir_browse.setObjectName(u"pushButton_sync_dir_browse") - self.gridLayout_5.addWidget(self.pushButton_3, 0, 2, 1, 1) + self.gridLayout_5.addWidget(self.pushButton_sync_dir_browse, 0, 2, 1, 1) self.label_sync_dir = QLabel(self.groupBox_8) self.label_sync_dir.setObjectName(u"label_sync_dir") @@ -453,10 +453,10 @@ class Ui_profile_settings(object): self.gridLayout_8.addWidget(self.lineEdit_log_dir, 1, 1, 1, 1) - self.pushButton_log_dir = QPushButton(self.groupBox_7) - self.pushButton_log_dir.setObjectName(u"pushButton_log_dir") + self.pushButton_log_dir_browse = QPushButton(self.groupBox_7) + self.pushButton_log_dir_browse.setObjectName(u"pushButton_log_dir_browse") - self.gridLayout_8.addWidget(self.pushButton_log_dir, 1, 2, 1, 1) + self.gridLayout_8.addWidget(self.pushButton_log_dir_browse, 1, 2, 1, 1) self.label_monitor_log_frequency = QLabel(self.groupBox_7) self.label_monitor_log_frequency.setObjectName(u"label_monitor_log_frequency") @@ -610,7 +610,7 @@ class Ui_profile_settings(object): self.retranslateUi(profile_settings) - self.tabWidget.setCurrentIndex(5) + self.tabWidget.setCurrentIndex(3) QMetaObject.connectSlotsByName(profile_settings) @@ -620,7 +620,7 @@ class Ui_profile_settings(object): profile_settings.setWindowTitle(QCoreApplication.translate("profile_settings", u"OneDriveGUI - Profile Settings", None)) self.label_profile_name.setText(QCoreApplication.translate("profile_settings", u"Profile name", None)) self.groupBox_8.setTitle(QCoreApplication.translate("profile_settings", u"Monitored directory", None)) - self.pushButton_3.setText(QCoreApplication.translate("profile_settings", u"Browse", None)) + self.pushButton_sync_dir_browse.setText(QCoreApplication.translate("profile_settings", u"Browse", None)) self.label_sync_dir.setText(QCoreApplication.translate("profile_settings", u"Sync Folder:", None)) self.checkBox_sync_root_files.setText(QCoreApplication.translate("profile_settings", u"Sync root files", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab_2), QCoreApplication.translate("profile_settings", u"Monitored Files", None)) @@ -667,7 +667,7 @@ class Ui_profile_settings(object): self.checkBox_enable_logging.setText(QCoreApplication.translate("profile_settings", u"Enable Logging", None)) self.label_log_dir.setText(QCoreApplication.translate("profile_settings", u"Log location:", None)) self.checkBox_debug_https.setText(QCoreApplication.translate("profile_settings", u"Debug HTTPS", None)) - self.pushButton_log_dir.setText(QCoreApplication.translate("profile_settings", u"Browse", None)) + self.pushButton_log_dir_browse.setText(QCoreApplication.translate("profile_settings", u"Browse", None)) self.label_monitor_log_frequency.setText(QCoreApplication.translate("profile_settings", u"Monitor log frequency", None)) self.groupBox_6.setTitle(QCoreApplication.translate("profile_settings", u"Notifications", None)) self.label_min_notify_changes.setText(QCoreApplication.translate("profile_settings", u"Minimum notify changes", None)) diff --git a/src/ui/ui_settings.py b/src/ui/ui_settings.py index eb6a1d5..388d251 100644 --- a/src/ui/ui_settings.py +++ b/src/ui/ui_settings.py @@ -48,6 +48,11 @@ class Ui_settings_window(object): self.verticalLayout.addWidget(self.pushButton_remove) + self.pushButton_create_import = QPushButton(settings_window) + self.pushButton_create_import.setObjectName(u"pushButton_create_import") + + self.verticalLayout.addWidget(self.pushButton_create_import) + self.pushButton_open_create = QPushButton(settings_window) self.pushButton_open_create.setObjectName(u"pushButton_open_create") @@ -74,6 +79,7 @@ class Ui_settings_window(object): settings_window.setWindowTitle(QCoreApplication.translate("settings_window", u"OneDriveGUI - Settings", None)) self.label_profiles.setText(QCoreApplication.translate("settings_window", u"Profiles:", None)) self.pushButton_remove.setText(QCoreApplication.translate("settings_window", u"Remove profile", None)) + self.pushButton_create_import.setText(QCoreApplication.translate("settings_window", u"Create/Import wizard", None)) self.pushButton_open_create.setText(QCoreApplication.translate("settings_window", u"Create new profile", None)) self.pushButton_open_import.setText(QCoreApplication.translate("settings_window", u"Import existing profile", None)) # retranslateUi From f3347b943751dbd6d7a4adfa1174b1d2ebca0052 Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Mon, 7 Feb 2022 17:25:36 +0100 Subject: [PATCH 06/12] Changed text color in SetupWizard --- src/OneDriveGUI.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/OneDriveGUI.py b/src/OneDriveGUI.py index 43b3f2d..a36e134 100644 --- a/src/OneDriveGUI.py +++ b/src/OneDriveGUI.py @@ -128,9 +128,11 @@ class wizardPage_version_check(QWizardPage): self.label_4 = QLabel() self.label_4.setText("Installed/Not Installed/ version") + self.label_5 = QLabel() self.label_5.setWordWrap(True) + self.label_5.setStyleSheet("color: red;") self.label_5.setText( "OneDrive Client for Linux does not seem to be installed. Please install it by following " "instructions for your distro. " @@ -149,10 +151,13 @@ class wizardPage_version_check(QWizardPage): self.od_version = re.search(r".\s(v[0-9.]+)", str(od_version_check)).group(1) print(f"OneDrive {self.od_version} detected.") self.label_4.setText(f"OneDrive {self.od_version} detected.") + self.label_4.setStyleSheet("color: green;") self.label_5.hide() + return True else: self.label_4.setText("OneDrive not detected.") + self.label_4.setStyleSheet("color: red;") return False From 0c3ac47a6e17d37555b3a1695978bc0c43079783 Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Mon, 7 Feb 2022 17:36:55 +0100 Subject: [PATCH 07/12] rm __trash dir --- src/__thrash/OneDriveGUI-backup.py | 307 -------------------- src/__thrash/OneDriveGUI-bob-Manja.py | 262 ----------------- src/__thrash/config | 47 --- src/__thrash/dict_parser_test.py | 120 -------- src/__thrash/file_dialog_test.py | 50 ---- src/__thrash/form.ui | 22 -- src/__thrash/list_test.py | 106 ------- src/__thrash/mainwindow.py | 52 ---- src/__thrash/message_box_test.py | 39 --- src/__thrash/new_window_test.py | 43 --- src/__thrash/output_parser_test.py | 136 --------- src/__thrash/re_test.py | 58 ---- src/__thrash/setup_wizard.py | 232 --------------- src/__thrash/system_tray.py | 39 --- src/__thrash/test.py | 13 - src/__thrash/ui/settings-good-backup.ui | 223 -------------- src/__thrash/ui/settings2.ui | 236 --------------- src/__thrash/ui/settings_qt5_web-test.ui | 245 ---------------- src/__thrash/ui/settings_ui.py | 229 --------------- src/__thrash/ui/ui_OneDriveGUI.py | 127 -------- src/__thrash/ui/ui_settings-good-backup.py | 229 --------------- src/__thrash/ui/ui_settings2.py | 240 --------------- src/__thrash/ui/ui_settings_qt5_web-test.py | 229 --------------- src/__thrash/ui/ui_settings_web.py | 229 --------------- src/__thrash/ui_list_item_widget.py_ | 83 ------ src/__thrash/ui_setup_wizard.py | 150 ---------- src/__thrash/ui_wizardPage_welcome.py | 43 --- src/__thrash/version2.py | 20 -- src/__thrash/wizardPage_welcome.ui | 45 --- src/__thrash/wizard_test.py | 81 ------ src/__thrash/wizard_test2.py | 95 ------ 31 files changed, 4030 deletions(-) delete mode 100644 src/__thrash/OneDriveGUI-backup.py delete mode 100644 src/__thrash/OneDriveGUI-bob-Manja.py delete mode 100644 src/__thrash/config delete mode 100644 src/__thrash/dict_parser_test.py delete mode 100644 src/__thrash/file_dialog_test.py delete mode 100644 src/__thrash/form.ui delete mode 100644 src/__thrash/list_test.py delete mode 100644 src/__thrash/mainwindow.py delete mode 100644 src/__thrash/message_box_test.py delete mode 100644 src/__thrash/new_window_test.py delete mode 100644 src/__thrash/output_parser_test.py delete mode 100644 src/__thrash/re_test.py delete mode 100644 src/__thrash/setup_wizard.py delete mode 100644 src/__thrash/system_tray.py delete mode 100644 src/__thrash/test.py delete mode 100644 src/__thrash/ui/settings-good-backup.ui delete mode 100644 src/__thrash/ui/settings2.ui delete mode 100644 src/__thrash/ui/settings_qt5_web-test.ui delete mode 100644 src/__thrash/ui/settings_ui.py delete mode 100644 src/__thrash/ui/ui_OneDriveGUI.py delete mode 100644 src/__thrash/ui/ui_settings-good-backup.py delete mode 100644 src/__thrash/ui/ui_settings2.py delete mode 100644 src/__thrash/ui/ui_settings_qt5_web-test.py delete mode 100644 src/__thrash/ui/ui_settings_web.py delete mode 100644 src/__thrash/ui_list_item_widget.py_ delete mode 100644 src/__thrash/ui_setup_wizard.py delete mode 100644 src/__thrash/ui_wizardPage_welcome.py delete mode 100644 src/__thrash/version2.py delete mode 100644 src/__thrash/wizardPage_welcome.ui delete mode 100644 src/__thrash/wizard_test.py delete mode 100644 src/__thrash/wizard_test2.py diff --git a/src/__thrash/OneDriveGUI-backup.py b/src/__thrash/OneDriveGUI-backup.py deleted file mode 100644 index a882da4..0000000 --- a/src/__thrash/OneDriveGUI-backup.py +++ /dev/null @@ -1,307 +0,0 @@ -import sys, psutil, os, subprocess, signal -from configparser import ConfigParser - -from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) -from PySide6.QtGui import QIcon -from PySide6.QtCore import QTimer, QUrl - -from ui.ui_mainwindow import Ui_MainWindow -from ui.ui_settings import Ui_Form -from ui.ui_login import Ui_LoginWindow - -CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') - -class MainWindow(QMainWindow, Ui_MainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.setupUi(self) - - # Open Settings window - self.pushButton_3.clicked.connect(lambda: self.show_settings()) - - # Update OneDrive Status - self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) - - # Start OneDrive service - self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) - - # Stop OneDrive service - self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) - - # Restart OneDrive service - self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) - - # Start OneDrive monitoring - self.pushButton_5.clicked.connect(lambda: self.oneDriveMonitor('onedrive --monitor')) - - # Stop OneDrive monitoring - self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - - # Force OneDrive resync - # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - # - - # Open login form TODO: testing - self.pushButton_2.setText("login") - self.pushButton_2.clicked.connect(lambda: self.show_login()) - - - # Refresh Sync Status - self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) - self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) - - self.text_timer = QTimer() - self.text_timer.setSingleShot(False) - self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) - self.text_timer.start(1000) - - - - # System Tray - - self.tray = QSystemTrayIcon() - if self.tray.isSystemTrayAvailable(): - - icon = QIcon("icons8-clouds-48.png") - menu = QMenu() - - actionshow = menu.addAction("Show/Hide") - actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) - settingAction = menu.addAction("Settings") - settingAction.triggered.connect(self.show_settings) - quitAction = menu.addAction("Quit") - quitAction.triggered.connect(sys.exit) - - self.tray.setIcon(icon) - self.tray.setContextMenu(menu) - self.tray.show() - self.tray.setToolTip("This is OneDriveGUI") - # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") - else: - self.tray = None - - # Check OneDrive status - def oneDriveProcessStatus(self): - for onedrive_process in psutil.process_iter(): - if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': - # print("OneDrive is running.") - self.label_3.setText("running") - return True - # print("OneDrive is NOT running.") - self.label_3.setText("not running") - return False - - def oneDriveSyncStatus(self): - - status = subprocess.check_output(['onedrive', '--display-sync-status']) - if 'in sync' in str(status): - self.label_4.setText("In Sync") - return True - else: - self.label_4.setText("Out of Sync") - return False - - # def oneDriveMonitor(self, state): - # if state == 'start': - # self.onedrive_process = subprocess.Popen('onedrive --monitor -v', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) - # while True: - # onedrive_output = self.onedrive_process.communicate() - # print(onedrive_output) - # elif state == 'stop': - # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) - - - - # # def status_checker(): - # # timer = QTimer() - # # timer.setSingleShot(True) - # # timer.timeout.connect(status_checker) - # # timer.start(1000) - - # # status_checker() - - async def oneDriveMonitor(self, command): - self.onedrive_process = subprocess.Popen(command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=True, - universal_newlines=True) - - - while self.onedrive_process.poll() == None: - - if self.onedrive_process.stdout: - stdout = self.onedrive_process.stdout.readline() - - if 'Authorize this app visiting' in stdout: - # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) - self.onedrive_process.kill() - self.show_login() - if 'time' in stdout: - print('# ' + stdout) - else: - print('@@ ' + stdout.strip()) - - - if self.onedrive_process.stderr: - stderr = self.onedrive_process.stderr.readline() - print('!!!!ERROR ' + stderr) - - if 'command not found' in stderr: - print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") - elif '--resync is required' in stderr: - print(stderr.decode() + " Starting resync.") - self.oneDriveMonitor("onedrive --monitor --resync") - else: - print('@@ERROR' + stderr) - - - - def show_login(self): - self.window1 = QWidget() - self.lw = Ui_LoginWindow() - self.lw.setupUi(self.window1) - self.window1.show() - - # use static URL for now. TODO: use auth files in the future - url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - self.lw.loginFrame.setUrl(QUrl(url)) - - # Wait for user to login and obtain response URL - self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) - - - def getResponseUrl(self, response_url): - if 'nativeclient?code=' in response_url: - os.system(f'onedrive --auth-response "{response_url}"') - print("Login performed") - else: - pass - - - - - - def show_settings(self): - self.window2 = QWidget() - self.ui = Ui_Form() - self.ui.setupUi(self.window2) - - self.window2.show() - - self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) - self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) - - self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) - self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) - - - skip_files = settings['onedrive']['skip_file'].strip('"').split('|') - self.ui.listWidget.addItems(skip_files) - self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) - self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) - self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) - - # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) - # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) - - - skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') - self.ui.listWidget_2.addItems(skip_dirs) - self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) - self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) - self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) - - # self.button2 = QtWidgets.QPushButton("save") - # self.pushButton_4.setText("save") - # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) - self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) - - # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - # self.ui.webEngineView.setUrl(QUrl(url)) - # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) - # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) - - # Rate limit - self.ui.lineEdit_5.setText(settings['onedrive']['rate_limit'].strip('"')) - self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s") - self.ui.lineEdit_5.textChanged.connect(lambda: settings.set('onedrive', 'rate_limit', f'"{self.ui.lineEdit_5.text()}"')) - self.ui.lineEdit_5.textChanged.connect(lambda: self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s")) - - - - - def add_item_to_Qlist(self, source_widget, destination_widget, list): - if source_widget.text() == "": - print("Inoring empty value.") - elif source_widget.text() in list: - print("Item already in exemption list.") - else: - list.append(source_widget.text()) - destination_widget.addItem(source_widget.text()) - - - - def remove_item_from_Qlist(self, QListWidget_name): - for item in QListWidget_name.selectedItems(): - print("Removing: " + item.text()) - items.remove(item.text()) - QListWidget_name.takeItem(QListWidget_name.row(item)) - - - - - - - -def read_config(config_file): - with open(config_file, 'r') as f: - config_string = '[onedrive]\n' + f.read() - - config = ConfigParser() - config.read_string(config_string) - - return config - - -def save_config(new_settings): - # config = ConfigParser() - # config.read_dict - - new_settings.write - print(new_settings) - print(new_settings['onedrive']['sync_dir']) - print('saved') - - # new_settings.set('onedrive', 'testoption', '"QQQQQ"') - - with open(CONFIG_FILE, 'w') as configfile: - new_settings.write(configfile) - - # remove first line (section) from config file - with open(CONFIG_FILE, 'r') as fin: - data = fin.read().splitlines(True) - with open(CONFIG_FILE, 'w') as fout: - fout.writelines(data[1:]) - - - config = ConfigParser() - config.read(new_settings) - # print(config['onedrive']['skip_dir']) - - - - - - - -if __name__ == "__main__": - settings = read_config(CONFIG_FILE) - - app = QApplication(sys.argv) - window = MainWindow() - - window.show() - app.exec() - - diff --git a/src/__thrash/OneDriveGUI-bob-Manja.py b/src/__thrash/OneDriveGUI-bob-Manja.py deleted file mode 100644 index d48aaee..0000000 --- a/src/__thrash/OneDriveGUI-bob-Manja.py +++ /dev/null @@ -1,262 +0,0 @@ -import sys, psutil, os, subprocess, signal -from configparser import ConfigParser - -from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) -from PySide6.QtGui import QIcon -from PySide6.QtCore import QTimer, QUrl - -from ui.ui_mainwindow import Ui_MainWindow -from ui.ui_settings import Ui_Form -from ui.ui_login import Ui_LoginWindow - -CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') - -class MainWindow(QMainWindow, Ui_MainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.setupUi(self) - - # Open Settings window - self.pushButton_3.clicked.connect(lambda: self.show_settings()) - - # Update OneDrive Status - self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) - - # Start OneDrive service - self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) - - # Stop OneDrive service - self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) - - # Restart OneDrive service - self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) - - # Start OneDrive monitoring - self.pushButton_5.clicked.connect(lambda: subprocess.Popen('onedrive --monitor', shell=True)) - - # Stop OneDrive monitoring - self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - - # Force OneDrive resync - # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - # - - # Open login form TODO: testing - self.pushButton_2.setText("login") - self.pushButton_2.clicked.connect(lambda: self.show_login()) - - - # Refresh Sync Status - self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) - self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) - - self.text_timer = QTimer() - self.text_timer.setSingleShot(False) - self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) - self.text_timer.start(1000) - - - - # System Tray - - self.tray = QSystemTrayIcon() - if self.tray.isSystemTrayAvailable(): - - icon = QIcon("icons8-clouds-48.png") - menu = QMenu() - - actionshow = menu.addAction("Show/Hide") - actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) - settingAction = menu.addAction("Settings") - settingAction.triggered.connect(self.show_settings) - quitAction = menu.addAction("Quit") - quitAction.triggered.connect(sys.exit) - - self.tray.setIcon(icon) - self.tray.setContextMenu(menu) - self.tray.show() - self.tray.setToolTip("This is OneDriveGUI") - # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") - else: - self.tray = None - - # Check OneDrive status - def oneDriveProcessStatus(self): - for onedrive_process in psutil.process_iter(): - if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': - # print("OneDrive is running.") - self.label_3.setText("running") - return True - # print("OneDrive is NOT running.") - self.label_3.setText("not running") - return False - - def oneDriveSyncStatus(self): - - status = subprocess.check_output(['onedrive', '--display-sync-status']) - if 'in sync' in str(status): - self.label_4.setText("In Sync") - return True - else: - self.label_4.setText("Out of Sync") - return False - - def startOneDriveMonitor(self, state): - if state == 'start': - self.onedrive_process = subprocess.Popen('onedrive --monitor', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) - elif state == 'stop': - os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) - - - - # def status_checker(): - # timer = QTimer() - # timer.setSingleShot(True) - # timer.timeout.connect(status_checker) - # timer.start(1000) - - # status_checker() - - def show_login(self): - self.window1 = QWidget() - self.lw = Ui_LoginWindow() - self.lw.setupUi(self.window1) - self.window1.show() - - # use static URL for now. TODO: use auth files in the future - url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - self.lw.loginFrame.setUrl(QUrl(url)) - - # Wait for user to login and obtain response URL - self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) - - - def getResponseUrl(self, response_url): - if 'nativeclient?code=' in response_url: - os.system(f'onedrive --auth-response "{response_url}"') - print("Login performed") - else: - pass - - - - - - def show_settings(self): - self.window2 = QWidget() - self.ui = Ui_Form() - self.ui.setupUi(self.window2) - - self.window2.show() - - self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) - self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) - - self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) - self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) - - - skip_files = settings['onedrive']['skip_file'].strip('"').split('|') - self.ui.listWidget.addItems(skip_files) - self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) - self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) - self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) - - # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) - # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) - - - skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') - self.ui.listWidget_2.addItems(skip_dirs) - self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) - self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) - self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) - - # self.button2 = QtWidgets.QPushButton("save") - # self.pushButton_4.setText("save") - # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) - self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) - - # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - # self.ui.webEngineView.setUrl(QUrl(url)) - # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) - # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) - - - - - - def add_item_to_Qlist(self, source_widget, destination_widget, list): - if source_widget.text() == "": - print("Inoring empty value.") - elif source_widget.text() in list: - print("Item already in exemption list.") - else: - list.append(source_widget.text()) - destination_widget.addItem(source_widget.text()) - - - - def remove_item_from_Qlist(self, QListWidget_name): - for item in QListWidget_name.selectedItems(): - print("Removing: " + item.text()) - items.remove(item.text()) - QListWidget_name.takeItem(QListWidget_name.row(item)) - - - - - - - -def read_config(config_file): - with open(config_file, 'r') as f: - config_string = '[onedrive]\n' + f.read() - - config = ConfigParser() - config.read_string(config_string) - - return config - - -def save_config(new_settings): - # config = ConfigParser() - # config.read_dict - - new_settings.write - print(new_settings) - print(new_settings['onedrive']['sync_dir']) - print('saved') - - # new_settings.set('onedrive', 'testoption', '"QQQQQ"') - - with open(CONFIG_FILE, 'w') as configfile: - new_settings.write(configfile) - - # remove first line (section) from config file - with open(CONFIG_FILE, 'r') as fin: - data = fin.read().splitlines(True) - with open(CONFIG_FILE, 'w') as fout: - fout.writelines(data[1:]) - - - config = ConfigParser() - config.read(new_settings) - # print(config['onedrive']['skip_dir']) - - - - - - - -if __name__ == "__main__": - settings = read_config(CONFIG_FILE) - - app = QApplication(sys.argv) - window = MainWindow() - - window.show() - app.exec() - - diff --git a/src/__thrash/config b/src/__thrash/config deleted file mode 100644 index e1cc097..0000000 --- a/src/__thrash/config +++ /dev/null @@ -1,47 +0,0 @@ -sync_dir = ""~/OneDrive2"" -skip_file = "~*|.~*|*.tmp" -monitor_interval = "300" -skip_dir = "akjshdaskhdsakjh" -log_dir = "/var/log/onedrive/" -drive_id = "" -upload_only = "false" -check_nomount = "false" -check_nosync = "false" -download_only = "false" -disable_notifications = "false" -disable_upload_validation = "false" -enable_logging = ""true1"" -force_http_2 = "false" -local_first = "false" -no_remote_delete = "false" -skip_symlinks = "false" -debug_https = "false" -skip_dotfiles = "false" -dry_run = "false" -min_notify_changes = "5" -monitor_log_frequency = "5" -monitor_fullscan_frequency = "10" -sync_root_files = "false" -classify_as_big_delete = "1000" -user_agent = "" -remove_source_files = "false" -skip_dir_strict_match = "false" -application_id = "" -resync = "false" -bypass_data_preservation = "false" -azure_ad_endpoint = "" -azure_tenant_id = "common" -sync_business_shared_folders = "false" -sync_dir_permissions = "700" -sync_file_permissions = "600" -rate_limit = "131072" -webhook_enabled = "false" -webhook_public_url = "" -webhook_listening_host = "" -webhook_listening_port = "8888" -webhook_expiration_interval = "86400" -webhook_renewal_interval = "43200" -operation_timeout = "3600" -testoption = "QQQQQ" -testoption2 = "testvalueCC2a" - diff --git a/src/__thrash/dict_parser_test.py b/src/__thrash/dict_parser_test.py deleted file mode 100644 index e06fb1b..0000000 --- a/src/__thrash/dict_parser_test.py +++ /dev/null @@ -1,120 +0,0 @@ -from configparser import ConfigParser - -global_config = { - "boris@pozdena.eu": { - "config_file": "/home/bob/.config/onedrive/accounts/boris@pozdena.eu/config", - "enable_debug": "True", - "mode": "monitor", - "onedrive": { - "sync_dir": '"/home/bob/OneDrive/"', - "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe|.testfile"', - "monitor_interval": '"15"', - "skip_dir": '"__pycache__|env|venv"', - "log_dir": '"/var/log/onedrive/"', - "drive_id": '""', - "upload_only": '"false"', - "check_nomount": '"false"', - "check_nosync": '"false"', - "download_only": '"false"', - "disable_notifications": '"false"', - "disable_upload_validation": '"false"', - "enable_logging": '"false"', - "force_http_2": '"false"', - "local_first": '"false"', - "no_remote_delete": '"false"', - "skip_symlinks": '"false"', - "debug_https": '"false"', - "skip_dotfiles": '"false"', - "dry_run": '"false"', - "min_notify_changes": '"5"', - "monitor_log_frequency": '"5"', - "monitor_fullscan_frequency": '"1"', - "sync_root_files": '"false"', - "classify_as_big_delete": '"1000"', - "user_agent": '""', - "remove_source_files": '"false"', - "skip_dir_strict_match": '"false"', - "application_id": '""', - "resync": '"false"', - "bypass_data_preservation": '"false"', - "azure_ad_endpoint": '""', - "azure_tenant_id": '"common"', - "sync_business_shared_folders": '"false"', - "sync_dir_permissions": '"700"', - "sync_file_permissions": '"600"', - "rate_limit": '"185700000"', - "operation_timeout": '"3600"', - "webhook_enabled": '"false"', - "webhook_public_url": '""', - "webhook_listening_host": '""', - "webhook_listening_port": '"8888"', - "webhook_expiration_interval": '"86400"', - "webhook_renewal_interval": '"43200"', - }, - }, - "bpozdena@gmail.com": { - "config_file": "/home/bob/.config/onedrive/accounts/pozdenab@gmail.com/config", - "enable_debug": "True", - "mode": "monitor", - "onedrive": { - "sync_dir": '"~/OneDrive222"', - "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe"', - "monitor_interval": '"15"', - "skip_dir": '"__pycache__|env|venv|ignore_filder"', - "log_dir": '"/var/log/onedrive/"', - "drive_id": '""', - "upload_only": '"false"', - "check_nomount": '"false"', - "check_nosync": '"false"', - "download_only": '"false"', - "disable_notifications": '"false"', - "disable_upload_validation": '"false"', - "enable_logging": '"false"', - "force_http_2": '"false"', - "local_first": '"false"', - "no_remote_delete": '"false"', - "skip_symlinks": '"false"', - "debug_https": '"false"', - "skip_dotfiles": '"false"', - "dry_run": '"false"', - "min_notify_changes": '"5"', - "monitor_log_frequency": '"5"', - "monitor_fullscan_frequency": '"1"', - "sync_root_files": '"false"', - "classify_as_big_delete": '"1000"', - "user_agent": '""', - "remove_source_files": '"false"', - "skip_dir_strict_match": '"false"', - "application_id": '""', - "resync": '"false"', - "bypass_data_preservation": '"false"', - "azure_ad_endpoint": '""', - "azure_tenant_id": '"common"', - "sync_business_shared_folders": '"false"', - "sync_dir_permissions": '"700"', - "sync_file_permissions": '"600"', - "rate_limit": '"185700000"', - "operation_timeout": '"3600"', - "webhook_enabled": '"false"', - "webhook_public_url": '""', - "webhook_listening_host": '""', - "webhook_listening_port": '"8888"', - "webhook_expiration_interval": '"86400"', - "webhook_renewal_interval": '"43200"', - }, - }, -} - - - -test = {} -test['onedrive'] = global_config['boris@pozdena.eu'] - -od_config = ConfigParser() - -print(test) - - -od_config.read_dict(test) - -print(od_config) \ No newline at end of file diff --git a/src/__thrash/file_dialog_test.py b/src/__thrash/file_dialog_test.py deleted file mode 100644 index 530f467..0000000 --- a/src/__thrash/file_dialog_test.py +++ /dev/null @@ -1,50 +0,0 @@ -import sys -from PySide6.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog -from PySide6.QtGui import QIcon - -class App(QWidget): - - def __init__(self): - super().__init__() - self.title = 'PyQt5 file dialogs - pythonspot.com' - self.left = 10 - self.top = 10 - self.width = 640 - self.height = 480 - self.initUI() - - def initUI(self): - self.setWindowTitle(self.title) - self.setGeometry(self.left, self.top, self.width, self.height) - - self.openFileNameDialog() - # self.openFileNamesDialog() - # self.saveFileDialog() - - self.show() - - def openFileNameDialog(self): - options = QFileDialog.Options() - options |= QFileDialog.DontUseNativeDialog - fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options) - if fileName: - print(fileName) - - # def openFileNamesDialog(self): - # options = QFileDialog.Options() - # options |= QFileDialog.DontUseNativeDialog - # files, _ = QFileDialog.getOpenFileNames(self,"QFileDialog.getOpenFileNames()", "","All Files (*);;Python Files (*.py)", options=options) - # if files: - # print(files) - - # def saveFileDialog(self): - # options = QFileDialog.Options() - # options |= QFileDialog.DontUseNativeDialog - # fileName, _ = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","All Files (*);;Text Files (*.txt)", options=options) - # if fileName: - # print(fileName) - -if __name__ == '__main__': - app = QApplication(sys.argv) - ex = App() - sys.exit(app.exec_()) diff --git a/src/__thrash/form.ui b/src/__thrash/form.ui deleted file mode 100644 index b232854..0000000 --- a/src/__thrash/form.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/src/__thrash/list_test.py b/src/__thrash/list_test.py deleted file mode 100644 index 78a7dbf..0000000 --- a/src/__thrash/list_test.py +++ /dev/null @@ -1,106 +0,0 @@ -import sys -from PySide6 import QtGui, QtCore -from PySide6.QtWidgets import * - - -class LayerObject(object): - - def __init__(self, **kwargs): - self.name = kwargs.get('name', '') - self.enabled = kwargs.get('enabled', False) - - -class LayerManager(QtGui.QWidget): - def __init__(self): - super(LayerManager, self).__init__() - self.resize(400, 300) - self.list_widget = QtGui.QListWidget() - main_layout = QtGui.QHBoxLayout(self) - main_layout.addWidget(self.list_widget) - self.add_layers() - - def add_layers(self): - layers = [ - LayerObject(name='Layer001', enabled=False), - LayerObject(name='Layer002', enabled=False), - LayerObject(name='Layer003', enabled=True), - LayerObject(name='Layer004', enabled=False), - LayerObject(name='Layer005', enabled=True), - LayerObject(name='Layer006', enabled=False), - LayerObject(name='Layer007', enabled=False), - LayerObject(name='Layer008', enabled=True), - LayerObject(name='Layer009', enabled=False), - LayerObject(name='Layer010', enabled=True) - ] - - for x in layers: - widget = LayerWidget(layer=x) - item = QtGui.QListWidgetItem() - self.list_widget.insertItem(self.list_widget.count(), item) - self.list_widget.setItemWidget(item, widget) - item.setSizeHint(widget.sizeHint()) - - - # properties - @property - def layer(self): - return self._layer - - @layer.setter - def layer(self, value): - self._layer== value - self.ui_layername.setText(value.name) - self.ui_enabled.setChecked(value.enabled) - - -class LayerManager(QWidget): - def __init__(self): - super(LayerManager, self).__init__() - self.resize(400, 300) - - # controls - self.ui_scroll = QWidget() - self.ui_scroll_layout = QtGui.QVBoxLayout() - self.ui_scroll.setLayout(self.ui_scroll_layout) - - self.ui_scroll_area = QtGui.QScrollArea() - self.ui_scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) - self.ui_scroll_area.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.ui_scroll_area.setWidgetResizable(True) - self.ui_scroll_area.setWidget(self.ui_scroll) - - main_layout = QtGui.QHBoxLayout() - main_layout.addWidget(self.ui_scroll_area) - self.setLayout(main_layout) - - - self.add_layers() - - def add_layers(self): - layers = [ - LayerObject(name='Layer001', enabled=False), - LayerObject(name='Layer002', enabled=False), - LayerObject(name='Layer003', enabled=True), - LayerObject(name='Layer004', enabled=False), - LayerObject(name='Layer005', enabled=True), - LayerObject(name='Layer006', enabled=False), - LayerObject(name='Layer007', enabled=False), - LayerObject(name='Layer008', enabled=True), - LayerObject(name='Layer009', enabled=False), - LayerObject(name='Layer010', enabled=True) - ] - - for x in layers: - widget = LayerWidget(layer=x) - self.ui_scroll_layout.addWidget(widget) - - -def main(): - app = QtGui.QApplication(sys.argv) - ex = LayerManager() - ex.show() - sys.exit(app.exec_()) - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/src/__thrash/mainwindow.py b/src/__thrash/mainwindow.py deleted file mode 100644 index e74898b..0000000 --- a/src/__thrash/mainwindow.py +++ /dev/null @@ -1,52 +0,0 @@ -# This Python file uses the following encoding: utf-8 -import os -from pathlib import Path -import sys - -from PySide6.QtWidgets import QApplication, QMainWindow, QListWidgetItem, QWidget, QLabel, QPushButton, QHBoxLayout, QLayout, QListWidget -from PySide6.QtCore import QFile -from PySide6.QtUiTools import QUiLoader - - -class MainWindow(QMainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.load_ui() - - funList = QListWidget() - - itemN = QListWidgetItem() - # Create widget - widget = QWidget() - widgetText = QLabel("I love PyQt!") - widgetButton = QPushButton("Push Me") - widgetLayout = QHBoxLayout() - widgetLayout.addWidget(widgetText) - widgetLayout.addWidget(widgetButton) - widgetLayout.addStretch() - - widgetLayout.setSizeConstraint(QLayout.SetFixedSize) - widget.setLayout(widgetLayout) - itemN.setSizeHint(widget.sizeHint()) - - # Add widget to QListWidget funList - funList.addItem(itemN) - funList.setItemWidget(itemN, widget) - - funList.show() - - - def load_ui(self): - loader = QUiLoader() - path = os.fspath(Path(__file__).resolve().parent / "form.ui") - ui_file = QFile(path) - ui_file.open(QFile.ReadOnly) - loader.load(ui_file, self) - ui_file.close() - - -if __name__ == "__main__": - app = QApplication([]) - widget = MainWindow() - widget.show() - sys.exit(app.exec_()) diff --git a/src/__thrash/message_box_test.py b/src/__thrash/message_box_test.py deleted file mode 100644 index 0d45f27..0000000 --- a/src/__thrash/message_box_test.py +++ /dev/null @@ -1,39 +0,0 @@ -import sys - -from PySide6.QtWidgets import QApplication, QDialog, QMainWindow, QMessageBox, QPushButton - - -class MainWindow(QMainWindow): - def __init__(self): - super().__init__() - - self.setWindowTitle("My App") - - button = QPushButton("Press me for a dialog!") - button.clicked.connect(self.button_clicked) - self.setCentralWidget(button) - - def button_clicked(self, s): - - button = QMessageBox.critical( - self, - "Oh dear!", - "Something went very wrong.", - buttons=QMessageBox.Discard | QMessageBox.NoToAll | QMessageBox.Ignore, - defaultButton=QMessageBox.Discard, - ) - - if button == QMessageBox.Discard: - print("Discard!") - elif button == QMessageBox.NoToAll: - print("No to all!") - else: - print("Ignore!") - - -app = QApplication(sys.argv) - -window = MainWindow() -window.show() - -app.exec() \ No newline at end of file diff --git a/src/__thrash/new_window_test.py b/src/__thrash/new_window_test.py deleted file mode 100644 index 184a086..0000000 --- a/src/__thrash/new_window_test.py +++ /dev/null @@ -1,43 +0,0 @@ -from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel, QVBoxLayout, QWidget - -import sys - -from random import randint - - -class AnotherWindow(QWidget): - """ - This "window" is a QWidget. If it has no parent, it - will appear as a free-floating window as we want. - """ - def __init__(self): - super().__init__() - layout = QVBoxLayout() - self.label = QLabel("Another Window % d" % randint(0,100)) - layout.addWidget(self.label) - self.setLayout(layout) - - -class MainWindow(QMainWindow): - - def __init__(self): - super().__init__() - self.w = None # No external window yet. - self.button = QPushButton("Push for Window") - self.button.clicked.connect(self.show_new_window) - self.setCentralWidget(self.button) - - def show_new_window(self, checked): - if self.w is None: - self.w = AnotherWindow() - self.w.show() - - else: - self.w.close() # Close window. - self.w = None # Discard reference. - - -app = QApplication(sys.argv) -w = MainWindow() -w.show() -app.exec() \ No newline at end of file diff --git a/src/__thrash/output_parser_test.py b/src/__thrash/output_parser_test.py deleted file mode 100644 index 2c93f53..0000000 --- a/src/__thrash/output_parser_test.py +++ /dev/null @@ -1,136 +0,0 @@ -import subprocess, os, signal, time, shlex, sys, re - - -# def run_command(command): -# process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) -# while True: -# output = process.stdout.readline() -# if output == '' and process.poll() is not None: -# break -# # if 'one' in str(output): -# # print("MATCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") -# if output: -# print(output.strip()) - -# rc = process.poll() -# return rc - -# run_command("sudo -S tcpdump -i homebr0 proto 1 <<< C@rnival1") - - - - -# app = subprocess.Popen("journalctl -f", shell=True, stdout = subprocess.PIPE, universal_newlines = True) - -# while True: -# print(app.communicate()[0]) - -# invoke process -# command = 'sudo -S tcpdump -i homebr0 "proto 1" <<< C@rnival1' -# process = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE) - -# # Poll process.stdout to show stdout live -# while True: -# output = process.stdout.readline() -# print(output) -# if process.poll() is not None: -# break -# if output: -# print(output.strip()) -# rc = process.poll() - - -###################### - - - - -# command = shlex.split("ping -c 5 asdasdasdsad.com") - -# def oneDriveMonitor(command="onedrive --monitor"): - -# process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, universal_newlines=False) - -# # while True: -# while process.poll() == None: -# stdout = process.stdout.readline() -# try: -# stderr = process.stderr.readline() -# except: -# pass -# if stdout != '': -# if '1.1.1.1' in stdout: -# print('pinging one.one.one') -# if 'time' in stdout: -# print('# ' + stdout) -# else: -# print('@@ ' + stdout.strip()) - -# if stderr != '': -# if 'command not found' in stderr: -# print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") -# elif '--resync is required' in stderr: -# print(str(stderr) + " Starting resync.") -# # oneDriveMonitor("onedrive --monitor --resync") -# else: -# print('@@ERROR' + stderr) - - - # match line: - # case "1.1.1.1" in line: - # print(line) - - -# oneDriveMonitor() - - - -# else: -# break - - - -# output, err = process.communicate() -# print(output) - - - - - - -def oneDriveMonitor(command): - # command = "onedrive --monitor -v" - process = subprocess.Popen( command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=True, - universal_newlines=True) - - - while process.poll() == None: - - if process.stdout: - stdout = process.stdout.readline() - - if 'Authorize this app visiting' in stdout: - self.show_login() - if 'time' in stdout: - print('# ' + stdout) - else: - print('@@ ' + stdout.strip()) - - - if process.stderr: - stderr = process.stderr.readline() - print('!!!!ERROR ' + stderr) - - if 'command not found' in stderr: - print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") - elif '--resync is required' in stderr: - print(stderr.decode() + " Starting resync.") - oneDriveMonitor("onedrive --monitor --resync") - else: - print('@@ERROR' + stderr) - - -oneDriveMonitor("onedrive --monitor") diff --git a/src/__thrash/re_test.py b/src/__thrash/re_test.py deleted file mode 100644 index da63189..0000000 --- a/src/__thrash/re_test.py +++ /dev/null @@ -1,58 +0,0 @@ -import re - -file_path = '/home/bob/OneDrive/Python/One DriveGUI_POC/OneDri veGUI.spec' - -root_folder = re.search(r".+/([^/]+)/.+$", file_path) - -print(root_folder.group(1)) - - -# stdout = '# Uploading new file Hitchhiking _italy/New Folder/ui_s)(+ěš+ěčšř čýřý*&^&*(etting@#$%^&*s_qt5_$web-test.py ... done.' -# stdout = 'Uploading new file ./config ... done.' - -# file_operation = re.search(r'\b([Uploading|Downloading]+)*', stdout) -# file_path = re.search(r'^.*[a-zA-Z]+\s[a-zA-Z]+_([a-zA-Z]+( [a-zA-Z]+)+)/)[a-zA-Z]+\s\.+$', stdout) -# file_path = re.search(r'.*\b[file](.*)/[a-zA-Z0-9.-_]+\s+\.+$', stdout) -# file_name = re.search(r".*/([a-zA-Z0-9.-_]+)\s+\.+", stdout) - -# file_name = re.search(r".*/(.+)\s+\.\.\.", stdout) - - -# transfer_complete = 'done.' in stdout -# print(transfer_complete) - - -# file_path = re.search(r"\b[file]+\s(.+)\s+\.\.\.", stdout) -# print(file_path) -# print(file_path.group(1)) - - -# print("Operation is: " + file_operation.group(1)) -# # print("Path is: " + file_path.group(1)) -# # print(file_name) -# # print("Filename is: " + file_name.group(1)) -# print(transfer_complete) - - -# progress = re.search(r'\s([0-9]+)%', stdout) -# print(progress.group(1)) - -# # transfer_complete = progress.group(1) == '100' - -# # print(progress.group(1)) -# # print(transfer_complete) - -# # print("test") -# # matches = ['Downloading1 file', 'Downloading2 file', 'Uploading new file', 'Downloading new file'] -# # test = any(x in stdout for x in matches) -# # print(test) - - -# transfer_progress = { -# "file_operation": file_operation.group(1), -# "file_name": 'Resuming last file...' if file_name is None else file_name.group(1), -# # "progress": progress, -# "transfer_complete": transfer_complete -# } - -# print(transfer_progress) \ No newline at end of file diff --git a/src/__thrash/setup_wizard.py b/src/__thrash/setup_wizard.py deleted file mode 100644 index e33f707..0000000 --- a/src/__thrash/setup_wizard.py +++ /dev/null @@ -1,232 +0,0 @@ -import subprocess -import re -import os -from configparser import ConfigParser - -from PySide6.QtGui import QPixmap, QIcon -from PySide6.QtCore import Property, Qt -from PySide6.QtWidgets import ( - QWizard, - QGridLayout, - QLineEdit, - QWizardPage, - QLabel, - QVBoxLayout, - QComboBox, - QApplication, - QCheckBox, - QPushButton, -) - -from OneDriveGUI import read_config - - -class SetupWizard(QWizard): - def __init__(self, parent=None): - super(SetupWizard, self).__init__(parent) - self.setWindowIcon(QIcon("resources/images/icons8-clouds-48.png")) - self.setPage(1, WizardPage_welcome(self)) - self.setPage(2, wizardPage_version_check(self)) - self.setPage(3, wizardPage_create_import(self)) - self.setPage(4, wizardPage_import(self)) - - self.setWindowTitle("OneDriveGUI Setup Wizard") - self.resize(640, 480) - - self.currentIdChanged.connect(self.on_page_change) - - def on_page_change(self): - if self.currentId() == 2: - print("Checking installed OneDrive version") - self.page(2).check_onedrive_version() - - -class WizardPage_welcome(QWizardPage): - def __init__(self, parent=None): - super(WizardPage_welcome, self).__init__(parent) - - self.setTitle("Welcome to OneDriveGUI") - # self.setSubTitle("SubTitle") - - # self.label1 = QLabel() - # self.label1.setText("Welcome to OneDriveGUI") - - self.label_2 = QLabel() - self.label_2.setText("This wizard will help you with initial OneDrive profile creation/import.") - - layout = QVBoxLayout() - # layout.addWidget(self.label1) - layout.addWidget(self.label_2) - self.setLayout(layout) - - - -class wizardPage_version_check(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_version_check, self).__init__(parent) - self.setTitle("OneDrive version check") - - # self.label_3 = QLabel() - # self.label_3.setText("Installed OneDrive version:") - - self.label_4 = QLabel() - self.label_4.setText("Installed/Not Installed/ version") - - self.label_5 = QLabel() - self.label_5.setWordWrap(True) - self.label_5.setText( - "OneDrive Client for Linux does not seem to be installed. Please install it by following " \ - "instructions for your distro. " - ) - - layout = QVBoxLayout() - # layout.addWidget(self.label_3) - layout.addWidget(self.label_4) - layout.addWidget(self.label_5) - self.setLayout(layout) - - def check_onedrive_version(self): - # Check if OneDrive is installed - od_version_check = subprocess.check_output(["onedrive", "--version"]) - if "onedrive v" in str(od_version_check): - self.od_version = re.search(r".\s(v[0-9.]+)", str(od_version_check)).group(1) - print(f"OneDrive {self.od_version} detected.") - self.label_4.setText(f"OneDrive {self.od_version} detected.") - self.label_5.hide() - return True - else: - self.label_4.setText("OneDrive not detected.") - return False - - - -class wizardPage_create_import(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_create_import, self).__init__(parent) - self.setTitle("Create/Import OneDrive profile") - - self.checkBox_create = QCheckBox() - self.checkBox_create.setText("Create new OneDrive profile") - self.checkBox_create.stateChanged.connect(self.on_checkbox_change) - - self.checkBox_import = QCheckBox() - self.checkBox_import.setText("Import existing OneDrive profile/config") - self.checkBox_import.stateChanged.connect(self.on_checkbox_change) - - layout = QVBoxLayout() - layout.addWidget(self.checkBox_create) - layout.addWidget(self.checkBox_import) - self.setLayout(layout) - - - def on_checkbox_change(self): - if self.checkBox_create.isChecked(): - print(f"Create new profile is checked") - self.checkBox_import.setDisabled(True) - # self.wizardPage_create_import.completeChanged() - - elif self.checkBox_import.isChecked(): - print(f"Import profile is checked") - self.checkBox_create.setDisabled(True) - # self.wizardPage_create_import.completeChanged() - - else: - print(f"No option is unchecked") - self.checkBox_import.setDisabled(False) - self.checkBox_create.setDisabled(False) - - -class wizardPage_import(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_import, self).__init__(parent) - self.setTitle("Create/Import OneDrive profile") - - self.label_profile_name = QLabel() - self.label_profile_name.setText("Profile name") - - self.label_config_path = QLabel() - self.label_config_path.setText("Config fil path") - - - self.lineEdit_profile_name = QLineEdit() - self.lineEdit_profile_name.setPlaceholderText("E.g. john@live.com") - - self.lineEdit_config_path = QLineEdit() - self.lineEdit_config_path.setPlaceholderText("E.g. ~/.config/onedrive/config") - - - self.pushButton_import = QPushButton() - - - layout = QVBoxLayout() - layout.addWidget(self.label_profile_name) - layout.addWidget(self.label_config_path) - layout.addWidget(self.lineEdit_profile_name) - layout.addWidget(self.lineEdit_config_path) - layout.addWidget(self.pushButton_import) - self.setLayout(layout) - - def import_profile(self): - """ - Imports pre-existing OneDrive profile. - Loads default values firt, then overwrite them with user settings. - This is to handle cases where imported config contains only some properties. - """ - - profile_name = self.lineEdit_profile_name.text() - config_path = os.path.expanduser(self.lineEdit_config_path.text()) - - # Load all default values. - _default_od_config = read_config("resources/default_config") - default_od_config = _default_od_config._sections - - # Load user's settings. - _new_od_config = read_config(config_path) - new_od_config = _new_od_config._sections - - # Construct dict with user profile settings. - new_profile = {profile_name: {"config_file": config_path, "enable_debug": False, "mode": "monitor"}} - - # Load existing user profiles and add the new profile. - _profiles = ConfigParser() - _profiles.read(PROFILES_FILE) - _profiles[profile_name] = new_profile[profile_name] - - # Create profile config file if it does not exist. - profiles_dir = re.search(r"(.+)/profiles$", PROFILES_FILE).group(1) - if not os.path.exists(profiles_dir): - os.makedirs(profiles_dir) - - # Save the new profile. - with open(PROFILES_FILE, "w") as configfile: - _profiles.write(configfile) - - # Append OD config - new_profile[profile_name].update(default_od_config) - new_profile[profile_name].update(new_od_config) - - # Append new profile into running global profile - global_config.update(new_profile) - # print(new_profile) - # print(global_config) - - self.settings_window.listWidget_profiles.addItem(profile_name) - self.setting_page = ProfileSettingsPage(profile_name) - self.settings_window.stackedLayout.addWidget(self.setting_page) - - # Add status page widget for new profile - main_window.comboBox.addItem(profile_name) - main_window.profile_status_pages[profile_name] = ProfileStatusPage(profile_name) - main_window.stackedLayout.addWidget(main_window.profile_status_pages[profile_name]) - - # Hide "Create profile" push button from main windows. - main_window.pushButton_new_profile.hide() - - print(f"Account {profile_name} has been imported") - self.pushButton_import.setText("Done") - self.pushButton_import.setDisabled(True) - - - - - diff --git a/src/__thrash/system_tray.py b/src/__thrash/system_tray.py deleted file mode 100644 index 110d3b9..0000000 --- a/src/__thrash/system_tray.py +++ /dev/null @@ -1,39 +0,0 @@ -import sys -from PySide6.QtCore import * -from PySide6.QtGui import * -from PySide6.QtWidgets import * - - -class App: - def __init__(self): - # Create a Qt application - self.app = QApplication(sys.argv) - - icon = QIcon("icons8-clouds-48.png") - menu = QMenu() - settingAction = menu.addAction("setting") - settingAction.triggered.connect(self.setting) - exitAction = menu.addAction("exit") - exitAction.triggered.connect(sys.exit) - - self.tray = QSystemTrayIcon() - self.tray.setIcon(icon) - self.tray.setContextMenu(menu) - self.tray.show() - self.tray.setToolTip("unko!") - self.tray.showMessage("hoge", "moge") - self.tray.showMessage("fuga", "moge") - - def run(self): - # Enter Qt application main loop - self.app.exec_() - sys.exit() - - def setting(self): - self.dialog = QDialog() - self.dialog.setWindowTitle("Setting Dialog") - self.dialog.show() - -if __name__ == "__main__": - app = App() - app.run() \ No newline at end of file diff --git a/src/__thrash/test.py b/src/__thrash/test.py deleted file mode 100644 index b356047..0000000 --- a/src/__thrash/test.py +++ /dev/null @@ -1,13 +0,0 @@ -import psutil - -def OneDriveStatus(): - for proc in psutil.process_iter(): - if proc.name().lower() == 'onedrive' and proc.status() != 'zombie': - print("OneDrive is running.") - return True - print("OneDrive is NOT running.") - return False - - - -OneDriveStatus() \ No newline at end of file diff --git a/src/__thrash/ui/settings-good-backup.ui b/src/__thrash/ui/settings-good-backup.ui deleted file mode 100644 index 00c0575..0000000 --- a/src/__thrash/ui/settings-good-backup.ui +++ /dev/null @@ -1,223 +0,0 @@ - - - Form - - - - 0 - 0 - 437 - 718 - - - - Form - - - - - - - - 0 - - - - Monitored Files - - - - - - - - Skip Hidden Files - - - - - - - Sync Folder: - - - - - - - - - - Browse - - - - - - - - - Skip files: - - - - - - - - - - - - Add - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - - - - - Skip directories: - - - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Add - - - - - - - - - - Logging - - - - - - - - Enable Logging - - - - - - - Log location: - - - - - - - - - - Browse - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Page - - - - - Page - - - - - - - - - - - - Save - - - - - - - - - - diff --git a/src/__thrash/ui/settings2.ui b/src/__thrash/ui/settings2.ui deleted file mode 100644 index 24284c2..0000000 --- a/src/__thrash/ui/settings2.ui +++ /dev/null @@ -1,236 +0,0 @@ - - - settings_new - - - - 0 - 0 - 619 - 892 - - - - MainWindow - - - - - - - - - Save - - - - - - - - - - - 0 - - - - Monitored Files - - - - - - - - Skip Hidden Files - - - - - - - Sync Folder: - - - - - - - - - - Browse - - - - - - - - - Skip files: - - - - - - - - - - - - Add - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - - - - - Skip directories: - - - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Add - - - - - - - - - - Logging - - - - - - - - Enable Logging - - - - - - - Log location: - - - - - - - - - - Browse - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Page - - - - - Page - - - - - - - - - - - - 0 - 0 - 619 - 19 - - - - - - - - diff --git a/src/__thrash/ui/settings_qt5_web-test.ui b/src/__thrash/ui/settings_qt5_web-test.ui deleted file mode 100644 index 632a9d2..0000000 --- a/src/__thrash/ui/settings_qt5_web-test.ui +++ /dev/null @@ -1,245 +0,0 @@ - - - Form - - - - 0 - 0 - 697 - 846 - - - - Form - - - - - - - - 3 - - - - Monitored Files - - - - - - - - Skip Hidden Files - - - - - - - Sync Folder: - - - - - - - - - - Browse - - - - - - - - - Skip files: - - - - - - - - - - - - Add - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - - - - - Skip directories: - - - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Add - - - - - - - - - - Logging - - - - - - - - Enable Logging - - - - - - - Log location: - - - - - - - - - - Browse - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Page - - - - - Page - - - - - 30 - 150 - 611 - 461 - - - - - https://www.seznam.cz/ - - - - - - - - - - - - - - Save - - - - - - - - - - QWebEngineView - QWidget -
QtWebEngineWidgets/QWebEngineView
-
-
- - -
diff --git a/src/__thrash/ui/settings_ui.py b/src/__thrash/ui/settings_ui.py deleted file mode 100644 index 054379b..0000000 --- a/src/__thrash/ui/settings_ui.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settings.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, - QLabel, QLineEdit, QListWidget, QListWidgetItem, - QPushButton, QSizePolicy, QSpacerItem, QTabWidget, - QVBoxLayout, QWidget) - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(878, 1011) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_OneDriveGUI.py b/src/__thrash/ui/ui_OneDriveGUI.py deleted file mode 100644 index 988b6ee..0000000 --- a/src/__thrash/ui/ui_OneDriveGUI.py +++ /dev/null @@ -1,127 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'OneDriveGUIAnUifJ.ui' -## -## Created by: Qt User Interface Compiler version 5.15.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide2.QtCore import * -from PySide2.QtGui import * -from PySide2.QtWidgets import * - - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - if not MainWindow.objectName(): - MainWindow.setObjectName(u"MainWindow") - MainWindow.resize(1115, 781) - self.centralwidget = QWidget(MainWindow) - self.centralwidget.setObjectName(u"centralwidget") - self.listView = QListView(self.centralwidget) - self.listView.setObjectName(u"listView") - self.listView.setGeometry(QRect(10, 70, 401, 531)) - self.pushButton = QPushButton(self.centralwidget) - self.pushButton.setObjectName(u"pushButton") - self.pushButton.setGeometry(QRect(20, 623, 101, 81)) - self.pushButton_2 = QPushButton(self.centralwidget) - self.pushButton_2.setObjectName(u"pushButton_2") - self.pushButton_2.setGeometry(QRect(150, 620, 101, 81)) - self.pushButton_3 = QPushButton(self.centralwidget) - self.pushButton_3.setObjectName(u"pushButton_3") - self.pushButton_3.setGeometry(QRect(290, 620, 101, 81)) - self.toolButton = QToolButton(self.centralwidget) - self.toolButton.setObjectName(u"toolButton") - self.toolButton.setGeometry(QRect(240, 640, 32, 33)) - self.toolButton_2 = QToolButton(self.centralwidget) - self.toolButton_2.setObjectName(u"toolButton_2") - self.toolButton_2.setGeometry(QRect(20, 20, 32, 33)) - self.label = QLabel(self.centralwidget) - self.label.setObjectName(u"label") - self.label.setGeometry(QRect(80, 20, 191, 31)) - self.frame = QFrame(self.centralwidget) - self.frame.setObjectName(u"frame") - self.frame.setGeometry(QRect(440, 10, 661, 721)) - self.frame.setFrameShape(QFrame.StyledPanel) - self.frame.setFrameShadow(QFrame.Raised) - self.tabWidget = QTabWidget(self.frame) - self.tabWidget.setObjectName(u"tabWidget") - self.tabWidget.setGeometry(QRect(20, 40, 621, 631)) - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.textEdit = QTextEdit(self.exemptions_tab) - self.textEdit.setObjectName(u"textEdit") - self.textEdit.setGeometry(QRect(40, 340, 501, 231)) - self.textEdit_2 = QTextEdit(self.exemptions_tab) - self.textEdit_2.setObjectName(u"textEdit_2") - self.textEdit_2.setGeometry(QRect(40, 50, 501, 241)) - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - self.label_4.setGeometry(QRect(40, 20, 58, 18)) - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - self.label_5.setGeometry(QRect(40, 310, 111, 18)) - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - self.checkBox.setGeometry(QRect(150, 30, 88, 22)) - self.label_2 = QLabel(self.logging_tab) - self.label_2.setObjectName(u"label_2") - self.label_2.setGeometry(QRect(30, 30, 101, 18)) - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - self.lineEdit.setGeometry(QRect(150, 60, 421, 32)) - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - self.label_3.setGeometry(QRect(30, 70, 101, 18)) - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - self.pushButton_4 = QPushButton(self.frame) - self.pushButton_4.setObjectName(u"pushButton_4") - self.pushButton_4.setGeometry(QRect(540, 680, 88, 34)) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QMenuBar(MainWindow) - self.menubar.setObjectName(u"menubar") - self.menubar.setGeometry(QRect(0, 0, 1115, 30)) - MainWindow.setMenuBar(self.menubar) - self.statusbar = QStatusBar(MainWindow) - self.statusbar.setObjectName(u"statusbar") - MainWindow.setStatusBar(self.statusbar) - - self.retranslateUi(MainWindow) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(MainWindow) - # setupUi - - def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) - self.pushButton.setText(QCoreApplication.translate("MainWindow", u"Open Folder", None)) - self.pushButton_2.setText(QCoreApplication.translate("MainWindow", u"Sync", None)) - self.pushButton_3.setText(QCoreApplication.translate("MainWindow", u"Settings", None)) - self.toolButton.setText(QCoreApplication.translate("MainWindow", u"...", None)) - self.toolButton_2.setText(QCoreApplication.translate("MainWindow", u"...", None)) - self.label.setText(QCoreApplication.translate("MainWindow", u"Status", None)) - self.label_4.setText(QCoreApplication.translate("MainWindow", u"Skip files:", None)) - self.label_5.setText(QCoreApplication.translate("MainWindow", u"Skip directories:", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("MainWindow", u"Exemptions", None)) - self.checkBox.setText("") - self.label_2.setText(QCoreApplication.translate("MainWindow", u"Enable logging:", None)) - self.label_3.setText(QCoreApplication.translate("MainWindow", u"Log location:", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("MainWindow", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("MainWindow", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("MainWindow", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("MainWindow", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings-good-backup.py b/src/__thrash/ui/ui_settings-good-backup.py deleted file mode 100644 index 31b648f..0000000 --- a/src/__thrash/ui/ui_settings-good-backup.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settingsfQdOxi.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, - QLabel, QLineEdit, QListWidget, QListWidgetItem, - QPushButton, QSizePolicy, QSpacerItem, QTabWidget, - QVBoxLayout, QWidget) - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(437, 718) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings2.py b/src/__thrash/ui/ui_settings2.py deleted file mode 100644 index a048186..0000000 --- a/src/__thrash/ui/ui_settings2.py +++ /dev/null @@ -1,240 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settings2DclElV.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, - QLabel, QLineEdit, QListWidget, QListWidgetItem, - QMainWindow, QMenuBar, QPushButton, QSizePolicy, - QSpacerItem, QStatusBar, QTabWidget, QVBoxLayout, - QWidget) - -class Ui_settings_new(object): - def setupUi(self, settings_new): - if not settings_new.objectName(): - settings_new.setObjectName(u"settings_new") - settings_new.resize(619, 892) - self.centralwidget = QWidget(settings_new) - self.centralwidget.setObjectName(u"centralwidget") - self.verticalLayout_2 = QVBoxLayout(self.centralwidget) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(self.centralwidget) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(self.centralwidget) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - settings_new.setCentralWidget(self.centralwidget) - self.menubar = QMenuBar(settings_new) - self.menubar.setObjectName(u"menubar") - self.menubar.setGeometry(QRect(0, 0, 619, 19)) - settings_new.setMenuBar(self.menubar) - self.statusbar = QStatusBar(settings_new) - self.statusbar.setObjectName(u"statusbar") - settings_new.setStatusBar(self.statusbar) - - self.retranslateUi(settings_new) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(settings_new) - # setupUi - - def retranslateUi(self, settings_new): - settings_new.setWindowTitle(QCoreApplication.translate("settings_new", u"MainWindow", None)) - self.pushButton_4.setText(QCoreApplication.translate("settings_new", u"Save", None)) - self.checkBox_2.setText(QCoreApplication.translate("settings_new", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("settings_new", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("settings_new", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("settings_new", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("settings_new", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("settings_new", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("settings_new", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("settings_new", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("settings_new", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("settings_new", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("settings_new", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("settings_new", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("settings_new", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("settings_new", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("settings_new", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("settings_new", u"Page", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings_qt5_web-test.py b/src/__thrash/ui/ui_settings_qt5_web-test.py deleted file mode 100644 index 0b8a514..0000000 --- a/src/__thrash/ui/ui_settings_qt5_web-test.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settings_qt5_web-testdOxRon.ui' -## -## Created by: Qt User Interface Compiler version 5.15.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide2.QtCore import * -from PySide2.QtGui import * -from PySide2.QtWidgets import * - -from PySide2.QtWebEngineWidgets import QWebEngineView - - - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(697, 846) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.webEngineView = QWebEngineView(self.tab_4) - self.webEngineView.setObjectName(u"webEngineView") - self.webEngineView.setGeometry(QRect(30, 150, 611, 461)) - self.webEngineView.setUrl(QUrl(u"https://www.seznam.cz/")) - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(3) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings_web.py b/src/__thrash/ui/ui_settings_web.py deleted file mode 100644 index 8d75edd..0000000 --- a/src/__thrash/ui/ui_settings_web.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settingsHGXEPD.ui' -## -## Created by: Qt User Interface Compiler version 5.15.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import * -from PySide6.QtGui import * -from PySide6.QtWidgets import * - -from PySide6.QtWebEngineWidgets import QWebEngineView - - - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(647, 732) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.webEngineView = QWebEngineView(self.tab_4) - self.webEngineView.setObjectName(u"webEngineView") - self.webEngineView.setGeometry(QRect(10, 40, 611, 501)) - self.webEngineView.setUrl(QUrl(u"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite Files.ReadWrite.all Sites.Read.All Sites.ReadWrite.All offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient")) - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(3) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui_list_item_widget.py_ b/src/__thrash/ui_list_item_widget.py_ deleted file mode 100644 index e2c4779..0000000 --- a/src/__thrash/ui_list_item_widget.py_ +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'list_item_widget.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QProgressBar, - QSizePolicy, QToolButton, QWidget) - -class Ui_list_item_widget(object): - def setupUi(self, list_item_widget): - if not list_item_widget.objectName(): - list_item_widget.setObjectName(u"list_item_widget") - list_item_widget.resize(426, 79) - list_item_widget.setMinimumSize(QSize(50, 60)) - self.gridLayout = QGridLayout(list_item_widget) - self.gridLayout.setObjectName(u"gridLayout") - self.toolButton = QToolButton(list_item_widget) - self.toolButton.setObjectName(u"toolButton") - self.toolButton.setEnabled(True) - self.toolButton.setMinimumSize(QSize(40, 65)) - self.toolButton.setAutoFillBackground(False) - icon = QIcon() - icon.addFile(u"../resources/images/icons8-clouds-48.png", QSize(), QIcon.Normal, QIcon.Off) - self.toolButton.setIcon(icon) - self.toolButton.setIconSize(QSize(50, 75)) - - self.gridLayout.addWidget(self.toolButton, 0, 0, 5, 1) - - self.ls_label_file_name = QLabel(list_item_widget) - self.ls_label_file_name.setObjectName(u"ls_label_file_name") - - self.gridLayout.addWidget(self.ls_label_file_name, 0, 1, 1, 1) - - self.ls_label_task = QLabel(list_item_widget) - self.ls_label_task.setObjectName(u"ls_label_task") - - self.gridLayout.addWidget(self.ls_label_task, 2, 1, 1, 1) - - self.ls_label_dir = QLabel(list_item_widget) - self.ls_label_dir.setObjectName(u"ls_label_dir") - - self.gridLayout.addWidget(self.ls_label_dir, 4, 1, 1, 1) - - self.ls_label_status = QLabel(list_item_widget) - self.ls_label_status.setObjectName(u"ls_label_status") - - self.gridLayout.addWidget(self.ls_label_status, 2, 2, 1, 1) - - self.ls_progressBar = QProgressBar(list_item_widget) - self.ls_progressBar.setObjectName(u"ls_progressBar") - self.ls_progressBar.setMaximumSize(QSize(16777215, 5)) - self.ls_progressBar.setValue(24) - self.ls_progressBar.setTextVisible(False) - - self.gridLayout.addWidget(self.ls_progressBar, 1, 1, 1, 2) - - - self.retranslateUi(list_item_widget) - - QMetaObject.connectSlotsByName(list_item_widget) - # setupUi - - def retranslateUi(self, list_item_widget): - list_item_widget.setWindowTitle(QCoreApplication.translate("list_item_widget", u"Form", None)) - self.toolButton.setText(QCoreApplication.translate("list_item_widget", u"...", None)) - self.ls_label_file_name.setText(QCoreApplication.translate("list_item_widget", u"FileName", None)) - self.ls_label_task.setText(QCoreApplication.translate("list_item_widget", u"Downloading/Uploading ", None)) - self.ls_label_dir.setText(QCoreApplication.translate("list_item_widget", u"Uploaded to Downloads", None)) - self.ls_label_status.setText(QCoreApplication.translate("list_item_widget", u"60KB of 100KB", None)) - # retranslateUi - diff --git a/src/__thrash/ui_setup_wizard.py b/src/__thrash/ui_setup_wizard.py deleted file mode 100644 index 92ac5ec..0000000 --- a/src/__thrash/ui_setup_wizard.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'setup_wizard.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QLabel, QLineEdit, - QPushButton, QSizePolicy, QWidget, QWizard, - QWizardPage) - -class Ui_SetupWizard(object): - def setupUi(self, SetupWizard): - if not SetupWizard.objectName(): - SetupWizard.setObjectName(u"SetupWizard") - SetupWizard.resize(640, 480) - SetupWizard.setMinimumSize(QSize(640, 480)) - SetupWizard.setMaximumSize(QSize(640, 480)) - SetupWizard.setWizardStyle(QWizard.ClassicStyle) - self.wizardPage_welcome = QWizardPage() - self.wizardPage_welcome.setObjectName(u"wizardPage_welcome") - self.label = QLabel(self.wizardPage_welcome) - self.label.setObjectName(u"label") - self.label.setGeometry(QRect(230, 80, 271, 18)) - self.label_2 = QLabel(self.wizardPage_welcome) - self.label_2.setObjectName(u"label_2") - self.label_2.setGeometry(QRect(110, 200, 441, 20)) - SetupWizard.setPage(1, self.wizardPage_welcome) - self.wizardPage_version_check = QWizardPage() - self.wizardPage_version_check.setObjectName(u"wizardPage_version_check") - self.label_3 = QLabel(self.wizardPage_version_check) - self.label_3.setObjectName(u"label_3") - self.label_3.setGeometry(QRect(20, 80, 171, 18)) - self.label_4 = QLabel(self.wizardPage_version_check) - self.label_4.setObjectName(u"label_4") - self.label_4.setGeometry(QRect(200, 80, 211, 18)) - self.label_5 = QLabel(self.wizardPage_version_check) - self.label_5.setObjectName(u"label_5") - self.label_5.setGeometry(QRect(10, 160, 531, 111)) - SetupWizard.setPage(2, self.wizardPage_version_check) - self.wizardPage_create_import = QWizardPage() - self.wizardPage_create_import.setObjectName(u"wizardPage_create_import") - self.label_6 = QLabel(self.wizardPage_create_import) - self.label_6.setObjectName(u"label_6") - self.label_6.setGeometry(QRect(30, 70, 481, 18)) - self.checkBox_create = QCheckBox(self.wizardPage_create_import) - self.checkBox_create.setObjectName(u"checkBox_create") - self.checkBox_create.setGeometry(QRect(30, 140, 171, 22)) - self.checkBox_import = QCheckBox(self.wizardPage_create_import) - self.checkBox_import.setObjectName(u"checkBox_import") - self.checkBox_import.setGeometry(QRect(30, 180, 251, 22)) - SetupWizard.setPage(3, self.wizardPage_create_import) - self.wizardPage_import = QWizardPage() - self.wizardPage_import.setObjectName(u"wizardPage_import") - self.label_7 = QLabel(self.wizardPage_import) - self.label_7.setObjectName(u"label_7") - self.label_7.setGeometry(QRect(30, 60, 291, 18)) - self.label_profile_name = QLabel(self.wizardPage_import) - self.label_profile_name.setObjectName(u"label_profile_name") - self.label_profile_name.setGeometry(QRect(7, 166, 107, 32)) -#if QT_CONFIG(tooltip) - self.label_profile_name.setToolTip(u"") -#endif // QT_CONFIG(tooltip) - self.label_profile_name.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) - self.label_config_path = QLabel(self.wizardPage_import) - self.label_config_path.setObjectName(u"label_config_path") - self.label_config_path.setGeometry(QRect(7, 210, 107, 32)) -#if QT_CONFIG(tooltip) - self.label_config_path.setToolTip(u"") -#endif // QT_CONFIG(tooltip) - self.label_config_path.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) - self.lineEdit_profile_name = QLineEdit(self.wizardPage_import) - self.lineEdit_profile_name.setObjectName(u"lineEdit_profile_name") - self.lineEdit_profile_name.setGeometry(QRect(120, 166, 308, 32)) - self.lineEdit_config_path = QLineEdit(self.wizardPage_import) - self.lineEdit_config_path.setObjectName(u"lineEdit_config_path") - self.lineEdit_config_path.setGeometry(QRect(120, 210, 308, 32)) - self.pushButton_import = QPushButton(self.wizardPage_import) - self.pushButton_import.setObjectName(u"pushButton_import") - self.pushButton_import.setGeometry(QRect(120, 310, 391, 34)) - SetupWizard.setPage(4, self.wizardPage_import) - self.wizardPage_create = QWizardPage() - self.wizardPage_create.setObjectName(u"wizardPage_create") - self.label_10 = QLabel(self.wizardPage_create) - self.label_10.setObjectName(u"label_10") - self.label_10.setGeometry(QRect(40, 70, 231, 18)) - self.lineEdit_sync_dir = QLineEdit(self.wizardPage_create) - self.lineEdit_sync_dir.setObjectName(u"lineEdit_sync_dir") - self.lineEdit_sync_dir.setGeometry(QRect(145, 219, 249, 32)) - self.lineEdit_new_profile_name = QLineEdit(self.wizardPage_create) - self.lineEdit_new_profile_name.setObjectName(u"lineEdit_new_profile_name") - self.lineEdit_new_profile_name.setGeometry(QRect(145, 180, 249, 32)) - self.label_new_profile_name = QLabel(self.wizardPage_create) - self.label_new_profile_name.setObjectName(u"label_new_profile_name") - self.label_new_profile_name.setGeometry(QRect(30, 180, 109, 32)) - self.label_sync_dir = QLabel(self.wizardPage_create) - self.label_sync_dir.setObjectName(u"label_sync_dir") - self.label_sync_dir.setGeometry(QRect(30, 219, 109, 32)) - self.pushButton_create = QPushButton(self.wizardPage_create) - self.pushButton_create.setObjectName(u"pushButton_create") - self.pushButton_create.setGeometry(QRect(170, 340, 351, 34)) - SetupWizard.setPage(5, self.wizardPage_create) - self.wizardPage_finish = QWizardPage() - self.wizardPage_finish.setObjectName(u"wizardPage_finish") - self.label_13 = QLabel(self.wizardPage_finish) - self.label_13.setObjectName(u"label_13") - self.label_13.setGeometry(QRect(20, 80, 591, 171)) - self.label_13.setWordWrap(True) - SetupWizard.setPage(6, self.wizardPage_finish) - - self.retranslateUi(SetupWizard) - - QMetaObject.connectSlotsByName(SetupWizard) - # setupUi - - def retranslateUi(self, SetupWizard): - SetupWizard.setWindowTitle(QCoreApplication.translate("SetupWizard", u"Wizard", None)) - self.label.setText(QCoreApplication.translate("SetupWizard", u"Welcome to OneDriveGUI", None)) - self.label_2.setText(QCoreApplication.translate("SetupWizard", u"This wizard will help you with initial OneDrive profile creation/import.", None)) - self.label_3.setText(QCoreApplication.translate("SetupWizard", u"Installed OneDrive version:", None)) - self.label_4.setText(QCoreApplication.translate("SetupWizard", u"Installed/Not Installed/ version", None)) - self.label_5.setText(QCoreApplication.translate("SetupWizard", u"

OneDrive Client for Linux does not seem to be installed.

Please install it by following instructions for your distro. 
", None)) - self.label_6.setText(QCoreApplication.translate("SetupWizard", u"Would you like to create a new OneDrive profile or import existing one?", None)) - self.checkBox_create.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) - self.checkBox_import.setText(QCoreApplication.translate("SetupWizard", u"Import existing profile/config. ", None)) - self.label_7.setText(QCoreApplication.translate("SetupWizard", u"Import existing profile/config", None)) - self.label_profile_name.setText(QCoreApplication.translate("SetupWizard", u"Profile Name", None)) - self.label_config_path.setText(QCoreApplication.translate("SetupWizard", u"Path to config file", None)) - self.lineEdit_profile_name.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. john@live.com", None)) - self.lineEdit_config_path.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. ~/.config/onedrive/config", None)) - self.pushButton_import.setText(QCoreApplication.translate("SetupWizard", u"Import profile", None)) - self.label_10.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) - self.lineEdit_sync_dir.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. ~/OneDrive_john@live.com/", None)) - self.lineEdit_new_profile_name.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. john@live.com", None)) - self.label_new_profile_name.setText(QCoreApplication.translate("SetupWizard", u"New profile name", None)) - self.label_sync_dir.setText(QCoreApplication.translate("SetupWizard", u"Sync directory", None)) - self.pushButton_create.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) - self.label_13.setText(QCoreApplication.translate("SetupWizard", u"

Your OneDrive profile has been created.


You can adjust advanced profile options if needed. Once you are happy with the profile settings, start sync with OneDrive. You will be automatically presented with a OneDrive login page if you have not logged on previously.

", None)) - # retranslateUi - diff --git a/src/__thrash/ui_wizardPage_welcome.py b/src/__thrash/ui_wizardPage_welcome.py deleted file mode 100644 index a4d9dab..0000000 --- a/src/__thrash/ui_wizardPage_welcome.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'wizardPage_welcome.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QLabel, QSizePolicy, QWidget, - QWizardPage) - -class Ui_WizardPage(object): - def setupUi(self, WizardPage): - if not WizardPage.objectName(): - WizardPage.setObjectName(u"WizardPage") - WizardPage.resize(628, 420) - self.label = QLabel(WizardPage) - self.label.setObjectName(u"label") - self.label.setGeometry(QRect(230, 160, 271, 18)) - self.label_2 = QLabel(WizardPage) - self.label_2.setObjectName(u"label_2") - self.label_2.setGeometry(QRect(110, 280, 441, 20)) - - self.retranslateUi(WizardPage) - - QMetaObject.connectSlotsByName(WizardPage) - # setupUi - - def retranslateUi(self, WizardPage): - WizardPage.setWindowTitle(QCoreApplication.translate("WizardPage", u"WizardPage", None)) - self.label.setText(QCoreApplication.translate("WizardPage", u"Welcome to OneDriveGUI", None)) - self.label_2.setText(QCoreApplication.translate("WizardPage", u"This wizard will help you with initial OneDrive profile creation/import.", None)) - # retranslateUi - diff --git a/src/__thrash/version2.py b/src/__thrash/version2.py deleted file mode 100644 index 8472f7f..0000000 --- a/src/__thrash/version2.py +++ /dev/null @@ -1,20 +0,0 @@ -import sys -from PySide6.QtWidgets import QApplication, QMainWindow -from PySide6.QtCore import QFile -from ui.ui_mainwindow import Ui_MainWindow - -class MainWindow(QMainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.ui = Ui_MainWindow() - self.ui.setupUi(self) - - self.ui.label.setText("test text") - -if __name__ == "__main__": - app = QApplication(sys.argv) - - window = MainWindow() - window.show() - - sys.exit(app.exec()) \ No newline at end of file diff --git a/src/__thrash/wizardPage_welcome.ui b/src/__thrash/wizardPage_welcome.ui deleted file mode 100644 index eed8899..0000000 --- a/src/__thrash/wizardPage_welcome.ui +++ /dev/null @@ -1,45 +0,0 @@ - - - WizardPage - - - - 0 - 0 - 628 - 420 - - - - WizardPage - - - - - 230 - 160 - 271 - 18 - - - - Welcome to OneDriveGUI - - - - - - 110 - 280 - 441 - 20 - - - - This wizard will help you with initial OneDrive profile creation/import. - - - - - - diff --git a/src/__thrash/wizard_test.py b/src/__thrash/wizard_test.py deleted file mode 100644 index 67c81d2..0000000 --- a/src/__thrash/wizard_test.py +++ /dev/null @@ -1,81 +0,0 @@ -from PySide6.QtGui import QPixmap, QIcon -from PySide6.QtCore import Property, Qt -from PySide6.QtWidgets import ( - QWizard, - QGridLayout, - QLineEdit, - QWizardPage, - QLabel, - QVBoxLayout, - QComboBox, - QApplication, -) - - -class QIComboBox(QComboBox): - def __init__(self, parent=None): - super(QIComboBox, self).__init__(parent) - - -class MagicWizard(QWizard): - def __init__(self, parent=None): - super(MagicWizard, self).__init__(parent) - self.addPage(WizardPage_welcome(self)) - self.addPage(wizardPage_version_check(self)) - self.setWindowTitle("OneDriveGUI Setup Wizard") - self.resize(640, 480) - self.setWindowIcon(QIcon("resources/images/icons8-clouds-48.png")) - - -class WizardPage_welcome(QWizardPage): - def __init__(self, parent=None): - super(WizardPage_welcome, self).__init__(parent) - self.setTitle("Welcome to OneDriveGUI") - # self.setSubTitle("SubTitle") - - # self.label1 = QLabel() - # self.label1.setText("Welcome to OneDriveGUI") - - self.label_2 = QLabel() - self.label_2.setText("This wizard will help you with initial OneDrive profile creation/import.") - - layout = QVBoxLayout() - # layout.addWidget(self.label1) - layout.addWidget(self.label_2) - self.setLayout(layout) - - -class wizardPage_version_check(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_version_check, self).__init__(parent) - self.setTitle("OneDrive version check") - - # self.label_3 = QLabel() - # self.label_3.setText("Installed OneDrive version:") - - self.label_4 = QLabel() - self.label_4.setText("Installed/Not Installed/ version") - - self.label_5 = QLabel() - self.label_5.setWordWrap(True) - self.label_5.setText( - "OneDrive Client for Linux does not seem to be installed. Please install it by following " \ - "instructions for your distro. " - ) - - layout = QVBoxLayout() - # layout.addWidget(self.label_3) - layout.addWidget(self.label_4) - layout.addWidget(self.label_5) - self.setLayout(layout) - - - - -if __name__ == "__main__": - import sys - - app = QApplication(sys.argv) - wizard = MagicWizard() - wizard.show() - sys.exit(app.exec_()) diff --git a/src/__thrash/wizard_test2.py b/src/__thrash/wizard_test2.py deleted file mode 100644 index 4d8af46..0000000 --- a/src/__thrash/wizard_test2.py +++ /dev/null @@ -1,95 +0,0 @@ -from PySide6.QtCore import QImage -from PySide6.QtGui import QImage, QPixmap -from PySide6.QtCore import Property, QImage, QPixmap, Qt -from PySide6.QtWidgets import QWizard, QGridLayout, QPixmap, QLineEdit, QWizardPage, QLabel, QVBoxLayout, QgsProjectionSelectionTreeWidget - -icon_path = '/home/nyall/nr_logo.png' - -class ProjectWizard(QWizard): - - def __init__(self, parent=None): - super().__init__(parent) - - self.addPage(Page1(self)) - self.addPage(Page2(self)) - self.setWindowTitle("New Project") - - logo_image=QImage('path_to_logo.png') - self.setPixmap(QWizard.LogoPixmap, QPixmap.fromImage(logo_image)) - - self.setOption(QWizard.NoCancelButton, True) - self.setWindowFlags(self.windowFlags() | Qt.CustomizeWindowHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - def reject(self): - pass - -class Page1(QWizardPage): - - def __init__(self, parent=None): - super().__init__(parent) - self.setTitle('General Properties') - self.setSubTitle('Enter general properties for this project.') - - # create some widgets - self.project_number_line_edit = QLineEdit() - self.project_title_line_edit = QLineEdit() - self.author_line_edit = QLineEdit() - - # set the page layout - layout = QGridLayout() - layout.addWidget(QLabel('Project Number'),0,0) - layout.addWidget(self.project_number_line_edit,0,1) - layout.addWidget(QLabel('Title'),1,0) - layout.addWidget(self.project_title_line_edit,1,1) - layout.addWidget(QLabel('Author'),2,0) - layout.addWidget(self.author_line_edit,2,1) - self.setLayout(layout) - - self.registerField('number*',self.project_number_line_edit) - self.registerField('title*',self.project_title_line_edit) - self.registerField('author*',self.author_line_edit) - - -class Page2(QWizardPage): - - def __init__(self, parent=None): - super().__init__(parent) - self.setTitle('Project Coordinate System') - self.setSubTitle('Choosing an appropriate projection is important to ensure accurate distance and area measurements.') - - self.proj_selector = QgsProjectionSelectionTreeWidget() - layout = QVBoxLayout() - layout.addWidget(self.proj_selector) - self.setLayout(layout) - - self.registerField('crs',self.proj_selector) - self.proj_selector.crsSelected.connect(self.crs_selected) - - def crs_selected(self): - self.setField('crs',self.proj_selector.crs()) - self.completeChanged.emit() - - def isComplete(self): - return self.proj_selector.crs().isValid() - - -def runNewProjectWizard(): - d=ProjectWizard() - d.exec() - - # Set the project crs - crs=d.field('crs') - QgsProject.instance().setCrs(crs) - - # Set the project title - title=d.field('title') - QgsProject.instance().setTitle(d.field('title')) - - # Create expression variables for the author and project number - number=d.field('number') - QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_number', number) - author=d.field('author') - QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_author', author) - - -iface.newProjectCreated.connect(runNewProjectWizard) \ No newline at end of file From 4b5af371a207dc3255e96975eab8fba630371f0e Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Mon, 7 Feb 2022 17:37:12 +0100 Subject: [PATCH 08/12] rm trash dir --- src/__thrash/OneDriveGUI-backup.py | 307 ++++++++++++++++++++ src/__thrash/OneDriveGUI-bob-Manja.py | 262 +++++++++++++++++ src/__thrash/config | 47 +++ src/__thrash/dict_parser_test.py | 120 ++++++++ src/__thrash/file_dialog_test.py | 50 ++++ src/__thrash/form.ui | 22 ++ src/__thrash/list_test.py | 106 +++++++ src/__thrash/mainwindow.py | 52 ++++ src/__thrash/message_box_test.py | 39 +++ src/__thrash/new_window_test.py | 43 +++ src/__thrash/output_parser_test.py | 136 +++++++++ src/__thrash/re_test.py | 58 ++++ src/__thrash/setup_wizard.py | 232 +++++++++++++++ src/__thrash/system_tray.py | 39 +++ src/__thrash/test.py | 13 + src/__thrash/ui/settings-good-backup.ui | 223 ++++++++++++++ src/__thrash/ui/settings2.ui | 236 +++++++++++++++ src/__thrash/ui/settings_qt5_web-test.ui | 245 ++++++++++++++++ src/__thrash/ui/settings_ui.py | 229 +++++++++++++++ src/__thrash/ui/ui_OneDriveGUI.py | 127 ++++++++ src/__thrash/ui/ui_settings-good-backup.py | 229 +++++++++++++++ src/__thrash/ui/ui_settings2.py | 240 +++++++++++++++ src/__thrash/ui/ui_settings_qt5_web-test.py | 229 +++++++++++++++ src/__thrash/ui/ui_settings_web.py | 229 +++++++++++++++ src/__thrash/ui_list_item_widget.py_ | 83 ++++++ src/__thrash/ui_setup_wizard.py | 150 ++++++++++ src/__thrash/ui_wizardPage_welcome.py | 43 +++ src/__thrash/version2.py | 20 ++ src/__thrash/wizardPage_welcome.ui | 45 +++ src/__thrash/wizard_test.py | 81 ++++++ src/__thrash/wizard_test2.py | 95 ++++++ 31 files changed, 4030 insertions(+) create mode 100644 src/__thrash/OneDriveGUI-backup.py create mode 100644 src/__thrash/OneDriveGUI-bob-Manja.py create mode 100644 src/__thrash/config create mode 100644 src/__thrash/dict_parser_test.py create mode 100644 src/__thrash/file_dialog_test.py create mode 100644 src/__thrash/form.ui create mode 100644 src/__thrash/list_test.py create mode 100644 src/__thrash/mainwindow.py create mode 100644 src/__thrash/message_box_test.py create mode 100644 src/__thrash/new_window_test.py create mode 100644 src/__thrash/output_parser_test.py create mode 100644 src/__thrash/re_test.py create mode 100644 src/__thrash/setup_wizard.py create mode 100644 src/__thrash/system_tray.py create mode 100644 src/__thrash/test.py create mode 100644 src/__thrash/ui/settings-good-backup.ui create mode 100644 src/__thrash/ui/settings2.ui create mode 100644 src/__thrash/ui/settings_qt5_web-test.ui create mode 100644 src/__thrash/ui/settings_ui.py create mode 100644 src/__thrash/ui/ui_OneDriveGUI.py create mode 100644 src/__thrash/ui/ui_settings-good-backup.py create mode 100644 src/__thrash/ui/ui_settings2.py create mode 100644 src/__thrash/ui/ui_settings_qt5_web-test.py create mode 100644 src/__thrash/ui/ui_settings_web.py create mode 100644 src/__thrash/ui_list_item_widget.py_ create mode 100644 src/__thrash/ui_setup_wizard.py create mode 100644 src/__thrash/ui_wizardPage_welcome.py create mode 100644 src/__thrash/version2.py create mode 100644 src/__thrash/wizardPage_welcome.ui create mode 100644 src/__thrash/wizard_test.py create mode 100644 src/__thrash/wizard_test2.py diff --git a/src/__thrash/OneDriveGUI-backup.py b/src/__thrash/OneDriveGUI-backup.py new file mode 100644 index 0000000..a882da4 --- /dev/null +++ b/src/__thrash/OneDriveGUI-backup.py @@ -0,0 +1,307 @@ +import sys, psutil, os, subprocess, signal +from configparser import ConfigParser + +from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) +from PySide6.QtGui import QIcon +from PySide6.QtCore import QTimer, QUrl + +from ui.ui_mainwindow import Ui_MainWindow +from ui.ui_settings import Ui_Form +from ui.ui_login import Ui_LoginWindow + +CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') + +class MainWindow(QMainWindow, Ui_MainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.setupUi(self) + + # Open Settings window + self.pushButton_3.clicked.connect(lambda: self.show_settings()) + + # Update OneDrive Status + self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) + + # Start OneDrive service + self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) + + # Stop OneDrive service + self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) + + # Restart OneDrive service + self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) + + # Start OneDrive monitoring + self.pushButton_5.clicked.connect(lambda: self.oneDriveMonitor('onedrive --monitor')) + + # Stop OneDrive monitoring + self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + + # Force OneDrive resync + # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + # + + # Open login form TODO: testing + self.pushButton_2.setText("login") + self.pushButton_2.clicked.connect(lambda: self.show_login()) + + + # Refresh Sync Status + self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) + self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) + + self.text_timer = QTimer() + self.text_timer.setSingleShot(False) + self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) + self.text_timer.start(1000) + + + + # System Tray + + self.tray = QSystemTrayIcon() + if self.tray.isSystemTrayAvailable(): + + icon = QIcon("icons8-clouds-48.png") + menu = QMenu() + + actionshow = menu.addAction("Show/Hide") + actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) + settingAction = menu.addAction("Settings") + settingAction.triggered.connect(self.show_settings) + quitAction = menu.addAction("Quit") + quitAction.triggered.connect(sys.exit) + + self.tray.setIcon(icon) + self.tray.setContextMenu(menu) + self.tray.show() + self.tray.setToolTip("This is OneDriveGUI") + # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") + else: + self.tray = None + + # Check OneDrive status + def oneDriveProcessStatus(self): + for onedrive_process in psutil.process_iter(): + if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': + # print("OneDrive is running.") + self.label_3.setText("running") + return True + # print("OneDrive is NOT running.") + self.label_3.setText("not running") + return False + + def oneDriveSyncStatus(self): + + status = subprocess.check_output(['onedrive', '--display-sync-status']) + if 'in sync' in str(status): + self.label_4.setText("In Sync") + return True + else: + self.label_4.setText("Out of Sync") + return False + + # def oneDriveMonitor(self, state): + # if state == 'start': + # self.onedrive_process = subprocess.Popen('onedrive --monitor -v', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) + # while True: + # onedrive_output = self.onedrive_process.communicate() + # print(onedrive_output) + # elif state == 'stop': + # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) + + + + # # def status_checker(): + # # timer = QTimer() + # # timer.setSingleShot(True) + # # timer.timeout.connect(status_checker) + # # timer.start(1000) + + # # status_checker() + + async def oneDriveMonitor(self, command): + self.onedrive_process = subprocess.Popen(command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True, + universal_newlines=True) + + + while self.onedrive_process.poll() == None: + + if self.onedrive_process.stdout: + stdout = self.onedrive_process.stdout.readline() + + if 'Authorize this app visiting' in stdout: + # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) + self.onedrive_process.kill() + self.show_login() + if 'time' in stdout: + print('# ' + stdout) + else: + print('@@ ' + stdout.strip()) + + + if self.onedrive_process.stderr: + stderr = self.onedrive_process.stderr.readline() + print('!!!!ERROR ' + stderr) + + if 'command not found' in stderr: + print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") + elif '--resync is required' in stderr: + print(stderr.decode() + " Starting resync.") + self.oneDriveMonitor("onedrive --monitor --resync") + else: + print('@@ERROR' + stderr) + + + + def show_login(self): + self.window1 = QWidget() + self.lw = Ui_LoginWindow() + self.lw.setupUi(self.window1) + self.window1.show() + + # use static URL for now. TODO: use auth files in the future + url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + self.lw.loginFrame.setUrl(QUrl(url)) + + # Wait for user to login and obtain response URL + self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) + + + def getResponseUrl(self, response_url): + if 'nativeclient?code=' in response_url: + os.system(f'onedrive --auth-response "{response_url}"') + print("Login performed") + else: + pass + + + + + + def show_settings(self): + self.window2 = QWidget() + self.ui = Ui_Form() + self.ui.setupUi(self.window2) + + self.window2.show() + + self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) + self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) + + self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) + self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) + + + skip_files = settings['onedrive']['skip_file'].strip('"').split('|') + self.ui.listWidget.addItems(skip_files) + self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) + self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) + self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) + + # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) + # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) + + + skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') + self.ui.listWidget_2.addItems(skip_dirs) + self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) + self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) + self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) + + # self.button2 = QtWidgets.QPushButton("save") + # self.pushButton_4.setText("save") + # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) + self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) + + # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + # self.ui.webEngineView.setUrl(QUrl(url)) + # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) + # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) + + # Rate limit + self.ui.lineEdit_5.setText(settings['onedrive']['rate_limit'].strip('"')) + self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s") + self.ui.lineEdit_5.textChanged.connect(lambda: settings.set('onedrive', 'rate_limit', f'"{self.ui.lineEdit_5.text()}"')) + self.ui.lineEdit_5.textChanged.connect(lambda: self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s")) + + + + + def add_item_to_Qlist(self, source_widget, destination_widget, list): + if source_widget.text() == "": + print("Inoring empty value.") + elif source_widget.text() in list: + print("Item already in exemption list.") + else: + list.append(source_widget.text()) + destination_widget.addItem(source_widget.text()) + + + + def remove_item_from_Qlist(self, QListWidget_name): + for item in QListWidget_name.selectedItems(): + print("Removing: " + item.text()) + items.remove(item.text()) + QListWidget_name.takeItem(QListWidget_name.row(item)) + + + + + + + +def read_config(config_file): + with open(config_file, 'r') as f: + config_string = '[onedrive]\n' + f.read() + + config = ConfigParser() + config.read_string(config_string) + + return config + + +def save_config(new_settings): + # config = ConfigParser() + # config.read_dict + + new_settings.write + print(new_settings) + print(new_settings['onedrive']['sync_dir']) + print('saved') + + # new_settings.set('onedrive', 'testoption', '"QQQQQ"') + + with open(CONFIG_FILE, 'w') as configfile: + new_settings.write(configfile) + + # remove first line (section) from config file + with open(CONFIG_FILE, 'r') as fin: + data = fin.read().splitlines(True) + with open(CONFIG_FILE, 'w') as fout: + fout.writelines(data[1:]) + + + config = ConfigParser() + config.read(new_settings) + # print(config['onedrive']['skip_dir']) + + + + + + + +if __name__ == "__main__": + settings = read_config(CONFIG_FILE) + + app = QApplication(sys.argv) + window = MainWindow() + + window.show() + app.exec() + + diff --git a/src/__thrash/OneDriveGUI-bob-Manja.py b/src/__thrash/OneDriveGUI-bob-Manja.py new file mode 100644 index 0000000..d48aaee --- /dev/null +++ b/src/__thrash/OneDriveGUI-bob-Manja.py @@ -0,0 +1,262 @@ +import sys, psutil, os, subprocess, signal +from configparser import ConfigParser + +from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) +from PySide6.QtGui import QIcon +from PySide6.QtCore import QTimer, QUrl + +from ui.ui_mainwindow import Ui_MainWindow +from ui.ui_settings import Ui_Form +from ui.ui_login import Ui_LoginWindow + +CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') + +class MainWindow(QMainWindow, Ui_MainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.setupUi(self) + + # Open Settings window + self.pushButton_3.clicked.connect(lambda: self.show_settings()) + + # Update OneDrive Status + self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) + + # Start OneDrive service + self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) + + # Stop OneDrive service + self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) + + # Restart OneDrive service + self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) + + # Start OneDrive monitoring + self.pushButton_5.clicked.connect(lambda: subprocess.Popen('onedrive --monitor', shell=True)) + + # Stop OneDrive monitoring + self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + + # Force OneDrive resync + # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) + # + + # Open login form TODO: testing + self.pushButton_2.setText("login") + self.pushButton_2.clicked.connect(lambda: self.show_login()) + + + # Refresh Sync Status + self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) + self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) + + self.text_timer = QTimer() + self.text_timer.setSingleShot(False) + self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) + self.text_timer.start(1000) + + + + # System Tray + + self.tray = QSystemTrayIcon() + if self.tray.isSystemTrayAvailable(): + + icon = QIcon("icons8-clouds-48.png") + menu = QMenu() + + actionshow = menu.addAction("Show/Hide") + actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) + settingAction = menu.addAction("Settings") + settingAction.triggered.connect(self.show_settings) + quitAction = menu.addAction("Quit") + quitAction.triggered.connect(sys.exit) + + self.tray.setIcon(icon) + self.tray.setContextMenu(menu) + self.tray.show() + self.tray.setToolTip("This is OneDriveGUI") + # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") + else: + self.tray = None + + # Check OneDrive status + def oneDriveProcessStatus(self): + for onedrive_process in psutil.process_iter(): + if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': + # print("OneDrive is running.") + self.label_3.setText("running") + return True + # print("OneDrive is NOT running.") + self.label_3.setText("not running") + return False + + def oneDriveSyncStatus(self): + + status = subprocess.check_output(['onedrive', '--display-sync-status']) + if 'in sync' in str(status): + self.label_4.setText("In Sync") + return True + else: + self.label_4.setText("Out of Sync") + return False + + def startOneDriveMonitor(self, state): + if state == 'start': + self.onedrive_process = subprocess.Popen('onedrive --monitor', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) + elif state == 'stop': + os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) + + + + # def status_checker(): + # timer = QTimer() + # timer.setSingleShot(True) + # timer.timeout.connect(status_checker) + # timer.start(1000) + + # status_checker() + + def show_login(self): + self.window1 = QWidget() + self.lw = Ui_LoginWindow() + self.lw.setupUi(self.window1) + self.window1.show() + + # use static URL for now. TODO: use auth files in the future + url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + self.lw.loginFrame.setUrl(QUrl(url)) + + # Wait for user to login and obtain response URL + self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) + + + def getResponseUrl(self, response_url): + if 'nativeclient?code=' in response_url: + os.system(f'onedrive --auth-response "{response_url}"') + print("Login performed") + else: + pass + + + + + + def show_settings(self): + self.window2 = QWidget() + self.ui = Ui_Form() + self.ui.setupUi(self.window2) + + self.window2.show() + + self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) + self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) + + self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) + self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) + + + skip_files = settings['onedrive']['skip_file'].strip('"').split('|') + self.ui.listWidget.addItems(skip_files) + self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) + self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) + self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) + + # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) + # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) + + + skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') + self.ui.listWidget_2.addItems(skip_dirs) + self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) + self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) + self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) + + # self.button2 = QtWidgets.QPushButton("save") + # self.pushButton_4.setText("save") + # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) + self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) + + # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' + # self.ui.webEngineView.setUrl(QUrl(url)) + # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) + # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) + + + + + + def add_item_to_Qlist(self, source_widget, destination_widget, list): + if source_widget.text() == "": + print("Inoring empty value.") + elif source_widget.text() in list: + print("Item already in exemption list.") + else: + list.append(source_widget.text()) + destination_widget.addItem(source_widget.text()) + + + + def remove_item_from_Qlist(self, QListWidget_name): + for item in QListWidget_name.selectedItems(): + print("Removing: " + item.text()) + items.remove(item.text()) + QListWidget_name.takeItem(QListWidget_name.row(item)) + + + + + + + +def read_config(config_file): + with open(config_file, 'r') as f: + config_string = '[onedrive]\n' + f.read() + + config = ConfigParser() + config.read_string(config_string) + + return config + + +def save_config(new_settings): + # config = ConfigParser() + # config.read_dict + + new_settings.write + print(new_settings) + print(new_settings['onedrive']['sync_dir']) + print('saved') + + # new_settings.set('onedrive', 'testoption', '"QQQQQ"') + + with open(CONFIG_FILE, 'w') as configfile: + new_settings.write(configfile) + + # remove first line (section) from config file + with open(CONFIG_FILE, 'r') as fin: + data = fin.read().splitlines(True) + with open(CONFIG_FILE, 'w') as fout: + fout.writelines(data[1:]) + + + config = ConfigParser() + config.read(new_settings) + # print(config['onedrive']['skip_dir']) + + + + + + + +if __name__ == "__main__": + settings = read_config(CONFIG_FILE) + + app = QApplication(sys.argv) + window = MainWindow() + + window.show() + app.exec() + + diff --git a/src/__thrash/config b/src/__thrash/config new file mode 100644 index 0000000..e1cc097 --- /dev/null +++ b/src/__thrash/config @@ -0,0 +1,47 @@ +sync_dir = ""~/OneDrive2"" +skip_file = "~*|.~*|*.tmp" +monitor_interval = "300" +skip_dir = "akjshdaskhdsakjh" +log_dir = "/var/log/onedrive/" +drive_id = "" +upload_only = "false" +check_nomount = "false" +check_nosync = "false" +download_only = "false" +disable_notifications = "false" +disable_upload_validation = "false" +enable_logging = ""true1"" +force_http_2 = "false" +local_first = "false" +no_remote_delete = "false" +skip_symlinks = "false" +debug_https = "false" +skip_dotfiles = "false" +dry_run = "false" +min_notify_changes = "5" +monitor_log_frequency = "5" +monitor_fullscan_frequency = "10" +sync_root_files = "false" +classify_as_big_delete = "1000" +user_agent = "" +remove_source_files = "false" +skip_dir_strict_match = "false" +application_id = "" +resync = "false" +bypass_data_preservation = "false" +azure_ad_endpoint = "" +azure_tenant_id = "common" +sync_business_shared_folders = "false" +sync_dir_permissions = "700" +sync_file_permissions = "600" +rate_limit = "131072" +webhook_enabled = "false" +webhook_public_url = "" +webhook_listening_host = "" +webhook_listening_port = "8888" +webhook_expiration_interval = "86400" +webhook_renewal_interval = "43200" +operation_timeout = "3600" +testoption = "QQQQQ" +testoption2 = "testvalueCC2a" + diff --git a/src/__thrash/dict_parser_test.py b/src/__thrash/dict_parser_test.py new file mode 100644 index 0000000..e06fb1b --- /dev/null +++ b/src/__thrash/dict_parser_test.py @@ -0,0 +1,120 @@ +from configparser import ConfigParser + +global_config = { + "boris@pozdena.eu": { + "config_file": "/home/bob/.config/onedrive/accounts/boris@pozdena.eu/config", + "enable_debug": "True", + "mode": "monitor", + "onedrive": { + "sync_dir": '"/home/bob/OneDrive/"', + "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe|.testfile"', + "monitor_interval": '"15"', + "skip_dir": '"__pycache__|env|venv"', + "log_dir": '"/var/log/onedrive/"', + "drive_id": '""', + "upload_only": '"false"', + "check_nomount": '"false"', + "check_nosync": '"false"', + "download_only": '"false"', + "disable_notifications": '"false"', + "disable_upload_validation": '"false"', + "enable_logging": '"false"', + "force_http_2": '"false"', + "local_first": '"false"', + "no_remote_delete": '"false"', + "skip_symlinks": '"false"', + "debug_https": '"false"', + "skip_dotfiles": '"false"', + "dry_run": '"false"', + "min_notify_changes": '"5"', + "monitor_log_frequency": '"5"', + "monitor_fullscan_frequency": '"1"', + "sync_root_files": '"false"', + "classify_as_big_delete": '"1000"', + "user_agent": '""', + "remove_source_files": '"false"', + "skip_dir_strict_match": '"false"', + "application_id": '""', + "resync": '"false"', + "bypass_data_preservation": '"false"', + "azure_ad_endpoint": '""', + "azure_tenant_id": '"common"', + "sync_business_shared_folders": '"false"', + "sync_dir_permissions": '"700"', + "sync_file_permissions": '"600"', + "rate_limit": '"185700000"', + "operation_timeout": '"3600"', + "webhook_enabled": '"false"', + "webhook_public_url": '""', + "webhook_listening_host": '""', + "webhook_listening_port": '"8888"', + "webhook_expiration_interval": '"86400"', + "webhook_renewal_interval": '"43200"', + }, + }, + "bpozdena@gmail.com": { + "config_file": "/home/bob/.config/onedrive/accounts/pozdenab@gmail.com/config", + "enable_debug": "True", + "mode": "monitor", + "onedrive": { + "sync_dir": '"~/OneDrive222"', + "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe"', + "monitor_interval": '"15"', + "skip_dir": '"__pycache__|env|venv|ignore_filder"', + "log_dir": '"/var/log/onedrive/"', + "drive_id": '""', + "upload_only": '"false"', + "check_nomount": '"false"', + "check_nosync": '"false"', + "download_only": '"false"', + "disable_notifications": '"false"', + "disable_upload_validation": '"false"', + "enable_logging": '"false"', + "force_http_2": '"false"', + "local_first": '"false"', + "no_remote_delete": '"false"', + "skip_symlinks": '"false"', + "debug_https": '"false"', + "skip_dotfiles": '"false"', + "dry_run": '"false"', + "min_notify_changes": '"5"', + "monitor_log_frequency": '"5"', + "monitor_fullscan_frequency": '"1"', + "sync_root_files": '"false"', + "classify_as_big_delete": '"1000"', + "user_agent": '""', + "remove_source_files": '"false"', + "skip_dir_strict_match": '"false"', + "application_id": '""', + "resync": '"false"', + "bypass_data_preservation": '"false"', + "azure_ad_endpoint": '""', + "azure_tenant_id": '"common"', + "sync_business_shared_folders": '"false"', + "sync_dir_permissions": '"700"', + "sync_file_permissions": '"600"', + "rate_limit": '"185700000"', + "operation_timeout": '"3600"', + "webhook_enabled": '"false"', + "webhook_public_url": '""', + "webhook_listening_host": '""', + "webhook_listening_port": '"8888"', + "webhook_expiration_interval": '"86400"', + "webhook_renewal_interval": '"43200"', + }, + }, +} + + + +test = {} +test['onedrive'] = global_config['boris@pozdena.eu'] + +od_config = ConfigParser() + +print(test) + + +od_config.read_dict(test) + +print(od_config) \ No newline at end of file diff --git a/src/__thrash/file_dialog_test.py b/src/__thrash/file_dialog_test.py new file mode 100644 index 0000000..530f467 --- /dev/null +++ b/src/__thrash/file_dialog_test.py @@ -0,0 +1,50 @@ +import sys +from PySide6.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog +from PySide6.QtGui import QIcon + +class App(QWidget): + + def __init__(self): + super().__init__() + self.title = 'PyQt5 file dialogs - pythonspot.com' + self.left = 10 + self.top = 10 + self.width = 640 + self.height = 480 + self.initUI() + + def initUI(self): + self.setWindowTitle(self.title) + self.setGeometry(self.left, self.top, self.width, self.height) + + self.openFileNameDialog() + # self.openFileNamesDialog() + # self.saveFileDialog() + + self.show() + + def openFileNameDialog(self): + options = QFileDialog.Options() + options |= QFileDialog.DontUseNativeDialog + fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options) + if fileName: + print(fileName) + + # def openFileNamesDialog(self): + # options = QFileDialog.Options() + # options |= QFileDialog.DontUseNativeDialog + # files, _ = QFileDialog.getOpenFileNames(self,"QFileDialog.getOpenFileNames()", "","All Files (*);;Python Files (*.py)", options=options) + # if files: + # print(files) + + # def saveFileDialog(self): + # options = QFileDialog.Options() + # options |= QFileDialog.DontUseNativeDialog + # fileName, _ = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","All Files (*);;Text Files (*.txt)", options=options) + # if fileName: + # print(fileName) + +if __name__ == '__main__': + app = QApplication(sys.argv) + ex = App() + sys.exit(app.exec_()) diff --git a/src/__thrash/form.ui b/src/__thrash/form.ui new file mode 100644 index 0000000..b232854 --- /dev/null +++ b/src/__thrash/form.ui @@ -0,0 +1,22 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/src/__thrash/list_test.py b/src/__thrash/list_test.py new file mode 100644 index 0000000..78a7dbf --- /dev/null +++ b/src/__thrash/list_test.py @@ -0,0 +1,106 @@ +import sys +from PySide6 import QtGui, QtCore +from PySide6.QtWidgets import * + + +class LayerObject(object): + + def __init__(self, **kwargs): + self.name = kwargs.get('name', '') + self.enabled = kwargs.get('enabled', False) + + +class LayerManager(QtGui.QWidget): + def __init__(self): + super(LayerManager, self).__init__() + self.resize(400, 300) + self.list_widget = QtGui.QListWidget() + main_layout = QtGui.QHBoxLayout(self) + main_layout.addWidget(self.list_widget) + self.add_layers() + + def add_layers(self): + layers = [ + LayerObject(name='Layer001', enabled=False), + LayerObject(name='Layer002', enabled=False), + LayerObject(name='Layer003', enabled=True), + LayerObject(name='Layer004', enabled=False), + LayerObject(name='Layer005', enabled=True), + LayerObject(name='Layer006', enabled=False), + LayerObject(name='Layer007', enabled=False), + LayerObject(name='Layer008', enabled=True), + LayerObject(name='Layer009', enabled=False), + LayerObject(name='Layer010', enabled=True) + ] + + for x in layers: + widget = LayerWidget(layer=x) + item = QtGui.QListWidgetItem() + self.list_widget.insertItem(self.list_widget.count(), item) + self.list_widget.setItemWidget(item, widget) + item.setSizeHint(widget.sizeHint()) + + + # properties + @property + def layer(self): + return self._layer + + @layer.setter + def layer(self, value): + self._layer== value + self.ui_layername.setText(value.name) + self.ui_enabled.setChecked(value.enabled) + + +class LayerManager(QWidget): + def __init__(self): + super(LayerManager, self).__init__() + self.resize(400, 300) + + # controls + self.ui_scroll = QWidget() + self.ui_scroll_layout = QtGui.QVBoxLayout() + self.ui_scroll.setLayout(self.ui_scroll_layout) + + self.ui_scroll_area = QtGui.QScrollArea() + self.ui_scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) + self.ui_scroll_area.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.ui_scroll_area.setWidgetResizable(True) + self.ui_scroll_area.setWidget(self.ui_scroll) + + main_layout = QtGui.QHBoxLayout() + main_layout.addWidget(self.ui_scroll_area) + self.setLayout(main_layout) + + + self.add_layers() + + def add_layers(self): + layers = [ + LayerObject(name='Layer001', enabled=False), + LayerObject(name='Layer002', enabled=False), + LayerObject(name='Layer003', enabled=True), + LayerObject(name='Layer004', enabled=False), + LayerObject(name='Layer005', enabled=True), + LayerObject(name='Layer006', enabled=False), + LayerObject(name='Layer007', enabled=False), + LayerObject(name='Layer008', enabled=True), + LayerObject(name='Layer009', enabled=False), + LayerObject(name='Layer010', enabled=True) + ] + + for x in layers: + widget = LayerWidget(layer=x) + self.ui_scroll_layout.addWidget(widget) + + +def main(): + app = QtGui.QApplication(sys.argv) + ex = LayerManager() + ex.show() + sys.exit(app.exec_()) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/src/__thrash/mainwindow.py b/src/__thrash/mainwindow.py new file mode 100644 index 0000000..e74898b --- /dev/null +++ b/src/__thrash/mainwindow.py @@ -0,0 +1,52 @@ +# This Python file uses the following encoding: utf-8 +import os +from pathlib import Path +import sys + +from PySide6.QtWidgets import QApplication, QMainWindow, QListWidgetItem, QWidget, QLabel, QPushButton, QHBoxLayout, QLayout, QListWidget +from PySide6.QtCore import QFile +from PySide6.QtUiTools import QUiLoader + + +class MainWindow(QMainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.load_ui() + + funList = QListWidget() + + itemN = QListWidgetItem() + # Create widget + widget = QWidget() + widgetText = QLabel("I love PyQt!") + widgetButton = QPushButton("Push Me") + widgetLayout = QHBoxLayout() + widgetLayout.addWidget(widgetText) + widgetLayout.addWidget(widgetButton) + widgetLayout.addStretch() + + widgetLayout.setSizeConstraint(QLayout.SetFixedSize) + widget.setLayout(widgetLayout) + itemN.setSizeHint(widget.sizeHint()) + + # Add widget to QListWidget funList + funList.addItem(itemN) + funList.setItemWidget(itemN, widget) + + funList.show() + + + def load_ui(self): + loader = QUiLoader() + path = os.fspath(Path(__file__).resolve().parent / "form.ui") + ui_file = QFile(path) + ui_file.open(QFile.ReadOnly) + loader.load(ui_file, self) + ui_file.close() + + +if __name__ == "__main__": + app = QApplication([]) + widget = MainWindow() + widget.show() + sys.exit(app.exec_()) diff --git a/src/__thrash/message_box_test.py b/src/__thrash/message_box_test.py new file mode 100644 index 0000000..0d45f27 --- /dev/null +++ b/src/__thrash/message_box_test.py @@ -0,0 +1,39 @@ +import sys + +from PySide6.QtWidgets import QApplication, QDialog, QMainWindow, QMessageBox, QPushButton + + +class MainWindow(QMainWindow): + def __init__(self): + super().__init__() + + self.setWindowTitle("My App") + + button = QPushButton("Press me for a dialog!") + button.clicked.connect(self.button_clicked) + self.setCentralWidget(button) + + def button_clicked(self, s): + + button = QMessageBox.critical( + self, + "Oh dear!", + "Something went very wrong.", + buttons=QMessageBox.Discard | QMessageBox.NoToAll | QMessageBox.Ignore, + defaultButton=QMessageBox.Discard, + ) + + if button == QMessageBox.Discard: + print("Discard!") + elif button == QMessageBox.NoToAll: + print("No to all!") + else: + print("Ignore!") + + +app = QApplication(sys.argv) + +window = MainWindow() +window.show() + +app.exec() \ No newline at end of file diff --git a/src/__thrash/new_window_test.py b/src/__thrash/new_window_test.py new file mode 100644 index 0000000..184a086 --- /dev/null +++ b/src/__thrash/new_window_test.py @@ -0,0 +1,43 @@ +from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel, QVBoxLayout, QWidget + +import sys + +from random import randint + + +class AnotherWindow(QWidget): + """ + This "window" is a QWidget. If it has no parent, it + will appear as a free-floating window as we want. + """ + def __init__(self): + super().__init__() + layout = QVBoxLayout() + self.label = QLabel("Another Window % d" % randint(0,100)) + layout.addWidget(self.label) + self.setLayout(layout) + + +class MainWindow(QMainWindow): + + def __init__(self): + super().__init__() + self.w = None # No external window yet. + self.button = QPushButton("Push for Window") + self.button.clicked.connect(self.show_new_window) + self.setCentralWidget(self.button) + + def show_new_window(self, checked): + if self.w is None: + self.w = AnotherWindow() + self.w.show() + + else: + self.w.close() # Close window. + self.w = None # Discard reference. + + +app = QApplication(sys.argv) +w = MainWindow() +w.show() +app.exec() \ No newline at end of file diff --git a/src/__thrash/output_parser_test.py b/src/__thrash/output_parser_test.py new file mode 100644 index 0000000..2c93f53 --- /dev/null +++ b/src/__thrash/output_parser_test.py @@ -0,0 +1,136 @@ +import subprocess, os, signal, time, shlex, sys, re + + +# def run_command(command): +# process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) +# while True: +# output = process.stdout.readline() +# if output == '' and process.poll() is not None: +# break +# # if 'one' in str(output): +# # print("MATCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") +# if output: +# print(output.strip()) + +# rc = process.poll() +# return rc + +# run_command("sudo -S tcpdump -i homebr0 proto 1 <<< C@rnival1") + + + + +# app = subprocess.Popen("journalctl -f", shell=True, stdout = subprocess.PIPE, universal_newlines = True) + +# while True: +# print(app.communicate()[0]) + +# invoke process +# command = 'sudo -S tcpdump -i homebr0 "proto 1" <<< C@rnival1' +# process = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE) + +# # Poll process.stdout to show stdout live +# while True: +# output = process.stdout.readline() +# print(output) +# if process.poll() is not None: +# break +# if output: +# print(output.strip()) +# rc = process.poll() + + +###################### + + + + +# command = shlex.split("ping -c 5 asdasdasdsad.com") + +# def oneDriveMonitor(command="onedrive --monitor"): + +# process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, universal_newlines=False) + +# # while True: +# while process.poll() == None: +# stdout = process.stdout.readline() +# try: +# stderr = process.stderr.readline() +# except: +# pass +# if stdout != '': +# if '1.1.1.1' in stdout: +# print('pinging one.one.one') +# if 'time' in stdout: +# print('# ' + stdout) +# else: +# print('@@ ' + stdout.strip()) + +# if stderr != '': +# if 'command not found' in stderr: +# print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") +# elif '--resync is required' in stderr: +# print(str(stderr) + " Starting resync.") +# # oneDriveMonitor("onedrive --monitor --resync") +# else: +# print('@@ERROR' + stderr) + + + # match line: + # case "1.1.1.1" in line: + # print(line) + + +# oneDriveMonitor() + + + +# else: +# break + + + +# output, err = process.communicate() +# print(output) + + + + + + +def oneDriveMonitor(command): + # command = "onedrive --monitor -v" + process = subprocess.Popen( command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True, + universal_newlines=True) + + + while process.poll() == None: + + if process.stdout: + stdout = process.stdout.readline() + + if 'Authorize this app visiting' in stdout: + self.show_login() + if 'time' in stdout: + print('# ' + stdout) + else: + print('@@ ' + stdout.strip()) + + + if process.stderr: + stderr = process.stderr.readline() + print('!!!!ERROR ' + stderr) + + if 'command not found' in stderr: + print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") + elif '--resync is required' in stderr: + print(stderr.decode() + " Starting resync.") + oneDriveMonitor("onedrive --monitor --resync") + else: + print('@@ERROR' + stderr) + + +oneDriveMonitor("onedrive --monitor") diff --git a/src/__thrash/re_test.py b/src/__thrash/re_test.py new file mode 100644 index 0000000..da63189 --- /dev/null +++ b/src/__thrash/re_test.py @@ -0,0 +1,58 @@ +import re + +file_path = '/home/bob/OneDrive/Python/One DriveGUI_POC/OneDri veGUI.spec' + +root_folder = re.search(r".+/([^/]+)/.+$", file_path) + +print(root_folder.group(1)) + + +# stdout = '# Uploading new file Hitchhiking _italy/New Folder/ui_s)(+ěš+ěčšř čýřý*&^&*(etting@#$%^&*s_qt5_$web-test.py ... done.' +# stdout = 'Uploading new file ./config ... done.' + +# file_operation = re.search(r'\b([Uploading|Downloading]+)*', stdout) +# file_path = re.search(r'^.*[a-zA-Z]+\s[a-zA-Z]+_([a-zA-Z]+( [a-zA-Z]+)+)/)[a-zA-Z]+\s\.+$', stdout) +# file_path = re.search(r'.*\b[file](.*)/[a-zA-Z0-9.-_]+\s+\.+$', stdout) +# file_name = re.search(r".*/([a-zA-Z0-9.-_]+)\s+\.+", stdout) + +# file_name = re.search(r".*/(.+)\s+\.\.\.", stdout) + + +# transfer_complete = 'done.' in stdout +# print(transfer_complete) + + +# file_path = re.search(r"\b[file]+\s(.+)\s+\.\.\.", stdout) +# print(file_path) +# print(file_path.group(1)) + + +# print("Operation is: " + file_operation.group(1)) +# # print("Path is: " + file_path.group(1)) +# # print(file_name) +# # print("Filename is: " + file_name.group(1)) +# print(transfer_complete) + + +# progress = re.search(r'\s([0-9]+)%', stdout) +# print(progress.group(1)) + +# # transfer_complete = progress.group(1) == '100' + +# # print(progress.group(1)) +# # print(transfer_complete) + +# # print("test") +# # matches = ['Downloading1 file', 'Downloading2 file', 'Uploading new file', 'Downloading new file'] +# # test = any(x in stdout for x in matches) +# # print(test) + + +# transfer_progress = { +# "file_operation": file_operation.group(1), +# "file_name": 'Resuming last file...' if file_name is None else file_name.group(1), +# # "progress": progress, +# "transfer_complete": transfer_complete +# } + +# print(transfer_progress) \ No newline at end of file diff --git a/src/__thrash/setup_wizard.py b/src/__thrash/setup_wizard.py new file mode 100644 index 0000000..e33f707 --- /dev/null +++ b/src/__thrash/setup_wizard.py @@ -0,0 +1,232 @@ +import subprocess +import re +import os +from configparser import ConfigParser + +from PySide6.QtGui import QPixmap, QIcon +from PySide6.QtCore import Property, Qt +from PySide6.QtWidgets import ( + QWizard, + QGridLayout, + QLineEdit, + QWizardPage, + QLabel, + QVBoxLayout, + QComboBox, + QApplication, + QCheckBox, + QPushButton, +) + +from OneDriveGUI import read_config + + +class SetupWizard(QWizard): + def __init__(self, parent=None): + super(SetupWizard, self).__init__(parent) + self.setWindowIcon(QIcon("resources/images/icons8-clouds-48.png")) + self.setPage(1, WizardPage_welcome(self)) + self.setPage(2, wizardPage_version_check(self)) + self.setPage(3, wizardPage_create_import(self)) + self.setPage(4, wizardPage_import(self)) + + self.setWindowTitle("OneDriveGUI Setup Wizard") + self.resize(640, 480) + + self.currentIdChanged.connect(self.on_page_change) + + def on_page_change(self): + if self.currentId() == 2: + print("Checking installed OneDrive version") + self.page(2).check_onedrive_version() + + +class WizardPage_welcome(QWizardPage): + def __init__(self, parent=None): + super(WizardPage_welcome, self).__init__(parent) + + self.setTitle("Welcome to OneDriveGUI") + # self.setSubTitle("SubTitle") + + # self.label1 = QLabel() + # self.label1.setText("Welcome to OneDriveGUI") + + self.label_2 = QLabel() + self.label_2.setText("This wizard will help you with initial OneDrive profile creation/import.") + + layout = QVBoxLayout() + # layout.addWidget(self.label1) + layout.addWidget(self.label_2) + self.setLayout(layout) + + + +class wizardPage_version_check(QWizardPage): + def __init__(self, parent=None): + super(wizardPage_version_check, self).__init__(parent) + self.setTitle("OneDrive version check") + + # self.label_3 = QLabel() + # self.label_3.setText("Installed OneDrive version:") + + self.label_4 = QLabel() + self.label_4.setText("Installed/Not Installed/ version") + + self.label_5 = QLabel() + self.label_5.setWordWrap(True) + self.label_5.setText( + "OneDrive Client for Linux does not seem to be installed. Please install it by following " \ + "instructions for your distro. " + ) + + layout = QVBoxLayout() + # layout.addWidget(self.label_3) + layout.addWidget(self.label_4) + layout.addWidget(self.label_5) + self.setLayout(layout) + + def check_onedrive_version(self): + # Check if OneDrive is installed + od_version_check = subprocess.check_output(["onedrive", "--version"]) + if "onedrive v" in str(od_version_check): + self.od_version = re.search(r".\s(v[0-9.]+)", str(od_version_check)).group(1) + print(f"OneDrive {self.od_version} detected.") + self.label_4.setText(f"OneDrive {self.od_version} detected.") + self.label_5.hide() + return True + else: + self.label_4.setText("OneDrive not detected.") + return False + + + +class wizardPage_create_import(QWizardPage): + def __init__(self, parent=None): + super(wizardPage_create_import, self).__init__(parent) + self.setTitle("Create/Import OneDrive profile") + + self.checkBox_create = QCheckBox() + self.checkBox_create.setText("Create new OneDrive profile") + self.checkBox_create.stateChanged.connect(self.on_checkbox_change) + + self.checkBox_import = QCheckBox() + self.checkBox_import.setText("Import existing OneDrive profile/config") + self.checkBox_import.stateChanged.connect(self.on_checkbox_change) + + layout = QVBoxLayout() + layout.addWidget(self.checkBox_create) + layout.addWidget(self.checkBox_import) + self.setLayout(layout) + + + def on_checkbox_change(self): + if self.checkBox_create.isChecked(): + print(f"Create new profile is checked") + self.checkBox_import.setDisabled(True) + # self.wizardPage_create_import.completeChanged() + + elif self.checkBox_import.isChecked(): + print(f"Import profile is checked") + self.checkBox_create.setDisabled(True) + # self.wizardPage_create_import.completeChanged() + + else: + print(f"No option is unchecked") + self.checkBox_import.setDisabled(False) + self.checkBox_create.setDisabled(False) + + +class wizardPage_import(QWizardPage): + def __init__(self, parent=None): + super(wizardPage_import, self).__init__(parent) + self.setTitle("Create/Import OneDrive profile") + + self.label_profile_name = QLabel() + self.label_profile_name.setText("Profile name") + + self.label_config_path = QLabel() + self.label_config_path.setText("Config fil path") + + + self.lineEdit_profile_name = QLineEdit() + self.lineEdit_profile_name.setPlaceholderText("E.g. john@live.com") + + self.lineEdit_config_path = QLineEdit() + self.lineEdit_config_path.setPlaceholderText("E.g. ~/.config/onedrive/config") + + + self.pushButton_import = QPushButton() + + + layout = QVBoxLayout() + layout.addWidget(self.label_profile_name) + layout.addWidget(self.label_config_path) + layout.addWidget(self.lineEdit_profile_name) + layout.addWidget(self.lineEdit_config_path) + layout.addWidget(self.pushButton_import) + self.setLayout(layout) + + def import_profile(self): + """ + Imports pre-existing OneDrive profile. + Loads default values firt, then overwrite them with user settings. + This is to handle cases where imported config contains only some properties. + """ + + profile_name = self.lineEdit_profile_name.text() + config_path = os.path.expanduser(self.lineEdit_config_path.text()) + + # Load all default values. + _default_od_config = read_config("resources/default_config") + default_od_config = _default_od_config._sections + + # Load user's settings. + _new_od_config = read_config(config_path) + new_od_config = _new_od_config._sections + + # Construct dict with user profile settings. + new_profile = {profile_name: {"config_file": config_path, "enable_debug": False, "mode": "monitor"}} + + # Load existing user profiles and add the new profile. + _profiles = ConfigParser() + _profiles.read(PROFILES_FILE) + _profiles[profile_name] = new_profile[profile_name] + + # Create profile config file if it does not exist. + profiles_dir = re.search(r"(.+)/profiles$", PROFILES_FILE).group(1) + if not os.path.exists(profiles_dir): + os.makedirs(profiles_dir) + + # Save the new profile. + with open(PROFILES_FILE, "w") as configfile: + _profiles.write(configfile) + + # Append OD config + new_profile[profile_name].update(default_od_config) + new_profile[profile_name].update(new_od_config) + + # Append new profile into running global profile + global_config.update(new_profile) + # print(new_profile) + # print(global_config) + + self.settings_window.listWidget_profiles.addItem(profile_name) + self.setting_page = ProfileSettingsPage(profile_name) + self.settings_window.stackedLayout.addWidget(self.setting_page) + + # Add status page widget for new profile + main_window.comboBox.addItem(profile_name) + main_window.profile_status_pages[profile_name] = ProfileStatusPage(profile_name) + main_window.stackedLayout.addWidget(main_window.profile_status_pages[profile_name]) + + # Hide "Create profile" push button from main windows. + main_window.pushButton_new_profile.hide() + + print(f"Account {profile_name} has been imported") + self.pushButton_import.setText("Done") + self.pushButton_import.setDisabled(True) + + + + + diff --git a/src/__thrash/system_tray.py b/src/__thrash/system_tray.py new file mode 100644 index 0000000..110d3b9 --- /dev/null +++ b/src/__thrash/system_tray.py @@ -0,0 +1,39 @@ +import sys +from PySide6.QtCore import * +from PySide6.QtGui import * +from PySide6.QtWidgets import * + + +class App: + def __init__(self): + # Create a Qt application + self.app = QApplication(sys.argv) + + icon = QIcon("icons8-clouds-48.png") + menu = QMenu() + settingAction = menu.addAction("setting") + settingAction.triggered.connect(self.setting) + exitAction = menu.addAction("exit") + exitAction.triggered.connect(sys.exit) + + self.tray = QSystemTrayIcon() + self.tray.setIcon(icon) + self.tray.setContextMenu(menu) + self.tray.show() + self.tray.setToolTip("unko!") + self.tray.showMessage("hoge", "moge") + self.tray.showMessage("fuga", "moge") + + def run(self): + # Enter Qt application main loop + self.app.exec_() + sys.exit() + + def setting(self): + self.dialog = QDialog() + self.dialog.setWindowTitle("Setting Dialog") + self.dialog.show() + +if __name__ == "__main__": + app = App() + app.run() \ No newline at end of file diff --git a/src/__thrash/test.py b/src/__thrash/test.py new file mode 100644 index 0000000..b356047 --- /dev/null +++ b/src/__thrash/test.py @@ -0,0 +1,13 @@ +import psutil + +def OneDriveStatus(): + for proc in psutil.process_iter(): + if proc.name().lower() == 'onedrive' and proc.status() != 'zombie': + print("OneDrive is running.") + return True + print("OneDrive is NOT running.") + return False + + + +OneDriveStatus() \ No newline at end of file diff --git a/src/__thrash/ui/settings-good-backup.ui b/src/__thrash/ui/settings-good-backup.ui new file mode 100644 index 0000000..00c0575 --- /dev/null +++ b/src/__thrash/ui/settings-good-backup.ui @@ -0,0 +1,223 @@ + + + Form + + + + 0 + 0 + 437 + 718 + + + + Form + + + + + + + + 0 + + + + Monitored Files + + + + + + + + Skip Hidden Files + + + + + + + Sync Folder: + + + + + + + + + + Browse + + + + + + + + + Skip files: + + + + + + + + + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + + + + + Skip directories: + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + + + Logging + + + + + + + + Enable Logging + + + + + + + Log location: + + + + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Page + + + + + Page + + + + + + + + + + + + Save + + + + + + + + + + diff --git a/src/__thrash/ui/settings2.ui b/src/__thrash/ui/settings2.ui new file mode 100644 index 0000000..24284c2 --- /dev/null +++ b/src/__thrash/ui/settings2.ui @@ -0,0 +1,236 @@ + + + settings_new + + + + 0 + 0 + 619 + 892 + + + + MainWindow + + + + + + + + + Save + + + + + + + + + + + 0 + + + + Monitored Files + + + + + + + + Skip Hidden Files + + + + + + + Sync Folder: + + + + + + + + + + Browse + + + + + + + + + Skip files: + + + + + + + + + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + + + + + Skip directories: + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + + + Logging + + + + + + + + Enable Logging + + + + + + + Log location: + + + + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Page + + + + + Page + + + + + + + + + + + + 0 + 0 + 619 + 19 + + + + + + + + diff --git a/src/__thrash/ui/settings_qt5_web-test.ui b/src/__thrash/ui/settings_qt5_web-test.ui new file mode 100644 index 0000000..632a9d2 --- /dev/null +++ b/src/__thrash/ui/settings_qt5_web-test.ui @@ -0,0 +1,245 @@ + + + Form + + + + 0 + 0 + 697 + 846 + + + + Form + + + + + + + + 3 + + + + Monitored Files + + + + + + + + Skip Hidden Files + + + + + + + Sync Folder: + + + + + + + + + + Browse + + + + + + + + + Skip files: + + + + + + + + + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + + + + + Skip directories: + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + + + Logging + + + + + + + + Enable Logging + + + + + + + Log location: + + + + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Page + + + + + Page + + + + + 30 + 150 + 611 + 461 + + + + + https://www.seznam.cz/ + + + + + + + + + + + + + + Save + + + + + + + + + + QWebEngineView + QWidget +
QtWebEngineWidgets/QWebEngineView
+
+
+ + +
diff --git a/src/__thrash/ui/settings_ui.py b/src/__thrash/ui/settings_ui.py new file mode 100644 index 0000000..054379b --- /dev/null +++ b/src/__thrash/ui/settings_ui.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settings.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, + QLabel, QLineEdit, QListWidget, QListWidgetItem, + QPushButton, QSizePolicy, QSpacerItem, QTabWidget, + QVBoxLayout, QWidget) + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(878, 1011) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_OneDriveGUI.py b/src/__thrash/ui/ui_OneDriveGUI.py new file mode 100644 index 0000000..988b6ee --- /dev/null +++ b/src/__thrash/ui/ui_OneDriveGUI.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'OneDriveGUIAnUifJ.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide2.QtCore import * +from PySide2.QtGui import * +from PySide2.QtWidgets import * + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + if not MainWindow.objectName(): + MainWindow.setObjectName(u"MainWindow") + MainWindow.resize(1115, 781) + self.centralwidget = QWidget(MainWindow) + self.centralwidget.setObjectName(u"centralwidget") + self.listView = QListView(self.centralwidget) + self.listView.setObjectName(u"listView") + self.listView.setGeometry(QRect(10, 70, 401, 531)) + self.pushButton = QPushButton(self.centralwidget) + self.pushButton.setObjectName(u"pushButton") + self.pushButton.setGeometry(QRect(20, 623, 101, 81)) + self.pushButton_2 = QPushButton(self.centralwidget) + self.pushButton_2.setObjectName(u"pushButton_2") + self.pushButton_2.setGeometry(QRect(150, 620, 101, 81)) + self.pushButton_3 = QPushButton(self.centralwidget) + self.pushButton_3.setObjectName(u"pushButton_3") + self.pushButton_3.setGeometry(QRect(290, 620, 101, 81)) + self.toolButton = QToolButton(self.centralwidget) + self.toolButton.setObjectName(u"toolButton") + self.toolButton.setGeometry(QRect(240, 640, 32, 33)) + self.toolButton_2 = QToolButton(self.centralwidget) + self.toolButton_2.setObjectName(u"toolButton_2") + self.toolButton_2.setGeometry(QRect(20, 20, 32, 33)) + self.label = QLabel(self.centralwidget) + self.label.setObjectName(u"label") + self.label.setGeometry(QRect(80, 20, 191, 31)) + self.frame = QFrame(self.centralwidget) + self.frame.setObjectName(u"frame") + self.frame.setGeometry(QRect(440, 10, 661, 721)) + self.frame.setFrameShape(QFrame.StyledPanel) + self.frame.setFrameShadow(QFrame.Raised) + self.tabWidget = QTabWidget(self.frame) + self.tabWidget.setObjectName(u"tabWidget") + self.tabWidget.setGeometry(QRect(20, 40, 621, 631)) + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.textEdit = QTextEdit(self.exemptions_tab) + self.textEdit.setObjectName(u"textEdit") + self.textEdit.setGeometry(QRect(40, 340, 501, 231)) + self.textEdit_2 = QTextEdit(self.exemptions_tab) + self.textEdit_2.setObjectName(u"textEdit_2") + self.textEdit_2.setGeometry(QRect(40, 50, 501, 241)) + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + self.label_4.setGeometry(QRect(40, 20, 58, 18)) + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + self.label_5.setGeometry(QRect(40, 310, 111, 18)) + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + self.checkBox.setGeometry(QRect(150, 30, 88, 22)) + self.label_2 = QLabel(self.logging_tab) + self.label_2.setObjectName(u"label_2") + self.label_2.setGeometry(QRect(30, 30, 101, 18)) + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + self.lineEdit.setGeometry(QRect(150, 60, 421, 32)) + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + self.label_3.setGeometry(QRect(30, 70, 101, 18)) + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + self.pushButton_4 = QPushButton(self.frame) + self.pushButton_4.setObjectName(u"pushButton_4") + self.pushButton_4.setGeometry(QRect(540, 680, 88, 34)) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QMenuBar(MainWindow) + self.menubar.setObjectName(u"menubar") + self.menubar.setGeometry(QRect(0, 0, 1115, 30)) + MainWindow.setMenuBar(self.menubar) + self.statusbar = QStatusBar(MainWindow) + self.statusbar.setObjectName(u"statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(MainWindow) + # setupUi + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) + self.pushButton.setText(QCoreApplication.translate("MainWindow", u"Open Folder", None)) + self.pushButton_2.setText(QCoreApplication.translate("MainWindow", u"Sync", None)) + self.pushButton_3.setText(QCoreApplication.translate("MainWindow", u"Settings", None)) + self.toolButton.setText(QCoreApplication.translate("MainWindow", u"...", None)) + self.toolButton_2.setText(QCoreApplication.translate("MainWindow", u"...", None)) + self.label.setText(QCoreApplication.translate("MainWindow", u"Status", None)) + self.label_4.setText(QCoreApplication.translate("MainWindow", u"Skip files:", None)) + self.label_5.setText(QCoreApplication.translate("MainWindow", u"Skip directories:", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("MainWindow", u"Exemptions", None)) + self.checkBox.setText("") + self.label_2.setText(QCoreApplication.translate("MainWindow", u"Enable logging:", None)) + self.label_3.setText(QCoreApplication.translate("MainWindow", u"Log location:", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("MainWindow", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("MainWindow", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("MainWindow", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("MainWindow", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings-good-backup.py b/src/__thrash/ui/ui_settings-good-backup.py new file mode 100644 index 0000000..31b648f --- /dev/null +++ b/src/__thrash/ui/ui_settings-good-backup.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settingsfQdOxi.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, + QLabel, QLineEdit, QListWidget, QListWidgetItem, + QPushButton, QSizePolicy, QSpacerItem, QTabWidget, + QVBoxLayout, QWidget) + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(437, 718) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings2.py b/src/__thrash/ui/ui_settings2.py new file mode 100644 index 0000000..a048186 --- /dev/null +++ b/src/__thrash/ui/ui_settings2.py @@ -0,0 +1,240 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settings2DclElV.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, + QLabel, QLineEdit, QListWidget, QListWidgetItem, + QMainWindow, QMenuBar, QPushButton, QSizePolicy, + QSpacerItem, QStatusBar, QTabWidget, QVBoxLayout, + QWidget) + +class Ui_settings_new(object): + def setupUi(self, settings_new): + if not settings_new.objectName(): + settings_new.setObjectName(u"settings_new") + settings_new.resize(619, 892) + self.centralwidget = QWidget(settings_new) + self.centralwidget.setObjectName(u"centralwidget") + self.verticalLayout_2 = QVBoxLayout(self.centralwidget) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(self.centralwidget) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(self.centralwidget) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + settings_new.setCentralWidget(self.centralwidget) + self.menubar = QMenuBar(settings_new) + self.menubar.setObjectName(u"menubar") + self.menubar.setGeometry(QRect(0, 0, 619, 19)) + settings_new.setMenuBar(self.menubar) + self.statusbar = QStatusBar(settings_new) + self.statusbar.setObjectName(u"statusbar") + settings_new.setStatusBar(self.statusbar) + + self.retranslateUi(settings_new) + + self.tabWidget.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(settings_new) + # setupUi + + def retranslateUi(self, settings_new): + settings_new.setWindowTitle(QCoreApplication.translate("settings_new", u"MainWindow", None)) + self.pushButton_4.setText(QCoreApplication.translate("settings_new", u"Save", None)) + self.checkBox_2.setText(QCoreApplication.translate("settings_new", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("settings_new", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("settings_new", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("settings_new", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("settings_new", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("settings_new", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("settings_new", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("settings_new", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("settings_new", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("settings_new", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("settings_new", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("settings_new", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("settings_new", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("settings_new", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("settings_new", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("settings_new", u"Page", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings_qt5_web-test.py b/src/__thrash/ui/ui_settings_qt5_web-test.py new file mode 100644 index 0000000..0b8a514 --- /dev/null +++ b/src/__thrash/ui/ui_settings_qt5_web-test.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settings_qt5_web-testdOxRon.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide2.QtCore import * +from PySide2.QtGui import * +from PySide2.QtWidgets import * + +from PySide2.QtWebEngineWidgets import QWebEngineView + + + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(697, 846) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.webEngineView = QWebEngineView(self.tab_4) + self.webEngineView.setObjectName(u"webEngineView") + self.webEngineView.setGeometry(QRect(30, 150, 611, 461)) + self.webEngineView.setUrl(QUrl(u"https://www.seznam.cz/")) + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(3) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui/ui_settings_web.py b/src/__thrash/ui/ui_settings_web.py new file mode 100644 index 0000000..8d75edd --- /dev/null +++ b/src/__thrash/ui/ui_settings_web.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'settingsHGXEPD.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import * +from PySide6.QtGui import * +from PySide6.QtWidgets import * + +from PySide6.QtWebEngineWidgets import QWebEngineView + + + +class Ui_Form(object): + def setupUi(self, Form): + if not Form.objectName(): + Form.setObjectName(u"Form") + Form.resize(647, 732) + self.verticalLayout_2 = QVBoxLayout(Form) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(Form) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab = QWidget() + self.exemptions_tab.setObjectName(u"exemptions_tab") + self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.checkBox_2 = QCheckBox(self.exemptions_tab) + self.checkBox_2.setObjectName(u"checkBox_2") + + self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) + + self.label = QLabel(self.exemptions_tab) + self.label.setObjectName(u"label") + + self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) + + self.lineEdit_4 = QLineEdit(self.exemptions_tab) + self.lineEdit_4.setObjectName(u"lineEdit_4") + + self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) + + self.pushButton = QPushButton(self.exemptions_tab) + self.pushButton.setObjectName(u"pushButton") + + self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_3) + + self.label_4 = QLabel(self.exemptions_tab) + self.label_4.setObjectName(u"label_4") + + self.verticalLayout_3.addWidget(self.label_4) + + self.gridLayout_2 = QGridLayout() + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.lineEdit_2 = QLineEdit(self.exemptions_tab) + self.lineEdit_2.setObjectName(u"lineEdit_2") + + self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) + + self.pushButton_6 = QPushButton(self.exemptions_tab) + self.pushButton_6.setObjectName(u"pushButton_6") + + self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) + + self.pushButton_5 = QPushButton(self.exemptions_tab) + self.pushButton_5.setObjectName(u"pushButton_5") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) + self.pushButton_5.setSizePolicy(sizePolicy) + + self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) + + self.listWidget = QListWidget(self.exemptions_tab) + self.listWidget.setObjectName(u"listWidget") + + self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout_2) + + self.label_5 = QLabel(self.exemptions_tab) + self.label_5.setObjectName(u"label_5") + + self.verticalLayout_3.addWidget(self.label_5) + + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_8 = QPushButton(self.exemptions_tab) + self.pushButton_8.setObjectName(u"pushButton_8") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) + self.pushButton_8.setSizePolicy(sizePolicy1) + + self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) + + self.listWidget_2 = QListWidget(self.exemptions_tab) + self.listWidget_2.setObjectName(u"listWidget_2") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) + self.listWidget_2.setSizePolicy(sizePolicy2) + + self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) + + self.lineEdit_3 = QLineEdit(self.exemptions_tab) + self.lineEdit_3.setObjectName(u"lineEdit_3") + + self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) + + self.pushButton_7 = QPushButton(self.exemptions_tab) + self.pushButton_7.setObjectName(u"pushButton_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) + self.pushButton_7.setSizePolicy(sizePolicy3) + + self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) + + + self.verticalLayout_3.addLayout(self.gridLayout) + + self.tabWidget.addTab(self.exemptions_tab, "") + self.logging_tab = QWidget() + self.logging_tab.setObjectName(u"logging_tab") + self.verticalLayout_4 = QVBoxLayout(self.logging_tab) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_4 = QGridLayout() + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.checkBox = QCheckBox(self.logging_tab) + self.checkBox.setObjectName(u"checkBox") + + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) + + self.label_3 = QLabel(self.logging_tab) + self.label_3.setObjectName(u"label_3") + + self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) + + self.lineEdit = QLineEdit(self.logging_tab) + self.lineEdit.setObjectName(u"lineEdit") + + self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) + + self.pushButton_2 = QPushButton(self.logging_tab) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) + + + self.verticalLayout_4.addLayout(self.gridLayout_4) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.tabWidget.addTab(self.logging_tab, "") + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.tabWidget.addTab(self.tab_3, "") + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.webEngineView = QWebEngineView(self.tab_4) + self.webEngineView.setObjectName(u"webEngineView") + self.webEngineView.setGeometry(QRect(10, 40, 611, 501)) + self.webEngineView.setUrl(QUrl(u"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite Files.ReadWrite.all Sites.Read.All Sites.ReadWrite.All offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient")) + self.tabWidget.addTab(self.tab_4, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_4 = QPushButton(Form) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.horizontalLayout.addWidget(self.pushButton_4) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(Form) + + self.tabWidget.setCurrentIndex(3) + + + QMetaObject.connectSlotsByName(Form) + # setupUi + + def retranslateUi(self, Form): + Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) + self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) + self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) + self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) + self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) + self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) + self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) + self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) + self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) + self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) + self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) + # retranslateUi + diff --git a/src/__thrash/ui_list_item_widget.py_ b/src/__thrash/ui_list_item_widget.py_ new file mode 100644 index 0000000..e2c4779 --- /dev/null +++ b/src/__thrash/ui_list_item_widget.py_ @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'list_item_widget.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QProgressBar, + QSizePolicy, QToolButton, QWidget) + +class Ui_list_item_widget(object): + def setupUi(self, list_item_widget): + if not list_item_widget.objectName(): + list_item_widget.setObjectName(u"list_item_widget") + list_item_widget.resize(426, 79) + list_item_widget.setMinimumSize(QSize(50, 60)) + self.gridLayout = QGridLayout(list_item_widget) + self.gridLayout.setObjectName(u"gridLayout") + self.toolButton = QToolButton(list_item_widget) + self.toolButton.setObjectName(u"toolButton") + self.toolButton.setEnabled(True) + self.toolButton.setMinimumSize(QSize(40, 65)) + self.toolButton.setAutoFillBackground(False) + icon = QIcon() + icon.addFile(u"../resources/images/icons8-clouds-48.png", QSize(), QIcon.Normal, QIcon.Off) + self.toolButton.setIcon(icon) + self.toolButton.setIconSize(QSize(50, 75)) + + self.gridLayout.addWidget(self.toolButton, 0, 0, 5, 1) + + self.ls_label_file_name = QLabel(list_item_widget) + self.ls_label_file_name.setObjectName(u"ls_label_file_name") + + self.gridLayout.addWidget(self.ls_label_file_name, 0, 1, 1, 1) + + self.ls_label_task = QLabel(list_item_widget) + self.ls_label_task.setObjectName(u"ls_label_task") + + self.gridLayout.addWidget(self.ls_label_task, 2, 1, 1, 1) + + self.ls_label_dir = QLabel(list_item_widget) + self.ls_label_dir.setObjectName(u"ls_label_dir") + + self.gridLayout.addWidget(self.ls_label_dir, 4, 1, 1, 1) + + self.ls_label_status = QLabel(list_item_widget) + self.ls_label_status.setObjectName(u"ls_label_status") + + self.gridLayout.addWidget(self.ls_label_status, 2, 2, 1, 1) + + self.ls_progressBar = QProgressBar(list_item_widget) + self.ls_progressBar.setObjectName(u"ls_progressBar") + self.ls_progressBar.setMaximumSize(QSize(16777215, 5)) + self.ls_progressBar.setValue(24) + self.ls_progressBar.setTextVisible(False) + + self.gridLayout.addWidget(self.ls_progressBar, 1, 1, 1, 2) + + + self.retranslateUi(list_item_widget) + + QMetaObject.connectSlotsByName(list_item_widget) + # setupUi + + def retranslateUi(self, list_item_widget): + list_item_widget.setWindowTitle(QCoreApplication.translate("list_item_widget", u"Form", None)) + self.toolButton.setText(QCoreApplication.translate("list_item_widget", u"...", None)) + self.ls_label_file_name.setText(QCoreApplication.translate("list_item_widget", u"FileName", None)) + self.ls_label_task.setText(QCoreApplication.translate("list_item_widget", u"Downloading/Uploading ", None)) + self.ls_label_dir.setText(QCoreApplication.translate("list_item_widget", u"Uploaded to Downloads", None)) + self.ls_label_status.setText(QCoreApplication.translate("list_item_widget", u"60KB of 100KB", None)) + # retranslateUi + diff --git a/src/__thrash/ui_setup_wizard.py b/src/__thrash/ui_setup_wizard.py new file mode 100644 index 0000000..92ac5ec --- /dev/null +++ b/src/__thrash/ui_setup_wizard.py @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'setup_wizard.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QCheckBox, QLabel, QLineEdit, + QPushButton, QSizePolicy, QWidget, QWizard, + QWizardPage) + +class Ui_SetupWizard(object): + def setupUi(self, SetupWizard): + if not SetupWizard.objectName(): + SetupWizard.setObjectName(u"SetupWizard") + SetupWizard.resize(640, 480) + SetupWizard.setMinimumSize(QSize(640, 480)) + SetupWizard.setMaximumSize(QSize(640, 480)) + SetupWizard.setWizardStyle(QWizard.ClassicStyle) + self.wizardPage_welcome = QWizardPage() + self.wizardPage_welcome.setObjectName(u"wizardPage_welcome") + self.label = QLabel(self.wizardPage_welcome) + self.label.setObjectName(u"label") + self.label.setGeometry(QRect(230, 80, 271, 18)) + self.label_2 = QLabel(self.wizardPage_welcome) + self.label_2.setObjectName(u"label_2") + self.label_2.setGeometry(QRect(110, 200, 441, 20)) + SetupWizard.setPage(1, self.wizardPage_welcome) + self.wizardPage_version_check = QWizardPage() + self.wizardPage_version_check.setObjectName(u"wizardPage_version_check") + self.label_3 = QLabel(self.wizardPage_version_check) + self.label_3.setObjectName(u"label_3") + self.label_3.setGeometry(QRect(20, 80, 171, 18)) + self.label_4 = QLabel(self.wizardPage_version_check) + self.label_4.setObjectName(u"label_4") + self.label_4.setGeometry(QRect(200, 80, 211, 18)) + self.label_5 = QLabel(self.wizardPage_version_check) + self.label_5.setObjectName(u"label_5") + self.label_5.setGeometry(QRect(10, 160, 531, 111)) + SetupWizard.setPage(2, self.wizardPage_version_check) + self.wizardPage_create_import = QWizardPage() + self.wizardPage_create_import.setObjectName(u"wizardPage_create_import") + self.label_6 = QLabel(self.wizardPage_create_import) + self.label_6.setObjectName(u"label_6") + self.label_6.setGeometry(QRect(30, 70, 481, 18)) + self.checkBox_create = QCheckBox(self.wizardPage_create_import) + self.checkBox_create.setObjectName(u"checkBox_create") + self.checkBox_create.setGeometry(QRect(30, 140, 171, 22)) + self.checkBox_import = QCheckBox(self.wizardPage_create_import) + self.checkBox_import.setObjectName(u"checkBox_import") + self.checkBox_import.setGeometry(QRect(30, 180, 251, 22)) + SetupWizard.setPage(3, self.wizardPage_create_import) + self.wizardPage_import = QWizardPage() + self.wizardPage_import.setObjectName(u"wizardPage_import") + self.label_7 = QLabel(self.wizardPage_import) + self.label_7.setObjectName(u"label_7") + self.label_7.setGeometry(QRect(30, 60, 291, 18)) + self.label_profile_name = QLabel(self.wizardPage_import) + self.label_profile_name.setObjectName(u"label_profile_name") + self.label_profile_name.setGeometry(QRect(7, 166, 107, 32)) +#if QT_CONFIG(tooltip) + self.label_profile_name.setToolTip(u"") +#endif // QT_CONFIG(tooltip) + self.label_profile_name.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + self.label_config_path = QLabel(self.wizardPage_import) + self.label_config_path.setObjectName(u"label_config_path") + self.label_config_path.setGeometry(QRect(7, 210, 107, 32)) +#if QT_CONFIG(tooltip) + self.label_config_path.setToolTip(u"") +#endif // QT_CONFIG(tooltip) + self.label_config_path.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + self.lineEdit_profile_name = QLineEdit(self.wizardPage_import) + self.lineEdit_profile_name.setObjectName(u"lineEdit_profile_name") + self.lineEdit_profile_name.setGeometry(QRect(120, 166, 308, 32)) + self.lineEdit_config_path = QLineEdit(self.wizardPage_import) + self.lineEdit_config_path.setObjectName(u"lineEdit_config_path") + self.lineEdit_config_path.setGeometry(QRect(120, 210, 308, 32)) + self.pushButton_import = QPushButton(self.wizardPage_import) + self.pushButton_import.setObjectName(u"pushButton_import") + self.pushButton_import.setGeometry(QRect(120, 310, 391, 34)) + SetupWizard.setPage(4, self.wizardPage_import) + self.wizardPage_create = QWizardPage() + self.wizardPage_create.setObjectName(u"wizardPage_create") + self.label_10 = QLabel(self.wizardPage_create) + self.label_10.setObjectName(u"label_10") + self.label_10.setGeometry(QRect(40, 70, 231, 18)) + self.lineEdit_sync_dir = QLineEdit(self.wizardPage_create) + self.lineEdit_sync_dir.setObjectName(u"lineEdit_sync_dir") + self.lineEdit_sync_dir.setGeometry(QRect(145, 219, 249, 32)) + self.lineEdit_new_profile_name = QLineEdit(self.wizardPage_create) + self.lineEdit_new_profile_name.setObjectName(u"lineEdit_new_profile_name") + self.lineEdit_new_profile_name.setGeometry(QRect(145, 180, 249, 32)) + self.label_new_profile_name = QLabel(self.wizardPage_create) + self.label_new_profile_name.setObjectName(u"label_new_profile_name") + self.label_new_profile_name.setGeometry(QRect(30, 180, 109, 32)) + self.label_sync_dir = QLabel(self.wizardPage_create) + self.label_sync_dir.setObjectName(u"label_sync_dir") + self.label_sync_dir.setGeometry(QRect(30, 219, 109, 32)) + self.pushButton_create = QPushButton(self.wizardPage_create) + self.pushButton_create.setObjectName(u"pushButton_create") + self.pushButton_create.setGeometry(QRect(170, 340, 351, 34)) + SetupWizard.setPage(5, self.wizardPage_create) + self.wizardPage_finish = QWizardPage() + self.wizardPage_finish.setObjectName(u"wizardPage_finish") + self.label_13 = QLabel(self.wizardPage_finish) + self.label_13.setObjectName(u"label_13") + self.label_13.setGeometry(QRect(20, 80, 591, 171)) + self.label_13.setWordWrap(True) + SetupWizard.setPage(6, self.wizardPage_finish) + + self.retranslateUi(SetupWizard) + + QMetaObject.connectSlotsByName(SetupWizard) + # setupUi + + def retranslateUi(self, SetupWizard): + SetupWizard.setWindowTitle(QCoreApplication.translate("SetupWizard", u"Wizard", None)) + self.label.setText(QCoreApplication.translate("SetupWizard", u"Welcome to OneDriveGUI", None)) + self.label_2.setText(QCoreApplication.translate("SetupWizard", u"This wizard will help you with initial OneDrive profile creation/import.", None)) + self.label_3.setText(QCoreApplication.translate("SetupWizard", u"Installed OneDrive version:", None)) + self.label_4.setText(QCoreApplication.translate("SetupWizard", u"Installed/Not Installed/ version", None)) + self.label_5.setText(QCoreApplication.translate("SetupWizard", u"

OneDrive Client for Linux does not seem to be installed.

Please install it by following instructions for your distro. 
", None)) + self.label_6.setText(QCoreApplication.translate("SetupWizard", u"Would you like to create a new OneDrive profile or import existing one?", None)) + self.checkBox_create.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) + self.checkBox_import.setText(QCoreApplication.translate("SetupWizard", u"Import existing profile/config. ", None)) + self.label_7.setText(QCoreApplication.translate("SetupWizard", u"Import existing profile/config", None)) + self.label_profile_name.setText(QCoreApplication.translate("SetupWizard", u"Profile Name", None)) + self.label_config_path.setText(QCoreApplication.translate("SetupWizard", u"Path to config file", None)) + self.lineEdit_profile_name.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. john@live.com", None)) + self.lineEdit_config_path.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. ~/.config/onedrive/config", None)) + self.pushButton_import.setText(QCoreApplication.translate("SetupWizard", u"Import profile", None)) + self.label_10.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) + self.lineEdit_sync_dir.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. ~/OneDrive_john@live.com/", None)) + self.lineEdit_new_profile_name.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. john@live.com", None)) + self.label_new_profile_name.setText(QCoreApplication.translate("SetupWizard", u"New profile name", None)) + self.label_sync_dir.setText(QCoreApplication.translate("SetupWizard", u"Sync directory", None)) + self.pushButton_create.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) + self.label_13.setText(QCoreApplication.translate("SetupWizard", u"

Your OneDrive profile has been created.


You can adjust advanced profile options if needed. Once you are happy with the profile settings, start sync with OneDrive. You will be automatically presented with a OneDrive login page if you have not logged on previously.

", None)) + # retranslateUi + diff --git a/src/__thrash/ui_wizardPage_welcome.py b/src/__thrash/ui_wizardPage_welcome.py new file mode 100644 index 0000000..a4d9dab --- /dev/null +++ b/src/__thrash/ui_wizardPage_welcome.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'wizardPage_welcome.ui' +## +## Created by: Qt User Interface Compiler version 6.2.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QLabel, QSizePolicy, QWidget, + QWizardPage) + +class Ui_WizardPage(object): + def setupUi(self, WizardPage): + if not WizardPage.objectName(): + WizardPage.setObjectName(u"WizardPage") + WizardPage.resize(628, 420) + self.label = QLabel(WizardPage) + self.label.setObjectName(u"label") + self.label.setGeometry(QRect(230, 160, 271, 18)) + self.label_2 = QLabel(WizardPage) + self.label_2.setObjectName(u"label_2") + self.label_2.setGeometry(QRect(110, 280, 441, 20)) + + self.retranslateUi(WizardPage) + + QMetaObject.connectSlotsByName(WizardPage) + # setupUi + + def retranslateUi(self, WizardPage): + WizardPage.setWindowTitle(QCoreApplication.translate("WizardPage", u"WizardPage", None)) + self.label.setText(QCoreApplication.translate("WizardPage", u"Welcome to OneDriveGUI", None)) + self.label_2.setText(QCoreApplication.translate("WizardPage", u"This wizard will help you with initial OneDrive profile creation/import.", None)) + # retranslateUi + diff --git a/src/__thrash/version2.py b/src/__thrash/version2.py new file mode 100644 index 0000000..8472f7f --- /dev/null +++ b/src/__thrash/version2.py @@ -0,0 +1,20 @@ +import sys +from PySide6.QtWidgets import QApplication, QMainWindow +from PySide6.QtCore import QFile +from ui.ui_mainwindow import Ui_MainWindow + +class MainWindow(QMainWindow): + def __init__(self): + super(MainWindow, self).__init__() + self.ui = Ui_MainWindow() + self.ui.setupUi(self) + + self.ui.label.setText("test text") + +if __name__ == "__main__": + app = QApplication(sys.argv) + + window = MainWindow() + window.show() + + sys.exit(app.exec()) \ No newline at end of file diff --git a/src/__thrash/wizardPage_welcome.ui b/src/__thrash/wizardPage_welcome.ui new file mode 100644 index 0000000..eed8899 --- /dev/null +++ b/src/__thrash/wizardPage_welcome.ui @@ -0,0 +1,45 @@ + + + WizardPage + + + + 0 + 0 + 628 + 420 + + + + WizardPage + + + + + 230 + 160 + 271 + 18 + + + + Welcome to OneDriveGUI + + + + + + 110 + 280 + 441 + 20 + + + + This wizard will help you with initial OneDrive profile creation/import. + + + + + + diff --git a/src/__thrash/wizard_test.py b/src/__thrash/wizard_test.py new file mode 100644 index 0000000..67c81d2 --- /dev/null +++ b/src/__thrash/wizard_test.py @@ -0,0 +1,81 @@ +from PySide6.QtGui import QPixmap, QIcon +from PySide6.QtCore import Property, Qt +from PySide6.QtWidgets import ( + QWizard, + QGridLayout, + QLineEdit, + QWizardPage, + QLabel, + QVBoxLayout, + QComboBox, + QApplication, +) + + +class QIComboBox(QComboBox): + def __init__(self, parent=None): + super(QIComboBox, self).__init__(parent) + + +class MagicWizard(QWizard): + def __init__(self, parent=None): + super(MagicWizard, self).__init__(parent) + self.addPage(WizardPage_welcome(self)) + self.addPage(wizardPage_version_check(self)) + self.setWindowTitle("OneDriveGUI Setup Wizard") + self.resize(640, 480) + self.setWindowIcon(QIcon("resources/images/icons8-clouds-48.png")) + + +class WizardPage_welcome(QWizardPage): + def __init__(self, parent=None): + super(WizardPage_welcome, self).__init__(parent) + self.setTitle("Welcome to OneDriveGUI") + # self.setSubTitle("SubTitle") + + # self.label1 = QLabel() + # self.label1.setText("Welcome to OneDriveGUI") + + self.label_2 = QLabel() + self.label_2.setText("This wizard will help you with initial OneDrive profile creation/import.") + + layout = QVBoxLayout() + # layout.addWidget(self.label1) + layout.addWidget(self.label_2) + self.setLayout(layout) + + +class wizardPage_version_check(QWizardPage): + def __init__(self, parent=None): + super(wizardPage_version_check, self).__init__(parent) + self.setTitle("OneDrive version check") + + # self.label_3 = QLabel() + # self.label_3.setText("Installed OneDrive version:") + + self.label_4 = QLabel() + self.label_4.setText("Installed/Not Installed/ version") + + self.label_5 = QLabel() + self.label_5.setWordWrap(True) + self.label_5.setText( + "OneDrive Client for Linux does not seem to be installed. Please install it by following " \ + "instructions for your distro. " + ) + + layout = QVBoxLayout() + # layout.addWidget(self.label_3) + layout.addWidget(self.label_4) + layout.addWidget(self.label_5) + self.setLayout(layout) + + + + +if __name__ == "__main__": + import sys + + app = QApplication(sys.argv) + wizard = MagicWizard() + wizard.show() + sys.exit(app.exec_()) diff --git a/src/__thrash/wizard_test2.py b/src/__thrash/wizard_test2.py new file mode 100644 index 0000000..4d8af46 --- /dev/null +++ b/src/__thrash/wizard_test2.py @@ -0,0 +1,95 @@ +from PySide6.QtCore import QImage +from PySide6.QtGui import QImage, QPixmap +from PySide6.QtCore import Property, QImage, QPixmap, Qt +from PySide6.QtWidgets import QWizard, QGridLayout, QPixmap, QLineEdit, QWizardPage, QLabel, QVBoxLayout, QgsProjectionSelectionTreeWidget + +icon_path = '/home/nyall/nr_logo.png' + +class ProjectWizard(QWizard): + + def __init__(self, parent=None): + super().__init__(parent) + + self.addPage(Page1(self)) + self.addPage(Page2(self)) + self.setWindowTitle("New Project") + + logo_image=QImage('path_to_logo.png') + self.setPixmap(QWizard.LogoPixmap, QPixmap.fromImage(logo_image)) + + self.setOption(QWizard.NoCancelButton, True) + self.setWindowFlags(self.windowFlags() | Qt.CustomizeWindowHint) + self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) + def reject(self): + pass + +class Page1(QWizardPage): + + def __init__(self, parent=None): + super().__init__(parent) + self.setTitle('General Properties') + self.setSubTitle('Enter general properties for this project.') + + # create some widgets + self.project_number_line_edit = QLineEdit() + self.project_title_line_edit = QLineEdit() + self.author_line_edit = QLineEdit() + + # set the page layout + layout = QGridLayout() + layout.addWidget(QLabel('Project Number'),0,0) + layout.addWidget(self.project_number_line_edit,0,1) + layout.addWidget(QLabel('Title'),1,0) + layout.addWidget(self.project_title_line_edit,1,1) + layout.addWidget(QLabel('Author'),2,0) + layout.addWidget(self.author_line_edit,2,1) + self.setLayout(layout) + + self.registerField('number*',self.project_number_line_edit) + self.registerField('title*',self.project_title_line_edit) + self.registerField('author*',self.author_line_edit) + + +class Page2(QWizardPage): + + def __init__(self, parent=None): + super().__init__(parent) + self.setTitle('Project Coordinate System') + self.setSubTitle('Choosing an appropriate projection is important to ensure accurate distance and area measurements.') + + self.proj_selector = QgsProjectionSelectionTreeWidget() + layout = QVBoxLayout() + layout.addWidget(self.proj_selector) + self.setLayout(layout) + + self.registerField('crs',self.proj_selector) + self.proj_selector.crsSelected.connect(self.crs_selected) + + def crs_selected(self): + self.setField('crs',self.proj_selector.crs()) + self.completeChanged.emit() + + def isComplete(self): + return self.proj_selector.crs().isValid() + + +def runNewProjectWizard(): + d=ProjectWizard() + d.exec() + + # Set the project crs + crs=d.field('crs') + QgsProject.instance().setCrs(crs) + + # Set the project title + title=d.field('title') + QgsProject.instance().setTitle(d.field('title')) + + # Create expression variables for the author and project number + number=d.field('number') + QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_number', number) + author=d.field('author') + QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_author', author) + + +iface.newProjectCreated.connect(runNewProjectWizard) \ No newline at end of file From 91386b165a51aac346dd95c4d1e9bd3b1571f859 Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Mon, 7 Feb 2022 17:40:21 +0100 Subject: [PATCH 09/12] fixed type in gitignore --- src/__thrash/OneDriveGUI-backup.py | 307 -------------------- src/__thrash/OneDriveGUI-bob-Manja.py | 262 ----------------- src/__thrash/config | 47 --- src/__thrash/dict_parser_test.py | 120 -------- src/__thrash/file_dialog_test.py | 50 ---- src/__thrash/form.ui | 22 -- src/__thrash/list_test.py | 106 ------- src/__thrash/mainwindow.py | 52 ---- src/__thrash/message_box_test.py | 39 --- src/__thrash/new_window_test.py | 43 --- src/__thrash/output_parser_test.py | 136 --------- src/__thrash/re_test.py | 58 ---- src/__thrash/setup_wizard.py | 232 --------------- src/__thrash/system_tray.py | 39 --- src/__thrash/test.py | 13 - src/__thrash/ui/settings-good-backup.ui | 223 -------------- src/__thrash/ui/settings2.ui | 236 --------------- src/__thrash/ui/settings_qt5_web-test.ui | 245 ---------------- src/__thrash/ui/settings_ui.py | 229 --------------- src/__thrash/ui/ui_OneDriveGUI.py | 127 -------- src/__thrash/ui/ui_settings-good-backup.py | 229 --------------- src/__thrash/ui/ui_settings2.py | 240 --------------- src/__thrash/ui/ui_settings_qt5_web-test.py | 229 --------------- src/__thrash/ui/ui_settings_web.py | 229 --------------- src/__thrash/ui_list_item_widget.py_ | 83 ------ src/__thrash/ui_setup_wizard.py | 150 ---------- src/__thrash/ui_wizardPage_welcome.py | 43 --- src/__thrash/version2.py | 20 -- src/__thrash/wizardPage_welcome.ui | 45 --- src/__thrash/wizard_test.py | 81 ------ src/__thrash/wizard_test2.py | 95 ------ 31 files changed, 4030 deletions(-) delete mode 100644 src/__thrash/OneDriveGUI-backup.py delete mode 100644 src/__thrash/OneDriveGUI-bob-Manja.py delete mode 100644 src/__thrash/config delete mode 100644 src/__thrash/dict_parser_test.py delete mode 100644 src/__thrash/file_dialog_test.py delete mode 100644 src/__thrash/form.ui delete mode 100644 src/__thrash/list_test.py delete mode 100644 src/__thrash/mainwindow.py delete mode 100644 src/__thrash/message_box_test.py delete mode 100644 src/__thrash/new_window_test.py delete mode 100644 src/__thrash/output_parser_test.py delete mode 100644 src/__thrash/re_test.py delete mode 100644 src/__thrash/setup_wizard.py delete mode 100644 src/__thrash/system_tray.py delete mode 100644 src/__thrash/test.py delete mode 100644 src/__thrash/ui/settings-good-backup.ui delete mode 100644 src/__thrash/ui/settings2.ui delete mode 100644 src/__thrash/ui/settings_qt5_web-test.ui delete mode 100644 src/__thrash/ui/settings_ui.py delete mode 100644 src/__thrash/ui/ui_OneDriveGUI.py delete mode 100644 src/__thrash/ui/ui_settings-good-backup.py delete mode 100644 src/__thrash/ui/ui_settings2.py delete mode 100644 src/__thrash/ui/ui_settings_qt5_web-test.py delete mode 100644 src/__thrash/ui/ui_settings_web.py delete mode 100644 src/__thrash/ui_list_item_widget.py_ delete mode 100644 src/__thrash/ui_setup_wizard.py delete mode 100644 src/__thrash/ui_wizardPage_welcome.py delete mode 100644 src/__thrash/version2.py delete mode 100644 src/__thrash/wizardPage_welcome.ui delete mode 100644 src/__thrash/wizard_test.py delete mode 100644 src/__thrash/wizard_test2.py diff --git a/src/__thrash/OneDriveGUI-backup.py b/src/__thrash/OneDriveGUI-backup.py deleted file mode 100644 index a882da4..0000000 --- a/src/__thrash/OneDriveGUI-backup.py +++ /dev/null @@ -1,307 +0,0 @@ -import sys, psutil, os, subprocess, signal -from configparser import ConfigParser - -from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) -from PySide6.QtGui import QIcon -from PySide6.QtCore import QTimer, QUrl - -from ui.ui_mainwindow import Ui_MainWindow -from ui.ui_settings import Ui_Form -from ui.ui_login import Ui_LoginWindow - -CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') - -class MainWindow(QMainWindow, Ui_MainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.setupUi(self) - - # Open Settings window - self.pushButton_3.clicked.connect(lambda: self.show_settings()) - - # Update OneDrive Status - self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) - - # Start OneDrive service - self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) - - # Stop OneDrive service - self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) - - # Restart OneDrive service - self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) - - # Start OneDrive monitoring - self.pushButton_5.clicked.connect(lambda: self.oneDriveMonitor('onedrive --monitor')) - - # Stop OneDrive monitoring - self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - - # Force OneDrive resync - # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - # - - # Open login form TODO: testing - self.pushButton_2.setText("login") - self.pushButton_2.clicked.connect(lambda: self.show_login()) - - - # Refresh Sync Status - self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) - self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) - - self.text_timer = QTimer() - self.text_timer.setSingleShot(False) - self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) - self.text_timer.start(1000) - - - - # System Tray - - self.tray = QSystemTrayIcon() - if self.tray.isSystemTrayAvailable(): - - icon = QIcon("icons8-clouds-48.png") - menu = QMenu() - - actionshow = menu.addAction("Show/Hide") - actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) - settingAction = menu.addAction("Settings") - settingAction.triggered.connect(self.show_settings) - quitAction = menu.addAction("Quit") - quitAction.triggered.connect(sys.exit) - - self.tray.setIcon(icon) - self.tray.setContextMenu(menu) - self.tray.show() - self.tray.setToolTip("This is OneDriveGUI") - # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") - else: - self.tray = None - - # Check OneDrive status - def oneDriveProcessStatus(self): - for onedrive_process in psutil.process_iter(): - if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': - # print("OneDrive is running.") - self.label_3.setText("running") - return True - # print("OneDrive is NOT running.") - self.label_3.setText("not running") - return False - - def oneDriveSyncStatus(self): - - status = subprocess.check_output(['onedrive', '--display-sync-status']) - if 'in sync' in str(status): - self.label_4.setText("In Sync") - return True - else: - self.label_4.setText("Out of Sync") - return False - - # def oneDriveMonitor(self, state): - # if state == 'start': - # self.onedrive_process = subprocess.Popen('onedrive --monitor -v', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) - # while True: - # onedrive_output = self.onedrive_process.communicate() - # print(onedrive_output) - # elif state == 'stop': - # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) - - - - # # def status_checker(): - # # timer = QTimer() - # # timer.setSingleShot(True) - # # timer.timeout.connect(status_checker) - # # timer.start(1000) - - # # status_checker() - - async def oneDriveMonitor(self, command): - self.onedrive_process = subprocess.Popen(command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=True, - universal_newlines=True) - - - while self.onedrive_process.poll() == None: - - if self.onedrive_process.stdout: - stdout = self.onedrive_process.stdout.readline() - - if 'Authorize this app visiting' in stdout: - # os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) - self.onedrive_process.kill() - self.show_login() - if 'time' in stdout: - print('# ' + stdout) - else: - print('@@ ' + stdout.strip()) - - - if self.onedrive_process.stderr: - stderr = self.onedrive_process.stderr.readline() - print('!!!!ERROR ' + stderr) - - if 'command not found' in stderr: - print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") - elif '--resync is required' in stderr: - print(stderr.decode() + " Starting resync.") - self.oneDriveMonitor("onedrive --monitor --resync") - else: - print('@@ERROR' + stderr) - - - - def show_login(self): - self.window1 = QWidget() - self.lw = Ui_LoginWindow() - self.lw.setupUi(self.window1) - self.window1.show() - - # use static URL for now. TODO: use auth files in the future - url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - self.lw.loginFrame.setUrl(QUrl(url)) - - # Wait for user to login and obtain response URL - self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) - - - def getResponseUrl(self, response_url): - if 'nativeclient?code=' in response_url: - os.system(f'onedrive --auth-response "{response_url}"') - print("Login performed") - else: - pass - - - - - - def show_settings(self): - self.window2 = QWidget() - self.ui = Ui_Form() - self.ui.setupUi(self.window2) - - self.window2.show() - - self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) - self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) - - self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) - self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) - - - skip_files = settings['onedrive']['skip_file'].strip('"').split('|') - self.ui.listWidget.addItems(skip_files) - self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) - self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) - self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) - - # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) - # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) - - - skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') - self.ui.listWidget_2.addItems(skip_dirs) - self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) - self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) - self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) - - # self.button2 = QtWidgets.QPushButton("save") - # self.pushButton_4.setText("save") - # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) - self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) - - # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - # self.ui.webEngineView.setUrl(QUrl(url)) - # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) - # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) - - # Rate limit - self.ui.lineEdit_5.setText(settings['onedrive']['rate_limit'].strip('"')) - self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s") - self.ui.lineEdit_5.textChanged.connect(lambda: settings.set('onedrive', 'rate_limit', f'"{self.ui.lineEdit_5.text()}"')) - self.ui.lineEdit_5.textChanged.connect(lambda: self.ui.label_6.setText(str(round(int(self.ui.lineEdit_5.text()) * 8 / 1024 / 1024, 2)) + " MiB/s")) - - - - - def add_item_to_Qlist(self, source_widget, destination_widget, list): - if source_widget.text() == "": - print("Inoring empty value.") - elif source_widget.text() in list: - print("Item already in exemption list.") - else: - list.append(source_widget.text()) - destination_widget.addItem(source_widget.text()) - - - - def remove_item_from_Qlist(self, QListWidget_name): - for item in QListWidget_name.selectedItems(): - print("Removing: " + item.text()) - items.remove(item.text()) - QListWidget_name.takeItem(QListWidget_name.row(item)) - - - - - - - -def read_config(config_file): - with open(config_file, 'r') as f: - config_string = '[onedrive]\n' + f.read() - - config = ConfigParser() - config.read_string(config_string) - - return config - - -def save_config(new_settings): - # config = ConfigParser() - # config.read_dict - - new_settings.write - print(new_settings) - print(new_settings['onedrive']['sync_dir']) - print('saved') - - # new_settings.set('onedrive', 'testoption', '"QQQQQ"') - - with open(CONFIG_FILE, 'w') as configfile: - new_settings.write(configfile) - - # remove first line (section) from config file - with open(CONFIG_FILE, 'r') as fin: - data = fin.read().splitlines(True) - with open(CONFIG_FILE, 'w') as fout: - fout.writelines(data[1:]) - - - config = ConfigParser() - config.read(new_settings) - # print(config['onedrive']['skip_dir']) - - - - - - - -if __name__ == "__main__": - settings = read_config(CONFIG_FILE) - - app = QApplication(sys.argv) - window = MainWindow() - - window.show() - app.exec() - - diff --git a/src/__thrash/OneDriveGUI-bob-Manja.py b/src/__thrash/OneDriveGUI-bob-Manja.py deleted file mode 100644 index d48aaee..0000000 --- a/src/__thrash/OneDriveGUI-bob-Manja.py +++ /dev/null @@ -1,262 +0,0 @@ -import sys, psutil, os, subprocess, signal -from configparser import ConfigParser - -from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QDialog) -from PySide6.QtGui import QIcon -from PySide6.QtCore import QTimer, QUrl - -from ui.ui_mainwindow import Ui_MainWindow -from ui.ui_settings import Ui_Form -from ui.ui_login import Ui_LoginWindow - -CONFIG_FILE = os.path.expanduser('~/.config/onedrive/config') - -class MainWindow(QMainWindow, Ui_MainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.setupUi(self) - - # Open Settings window - self.pushButton_3.clicked.connect(lambda: self.show_settings()) - - # Update OneDrive Status - self.pushButton_10.clicked.connect(lambda: self.oneDriveProcessStatus()) - - # Start OneDrive service - self.pushButton_4.clicked.connect(lambda: os.system('systemctl --user start onedrive')) - - # Stop OneDrive service - self.pushButton_7.clicked.connect(lambda: os.system('systemctl --user stop onedrive')) - - # Restart OneDrive service - self.pushButton_9.clicked.connect(lambda: os.system('systemctl --user restart onedrive')) - - # Start OneDrive monitoring - self.pushButton_5.clicked.connect(lambda: subprocess.Popen('onedrive --monitor', shell=True)) - - # Stop OneDrive monitoring - self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - - # Force OneDrive resync - # self.pushButton_6.clicked.connect(lambda: os.system('pkill onedrive')) - # - - # Open login form TODO: testing - self.pushButton_2.setText("login") - self.pushButton_2.clicked.connect(lambda: self.show_login()) - - - # Refresh Sync Status - self.pushButton_11.clicked.connect(lambda: self.label_4.setText("Retreiving status...")) - self.pushButton_11.clicked.connect(lambda: self.oneDriveSyncStatus()) - - self.text_timer = QTimer() - self.text_timer.setSingleShot(False) - self.text_timer.timeout.connect(lambda: self.oneDriveProcessStatus()) - self.text_timer.start(1000) - - - - # System Tray - - self.tray = QSystemTrayIcon() - if self.tray.isSystemTrayAvailable(): - - icon = QIcon("icons8-clouds-48.png") - menu = QMenu() - - actionshow = menu.addAction("Show/Hide") - actionshow.triggered.connect(lambda: self.hide() if self.isVisible() else self.show()) - settingAction = menu.addAction("Settings") - settingAction.triggered.connect(self.show_settings) - quitAction = menu.addAction("Quit") - quitAction.triggered.connect(sys.exit) - - self.tray.setIcon(icon) - self.tray.setContextMenu(menu) - self.tray.show() - self.tray.setToolTip("This is OneDriveGUI") - # self.tray.showMessage("OneDriveGUI", "OneDriveGUI started sucessfully.") - else: - self.tray = None - - # Check OneDrive status - def oneDriveProcessStatus(self): - for onedrive_process in psutil.process_iter(): - if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': - # print("OneDrive is running.") - self.label_3.setText("running") - return True - # print("OneDrive is NOT running.") - self.label_3.setText("not running") - return False - - def oneDriveSyncStatus(self): - - status = subprocess.check_output(['onedrive', '--display-sync-status']) - if 'in sync' in str(status): - self.label_4.setText("In Sync") - return True - else: - self.label_4.setText("Out of Sync") - return False - - def startOneDriveMonitor(self, state): - if state == 'start': - self.onedrive_process = subprocess.Popen('onedrive --monitor', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) - elif state == 'stop': - os.killpg(os.getpgid(self.onedrive_process.pid), signal.SIGTERM) - - - - # def status_checker(): - # timer = QTimer() - # timer.setSingleShot(True) - # timer.timeout.connect(status_checker) - # timer.start(1000) - - # status_checker() - - def show_login(self): - self.window1 = QWidget() - self.lw = Ui_LoginWindow() - self.lw.setupUi(self.window1) - self.window1.show() - - # use static URL for now. TODO: use auth files in the future - url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - self.lw.loginFrame.setUrl(QUrl(url)) - - # Wait for user to login and obtain response URL - self.lw.loginFrame.urlChanged.connect(lambda: self.getResponseUrl(self.lw.loginFrame.url().toString())) - - - def getResponseUrl(self, response_url): - if 'nativeclient?code=' in response_url: - os.system(f'onedrive --auth-response "{response_url}"') - print("Login performed") - else: - pass - - - - - - def show_settings(self): - self.window2 = QWidget() - self.ui = Ui_Form() - self.ui.setupUi(self.window2) - - self.window2.show() - - self.ui.lineEdit_4.setText(settings['onedrive']['sync_dir'].strip('"')) - self.ui.lineEdit_4.textChanged.connect(lambda: settings.set('onedrive', 'sync_dir', f'"{self.ui.lineEdit_4.text()}"')) - - self.ui.lineEdit.setText(settings['onedrive']['log_dir'].strip('"')) - self.ui.lineEdit.textChanged.connect(lambda: settings.set('onedrive', 'log_dir', f'"{self.ui.lineEdit.text()}"')) - - - skip_files = settings['onedrive']['skip_file'].strip('"').split('|') - self.ui.listWidget.addItems(skip_files) - self.ui.pushButton_6.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_2, self.ui.listWidget, skip_files)) - self.ui.pushButton_6.clicked.connect(lambda: settings.set('onedrive', 'skip_file', '"' + '|'.join(skip_files) + '"' )) - self.ui.pushButton_6.clicked.connect(self.ui.lineEdit_2.clear) - - # self.ui.listWidget.itemChanged.connect(lambda: print("something changed")) - # self.ui.listWidget.itemChanged.connect(lambda: settings.set('onedrive', 'skip_file', "|".join(skip_files))) - - - skip_dirs = settings['onedrive']['skip_dir'].strip('"').split('|') - self.ui.listWidget_2.addItems(skip_dirs) - self.ui.pushButton_7.clicked.connect(lambda: self.add_item_to_Qlist(self.ui.lineEdit_3, self.ui.listWidget_2, skip_dirs)) - self.ui.pushButton_7.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', '"' + '|'.join(skip_dirs) + '"' )) - self.ui.pushButton_7.clicked.connect(self.ui.lineEdit_3.clear) - - # self.button2 = QtWidgets.QPushButton("save") - # self.pushButton_4.setText("save") - # self.button2.clicked.connect(lambda: settings.set('onedrive', 'skip_dir', f'"{self.input.text()}"')) - self.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) - - # url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient' - # self.ui.webEngineView.setUrl(QUrl(url)) - # self.ui.webEngineView.urlChanged.connect(lambda: print("the url is")) - # self.ui.webEngineView.urlChanged.connect(lambda: print(str(self.ui.webEngineView.url().toString()))) - - - - - - def add_item_to_Qlist(self, source_widget, destination_widget, list): - if source_widget.text() == "": - print("Inoring empty value.") - elif source_widget.text() in list: - print("Item already in exemption list.") - else: - list.append(source_widget.text()) - destination_widget.addItem(source_widget.text()) - - - - def remove_item_from_Qlist(self, QListWidget_name): - for item in QListWidget_name.selectedItems(): - print("Removing: " + item.text()) - items.remove(item.text()) - QListWidget_name.takeItem(QListWidget_name.row(item)) - - - - - - - -def read_config(config_file): - with open(config_file, 'r') as f: - config_string = '[onedrive]\n' + f.read() - - config = ConfigParser() - config.read_string(config_string) - - return config - - -def save_config(new_settings): - # config = ConfigParser() - # config.read_dict - - new_settings.write - print(new_settings) - print(new_settings['onedrive']['sync_dir']) - print('saved') - - # new_settings.set('onedrive', 'testoption', '"QQQQQ"') - - with open(CONFIG_FILE, 'w') as configfile: - new_settings.write(configfile) - - # remove first line (section) from config file - with open(CONFIG_FILE, 'r') as fin: - data = fin.read().splitlines(True) - with open(CONFIG_FILE, 'w') as fout: - fout.writelines(data[1:]) - - - config = ConfigParser() - config.read(new_settings) - # print(config['onedrive']['skip_dir']) - - - - - - - -if __name__ == "__main__": - settings = read_config(CONFIG_FILE) - - app = QApplication(sys.argv) - window = MainWindow() - - window.show() - app.exec() - - diff --git a/src/__thrash/config b/src/__thrash/config deleted file mode 100644 index e1cc097..0000000 --- a/src/__thrash/config +++ /dev/null @@ -1,47 +0,0 @@ -sync_dir = ""~/OneDrive2"" -skip_file = "~*|.~*|*.tmp" -monitor_interval = "300" -skip_dir = "akjshdaskhdsakjh" -log_dir = "/var/log/onedrive/" -drive_id = "" -upload_only = "false" -check_nomount = "false" -check_nosync = "false" -download_only = "false" -disable_notifications = "false" -disable_upload_validation = "false" -enable_logging = ""true1"" -force_http_2 = "false" -local_first = "false" -no_remote_delete = "false" -skip_symlinks = "false" -debug_https = "false" -skip_dotfiles = "false" -dry_run = "false" -min_notify_changes = "5" -monitor_log_frequency = "5" -monitor_fullscan_frequency = "10" -sync_root_files = "false" -classify_as_big_delete = "1000" -user_agent = "" -remove_source_files = "false" -skip_dir_strict_match = "false" -application_id = "" -resync = "false" -bypass_data_preservation = "false" -azure_ad_endpoint = "" -azure_tenant_id = "common" -sync_business_shared_folders = "false" -sync_dir_permissions = "700" -sync_file_permissions = "600" -rate_limit = "131072" -webhook_enabled = "false" -webhook_public_url = "" -webhook_listening_host = "" -webhook_listening_port = "8888" -webhook_expiration_interval = "86400" -webhook_renewal_interval = "43200" -operation_timeout = "3600" -testoption = "QQQQQ" -testoption2 = "testvalueCC2a" - diff --git a/src/__thrash/dict_parser_test.py b/src/__thrash/dict_parser_test.py deleted file mode 100644 index e06fb1b..0000000 --- a/src/__thrash/dict_parser_test.py +++ /dev/null @@ -1,120 +0,0 @@ -from configparser import ConfigParser - -global_config = { - "boris@pozdena.eu": { - "config_file": "/home/bob/.config/onedrive/accounts/boris@pozdena.eu/config", - "enable_debug": "True", - "mode": "monitor", - "onedrive": { - "sync_dir": '"/home/bob/OneDrive/"', - "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe|.testfile"', - "monitor_interval": '"15"', - "skip_dir": '"__pycache__|env|venv"', - "log_dir": '"/var/log/onedrive/"', - "drive_id": '""', - "upload_only": '"false"', - "check_nomount": '"false"', - "check_nosync": '"false"', - "download_only": '"false"', - "disable_notifications": '"false"', - "disable_upload_validation": '"false"', - "enable_logging": '"false"', - "force_http_2": '"false"', - "local_first": '"false"', - "no_remote_delete": '"false"', - "skip_symlinks": '"false"', - "debug_https": '"false"', - "skip_dotfiles": '"false"', - "dry_run": '"false"', - "min_notify_changes": '"5"', - "monitor_log_frequency": '"5"', - "monitor_fullscan_frequency": '"1"', - "sync_root_files": '"false"', - "classify_as_big_delete": '"1000"', - "user_agent": '""', - "remove_source_files": '"false"', - "skip_dir_strict_match": '"false"', - "application_id": '""', - "resync": '"false"', - "bypass_data_preservation": '"false"', - "azure_ad_endpoint": '""', - "azure_tenant_id": '"common"', - "sync_business_shared_folders": '"false"', - "sync_dir_permissions": '"700"', - "sync_file_permissions": '"600"', - "rate_limit": '"185700000"', - "operation_timeout": '"3600"', - "webhook_enabled": '"false"', - "webhook_public_url": '""', - "webhook_listening_host": '""', - "webhook_listening_port": '"8888"', - "webhook_expiration_interval": '"86400"', - "webhook_renewal_interval": '"43200"', - }, - }, - "bpozdena@gmail.com": { - "config_file": "/home/bob/.config/onedrive/accounts/pozdenab@gmail.com/config", - "enable_debug": "True", - "mode": "monitor", - "onedrive": { - "sync_dir": '"~/OneDrive222"', - "skip_file": '"~*|.~*|*.tmp|*.txt|*.exe"', - "monitor_interval": '"15"', - "skip_dir": '"__pycache__|env|venv|ignore_filder"', - "log_dir": '"/var/log/onedrive/"', - "drive_id": '""', - "upload_only": '"false"', - "check_nomount": '"false"', - "check_nosync": '"false"', - "download_only": '"false"', - "disable_notifications": '"false"', - "disable_upload_validation": '"false"', - "enable_logging": '"false"', - "force_http_2": '"false"', - "local_first": '"false"', - "no_remote_delete": '"false"', - "skip_symlinks": '"false"', - "debug_https": '"false"', - "skip_dotfiles": '"false"', - "dry_run": '"false"', - "min_notify_changes": '"5"', - "monitor_log_frequency": '"5"', - "monitor_fullscan_frequency": '"1"', - "sync_root_files": '"false"', - "classify_as_big_delete": '"1000"', - "user_agent": '""', - "remove_source_files": '"false"', - "skip_dir_strict_match": '"false"', - "application_id": '""', - "resync": '"false"', - "bypass_data_preservation": '"false"', - "azure_ad_endpoint": '""', - "azure_tenant_id": '"common"', - "sync_business_shared_folders": '"false"', - "sync_dir_permissions": '"700"', - "sync_file_permissions": '"600"', - "rate_limit": '"185700000"', - "operation_timeout": '"3600"', - "webhook_enabled": '"false"', - "webhook_public_url": '""', - "webhook_listening_host": '""', - "webhook_listening_port": '"8888"', - "webhook_expiration_interval": '"86400"', - "webhook_renewal_interval": '"43200"', - }, - }, -} - - - -test = {} -test['onedrive'] = global_config['boris@pozdena.eu'] - -od_config = ConfigParser() - -print(test) - - -od_config.read_dict(test) - -print(od_config) \ No newline at end of file diff --git a/src/__thrash/file_dialog_test.py b/src/__thrash/file_dialog_test.py deleted file mode 100644 index 530f467..0000000 --- a/src/__thrash/file_dialog_test.py +++ /dev/null @@ -1,50 +0,0 @@ -import sys -from PySide6.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog -from PySide6.QtGui import QIcon - -class App(QWidget): - - def __init__(self): - super().__init__() - self.title = 'PyQt5 file dialogs - pythonspot.com' - self.left = 10 - self.top = 10 - self.width = 640 - self.height = 480 - self.initUI() - - def initUI(self): - self.setWindowTitle(self.title) - self.setGeometry(self.left, self.top, self.width, self.height) - - self.openFileNameDialog() - # self.openFileNamesDialog() - # self.saveFileDialog() - - self.show() - - def openFileNameDialog(self): - options = QFileDialog.Options() - options |= QFileDialog.DontUseNativeDialog - fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options) - if fileName: - print(fileName) - - # def openFileNamesDialog(self): - # options = QFileDialog.Options() - # options |= QFileDialog.DontUseNativeDialog - # files, _ = QFileDialog.getOpenFileNames(self,"QFileDialog.getOpenFileNames()", "","All Files (*);;Python Files (*.py)", options=options) - # if files: - # print(files) - - # def saveFileDialog(self): - # options = QFileDialog.Options() - # options |= QFileDialog.DontUseNativeDialog - # fileName, _ = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","All Files (*);;Text Files (*.txt)", options=options) - # if fileName: - # print(fileName) - -if __name__ == '__main__': - app = QApplication(sys.argv) - ex = App() - sys.exit(app.exec_()) diff --git a/src/__thrash/form.ui b/src/__thrash/form.ui deleted file mode 100644 index b232854..0000000 --- a/src/__thrash/form.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/src/__thrash/list_test.py b/src/__thrash/list_test.py deleted file mode 100644 index 78a7dbf..0000000 --- a/src/__thrash/list_test.py +++ /dev/null @@ -1,106 +0,0 @@ -import sys -from PySide6 import QtGui, QtCore -from PySide6.QtWidgets import * - - -class LayerObject(object): - - def __init__(self, **kwargs): - self.name = kwargs.get('name', '') - self.enabled = kwargs.get('enabled', False) - - -class LayerManager(QtGui.QWidget): - def __init__(self): - super(LayerManager, self).__init__() - self.resize(400, 300) - self.list_widget = QtGui.QListWidget() - main_layout = QtGui.QHBoxLayout(self) - main_layout.addWidget(self.list_widget) - self.add_layers() - - def add_layers(self): - layers = [ - LayerObject(name='Layer001', enabled=False), - LayerObject(name='Layer002', enabled=False), - LayerObject(name='Layer003', enabled=True), - LayerObject(name='Layer004', enabled=False), - LayerObject(name='Layer005', enabled=True), - LayerObject(name='Layer006', enabled=False), - LayerObject(name='Layer007', enabled=False), - LayerObject(name='Layer008', enabled=True), - LayerObject(name='Layer009', enabled=False), - LayerObject(name='Layer010', enabled=True) - ] - - for x in layers: - widget = LayerWidget(layer=x) - item = QtGui.QListWidgetItem() - self.list_widget.insertItem(self.list_widget.count(), item) - self.list_widget.setItemWidget(item, widget) - item.setSizeHint(widget.sizeHint()) - - - # properties - @property - def layer(self): - return self._layer - - @layer.setter - def layer(self, value): - self._layer== value - self.ui_layername.setText(value.name) - self.ui_enabled.setChecked(value.enabled) - - -class LayerManager(QWidget): - def __init__(self): - super(LayerManager, self).__init__() - self.resize(400, 300) - - # controls - self.ui_scroll = QWidget() - self.ui_scroll_layout = QtGui.QVBoxLayout() - self.ui_scroll.setLayout(self.ui_scroll_layout) - - self.ui_scroll_area = QtGui.QScrollArea() - self.ui_scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) - self.ui_scroll_area.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.ui_scroll_area.setWidgetResizable(True) - self.ui_scroll_area.setWidget(self.ui_scroll) - - main_layout = QtGui.QHBoxLayout() - main_layout.addWidget(self.ui_scroll_area) - self.setLayout(main_layout) - - - self.add_layers() - - def add_layers(self): - layers = [ - LayerObject(name='Layer001', enabled=False), - LayerObject(name='Layer002', enabled=False), - LayerObject(name='Layer003', enabled=True), - LayerObject(name='Layer004', enabled=False), - LayerObject(name='Layer005', enabled=True), - LayerObject(name='Layer006', enabled=False), - LayerObject(name='Layer007', enabled=False), - LayerObject(name='Layer008', enabled=True), - LayerObject(name='Layer009', enabled=False), - LayerObject(name='Layer010', enabled=True) - ] - - for x in layers: - widget = LayerWidget(layer=x) - self.ui_scroll_layout.addWidget(widget) - - -def main(): - app = QtGui.QApplication(sys.argv) - ex = LayerManager() - ex.show() - sys.exit(app.exec_()) - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/src/__thrash/mainwindow.py b/src/__thrash/mainwindow.py deleted file mode 100644 index e74898b..0000000 --- a/src/__thrash/mainwindow.py +++ /dev/null @@ -1,52 +0,0 @@ -# This Python file uses the following encoding: utf-8 -import os -from pathlib import Path -import sys - -from PySide6.QtWidgets import QApplication, QMainWindow, QListWidgetItem, QWidget, QLabel, QPushButton, QHBoxLayout, QLayout, QListWidget -from PySide6.QtCore import QFile -from PySide6.QtUiTools import QUiLoader - - -class MainWindow(QMainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.load_ui() - - funList = QListWidget() - - itemN = QListWidgetItem() - # Create widget - widget = QWidget() - widgetText = QLabel("I love PyQt!") - widgetButton = QPushButton("Push Me") - widgetLayout = QHBoxLayout() - widgetLayout.addWidget(widgetText) - widgetLayout.addWidget(widgetButton) - widgetLayout.addStretch() - - widgetLayout.setSizeConstraint(QLayout.SetFixedSize) - widget.setLayout(widgetLayout) - itemN.setSizeHint(widget.sizeHint()) - - # Add widget to QListWidget funList - funList.addItem(itemN) - funList.setItemWidget(itemN, widget) - - funList.show() - - - def load_ui(self): - loader = QUiLoader() - path = os.fspath(Path(__file__).resolve().parent / "form.ui") - ui_file = QFile(path) - ui_file.open(QFile.ReadOnly) - loader.load(ui_file, self) - ui_file.close() - - -if __name__ == "__main__": - app = QApplication([]) - widget = MainWindow() - widget.show() - sys.exit(app.exec_()) diff --git a/src/__thrash/message_box_test.py b/src/__thrash/message_box_test.py deleted file mode 100644 index 0d45f27..0000000 --- a/src/__thrash/message_box_test.py +++ /dev/null @@ -1,39 +0,0 @@ -import sys - -from PySide6.QtWidgets import QApplication, QDialog, QMainWindow, QMessageBox, QPushButton - - -class MainWindow(QMainWindow): - def __init__(self): - super().__init__() - - self.setWindowTitle("My App") - - button = QPushButton("Press me for a dialog!") - button.clicked.connect(self.button_clicked) - self.setCentralWidget(button) - - def button_clicked(self, s): - - button = QMessageBox.critical( - self, - "Oh dear!", - "Something went very wrong.", - buttons=QMessageBox.Discard | QMessageBox.NoToAll | QMessageBox.Ignore, - defaultButton=QMessageBox.Discard, - ) - - if button == QMessageBox.Discard: - print("Discard!") - elif button == QMessageBox.NoToAll: - print("No to all!") - else: - print("Ignore!") - - -app = QApplication(sys.argv) - -window = MainWindow() -window.show() - -app.exec() \ No newline at end of file diff --git a/src/__thrash/new_window_test.py b/src/__thrash/new_window_test.py deleted file mode 100644 index 184a086..0000000 --- a/src/__thrash/new_window_test.py +++ /dev/null @@ -1,43 +0,0 @@ -from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel, QVBoxLayout, QWidget - -import sys - -from random import randint - - -class AnotherWindow(QWidget): - """ - This "window" is a QWidget. If it has no parent, it - will appear as a free-floating window as we want. - """ - def __init__(self): - super().__init__() - layout = QVBoxLayout() - self.label = QLabel("Another Window % d" % randint(0,100)) - layout.addWidget(self.label) - self.setLayout(layout) - - -class MainWindow(QMainWindow): - - def __init__(self): - super().__init__() - self.w = None # No external window yet. - self.button = QPushButton("Push for Window") - self.button.clicked.connect(self.show_new_window) - self.setCentralWidget(self.button) - - def show_new_window(self, checked): - if self.w is None: - self.w = AnotherWindow() - self.w.show() - - else: - self.w.close() # Close window. - self.w = None # Discard reference. - - -app = QApplication(sys.argv) -w = MainWindow() -w.show() -app.exec() \ No newline at end of file diff --git a/src/__thrash/output_parser_test.py b/src/__thrash/output_parser_test.py deleted file mode 100644 index 2c93f53..0000000 --- a/src/__thrash/output_parser_test.py +++ /dev/null @@ -1,136 +0,0 @@ -import subprocess, os, signal, time, shlex, sys, re - - -# def run_command(command): -# process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) -# while True: -# output = process.stdout.readline() -# if output == '' and process.poll() is not None: -# break -# # if 'one' in str(output): -# # print("MATCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") -# if output: -# print(output.strip()) - -# rc = process.poll() -# return rc - -# run_command("sudo -S tcpdump -i homebr0 proto 1 <<< C@rnival1") - - - - -# app = subprocess.Popen("journalctl -f", shell=True, stdout = subprocess.PIPE, universal_newlines = True) - -# while True: -# print(app.communicate()[0]) - -# invoke process -# command = 'sudo -S tcpdump -i homebr0 "proto 1" <<< C@rnival1' -# process = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE) - -# # Poll process.stdout to show stdout live -# while True: -# output = process.stdout.readline() -# print(output) -# if process.poll() is not None: -# break -# if output: -# print(output.strip()) -# rc = process.poll() - - -###################### - - - - -# command = shlex.split("ping -c 5 asdasdasdsad.com") - -# def oneDriveMonitor(command="onedrive --monitor"): - -# process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, universal_newlines=False) - -# # while True: -# while process.poll() == None: -# stdout = process.stdout.readline() -# try: -# stderr = process.stderr.readline() -# except: -# pass -# if stdout != '': -# if '1.1.1.1' in stdout: -# print('pinging one.one.one') -# if 'time' in stdout: -# print('# ' + stdout) -# else: -# print('@@ ' + stdout.strip()) - -# if stderr != '': -# if 'command not found' in stderr: -# print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") -# elif '--resync is required' in stderr: -# print(str(stderr) + " Starting resync.") -# # oneDriveMonitor("onedrive --monitor --resync") -# else: -# print('@@ERROR' + stderr) - - - # match line: - # case "1.1.1.1" in line: - # print(line) - - -# oneDriveMonitor() - - - -# else: -# break - - - -# output, err = process.communicate() -# print(output) - - - - - - -def oneDriveMonitor(command): - # command = "onedrive --monitor -v" - process = subprocess.Popen( command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=True, - universal_newlines=True) - - - while process.poll() == None: - - if process.stdout: - stdout = process.stdout.readline() - - if 'Authorize this app visiting' in stdout: - self.show_login() - if 'time' in stdout: - print('# ' + stdout) - else: - print('@@ ' + stdout.strip()) - - - if process.stderr: - stderr = process.stderr.readline() - print('!!!!ERROR ' + stderr) - - if 'command not found' in stderr: - print("Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md ") - elif '--resync is required' in stderr: - print(stderr.decode() + " Starting resync.") - oneDriveMonitor("onedrive --monitor --resync") - else: - print('@@ERROR' + stderr) - - -oneDriveMonitor("onedrive --monitor") diff --git a/src/__thrash/re_test.py b/src/__thrash/re_test.py deleted file mode 100644 index da63189..0000000 --- a/src/__thrash/re_test.py +++ /dev/null @@ -1,58 +0,0 @@ -import re - -file_path = '/home/bob/OneDrive/Python/One DriveGUI_POC/OneDri veGUI.spec' - -root_folder = re.search(r".+/([^/]+)/.+$", file_path) - -print(root_folder.group(1)) - - -# stdout = '# Uploading new file Hitchhiking _italy/New Folder/ui_s)(+ěš+ěčšř čýřý*&^&*(etting@#$%^&*s_qt5_$web-test.py ... done.' -# stdout = 'Uploading new file ./config ... done.' - -# file_operation = re.search(r'\b([Uploading|Downloading]+)*', stdout) -# file_path = re.search(r'^.*[a-zA-Z]+\s[a-zA-Z]+_([a-zA-Z]+( [a-zA-Z]+)+)/)[a-zA-Z]+\s\.+$', stdout) -# file_path = re.search(r'.*\b[file](.*)/[a-zA-Z0-9.-_]+\s+\.+$', stdout) -# file_name = re.search(r".*/([a-zA-Z0-9.-_]+)\s+\.+", stdout) - -# file_name = re.search(r".*/(.+)\s+\.\.\.", stdout) - - -# transfer_complete = 'done.' in stdout -# print(transfer_complete) - - -# file_path = re.search(r"\b[file]+\s(.+)\s+\.\.\.", stdout) -# print(file_path) -# print(file_path.group(1)) - - -# print("Operation is: " + file_operation.group(1)) -# # print("Path is: " + file_path.group(1)) -# # print(file_name) -# # print("Filename is: " + file_name.group(1)) -# print(transfer_complete) - - -# progress = re.search(r'\s([0-9]+)%', stdout) -# print(progress.group(1)) - -# # transfer_complete = progress.group(1) == '100' - -# # print(progress.group(1)) -# # print(transfer_complete) - -# # print("test") -# # matches = ['Downloading1 file', 'Downloading2 file', 'Uploading new file', 'Downloading new file'] -# # test = any(x in stdout for x in matches) -# # print(test) - - -# transfer_progress = { -# "file_operation": file_operation.group(1), -# "file_name": 'Resuming last file...' if file_name is None else file_name.group(1), -# # "progress": progress, -# "transfer_complete": transfer_complete -# } - -# print(transfer_progress) \ No newline at end of file diff --git a/src/__thrash/setup_wizard.py b/src/__thrash/setup_wizard.py deleted file mode 100644 index e33f707..0000000 --- a/src/__thrash/setup_wizard.py +++ /dev/null @@ -1,232 +0,0 @@ -import subprocess -import re -import os -from configparser import ConfigParser - -from PySide6.QtGui import QPixmap, QIcon -from PySide6.QtCore import Property, Qt -from PySide6.QtWidgets import ( - QWizard, - QGridLayout, - QLineEdit, - QWizardPage, - QLabel, - QVBoxLayout, - QComboBox, - QApplication, - QCheckBox, - QPushButton, -) - -from OneDriveGUI import read_config - - -class SetupWizard(QWizard): - def __init__(self, parent=None): - super(SetupWizard, self).__init__(parent) - self.setWindowIcon(QIcon("resources/images/icons8-clouds-48.png")) - self.setPage(1, WizardPage_welcome(self)) - self.setPage(2, wizardPage_version_check(self)) - self.setPage(3, wizardPage_create_import(self)) - self.setPage(4, wizardPage_import(self)) - - self.setWindowTitle("OneDriveGUI Setup Wizard") - self.resize(640, 480) - - self.currentIdChanged.connect(self.on_page_change) - - def on_page_change(self): - if self.currentId() == 2: - print("Checking installed OneDrive version") - self.page(2).check_onedrive_version() - - -class WizardPage_welcome(QWizardPage): - def __init__(self, parent=None): - super(WizardPage_welcome, self).__init__(parent) - - self.setTitle("Welcome to OneDriveGUI") - # self.setSubTitle("SubTitle") - - # self.label1 = QLabel() - # self.label1.setText("Welcome to OneDriveGUI") - - self.label_2 = QLabel() - self.label_2.setText("This wizard will help you with initial OneDrive profile creation/import.") - - layout = QVBoxLayout() - # layout.addWidget(self.label1) - layout.addWidget(self.label_2) - self.setLayout(layout) - - - -class wizardPage_version_check(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_version_check, self).__init__(parent) - self.setTitle("OneDrive version check") - - # self.label_3 = QLabel() - # self.label_3.setText("Installed OneDrive version:") - - self.label_4 = QLabel() - self.label_4.setText("Installed/Not Installed/ version") - - self.label_5 = QLabel() - self.label_5.setWordWrap(True) - self.label_5.setText( - "OneDrive Client for Linux does not seem to be installed. Please install it by following " \ - "instructions for your distro. " - ) - - layout = QVBoxLayout() - # layout.addWidget(self.label_3) - layout.addWidget(self.label_4) - layout.addWidget(self.label_5) - self.setLayout(layout) - - def check_onedrive_version(self): - # Check if OneDrive is installed - od_version_check = subprocess.check_output(["onedrive", "--version"]) - if "onedrive v" in str(od_version_check): - self.od_version = re.search(r".\s(v[0-9.]+)", str(od_version_check)).group(1) - print(f"OneDrive {self.od_version} detected.") - self.label_4.setText(f"OneDrive {self.od_version} detected.") - self.label_5.hide() - return True - else: - self.label_4.setText("OneDrive not detected.") - return False - - - -class wizardPage_create_import(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_create_import, self).__init__(parent) - self.setTitle("Create/Import OneDrive profile") - - self.checkBox_create = QCheckBox() - self.checkBox_create.setText("Create new OneDrive profile") - self.checkBox_create.stateChanged.connect(self.on_checkbox_change) - - self.checkBox_import = QCheckBox() - self.checkBox_import.setText("Import existing OneDrive profile/config") - self.checkBox_import.stateChanged.connect(self.on_checkbox_change) - - layout = QVBoxLayout() - layout.addWidget(self.checkBox_create) - layout.addWidget(self.checkBox_import) - self.setLayout(layout) - - - def on_checkbox_change(self): - if self.checkBox_create.isChecked(): - print(f"Create new profile is checked") - self.checkBox_import.setDisabled(True) - # self.wizardPage_create_import.completeChanged() - - elif self.checkBox_import.isChecked(): - print(f"Import profile is checked") - self.checkBox_create.setDisabled(True) - # self.wizardPage_create_import.completeChanged() - - else: - print(f"No option is unchecked") - self.checkBox_import.setDisabled(False) - self.checkBox_create.setDisabled(False) - - -class wizardPage_import(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_import, self).__init__(parent) - self.setTitle("Create/Import OneDrive profile") - - self.label_profile_name = QLabel() - self.label_profile_name.setText("Profile name") - - self.label_config_path = QLabel() - self.label_config_path.setText("Config fil path") - - - self.lineEdit_profile_name = QLineEdit() - self.lineEdit_profile_name.setPlaceholderText("E.g. john@live.com") - - self.lineEdit_config_path = QLineEdit() - self.lineEdit_config_path.setPlaceholderText("E.g. ~/.config/onedrive/config") - - - self.pushButton_import = QPushButton() - - - layout = QVBoxLayout() - layout.addWidget(self.label_profile_name) - layout.addWidget(self.label_config_path) - layout.addWidget(self.lineEdit_profile_name) - layout.addWidget(self.lineEdit_config_path) - layout.addWidget(self.pushButton_import) - self.setLayout(layout) - - def import_profile(self): - """ - Imports pre-existing OneDrive profile. - Loads default values firt, then overwrite them with user settings. - This is to handle cases where imported config contains only some properties. - """ - - profile_name = self.lineEdit_profile_name.text() - config_path = os.path.expanduser(self.lineEdit_config_path.text()) - - # Load all default values. - _default_od_config = read_config("resources/default_config") - default_od_config = _default_od_config._sections - - # Load user's settings. - _new_od_config = read_config(config_path) - new_od_config = _new_od_config._sections - - # Construct dict with user profile settings. - new_profile = {profile_name: {"config_file": config_path, "enable_debug": False, "mode": "monitor"}} - - # Load existing user profiles and add the new profile. - _profiles = ConfigParser() - _profiles.read(PROFILES_FILE) - _profiles[profile_name] = new_profile[profile_name] - - # Create profile config file if it does not exist. - profiles_dir = re.search(r"(.+)/profiles$", PROFILES_FILE).group(1) - if not os.path.exists(profiles_dir): - os.makedirs(profiles_dir) - - # Save the new profile. - with open(PROFILES_FILE, "w") as configfile: - _profiles.write(configfile) - - # Append OD config - new_profile[profile_name].update(default_od_config) - new_profile[profile_name].update(new_od_config) - - # Append new profile into running global profile - global_config.update(new_profile) - # print(new_profile) - # print(global_config) - - self.settings_window.listWidget_profiles.addItem(profile_name) - self.setting_page = ProfileSettingsPage(profile_name) - self.settings_window.stackedLayout.addWidget(self.setting_page) - - # Add status page widget for new profile - main_window.comboBox.addItem(profile_name) - main_window.profile_status_pages[profile_name] = ProfileStatusPage(profile_name) - main_window.stackedLayout.addWidget(main_window.profile_status_pages[profile_name]) - - # Hide "Create profile" push button from main windows. - main_window.pushButton_new_profile.hide() - - print(f"Account {profile_name} has been imported") - self.pushButton_import.setText("Done") - self.pushButton_import.setDisabled(True) - - - - - diff --git a/src/__thrash/system_tray.py b/src/__thrash/system_tray.py deleted file mode 100644 index 110d3b9..0000000 --- a/src/__thrash/system_tray.py +++ /dev/null @@ -1,39 +0,0 @@ -import sys -from PySide6.QtCore import * -from PySide6.QtGui import * -from PySide6.QtWidgets import * - - -class App: - def __init__(self): - # Create a Qt application - self.app = QApplication(sys.argv) - - icon = QIcon("icons8-clouds-48.png") - menu = QMenu() - settingAction = menu.addAction("setting") - settingAction.triggered.connect(self.setting) - exitAction = menu.addAction("exit") - exitAction.triggered.connect(sys.exit) - - self.tray = QSystemTrayIcon() - self.tray.setIcon(icon) - self.tray.setContextMenu(menu) - self.tray.show() - self.tray.setToolTip("unko!") - self.tray.showMessage("hoge", "moge") - self.tray.showMessage("fuga", "moge") - - def run(self): - # Enter Qt application main loop - self.app.exec_() - sys.exit() - - def setting(self): - self.dialog = QDialog() - self.dialog.setWindowTitle("Setting Dialog") - self.dialog.show() - -if __name__ == "__main__": - app = App() - app.run() \ No newline at end of file diff --git a/src/__thrash/test.py b/src/__thrash/test.py deleted file mode 100644 index b356047..0000000 --- a/src/__thrash/test.py +++ /dev/null @@ -1,13 +0,0 @@ -import psutil - -def OneDriveStatus(): - for proc in psutil.process_iter(): - if proc.name().lower() == 'onedrive' and proc.status() != 'zombie': - print("OneDrive is running.") - return True - print("OneDrive is NOT running.") - return False - - - -OneDriveStatus() \ No newline at end of file diff --git a/src/__thrash/ui/settings-good-backup.ui b/src/__thrash/ui/settings-good-backup.ui deleted file mode 100644 index 00c0575..0000000 --- a/src/__thrash/ui/settings-good-backup.ui +++ /dev/null @@ -1,223 +0,0 @@ - - - Form - - - - 0 - 0 - 437 - 718 - - - - Form - - - - - - - - 0 - - - - Monitored Files - - - - - - - - Skip Hidden Files - - - - - - - Sync Folder: - - - - - - - - - - Browse - - - - - - - - - Skip files: - - - - - - - - - - - - Add - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - - - - - Skip directories: - - - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Add - - - - - - - - - - Logging - - - - - - - - Enable Logging - - - - - - - Log location: - - - - - - - - - - Browse - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Page - - - - - Page - - - - - - - - - - - - Save - - - - - - - - - - diff --git a/src/__thrash/ui/settings2.ui b/src/__thrash/ui/settings2.ui deleted file mode 100644 index 24284c2..0000000 --- a/src/__thrash/ui/settings2.ui +++ /dev/null @@ -1,236 +0,0 @@ - - - settings_new - - - - 0 - 0 - 619 - 892 - - - - MainWindow - - - - - - - - - Save - - - - - - - - - - - 0 - - - - Monitored Files - - - - - - - - Skip Hidden Files - - - - - - - Sync Folder: - - - - - - - - - - Browse - - - - - - - - - Skip files: - - - - - - - - - - - - Add - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - - - - - Skip directories: - - - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Add - - - - - - - - - - Logging - - - - - - - - Enable Logging - - - - - - - Log location: - - - - - - - - - - Browse - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Page - - - - - Page - - - - - - - - - - - - 0 - 0 - 619 - 19 - - - - - - - - diff --git a/src/__thrash/ui/settings_qt5_web-test.ui b/src/__thrash/ui/settings_qt5_web-test.ui deleted file mode 100644 index 632a9d2..0000000 --- a/src/__thrash/ui/settings_qt5_web-test.ui +++ /dev/null @@ -1,245 +0,0 @@ - - - Form - - - - 0 - 0 - 697 - 846 - - - - Form - - - - - - - - 3 - - - - Monitored Files - - - - - - - - Skip Hidden Files - - - - - - - Sync Folder: - - - - - - - - - - Browse - - - - - - - - - Skip files: - - - - - - - - - - - - Add - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - - - - - Skip directories: - - - - - - - - - - 0 - 0 - - - - Remove - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Add - - - - - - - - - - Logging - - - - - - - - Enable Logging - - - - - - - Log location: - - - - - - - - - - Browse - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Page - - - - - Page - - - - - 30 - 150 - 611 - 461 - - - - - https://www.seznam.cz/ - - - - - - - - - - - - - - Save - - - - - - - - - - QWebEngineView - QWidget -
QtWebEngineWidgets/QWebEngineView
-
-
- - -
diff --git a/src/__thrash/ui/settings_ui.py b/src/__thrash/ui/settings_ui.py deleted file mode 100644 index 054379b..0000000 --- a/src/__thrash/ui/settings_ui.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settings.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, - QLabel, QLineEdit, QListWidget, QListWidgetItem, - QPushButton, QSizePolicy, QSpacerItem, QTabWidget, - QVBoxLayout, QWidget) - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(878, 1011) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_OneDriveGUI.py b/src/__thrash/ui/ui_OneDriveGUI.py deleted file mode 100644 index 988b6ee..0000000 --- a/src/__thrash/ui/ui_OneDriveGUI.py +++ /dev/null @@ -1,127 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'OneDriveGUIAnUifJ.ui' -## -## Created by: Qt User Interface Compiler version 5.15.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide2.QtCore import * -from PySide2.QtGui import * -from PySide2.QtWidgets import * - - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - if not MainWindow.objectName(): - MainWindow.setObjectName(u"MainWindow") - MainWindow.resize(1115, 781) - self.centralwidget = QWidget(MainWindow) - self.centralwidget.setObjectName(u"centralwidget") - self.listView = QListView(self.centralwidget) - self.listView.setObjectName(u"listView") - self.listView.setGeometry(QRect(10, 70, 401, 531)) - self.pushButton = QPushButton(self.centralwidget) - self.pushButton.setObjectName(u"pushButton") - self.pushButton.setGeometry(QRect(20, 623, 101, 81)) - self.pushButton_2 = QPushButton(self.centralwidget) - self.pushButton_2.setObjectName(u"pushButton_2") - self.pushButton_2.setGeometry(QRect(150, 620, 101, 81)) - self.pushButton_3 = QPushButton(self.centralwidget) - self.pushButton_3.setObjectName(u"pushButton_3") - self.pushButton_3.setGeometry(QRect(290, 620, 101, 81)) - self.toolButton = QToolButton(self.centralwidget) - self.toolButton.setObjectName(u"toolButton") - self.toolButton.setGeometry(QRect(240, 640, 32, 33)) - self.toolButton_2 = QToolButton(self.centralwidget) - self.toolButton_2.setObjectName(u"toolButton_2") - self.toolButton_2.setGeometry(QRect(20, 20, 32, 33)) - self.label = QLabel(self.centralwidget) - self.label.setObjectName(u"label") - self.label.setGeometry(QRect(80, 20, 191, 31)) - self.frame = QFrame(self.centralwidget) - self.frame.setObjectName(u"frame") - self.frame.setGeometry(QRect(440, 10, 661, 721)) - self.frame.setFrameShape(QFrame.StyledPanel) - self.frame.setFrameShadow(QFrame.Raised) - self.tabWidget = QTabWidget(self.frame) - self.tabWidget.setObjectName(u"tabWidget") - self.tabWidget.setGeometry(QRect(20, 40, 621, 631)) - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.textEdit = QTextEdit(self.exemptions_tab) - self.textEdit.setObjectName(u"textEdit") - self.textEdit.setGeometry(QRect(40, 340, 501, 231)) - self.textEdit_2 = QTextEdit(self.exemptions_tab) - self.textEdit_2.setObjectName(u"textEdit_2") - self.textEdit_2.setGeometry(QRect(40, 50, 501, 241)) - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - self.label_4.setGeometry(QRect(40, 20, 58, 18)) - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - self.label_5.setGeometry(QRect(40, 310, 111, 18)) - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - self.checkBox.setGeometry(QRect(150, 30, 88, 22)) - self.label_2 = QLabel(self.logging_tab) - self.label_2.setObjectName(u"label_2") - self.label_2.setGeometry(QRect(30, 30, 101, 18)) - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - self.lineEdit.setGeometry(QRect(150, 60, 421, 32)) - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - self.label_3.setGeometry(QRect(30, 70, 101, 18)) - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - self.pushButton_4 = QPushButton(self.frame) - self.pushButton_4.setObjectName(u"pushButton_4") - self.pushButton_4.setGeometry(QRect(540, 680, 88, 34)) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QMenuBar(MainWindow) - self.menubar.setObjectName(u"menubar") - self.menubar.setGeometry(QRect(0, 0, 1115, 30)) - MainWindow.setMenuBar(self.menubar) - self.statusbar = QStatusBar(MainWindow) - self.statusbar.setObjectName(u"statusbar") - MainWindow.setStatusBar(self.statusbar) - - self.retranslateUi(MainWindow) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(MainWindow) - # setupUi - - def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) - self.pushButton.setText(QCoreApplication.translate("MainWindow", u"Open Folder", None)) - self.pushButton_2.setText(QCoreApplication.translate("MainWindow", u"Sync", None)) - self.pushButton_3.setText(QCoreApplication.translate("MainWindow", u"Settings", None)) - self.toolButton.setText(QCoreApplication.translate("MainWindow", u"...", None)) - self.toolButton_2.setText(QCoreApplication.translate("MainWindow", u"...", None)) - self.label.setText(QCoreApplication.translate("MainWindow", u"Status", None)) - self.label_4.setText(QCoreApplication.translate("MainWindow", u"Skip files:", None)) - self.label_5.setText(QCoreApplication.translate("MainWindow", u"Skip directories:", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("MainWindow", u"Exemptions", None)) - self.checkBox.setText("") - self.label_2.setText(QCoreApplication.translate("MainWindow", u"Enable logging:", None)) - self.label_3.setText(QCoreApplication.translate("MainWindow", u"Log location:", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("MainWindow", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("MainWindow", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("MainWindow", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("MainWindow", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings-good-backup.py b/src/__thrash/ui/ui_settings-good-backup.py deleted file mode 100644 index 31b648f..0000000 --- a/src/__thrash/ui/ui_settings-good-backup.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settingsfQdOxi.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, - QLabel, QLineEdit, QListWidget, QListWidgetItem, - QPushButton, QSizePolicy, QSpacerItem, QTabWidget, - QVBoxLayout, QWidget) - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(437, 718) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings2.py b/src/__thrash/ui/ui_settings2.py deleted file mode 100644 index a048186..0000000 --- a/src/__thrash/ui/ui_settings2.py +++ /dev/null @@ -1,240 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settings2DclElV.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, - QLabel, QLineEdit, QListWidget, QListWidgetItem, - QMainWindow, QMenuBar, QPushButton, QSizePolicy, - QSpacerItem, QStatusBar, QTabWidget, QVBoxLayout, - QWidget) - -class Ui_settings_new(object): - def setupUi(self, settings_new): - if not settings_new.objectName(): - settings_new.setObjectName(u"settings_new") - settings_new.resize(619, 892) - self.centralwidget = QWidget(settings_new) - self.centralwidget.setObjectName(u"centralwidget") - self.verticalLayout_2 = QVBoxLayout(self.centralwidget) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(self.centralwidget) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(self.centralwidget) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - settings_new.setCentralWidget(self.centralwidget) - self.menubar = QMenuBar(settings_new) - self.menubar.setObjectName(u"menubar") - self.menubar.setGeometry(QRect(0, 0, 619, 19)) - settings_new.setMenuBar(self.menubar) - self.statusbar = QStatusBar(settings_new) - self.statusbar.setObjectName(u"statusbar") - settings_new.setStatusBar(self.statusbar) - - self.retranslateUi(settings_new) - - self.tabWidget.setCurrentIndex(0) - - - QMetaObject.connectSlotsByName(settings_new) - # setupUi - - def retranslateUi(self, settings_new): - settings_new.setWindowTitle(QCoreApplication.translate("settings_new", u"MainWindow", None)) - self.pushButton_4.setText(QCoreApplication.translate("settings_new", u"Save", None)) - self.checkBox_2.setText(QCoreApplication.translate("settings_new", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("settings_new", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("settings_new", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("settings_new", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("settings_new", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("settings_new", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("settings_new", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("settings_new", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("settings_new", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("settings_new", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("settings_new", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("settings_new", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("settings_new", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("settings_new", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("settings_new", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("settings_new", u"Page", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings_qt5_web-test.py b/src/__thrash/ui/ui_settings_qt5_web-test.py deleted file mode 100644 index 0b8a514..0000000 --- a/src/__thrash/ui/ui_settings_qt5_web-test.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settings_qt5_web-testdOxRon.ui' -## -## Created by: Qt User Interface Compiler version 5.15.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide2.QtCore import * -from PySide2.QtGui import * -from PySide2.QtWidgets import * - -from PySide2.QtWebEngineWidgets import QWebEngineView - - - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(697, 846) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.webEngineView = QWebEngineView(self.tab_4) - self.webEngineView.setObjectName(u"webEngineView") - self.webEngineView.setGeometry(QRect(30, 150, 611, 461)) - self.webEngineView.setUrl(QUrl(u"https://www.seznam.cz/")) - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(3) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui/ui_settings_web.py b/src/__thrash/ui/ui_settings_web.py deleted file mode 100644 index 8d75edd..0000000 --- a/src/__thrash/ui/ui_settings_web.py +++ /dev/null @@ -1,229 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'settingsHGXEPD.ui' -## -## Created by: Qt User Interface Compiler version 5.15.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import * -from PySide6.QtGui import * -from PySide6.QtWidgets import * - -from PySide6.QtWebEngineWidgets import QWebEngineView - - - -class Ui_Form(object): - def setupUi(self, Form): - if not Form.objectName(): - Form.setObjectName(u"Form") - Form.resize(647, 732) - self.verticalLayout_2 = QVBoxLayout(Form) - self.verticalLayout_2.setObjectName(u"verticalLayout_2") - self.verticalLayout = QVBoxLayout() - self.verticalLayout.setObjectName(u"verticalLayout") - self.tabWidget = QTabWidget(Form) - self.tabWidget.setObjectName(u"tabWidget") - self.exemptions_tab = QWidget() - self.exemptions_tab.setObjectName(u"exemptions_tab") - self.verticalLayout_3 = QVBoxLayout(self.exemptions_tab) - self.verticalLayout_3.setObjectName(u"verticalLayout_3") - self.gridLayout_3 = QGridLayout() - self.gridLayout_3.setObjectName(u"gridLayout_3") - self.checkBox_2 = QCheckBox(self.exemptions_tab) - self.checkBox_2.setObjectName(u"checkBox_2") - - self.gridLayout_3.addWidget(self.checkBox_2, 1, 0, 1, 2) - - self.label = QLabel(self.exemptions_tab) - self.label.setObjectName(u"label") - - self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) - - self.lineEdit_4 = QLineEdit(self.exemptions_tab) - self.lineEdit_4.setObjectName(u"lineEdit_4") - - self.gridLayout_3.addWidget(self.lineEdit_4, 0, 1, 1, 1) - - self.pushButton = QPushButton(self.exemptions_tab) - self.pushButton.setObjectName(u"pushButton") - - self.gridLayout_3.addWidget(self.pushButton, 0, 2, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_3) - - self.label_4 = QLabel(self.exemptions_tab) - self.label_4.setObjectName(u"label_4") - - self.verticalLayout_3.addWidget(self.label_4) - - self.gridLayout_2 = QGridLayout() - self.gridLayout_2.setObjectName(u"gridLayout_2") - self.lineEdit_2 = QLineEdit(self.exemptions_tab) - self.lineEdit_2.setObjectName(u"lineEdit_2") - - self.gridLayout_2.addWidget(self.lineEdit_2, 1, 0, 1, 1) - - self.pushButton_6 = QPushButton(self.exemptions_tab) - self.pushButton_6.setObjectName(u"pushButton_6") - - self.gridLayout_2.addWidget(self.pushButton_6, 1, 1, 1, 1) - - self.pushButton_5 = QPushButton(self.exemptions_tab) - self.pushButton_5.setObjectName(u"pushButton_5") - sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) - self.pushButton_5.setSizePolicy(sizePolicy) - - self.gridLayout_2.addWidget(self.pushButton_5, 0, 1, 1, 1) - - self.listWidget = QListWidget(self.exemptions_tab) - self.listWidget.setObjectName(u"listWidget") - - self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout_2) - - self.label_5 = QLabel(self.exemptions_tab) - self.label_5.setObjectName(u"label_5") - - self.verticalLayout_3.addWidget(self.label_5) - - self.gridLayout = QGridLayout() - self.gridLayout.setObjectName(u"gridLayout") - self.pushButton_8 = QPushButton(self.exemptions_tab) - self.pushButton_8.setObjectName(u"pushButton_8") - sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) - sizePolicy1.setHorizontalStretch(0) - sizePolicy1.setVerticalStretch(0) - sizePolicy1.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) - self.pushButton_8.setSizePolicy(sizePolicy1) - - self.gridLayout.addWidget(self.pushButton_8, 0, 1, 1, 1) - - self.listWidget_2 = QListWidget(self.exemptions_tab) - self.listWidget_2.setObjectName(u"listWidget_2") - sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.listWidget_2.sizePolicy().hasHeightForWidth()) - self.listWidget_2.setSizePolicy(sizePolicy2) - - self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1) - - self.lineEdit_3 = QLineEdit(self.exemptions_tab) - self.lineEdit_3.setObjectName(u"lineEdit_3") - - self.gridLayout.addWidget(self.lineEdit_3, 1, 0, 1, 1) - - self.pushButton_7 = QPushButton(self.exemptions_tab) - self.pushButton_7.setObjectName(u"pushButton_7") - sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) - self.pushButton_7.setSizePolicy(sizePolicy3) - - self.gridLayout.addWidget(self.pushButton_7, 1, 1, 1, 1) - - - self.verticalLayout_3.addLayout(self.gridLayout) - - self.tabWidget.addTab(self.exemptions_tab, "") - self.logging_tab = QWidget() - self.logging_tab.setObjectName(u"logging_tab") - self.verticalLayout_4 = QVBoxLayout(self.logging_tab) - self.verticalLayout_4.setObjectName(u"verticalLayout_4") - self.gridLayout_4 = QGridLayout() - self.gridLayout_4.setObjectName(u"gridLayout_4") - self.checkBox = QCheckBox(self.logging_tab) - self.checkBox.setObjectName(u"checkBox") - - self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 2) - - self.label_3 = QLabel(self.logging_tab) - self.label_3.setObjectName(u"label_3") - - self.gridLayout_4.addWidget(self.label_3, 1, 0, 1, 1) - - self.lineEdit = QLineEdit(self.logging_tab) - self.lineEdit.setObjectName(u"lineEdit") - - self.gridLayout_4.addWidget(self.lineEdit, 1, 1, 1, 1) - - self.pushButton_2 = QPushButton(self.logging_tab) - self.pushButton_2.setObjectName(u"pushButton_2") - - self.gridLayout_4.addWidget(self.pushButton_2, 1, 2, 1, 1) - - - self.verticalLayout_4.addLayout(self.gridLayout_4) - - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) - - self.verticalLayout_4.addItem(self.verticalSpacer) - - self.tabWidget.addTab(self.logging_tab, "") - self.tab_3 = QWidget() - self.tab_3.setObjectName(u"tab_3") - self.tabWidget.addTab(self.tab_3, "") - self.tab_4 = QWidget() - self.tab_4.setObjectName(u"tab_4") - self.webEngineView = QWebEngineView(self.tab_4) - self.webEngineView.setObjectName(u"webEngineView") - self.webEngineView.setGeometry(QRect(10, 40, 611, 501)) - self.webEngineView.setUrl(QUrl(u"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite Files.ReadWrite.all Sites.Read.All Sites.ReadWrite.All offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient")) - self.tabWidget.addTab(self.tab_4, "") - - self.verticalLayout.addWidget(self.tabWidget) - - - self.verticalLayout_2.addLayout(self.verticalLayout) - - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.pushButton_4 = QPushButton(Form) - self.pushButton_4.setObjectName(u"pushButton_4") - - self.horizontalLayout.addWidget(self.pushButton_4) - - - self.verticalLayout_2.addLayout(self.horizontalLayout) - - - self.retranslateUi(Form) - - self.tabWidget.setCurrentIndex(3) - - - QMetaObject.connectSlotsByName(Form) - # setupUi - - def retranslateUi(self, Form): - Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None)) - self.checkBox_2.setText(QCoreApplication.translate("Form", u"Skip Hidden Files", None)) - self.label.setText(QCoreApplication.translate("Form", u"Sync Folder:", None)) - self.pushButton.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.label_4.setText(QCoreApplication.translate("Form", u"Skip files:", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Add", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"Skip directories:", None)) - self.pushButton_8.setText(QCoreApplication.translate("Form", u"Remove", None)) - self.pushButton_7.setText(QCoreApplication.translate("Form", u"Add", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab), QCoreApplication.translate("Form", u"Monitored Files", None)) - self.checkBox.setText(QCoreApplication.translate("Form", u"Enable Logging", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Log location:", None)) - self.pushButton_2.setText(QCoreApplication.translate("Form", u"Browse", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab), QCoreApplication.translate("Form", u"Logging", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Form", u"Page", None)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("Form", u"Page", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Save", None)) - # retranslateUi - diff --git a/src/__thrash/ui_list_item_widget.py_ b/src/__thrash/ui_list_item_widget.py_ deleted file mode 100644 index e2c4779..0000000 --- a/src/__thrash/ui_list_item_widget.py_ +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'list_item_widget.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QProgressBar, - QSizePolicy, QToolButton, QWidget) - -class Ui_list_item_widget(object): - def setupUi(self, list_item_widget): - if not list_item_widget.objectName(): - list_item_widget.setObjectName(u"list_item_widget") - list_item_widget.resize(426, 79) - list_item_widget.setMinimumSize(QSize(50, 60)) - self.gridLayout = QGridLayout(list_item_widget) - self.gridLayout.setObjectName(u"gridLayout") - self.toolButton = QToolButton(list_item_widget) - self.toolButton.setObjectName(u"toolButton") - self.toolButton.setEnabled(True) - self.toolButton.setMinimumSize(QSize(40, 65)) - self.toolButton.setAutoFillBackground(False) - icon = QIcon() - icon.addFile(u"../resources/images/icons8-clouds-48.png", QSize(), QIcon.Normal, QIcon.Off) - self.toolButton.setIcon(icon) - self.toolButton.setIconSize(QSize(50, 75)) - - self.gridLayout.addWidget(self.toolButton, 0, 0, 5, 1) - - self.ls_label_file_name = QLabel(list_item_widget) - self.ls_label_file_name.setObjectName(u"ls_label_file_name") - - self.gridLayout.addWidget(self.ls_label_file_name, 0, 1, 1, 1) - - self.ls_label_task = QLabel(list_item_widget) - self.ls_label_task.setObjectName(u"ls_label_task") - - self.gridLayout.addWidget(self.ls_label_task, 2, 1, 1, 1) - - self.ls_label_dir = QLabel(list_item_widget) - self.ls_label_dir.setObjectName(u"ls_label_dir") - - self.gridLayout.addWidget(self.ls_label_dir, 4, 1, 1, 1) - - self.ls_label_status = QLabel(list_item_widget) - self.ls_label_status.setObjectName(u"ls_label_status") - - self.gridLayout.addWidget(self.ls_label_status, 2, 2, 1, 1) - - self.ls_progressBar = QProgressBar(list_item_widget) - self.ls_progressBar.setObjectName(u"ls_progressBar") - self.ls_progressBar.setMaximumSize(QSize(16777215, 5)) - self.ls_progressBar.setValue(24) - self.ls_progressBar.setTextVisible(False) - - self.gridLayout.addWidget(self.ls_progressBar, 1, 1, 1, 2) - - - self.retranslateUi(list_item_widget) - - QMetaObject.connectSlotsByName(list_item_widget) - # setupUi - - def retranslateUi(self, list_item_widget): - list_item_widget.setWindowTitle(QCoreApplication.translate("list_item_widget", u"Form", None)) - self.toolButton.setText(QCoreApplication.translate("list_item_widget", u"...", None)) - self.ls_label_file_name.setText(QCoreApplication.translate("list_item_widget", u"FileName", None)) - self.ls_label_task.setText(QCoreApplication.translate("list_item_widget", u"Downloading/Uploading ", None)) - self.ls_label_dir.setText(QCoreApplication.translate("list_item_widget", u"Uploaded to Downloads", None)) - self.ls_label_status.setText(QCoreApplication.translate("list_item_widget", u"60KB of 100KB", None)) - # retranslateUi - diff --git a/src/__thrash/ui_setup_wizard.py b/src/__thrash/ui_setup_wizard.py deleted file mode 100644 index 92ac5ec..0000000 --- a/src/__thrash/ui_setup_wizard.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'setup_wizard.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QCheckBox, QLabel, QLineEdit, - QPushButton, QSizePolicy, QWidget, QWizard, - QWizardPage) - -class Ui_SetupWizard(object): - def setupUi(self, SetupWizard): - if not SetupWizard.objectName(): - SetupWizard.setObjectName(u"SetupWizard") - SetupWizard.resize(640, 480) - SetupWizard.setMinimumSize(QSize(640, 480)) - SetupWizard.setMaximumSize(QSize(640, 480)) - SetupWizard.setWizardStyle(QWizard.ClassicStyle) - self.wizardPage_welcome = QWizardPage() - self.wizardPage_welcome.setObjectName(u"wizardPage_welcome") - self.label = QLabel(self.wizardPage_welcome) - self.label.setObjectName(u"label") - self.label.setGeometry(QRect(230, 80, 271, 18)) - self.label_2 = QLabel(self.wizardPage_welcome) - self.label_2.setObjectName(u"label_2") - self.label_2.setGeometry(QRect(110, 200, 441, 20)) - SetupWizard.setPage(1, self.wizardPage_welcome) - self.wizardPage_version_check = QWizardPage() - self.wizardPage_version_check.setObjectName(u"wizardPage_version_check") - self.label_3 = QLabel(self.wizardPage_version_check) - self.label_3.setObjectName(u"label_3") - self.label_3.setGeometry(QRect(20, 80, 171, 18)) - self.label_4 = QLabel(self.wizardPage_version_check) - self.label_4.setObjectName(u"label_4") - self.label_4.setGeometry(QRect(200, 80, 211, 18)) - self.label_5 = QLabel(self.wizardPage_version_check) - self.label_5.setObjectName(u"label_5") - self.label_5.setGeometry(QRect(10, 160, 531, 111)) - SetupWizard.setPage(2, self.wizardPage_version_check) - self.wizardPage_create_import = QWizardPage() - self.wizardPage_create_import.setObjectName(u"wizardPage_create_import") - self.label_6 = QLabel(self.wizardPage_create_import) - self.label_6.setObjectName(u"label_6") - self.label_6.setGeometry(QRect(30, 70, 481, 18)) - self.checkBox_create = QCheckBox(self.wizardPage_create_import) - self.checkBox_create.setObjectName(u"checkBox_create") - self.checkBox_create.setGeometry(QRect(30, 140, 171, 22)) - self.checkBox_import = QCheckBox(self.wizardPage_create_import) - self.checkBox_import.setObjectName(u"checkBox_import") - self.checkBox_import.setGeometry(QRect(30, 180, 251, 22)) - SetupWizard.setPage(3, self.wizardPage_create_import) - self.wizardPage_import = QWizardPage() - self.wizardPage_import.setObjectName(u"wizardPage_import") - self.label_7 = QLabel(self.wizardPage_import) - self.label_7.setObjectName(u"label_7") - self.label_7.setGeometry(QRect(30, 60, 291, 18)) - self.label_profile_name = QLabel(self.wizardPage_import) - self.label_profile_name.setObjectName(u"label_profile_name") - self.label_profile_name.setGeometry(QRect(7, 166, 107, 32)) -#if QT_CONFIG(tooltip) - self.label_profile_name.setToolTip(u"") -#endif // QT_CONFIG(tooltip) - self.label_profile_name.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) - self.label_config_path = QLabel(self.wizardPage_import) - self.label_config_path.setObjectName(u"label_config_path") - self.label_config_path.setGeometry(QRect(7, 210, 107, 32)) -#if QT_CONFIG(tooltip) - self.label_config_path.setToolTip(u"") -#endif // QT_CONFIG(tooltip) - self.label_config_path.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) - self.lineEdit_profile_name = QLineEdit(self.wizardPage_import) - self.lineEdit_profile_name.setObjectName(u"lineEdit_profile_name") - self.lineEdit_profile_name.setGeometry(QRect(120, 166, 308, 32)) - self.lineEdit_config_path = QLineEdit(self.wizardPage_import) - self.lineEdit_config_path.setObjectName(u"lineEdit_config_path") - self.lineEdit_config_path.setGeometry(QRect(120, 210, 308, 32)) - self.pushButton_import = QPushButton(self.wizardPage_import) - self.pushButton_import.setObjectName(u"pushButton_import") - self.pushButton_import.setGeometry(QRect(120, 310, 391, 34)) - SetupWizard.setPage(4, self.wizardPage_import) - self.wizardPage_create = QWizardPage() - self.wizardPage_create.setObjectName(u"wizardPage_create") - self.label_10 = QLabel(self.wizardPage_create) - self.label_10.setObjectName(u"label_10") - self.label_10.setGeometry(QRect(40, 70, 231, 18)) - self.lineEdit_sync_dir = QLineEdit(self.wizardPage_create) - self.lineEdit_sync_dir.setObjectName(u"lineEdit_sync_dir") - self.lineEdit_sync_dir.setGeometry(QRect(145, 219, 249, 32)) - self.lineEdit_new_profile_name = QLineEdit(self.wizardPage_create) - self.lineEdit_new_profile_name.setObjectName(u"lineEdit_new_profile_name") - self.lineEdit_new_profile_name.setGeometry(QRect(145, 180, 249, 32)) - self.label_new_profile_name = QLabel(self.wizardPage_create) - self.label_new_profile_name.setObjectName(u"label_new_profile_name") - self.label_new_profile_name.setGeometry(QRect(30, 180, 109, 32)) - self.label_sync_dir = QLabel(self.wizardPage_create) - self.label_sync_dir.setObjectName(u"label_sync_dir") - self.label_sync_dir.setGeometry(QRect(30, 219, 109, 32)) - self.pushButton_create = QPushButton(self.wizardPage_create) - self.pushButton_create.setObjectName(u"pushButton_create") - self.pushButton_create.setGeometry(QRect(170, 340, 351, 34)) - SetupWizard.setPage(5, self.wizardPage_create) - self.wizardPage_finish = QWizardPage() - self.wizardPage_finish.setObjectName(u"wizardPage_finish") - self.label_13 = QLabel(self.wizardPage_finish) - self.label_13.setObjectName(u"label_13") - self.label_13.setGeometry(QRect(20, 80, 591, 171)) - self.label_13.setWordWrap(True) - SetupWizard.setPage(6, self.wizardPage_finish) - - self.retranslateUi(SetupWizard) - - QMetaObject.connectSlotsByName(SetupWizard) - # setupUi - - def retranslateUi(self, SetupWizard): - SetupWizard.setWindowTitle(QCoreApplication.translate("SetupWizard", u"Wizard", None)) - self.label.setText(QCoreApplication.translate("SetupWizard", u"Welcome to OneDriveGUI", None)) - self.label_2.setText(QCoreApplication.translate("SetupWizard", u"This wizard will help you with initial OneDrive profile creation/import.", None)) - self.label_3.setText(QCoreApplication.translate("SetupWizard", u"Installed OneDrive version:", None)) - self.label_4.setText(QCoreApplication.translate("SetupWizard", u"Installed/Not Installed/ version", None)) - self.label_5.setText(QCoreApplication.translate("SetupWizard", u"

OneDrive Client for Linux does not seem to be installed.

Please install it by following instructions for your distro. 
", None)) - self.label_6.setText(QCoreApplication.translate("SetupWizard", u"Would you like to create a new OneDrive profile or import existing one?", None)) - self.checkBox_create.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) - self.checkBox_import.setText(QCoreApplication.translate("SetupWizard", u"Import existing profile/config. ", None)) - self.label_7.setText(QCoreApplication.translate("SetupWizard", u"Import existing profile/config", None)) - self.label_profile_name.setText(QCoreApplication.translate("SetupWizard", u"Profile Name", None)) - self.label_config_path.setText(QCoreApplication.translate("SetupWizard", u"Path to config file", None)) - self.lineEdit_profile_name.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. john@live.com", None)) - self.lineEdit_config_path.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. ~/.config/onedrive/config", None)) - self.pushButton_import.setText(QCoreApplication.translate("SetupWizard", u"Import profile", None)) - self.label_10.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) - self.lineEdit_sync_dir.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. ~/OneDrive_john@live.com/", None)) - self.lineEdit_new_profile_name.setPlaceholderText(QCoreApplication.translate("SetupWizard", u"E.g. john@live.com", None)) - self.label_new_profile_name.setText(QCoreApplication.translate("SetupWizard", u"New profile name", None)) - self.label_sync_dir.setText(QCoreApplication.translate("SetupWizard", u"Sync directory", None)) - self.pushButton_create.setText(QCoreApplication.translate("SetupWizard", u"Create new profile", None)) - self.label_13.setText(QCoreApplication.translate("SetupWizard", u"

Your OneDrive profile has been created.


You can adjust advanced profile options if needed. Once you are happy with the profile settings, start sync with OneDrive. You will be automatically presented with a OneDrive login page if you have not logged on previously.

", None)) - # retranslateUi - diff --git a/src/__thrash/ui_wizardPage_welcome.py b/src/__thrash/ui_wizardPage_welcome.py deleted file mode 100644 index a4d9dab..0000000 --- a/src/__thrash/ui_wizardPage_welcome.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'wizardPage_welcome.ui' -## -## Created by: Qt User Interface Compiler version 6.2.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, - QMetaObject, QObject, QPoint, QRect, - QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, - QFont, QFontDatabase, QGradient, QIcon, - QImage, QKeySequence, QLinearGradient, QPainter, - QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QLabel, QSizePolicy, QWidget, - QWizardPage) - -class Ui_WizardPage(object): - def setupUi(self, WizardPage): - if not WizardPage.objectName(): - WizardPage.setObjectName(u"WizardPage") - WizardPage.resize(628, 420) - self.label = QLabel(WizardPage) - self.label.setObjectName(u"label") - self.label.setGeometry(QRect(230, 160, 271, 18)) - self.label_2 = QLabel(WizardPage) - self.label_2.setObjectName(u"label_2") - self.label_2.setGeometry(QRect(110, 280, 441, 20)) - - self.retranslateUi(WizardPage) - - QMetaObject.connectSlotsByName(WizardPage) - # setupUi - - def retranslateUi(self, WizardPage): - WizardPage.setWindowTitle(QCoreApplication.translate("WizardPage", u"WizardPage", None)) - self.label.setText(QCoreApplication.translate("WizardPage", u"Welcome to OneDriveGUI", None)) - self.label_2.setText(QCoreApplication.translate("WizardPage", u"This wizard will help you with initial OneDrive profile creation/import.", None)) - # retranslateUi - diff --git a/src/__thrash/version2.py b/src/__thrash/version2.py deleted file mode 100644 index 8472f7f..0000000 --- a/src/__thrash/version2.py +++ /dev/null @@ -1,20 +0,0 @@ -import sys -from PySide6.QtWidgets import QApplication, QMainWindow -from PySide6.QtCore import QFile -from ui.ui_mainwindow import Ui_MainWindow - -class MainWindow(QMainWindow): - def __init__(self): - super(MainWindow, self).__init__() - self.ui = Ui_MainWindow() - self.ui.setupUi(self) - - self.ui.label.setText("test text") - -if __name__ == "__main__": - app = QApplication(sys.argv) - - window = MainWindow() - window.show() - - sys.exit(app.exec()) \ No newline at end of file diff --git a/src/__thrash/wizardPage_welcome.ui b/src/__thrash/wizardPage_welcome.ui deleted file mode 100644 index eed8899..0000000 --- a/src/__thrash/wizardPage_welcome.ui +++ /dev/null @@ -1,45 +0,0 @@ - - - WizardPage - - - - 0 - 0 - 628 - 420 - - - - WizardPage - - - - - 230 - 160 - 271 - 18 - - - - Welcome to OneDriveGUI - - - - - - 110 - 280 - 441 - 20 - - - - This wizard will help you with initial OneDrive profile creation/import. - - - - - - diff --git a/src/__thrash/wizard_test.py b/src/__thrash/wizard_test.py deleted file mode 100644 index 67c81d2..0000000 --- a/src/__thrash/wizard_test.py +++ /dev/null @@ -1,81 +0,0 @@ -from PySide6.QtGui import QPixmap, QIcon -from PySide6.QtCore import Property, Qt -from PySide6.QtWidgets import ( - QWizard, - QGridLayout, - QLineEdit, - QWizardPage, - QLabel, - QVBoxLayout, - QComboBox, - QApplication, -) - - -class QIComboBox(QComboBox): - def __init__(self, parent=None): - super(QIComboBox, self).__init__(parent) - - -class MagicWizard(QWizard): - def __init__(self, parent=None): - super(MagicWizard, self).__init__(parent) - self.addPage(WizardPage_welcome(self)) - self.addPage(wizardPage_version_check(self)) - self.setWindowTitle("OneDriveGUI Setup Wizard") - self.resize(640, 480) - self.setWindowIcon(QIcon("resources/images/icons8-clouds-48.png")) - - -class WizardPage_welcome(QWizardPage): - def __init__(self, parent=None): - super(WizardPage_welcome, self).__init__(parent) - self.setTitle("Welcome to OneDriveGUI") - # self.setSubTitle("SubTitle") - - # self.label1 = QLabel() - # self.label1.setText("Welcome to OneDriveGUI") - - self.label_2 = QLabel() - self.label_2.setText("This wizard will help you with initial OneDrive profile creation/import.") - - layout = QVBoxLayout() - # layout.addWidget(self.label1) - layout.addWidget(self.label_2) - self.setLayout(layout) - - -class wizardPage_version_check(QWizardPage): - def __init__(self, parent=None): - super(wizardPage_version_check, self).__init__(parent) - self.setTitle("OneDrive version check") - - # self.label_3 = QLabel() - # self.label_3.setText("Installed OneDrive version:") - - self.label_4 = QLabel() - self.label_4.setText("Installed/Not Installed/ version") - - self.label_5 = QLabel() - self.label_5.setWordWrap(True) - self.label_5.setText( - "OneDrive Client for Linux does not seem to be installed. Please install it by following " \ - "instructions for your distro. " - ) - - layout = QVBoxLayout() - # layout.addWidget(self.label_3) - layout.addWidget(self.label_4) - layout.addWidget(self.label_5) - self.setLayout(layout) - - - - -if __name__ == "__main__": - import sys - - app = QApplication(sys.argv) - wizard = MagicWizard() - wizard.show() - sys.exit(app.exec_()) diff --git a/src/__thrash/wizard_test2.py b/src/__thrash/wizard_test2.py deleted file mode 100644 index 4d8af46..0000000 --- a/src/__thrash/wizard_test2.py +++ /dev/null @@ -1,95 +0,0 @@ -from PySide6.QtCore import QImage -from PySide6.QtGui import QImage, QPixmap -from PySide6.QtCore import Property, QImage, QPixmap, Qt -from PySide6.QtWidgets import QWizard, QGridLayout, QPixmap, QLineEdit, QWizardPage, QLabel, QVBoxLayout, QgsProjectionSelectionTreeWidget - -icon_path = '/home/nyall/nr_logo.png' - -class ProjectWizard(QWizard): - - def __init__(self, parent=None): - super().__init__(parent) - - self.addPage(Page1(self)) - self.addPage(Page2(self)) - self.setWindowTitle("New Project") - - logo_image=QImage('path_to_logo.png') - self.setPixmap(QWizard.LogoPixmap, QPixmap.fromImage(logo_image)) - - self.setOption(QWizard.NoCancelButton, True) - self.setWindowFlags(self.windowFlags() | Qt.CustomizeWindowHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - def reject(self): - pass - -class Page1(QWizardPage): - - def __init__(self, parent=None): - super().__init__(parent) - self.setTitle('General Properties') - self.setSubTitle('Enter general properties for this project.') - - # create some widgets - self.project_number_line_edit = QLineEdit() - self.project_title_line_edit = QLineEdit() - self.author_line_edit = QLineEdit() - - # set the page layout - layout = QGridLayout() - layout.addWidget(QLabel('Project Number'),0,0) - layout.addWidget(self.project_number_line_edit,0,1) - layout.addWidget(QLabel('Title'),1,0) - layout.addWidget(self.project_title_line_edit,1,1) - layout.addWidget(QLabel('Author'),2,0) - layout.addWidget(self.author_line_edit,2,1) - self.setLayout(layout) - - self.registerField('number*',self.project_number_line_edit) - self.registerField('title*',self.project_title_line_edit) - self.registerField('author*',self.author_line_edit) - - -class Page2(QWizardPage): - - def __init__(self, parent=None): - super().__init__(parent) - self.setTitle('Project Coordinate System') - self.setSubTitle('Choosing an appropriate projection is important to ensure accurate distance and area measurements.') - - self.proj_selector = QgsProjectionSelectionTreeWidget() - layout = QVBoxLayout() - layout.addWidget(self.proj_selector) - self.setLayout(layout) - - self.registerField('crs',self.proj_selector) - self.proj_selector.crsSelected.connect(self.crs_selected) - - def crs_selected(self): - self.setField('crs',self.proj_selector.crs()) - self.completeChanged.emit() - - def isComplete(self): - return self.proj_selector.crs().isValid() - - -def runNewProjectWizard(): - d=ProjectWizard() - d.exec() - - # Set the project crs - crs=d.field('crs') - QgsProject.instance().setCrs(crs) - - # Set the project title - title=d.field('title') - QgsProject.instance().setTitle(d.field('title')) - - # Create expression variables for the author and project number - number=d.field('number') - QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_number', number) - author=d.field('author') - QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(),'project_author', author) - - -iface.newProjectCreated.connect(runNewProjectWizard) \ No newline at end of file From ab855e8a2ca3b877857d554b05d8ba6491810e13 Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Mon, 7 Feb 2022 17:40:35 +0100 Subject: [PATCH 10/12] gitignore update --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bfcf15b..03f90c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ venv/ .qt_for_python/ -scr/__thrash/ +src/__thrash/ __pycache__/ From d90a62155d8abd79154c1fb95055e0755496dc55 Mon Sep 17 00:00:00 2001 From: Boris Pozdena Date: Thu, 10 Feb 2022 17:43:43 +0100 Subject: [PATCH 11/12] -added simple debug logging -improved logout behaviour -Updated readme file --- README.md | 42 +++- src/OneDriveGUI.desktop | 10 + src/OneDriveGUI.py | 254 +++++++++++++--------- src/resources/images/icons8-clouds-48.ico | Bin 0 -> 101913 bytes 4 files changed, 205 insertions(+), 101 deletions(-) create mode 100755 src/OneDriveGUI.desktop create mode 100644 src/resources/images/icons8-clouds-48.ico diff --git a/README.md b/README.md index 1d93bd1..536d473 100644 --- a/README.md +++ b/README.md @@ -1 +1,41 @@ -# OneDriveGUI \ No newline at end of file +# OneDriveGUI +A simple GUI for [abraunegg's OneDrive Linux client](https://github.com/abraunegg/onedrive) , with multi-account support. + +# Usecases +- Create new OneDrive profile or import pre-existing one. +- Perform configuration changes. +- Start/Stop OneDrive monitoring mode. +- Real-time file transfer monitoring (monitor-mode only). + +# Important notes +- This project is currently in alpha stage. +- Check for known [issues/limitations](https://github.com/bpozdena/OneDriveGUI/issues). +- Suggetions and bug reports are welcome. + + +# Installation steps + +1) Ensure [OneDrive for Linux](https://abraunegg.github.io/) is instelled based on [instructions](https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md) for your distro. +1) Ensure Python3 and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your system. +1) Clone or download content this repository. +1) (Optional) Create and activate a Python virtual environment: + ```sh + python -m venv venv + source venv/bin/activate + ``` +1) Install dependencies: + ```sh + python -m pip install -r requirements.txt + ``` + +1) Start OneDrive GUI: + ```sh + cd OneDriveGUI/ + python OneDriveGUI.py + ``` + + Optionaly, you can detach the GUI from terminal by using the bellow command: + ```sh + nohup python OneDriveGUI.py > /dev/null 2>&1& + ``` + diff --git a/src/OneDriveGUI.desktop b/src/OneDriveGUI.desktop new file mode 100755 index 0000000..6875068 --- /dev/null +++ b/src/OneDriveGUI.desktop @@ -0,0 +1,10 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Name=OneDriveGUI +Version=v0.2.0 +Icon=icons8-clouds-48 +X-Icon-Path=/home/bob/OneDrive/Python/OneDriveGUI/src/resources/images/icons8-clouds-48.ico +Exec=python /home/bob/OneDrive/Python/OneDriveGUI/src/OneDriveGUI.py +Terminal=false +Type=Application +StartupNotify=true diff --git a/src/OneDriveGUI.py b/src/OneDriveGUI.py index a36e134..8eeb4d9 100644 --- a/src/OneDriveGUI.py +++ b/src/OneDriveGUI.py @@ -5,6 +5,8 @@ import os import re import subprocess import sys +import logging +import logging.handlers as handlers from configparser import ConfigParser from PySide6.QtCore import QThread, QTimer, QUrl, Signal, QFileInfo, Qt, QDir @@ -33,7 +35,6 @@ from PySide6.QtWidgets import ( ) # TODO: Split into multiple files once all main features are implemented. - # Import for login window. from ui.ui_login import Ui_LoginWindow @@ -56,6 +57,19 @@ from ui.ui_create_new_profile import Ui_create_new_profile PROFILES_FILE = os.path.expanduser("~/.config/onedrive-gui/profiles") +# Logging +# dir_path = os.path.dirname(os.path.realpath(__file__)) +log_path = os.path.expanduser("~/.config/onedrive-gui/onedrivegui.log") +# file_handler = logging.FileHandler(filename=log_path) +timed_handler = handlers.TimedRotatingFileHandler(filename=log_path, when='D', interval=1, backupCount=2) +stdout_handler = logging.StreamHandler(sys.stdout) +handlers = [timed_handler, stdout_handler] + +logging.basicConfig( + format="%(asctime)s - %(levelname)s - %(message)s", + handlers=handlers, + level=logging.DEBUG, +) class SetupWizard(QWizard): def __init__(self, parent=None): @@ -78,7 +92,7 @@ class SetupWizard(QWizard): def on_page_change(self): if self.currentId() == 2: - print("Checking installed OneDrive version") + logging.info("Checking installed OneDrive version") self.page(2).check_onedrive_version() def nextId(self): @@ -129,7 +143,6 @@ class wizardPage_version_check(QWizardPage): self.label_4 = QLabel() self.label_4.setText("Installed/Not Installed/ version") - self.label_5 = QLabel() self.label_5.setWordWrap(True) self.label_5.setStyleSheet("color: red;") @@ -146,19 +159,35 @@ class wizardPage_version_check(QWizardPage): def check_onedrive_version(self): # Check if OneDrive is installed - od_version_check = subprocess.check_output(["onedrive", "--version"]) - if "onedrive v" in str(od_version_check): - self.od_version = re.search(r".\s(v[0-9.]+)", str(od_version_check)).group(1) - print(f"OneDrive {self.od_version} detected.") - self.label_4.setText(f"OneDrive {self.od_version} detected.") - self.label_4.setStyleSheet("color: green;") - self.label_5.hide() - - return True - else: - self.label_4.setText("OneDrive not detected.") - self.label_4.setStyleSheet("color: red;") + # TODO: Minimim version check not yet enforced + try: + od_version_check = subprocess.check_output(["onedrive", "--version"], stderr=subprocess.STDOUT) + if "onedrive v" in str(od_version_check): + self.od_version = re.search(r".\s(v[0-9.]+)", str(od_version_check)).group(1) + logging.info(f"OneDrive {self.od_version} detected.") + self.label_4.setText(f"OneDrive {self.od_version} detected.") + self.label_4.setStyleSheet("color: green;") + self.label_5.hide() + self.completeChanged.emit() + + return True + else: + self.label_4.setText("OneDrive not detected.") + self.label_4.setStyleSheet("color: red;") + self.completeChanged.emit() + return False + except FileNotFoundError: + self.label_4.setText("OneDrive not detected.") + self.label_4.setStyleSheet("color: red;") + self.completeChanged.emit() + return False + + + def isComplete(self): + if 'not' in self.label_4.text().lower(): return False + else: + return True class wizardPage_create_import(QWizardPage): @@ -181,27 +210,27 @@ class wizardPage_create_import(QWizardPage): def on_checkbox_change(self): if self.checkBox_create.isChecked(): - print(f"Create new profile is checked") + logging.info(f"Create new profile is checked") self.checkBox_import.setDisabled(True) self.completeChanged.emit() elif self.checkBox_import.isChecked(): - print(f"Import profile is checked") + logging.info(f"Import profile is checked") self.checkBox_create.setDisabled(True) self.completeChanged.emit() else: - print(f"No option is unchecked") + logging.info(f"No option is unchecked") self.checkBox_import.setDisabled(False) self.checkBox_create.setDisabled(False) self.completeChanged.emit() def isComplete(self): if self.checkBox_create.isChecked() == False and self.checkBox_import.isChecked() == False: - print("not complete") + logging.info("not complete") return False else: - print("complete") + logging.info("complete") return True @@ -257,7 +286,7 @@ class wizardPage_create(QWizardPage): self.file_dialog = QFileDialog.getExistingDirectory(dir=os.path.expanduser("~/")) dir_name = self.file_dialog - print(dir_name) + logging.info(dir_name) self.lineEdit_sync_dir.setText(dir_name) def update_sync_dir(self, text): @@ -318,7 +347,7 @@ class wizardPage_create(QWizardPage): # Hide "Create profile" push button from main windows. main_window.pushButton_new_profile.hide() - print(f"Account {profile_name} has been created") + logging.info(f"Account {profile_name} has been created") self.pushButton_create.setText("Done") self.pushButton_create.setDisabled(True) self.completeChanged.emit() @@ -370,7 +399,7 @@ class wizardPage_import(QWizardPage): file_name = self.file_dialog[0] - print(file_name) + logging.info(file_name) self.lineEdit_config_path.setText(file_name) def import_profile(self): @@ -414,8 +443,8 @@ class wizardPage_import(QWizardPage): # Append new profile into running global profile global_config.update(new_profile) - # print(new_profile) - # print(global_config) + # logging.info(new_profile) + # logging.info(global_config) settings_window.listWidget_profiles.addItem(profile_name) self.setting_page = ProfileSettingsPage(profile_name) @@ -429,7 +458,7 @@ class wizardPage_import(QWizardPage): # Hide "Create profile" push button from main windows. main_window.pushButton_new_profile.hide() - print(f"Account {profile_name} has been imported") + logging.info(f"Account {profile_name} has been imported") self.pushButton_import.setText("Done") self.pushButton_import.setDisabled(True) self.completeChanged.emit() @@ -464,7 +493,7 @@ class SettingsWindow(QWidget, Ui_settings_window): self.stackedLayout = QStackedLayout() for profile in global_config: - print(profile) + logging.info(profile) self.listWidget_profiles.addItem(profile) self.page = ProfileSettingsPage(profile) self.stackedLayout.addWidget(self.page) @@ -531,7 +560,7 @@ class SettingsWindow(QWidget, Ui_settings_window): main_window.comboBox.removeItem(combo_box_index) main_window.profile_status_pages.pop(selected_profile_name, None) global_config.pop(selected_profile_name, None) - print(global_config) + logging.info(global_config) # Load existing user profiles and remove the new profile. _profiles = ConfigParser() @@ -638,8 +667,8 @@ class SettingsWindow(QWidget, Ui_settings_window): # Append new profile into running global profile global_config.update(new_profile) - # print(new_profile) - # print(global_config) + # logging.info(new_profile) + # logging.info(global_config) self.listWidget_profiles.addItem(profile_name) self.page = ProfileSettingsPage(profile_name) @@ -680,14 +709,15 @@ class ProfileStatusPage(QWidget, Ui_status_page): def show_setup_wizard(self): self.setup_wizard = SetupWizard() self.setup_wizard.show() - # self.currentIdChanged.connect(print("print test")) + # self.currentIdChanged.connect(logging.info("print test")) def stop_monitor(self): if self.profile_name in main_window.workers: main_window.workers[self.profile_name].stop_worker() self.label_onedrive_status.setText("OneDrive sync has been stopped") + logging.info(f"OneDrive sync for profile {self.profile_name} has been stopped.") else: - print(f"OneDrive for profile {self.profile_name} is not running") + logging.info(f"OneDrive for profile {self.profile_name} is not running.") def start_monitor(self): main_window.start_onedrive_monitor(self.profile_name) @@ -897,8 +927,11 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): self.config_dir = re.search(r"(.+)/.+$", self.config_file).group(1) self.pushButton_login.clicked.connect(lambda: main_window.show_login(self.profile)) - self.pushButton_logout.clicked.connect(lambda: os.system(f"onedrive --confdir='{self.config_dir}' --logout")) - self.pushButton_logout.clicked.connect(lambda: print(f"Profile {self.profile} has been logged out.")) + self.pushButton_login.hide() + self.pushButton_logout.clicked.connect(self.logout) + # self.pushButton_logout.clicked.connect(lambda: os.system(f"onedrive --confdir='{self.config_dir}' --logout")) + # self.pushButton_logout.clicked.connect(lambda: logging.info(f"Profile {self.profile} has been logged out.")) + # # Buttons @@ -912,18 +945,35 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): def str2bool(self, value): return value.lower() in "true" + def logout(self): + os.system(f"onedrive --confdir='{self.config_dir}' --logout") + logging.info(f"Profile {self.profile} has been logged out.") + # self.profile_status["status_message"] = "You have been logged out" + + main_window.profile_status_pages[self.profile].stop_monitor() + # main_window.profile_status_pages[self.profile]["status_message"] = "You have been logged out" + if self.profile in main_window.workers: + main_window.workers[self.profile].stop_worker() + main_window.profile_status_pages[self.profile].label_onedrive_status.setText("OneDrive sync has been stopped") + logging.info(f"OneDrive sync for profile {self.profile} has been stopped.") + else: + logging.info(f"OneDrive for profile {self.profile} is not running.") + + main_window.profile_status_pages[self.profile].label_onedrive_status.setText("You have been logged out") + + def get_sync_dir_name(self): self.file_dialog = QFileDialog.getExistingDirectory(dir=os.path.expanduser("~/")) sync_dir = self.file_dialog - print(sync_dir) + logging.info(sync_dir) self.lineEdit_sync_dir.setText(sync_dir) def get_log_dir_name(self): self.file_dialog = QFileDialog.getExistingDirectory(dir=os.path.expanduser("~/")) log_dir = self.file_dialog - print(log_dir) + logging.info(log_dir) self.lineEdit_log_dir.setText(log_dir) def set_line_edit_value(self, value): @@ -939,12 +989,12 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): def set_check_box_state(self, state): _property = self.sender().objectName() property = re.search(r"checkBox_(.+)", _property).group(1) - print(property) + logging.info(property) if state == Qt.Checked: - print("is checked") + logging.info("is checked") self.temp_profile_config[f"{property}"] = '"true"' else: - print("is unchecked") + logging.info("is unchecked") self.temp_profile_config[f"{property}"] = '"false"' def get_check_box_state(self, property): @@ -980,19 +1030,19 @@ class ProfileSettingsPage(QWidget, Ui_profile_settings): def add_item_to_qlist(self, source_widget, destination_widget, list): if source_widget.text() == "": - print("Inoring empty value.") + logging.info("Inoring empty value.") elif source_widget.text() in list: - print("Item already in exemption list.") + logging.info("Item already in exemption list.") else: list.append(source_widget.text()) destination_widget.addItem(source_widget.text()) def remove_item_from_qlist(self, qlistwidget_name, list): for item in qlistwidget_name.selectedItems(): - print("Removing: " + item.text()) + logging.info("Removing: " + item.text()) # items.remove(item.text()) qlistwidget_name.takeItem(qlistwidget_name.row(item)) - print(list) + logging.info(list) list.remove(item.text()) def save_profile_settings(self): @@ -1062,28 +1112,28 @@ class WorkerThread(QThread): def __init__(self, profile): super(WorkerThread, self).__init__() - print(f"Starting worker for profile {profile}") + logging.info(f"Starting worker for profile {profile}") self.config_file = global_config[profile]["config_file"] self.config_folder = re.search(r"(.+)/.+$", self.config_file) - # print(self.config_file) + # logging.info(self.config_file) self._command = f"onedrive --confdir='{self.config_folder.group(1)}' --monitor -v" - # print(f"command is: {self._command}") + # logging.info(f"command is: {self._command}") self.profile_name = profile def stop_worker(self): - print(f"[{self.profile_name}] Waiting for worker to finish...") + logging.info(f"[{self.profile_name}] Waiting for worker to finish...") while self.onedrive_process.poll() is None: self.onedrive_process.kill() # time.sleep(1) - print(f"[{self.profile_name}] Quiting thread") + logging.info(f"[{self.profile_name}] Quiting thread") self.quit() self.wait() - print(f"[{self.profile_name}] Removing thread info") + logging.info(f"[{self.profile_name}] Removing thread info") main_window.workers.pop(self.profile_name, None) - print(f"Remaining running workers: {main_window.workers}") + logging.info(f"Remaining running workers: {main_window.workers}") def run(self, resync=False): """ @@ -1119,8 +1169,8 @@ class WorkerThread(QThread): if stdout == "": continue - # print(bytes(stdout, 'utf-8')) - print(f"[{self.profile_name}] " + stdout.strip()) + # logging.info(bytes(stdout, 'utf-8')) + logging.info(f"[{self.profile_name}] " + stdout.strip()) if "Authorize this app visiting" in stdout: self.onedrive_process.kill() @@ -1136,7 +1186,7 @@ class WorkerThread(QThread): self.free_space_bytes = re.search(r"([0-9]+)", stdout).group(1) self.free_space_human = str(humanize_file_size(int(self.free_space_bytes))) - print(f"[{self.profile_name}] Free Space: {self.free_space_human}") + logging.info(f"[{self.profile_name}] Free Space: {self.free_space_human}") self.profile_status["free_space"] = f"Free Space: {self.free_space_human}" # self.profile_status["account_type"] = f"{self.account_type.capitalize()} [{self.free_space_human}]" self.update_profile_status.emit(self.profile_status, self.profile_name) @@ -1144,7 +1194,7 @@ class WorkerThread(QThread): elif "Account Type" in stdout: self.account_type = re.search(r"\s(\w+)$", stdout).group(1) self.profile_status["account_type"] = self.account_type.capitalize() - print(f"[{self.profile_name}] Account type: {self.account_type}") + logging.info(f"[{self.profile_name}] Account type: {self.account_type}") self.update_profile_status.emit(self.profile_status, self.profile_name) elif "Initializing the OneDrive API" in stdout: @@ -1184,7 +1234,7 @@ class WorkerThread(QThread): } # Update file transfer list - print(transfer_progress_new) + logging.info(transfer_progress_new) self.update_progress_new.emit(transfer_progress_new, self.profile_name) # Update profile status message. @@ -1205,7 +1255,7 @@ class WorkerThread(QThread): "transfer_complete": transfer_complete, } - print(transfer_progress_new) + logging.info(transfer_progress_new) self.update_progress_new.emit(transfer_progress_new, self.profile_name) if transfer_complete: @@ -1223,18 +1273,18 @@ class WorkerThread(QThread): stderr = self.onedrive_process.stderr.readline() if stderr != "": if "command not found" in stderr: - print( + logging.info( """Onedrive does not seem to be installed. Please install it as per instruction at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md """ ) elif "--resync is required" in stderr: - print(str(stderr) + " Starting resync.") + logging.info(str(stderr) + " Starting resync.") self.trigger_resync.emit() self.run(resync=True) else: - print("@ERROR " + stderr) + logging.info("@ERROR " + stderr) class MainWindow(QMainWindow, Ui_MainWindow): @@ -1270,7 +1320,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.actionRestart_Service.triggered.connect(lambda: os.system("systemctl --user restart onedrive")) # Start OneDrive monitoring - self.actionStart_Monitor.triggered.connect(lambda: self.start_onedrive_monitor("boris@pozdena.eu")) + self.actionStart_Monitor.triggered.connect(lambda: self.start_onedrive_monitor("")) # Stop OneDrive monitoring self.actionStop_Monitor.triggered.connect(lambda: os.system("pkill onedrive")) @@ -1280,7 +1330,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): # self.actionObtain_Sync_Status.triggered.connect(lambda: self.onedrive_sync_status()) # Start second account - self.actionstart.triggered.connect(lambda: self.start_onedrive_monitor("pozdenab")) + self.actionstart.triggered.connect(lambda: self.start_onedrive_monitor("")) self.comboBox.activated.connect(self.switch_account_status_page) self.stackedLayout = QStackedLayout() @@ -1338,22 +1388,22 @@ class MainWindow(QMainWindow, Ui_MainWindow): def onedrive_process_status(self): # Check OneDrive status - # print(self.workers) + # logging.info(self.workers) pixmap_running = QPixmap("resources/images/icons8-green-circle-48.png").scaled(20, 20, Qt.KeepAspectRatio) pixmap_stopped = QPixmap("resources/images/icons8-red-circle-48.png").scaled(20, 20, Qt.KeepAspectRatio) for profile_name in global_config: - # print(profile_name) + # logging.info(profile_name) if profile_name not in self.workers: self.profile_status_pages[profile_name].label_status.setText("stopped") self.profile_status_pages[profile_name].label_status.setPixmap(pixmap_stopped) - # print(f"not running {profile_name}") + # logging.info(f"not running {profile_name}") else: if self.workers[profile_name].isRunning(): self.profile_status_pages[profile_name].label_status.setText("running") self.profile_status_pages[profile_name].label_status.setPixmap(pixmap_running) - # print(f"running worker {profile_name}") + # logging.info(f"running worker {profile_name}") # for onedrive_process in psutil.process_iter(): # if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': @@ -1385,8 +1435,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.workers[profile_name] = WorkerThread(profile_name) self.workers[profile_name].start() else: - print(f"Worker for profile {profile_name} is already running. Please stop it first.") - print(f"Running workers: {main_window.workers}") + logging.info(f"Worker for profile {profile_name} is already running. Please stop it first.") + logging.info(f"Running workers: {main_window.workers}") # self.worker = WorkerThread() # self.worker.start() @@ -1395,8 +1445,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): # self.worker.trigger_resync.connect(self.show_login) self.workers[profile_name].update_progress_new.connect(self.event_update_progress_new) self.workers[profile_name].update_profile_status.connect(self.event_update_profile_status) - self.workers[profile_name].started.connect(lambda: print(f"started worker {profile_name}")) - self.workers[profile_name].finished.connect(lambda: print(f"finished worker {profile_name}")) + self.workers[profile_name].started.connect(lambda: logging.info(f"started worker {profile_name}")) + self.workers[profile_name].finished.connect(lambda: logging.info(f"finished worker {profile_name}")) def event_update_profile_status(self, data, profile): self.profile_status_pages[profile].label_onedrive_status.setText(data["status_message"]) @@ -1416,7 +1466,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): _sync_dir = os.path.expanduser(global_config[profile]["onedrive"]["sync_dir"].strip('"')) # profile_status_page = self.profile_status_pages[profile] - print(data) + logging.info(data) file_path = f"{_sync_dir}" + "/" + data["file_path"] absolute_path = QFileInfo(file_path).absolutePath().replace(" ", "%20") parent_dir = re.search(r".+/([^/]+)/.+$", file_path).group(1) @@ -1430,15 +1480,15 @@ class MainWindow(QMainWindow, Ui_MainWindow): file_operation = data["file_operation"] transfer_complete = data["transfer_complete"] - print("absolute path " + absolute_path) + logging.info("absolute path " + absolute_path) - print("parent dir " + parent_dir) - print("progress: " + progress) - print("progress data: " + humanize_file_size(progress_data)) - print("file path: " + file_path) - print("file size: " + humanize_file_size(file_size)) - print("file name: " + file_name) - print("file path2: " + file_path2) + logging.info("parent dir " + parent_dir) + logging.info("progress: " + progress) + logging.info("progress data: " + humanize_file_size(progress_data)) + logging.info("file path: " + file_path) + logging.info("file size: " + humanize_file_size(file_size)) + logging.info("file name: " + file_name) + logging.info("file path2: " + file_path2) # if data['transfer_complete'] == True: # if int(data['progress']) == 100: @@ -1449,10 +1499,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): last_item = self.profile_status_pages[profile].listWidget.item(0) last_item_widget = self.profile_status_pages[profile].listWidget.itemWidget(last_item) last_file_name = last_item_widget.get_file_name() - print(f"The last list item's file name is : {last_file_name}") + logging.info(f"The last list item's file name is : {last_file_name}") if file_name == last_file_name: - print("Deleting last list item") + logging.info("Deleting last list item") self.profile_status_pages[profile].listWidget.takeItem(0) myQCustomQWidget = TaskList() @@ -1504,22 +1554,33 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.lw.loginFrame.setUrl(QUrl(url)) # Wait for user to login and obtain response URL - self.lw.loginFrame.urlChanged.connect( - lambda: self.get_response_url(self.lw.loginFrame.url().toString(), self.config_dir, profile) - ) + self.lw.loginFrame.urlChanged.connect(lambda: + self.get_response_url(self.lw.loginFrame.url().toString(), self.config_dir, profile)) + # self.profile_status_pages[profile].label_onedrive_status.setText("You have been logged in") def get_response_url(self, response_url, config_dir, profile): # Get response URL from OneDrive OAuth2 if "nativeclient?code=" in response_url: - print(f'onedrive --confdir="{config_dir}" --auth-response "{response_url}"') + logging.info(f'onedrive --confdir="{config_dir}" --auth-response "{response_url}"') os.system(f'onedrive --confdir="{config_dir}" --auth-response "{response_url}"') - print("Login performed") + logging.info("Login performed") self.window1.hide() - main_window.workers[profile].onedrive_process.kill() + main_window.workers[profile].stop_worker() + main_window.profile_status_pages[profile].label_onedrive_status.setText("You have been logged in. Start sync manually.") + + # main_window.workers[profile].onedrive_process.kill() else: pass +def humanize_file_size(num, suffix="B"): + for unit in ["", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"]: + if abs(num) < 1024.0: + return f"{num:3.1f}{unit}{suffix}" + num /= 1024.0 + return f"{num:.1f}Yi{suffix}" + + def read_config(config_file): with open(config_file, "r") as f: config_string = "[onedrive]\n" + f.read() @@ -1572,7 +1633,7 @@ def create_global_config(): profiles[profile].update(default_od_config) profiles[profile].update(od_config) - # print(profiles) + # logging.info(profiles) return profiles @@ -1582,10 +1643,10 @@ def save_global_config(): profile_config_file = os.path.expanduser(global_config[profile]["config_file"].strip('"')) - # print(profile_config_file) - # print(global_config) - # print(global_config[profile]) - # print(global_config[profile]['onedrive']) + # logging.info(profile_config_file) + # logging.info(global_config) + # logging.info(global_config[profile]) + # logging.info(global_config[profile]['onedrive']) _od_config = {} _od_config["onedrive"] = global_config[profile]["onedrive"] @@ -1610,18 +1671,11 @@ def save_global_config(): with open(profile_config_file, "w") as output: output.writelines(data[1:]) - print(f"{profile} config saved") + logging.info(f"{profile} config saved") - print("All configs saved") + logging.info("All configs saved") -def humanize_file_size(num, suffix="B"): - for unit in ["", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"]: - if abs(num) < 1024.0: - return f"{num:3.1f}{unit}{suffix}" - num /= 1024.0 - return f"{num:.1f}Yi{suffix}" - if __name__ == "__main__": global_config = create_global_config() diff --git a/src/resources/images/icons8-clouds-48.ico b/src/resources/images/icons8-clouds-48.ico new file mode 100644 index 0000000000000000000000000000000000000000..4e23fc8aea74f3bb21a87a132ca072fbff35d007 GIT binary patch literal 101913 zcmeHQ30zcF+aCmT*Lt&j%?0xVaZAiKQ^c%39mEY6v=TLULCqyM6zTO-^Yt|gLtG&% zHO)YM(`054t&G6k3`LxoRF+Hx6hwi6`Toz$y*MGrfR|x_XMVr`oV%QR&UyaN^PF?; zIp^LhliA3gk)hG6|Ba(e zHgN>5Y$fbJE0fh(Vk3JNA*DCnP9{6J)<(8=*pLAY>b_JLNjH!We9ME*5^7V{@6G!L zdDfmMf9s8ri?7~MpV{Cw%I2B$wjEl`p?g{8urV_-;eyL_4zSZ&z_$9>fr4f-%oe$ zSd{91E-h$5MrNjFzBY4tQpB{>h&eTo_0#-3!*4uH z{Q-+MWN!4B=Nr&$>0O_I7J=%B?pNLq+9=oDKIt^5-MP%DAtBqc$4=R1-#pv>ht8?r z9_{76-o<7@pSrS_cFVq)h+yh-2j)iUk9=@6B+#Sfz%G~9Eou|z8Ta$7z!Zf;*9f2X z5vxuP>NN7ue0itQhq?wHJokIU4!4qg+t^;mItwZjh&GCX2}+W+)m za`yHWySDhaAHM%D<;II4`qZ0YUd#5lrk}9w>b!orY?6oU&QX`>%N?>Cb%>jqb7$DB ziT6Hp%UbqVP;3446x)Ap93h*&xrYDhcE(`V?vug8TZBX|o*%F>PxZBK!fT4&n-h|} z#zfj5OE?qLWBlp#zS+-@Q$*!V+R$?Il6jpkC!X?kR{ofFai)Ii_;lqvyXHOA?*ET( z&Y#yZU4IEqS(;v_fGT3_l~-h=T=EykT|D<@nBVQTcLotk)68 z`yHImc^-PuMKv_vXVaYdcW$+8F*R{rQ?D%FK>@x__gc@My>iv>p$Sp(ordUlHgWd5 zpPKq(`yaw*9Bq8m>tFNb4euYam4C7VqV zl-=F#X+EfHJ+b%7{T&AU=Ir0#+diGM>h}o0nqikZ?yndR z=iZ-rACPUY(eJ0mvTp7+hG74ew~t39Is0|_y~C}TMNz@cnw@PDFnf-3?(zWbCoTsM zCp}*fm9E%2)^597+{T3K*R|dB1MODNKAnE?Rb?z_FvA>21*?16SZrw+(Mqu189uy=q!i@b3-}?FvYO?Hy>aq^oX{Q%qK7YE% zdCxIE@Vci@+TfV$F@p|FNx3=Yr|?fF9}J4vl(6^2uc5w2>;pfaHfYn3`#0t{N(*u6 zn)T8BS(mgmPEUTgV^&Y6Y@aD97u*(lZ%WgTpD}3Jjfo!~8GUHEeD=PC!}ee92~fFa zy|I6FPdkx7pUk(9Ps*sbXk?oYhX$yF_9Py02nq9f|L{8h5%RtJmn`@y@)@7H^_qIM z7&Fe!z1=y7UUBt?I%Usa@#lr`@0@<=^UeALwI2pf9Cj%9RA=v4?nM_xxc;ID5l-t)Db&tR0^zo!ilg!OBS47a^f4eY(Gbr zg_*}=Jugps(ATJ9LDN31J!{0KCZ`=*d~R0lS$llt-|B+8#c`H`7$^MTx{foi#;=j(SwQWq| z&hHar7pz-!|Hl=MOT52Z)OTmk$-O?mZri6((!R9hHQs049hI)_^446+%2T{OE+?I96YjSotLEjcarM)l+Z++lV0mMctdbKC-0e6n z=eKjQ+iUnY*!`~Gf1NXLtZi%}8C5!iXFiu6BG1vzIo2Wi*uh5s?4bzQ?sjjXbKmZ3 zmuLUo_~ftDIO~)>!a3f4o&SNCoD`kHGXE=2neI_DeMmshrE#Hk?$itIJ}qGT{>k2F zAL-4$2K^hSr}mcY8wf30)t4VZY#%XWsp=uU%Z$?iiYI=7;aQF%b?t-j4Mi5S82{b>O{3KQ9lz zUP-D6J1(`%+;TB-XUvr*Ew8#}BrSE1ar#@``d#vrqjQ|HCpqfnu73us+1Px{mcYcY zLBV4$d)5j)oh$F9J>@mzmY>T%;}TcJM6Q?<(MB=5X8Ir3GQ%Ch9%S6is5i9HfS@oXy$;>%QN+B=02*_;%h&+5$P2j>^3hheE3+u;N$r* zS9*7dTkv_aZ%4F`^H@DTYWd62aWPk}>b2P&U7O6`6|_;+J?li)tX~JsUXkGz{&I9m zjL)e{H%@d)Y?gO$#JFRldhNSCVr=J*Qzo@^{_355lkF!jj!WIrNu3_8QeO;PtylTJ zKWMjJQ?JQ}l(bHtEI+W^&#nKXs_$vqZo1YpF>>(NZ*}h0@rC=eD}Q^)TcQ0Y{Hrat z{pkRDDAa{9{;0dcKW2a#U9D!$zAMq3oj5D900W)ymEA z{lf-mRGIL9!UOjIB5foeK2OL6vIJuPGW6D!Lv(8AlSJ z-?c!75e8Yr`i(%6ZUzZvyMTNS~^THfJ^Zhrc@luMto;ofL2xA=P07 zs?VyT4k}V69XP!&;0!{A0a``-TqBxWsxA<8FVy=6U5jm4Me+* z)_=9Bb1bfZ{k8B~z>5Uf-Cp3Hfa>IT)+lQ-^gsyKU-`L#0KBkT+8^uRYU>t@=wGK+ zJP*81fUO+`#Cuh1^oi=)3h9Q^-nqyzB3$O+OR!z*+%r zQtF=4g5Gier#f$hVZ8Zi%gfhG>qB>;`%3}_u>PxE{Z!8SH_ZS1AL@Mq&;Lm4yHeDJ zSD=@50y;_W|Ezy-D}|oQD~~Uf31ND*vZa8!tbeQ3m(=yYrSxAzr~_)@880u`8=m(ufY*LkY#Xo{dLYbz@7EPj zuFr?+G>TrpC<5{o^-rPHw$164z-f+JIYYqzN?qp{mmcfidhEO+^lxexCiMWd2fRL@ z1b=;sI+E&F@t$ito&%jlFx5pxY_t9?Ru@>S{;4kj82W_tTo8fA2WX6tAg)iRIU~`2 zxv%i#dV+X*C_sylZ~-_>5PV;bP+k!}UsRrj#s|iuoZ?uqxMnmS#|-n+D0eQ9Prxzm z<2}v+wWGHQI;}ETz@ltzcv}Gtiqb(v9%KDWYR8pP{{`a%uv;1{rsstSv~HLn2WSl; z;YUDh3)ugS{-2FDG?f5u=sBw)1o(b;0p$A)1W5jTrzPtS$h8|VKEM8W-B(@hAq%=s z6yR=2eONj#)_;+0MRn5u7T7?dfa>b+h2^IAz=?hS5tjBzOXdeTS^tl>d(}z*v`&TY zX9ydBWjhywXdeW5yT{|VhI1@x`V`YoyKtp6fy zzS`*D)IM}-Wsm@RpJ{dUdr{`I=ok42a4_YlDsQv?3v9l+>VGP1fUq9^e@%dt&zGu^ zCLswB*UHj*dC~7GIuytJB6Bn@*#B6-WrVc$s3O-NiTSTV zISB8<|Lp|WSd))hx-59d0LBMYE(GZQ8v!bCB#w{LIJt5CfLfUV-4o73_j?3Pz$Q-k^qk7mGQj$OS_Uik_0T`v z7q-AR?K-1A9&La|wHp2(Y=Bnv8@{PQV-GYYX*&KuW5@*YSfU}GF>V-+8?RR@N8vt{ z&>#Mfd<>BM{T!8B3l(2_Vcf;={VaTMdk8R_0G&n%I0c>390GynC-A;q1H@xj#JCu* z_!uxepR4~pvc7=Y6)z>1pg0Ct|HU!G$C&|UfEi#0m;q*h8DIvO0cL<1U}E^k*|2HL`q`T_oc zjjR>^@#|;!=RanE8DIvO0cL<1UgSDnQ>S zlkz(v=E(S@IHU)9UwtM(-=sK=ca-k~=I35hIF&(U!zGZr4$vIw;rp$sO9<(`=uaw# zHJ!T$`A_2A{7ZASiWh)drR9NS2S!3>Yq9gv@=G=fKUKIA2c?l;e=WQbzGpBV*VFg- zN}I2>#ZRVhKj1y^b{$x=r$g?DDj>Va)e*=) zu@v(E8?tMwko?qctty55I}tyt>d3D`+o%euzVaJ%xw91VZ-wsDs*e7ZcOlDm^W|5q zgT4GwW#rc?ZlDja-hBC$^ex@*s*L;^0y1?pSAO*W z>LR`z*Bt}IHng&aze1K_dbP5Fx$;vyokoHFzhV^RudMxlgT8Xq${E1_lty;bxB>@c z2bIYe=zf^)gJ+q_QkHF_9TI141sb5HKV-C`{CflHUm3um^!DrW^Y@-2(vdCQc z8lgU*I+5B1>Kjx4-~`eqo~@x?pfQ;%zz)bi18rURY;E{I3d09+2c(eyD8_f+#Q5$r=9alU;$gg?G2j9_{04H7Eu;Y1n1e{jQ7e?dN^JL` zyzyP)-Z-}bc-sDBKKL9BRJ!ku=V}z~fTd;RfOxwIy)P*bU0Nbd$llP%fx!;Q7tE~> z$hYV_)IN}(mU&m|pWq9Af=uTS-U6sUBi0|7zc74@o5thL0wKV=u=zHXT5yxX)7(_9 z=GZF*-=#L*%iMvS)UQp#+{G#2OVlm1gl|sUnOx4B%m6dM3@`)C05iZ0Fayj0Gr$Zm z1Iz$3zzjT*feL>Ef`Vd3oQOo|*0Agog0#NXt2uW5AAVK~y1Iz$3 zzzi@0%m6b`1sTA)hnjiUj5W0wszelzlK=TLI-R zEC=nAKJKCHuagW<5+MItxJ{l~(Himp0*XqjB9CeF;v-+mzxtz1aWbIHHGz)+t62Y9 zh{K2Q!G%Dv&wnF+ZQvweDPJv(KB-K{sEkkGzb?+xnkq~Ct2uI@OjMt!>XuOcWa}-z zVGYU?%CEwD4XnwqR{PN^&Y}(~_IYQNoBVeLV2%Du?a*qV*!6ru{rNKD+yu6QJiQtjdRT)XJIYM?8b)rHXUkza1B3AU%ldwJa?Uv@#_89Z-O11PSTW*--1h(l-zpQSZ+#n$s?7uqBubXW`c!UE+d zyT2xN`SDDHEzr*b<)?oCQJ~m0SLEgm(8Ol%nr2gP26lJ7mbRME@ zxrw##dl3#q`Rii+??fD@d$`j0JJmg7bZV6y*3O#bYWYp9;YPiy_&|`MBwM2M_pE8% zI?66183a90eew_>-xOt`koKv4zY5;pL-~vCTUuTN#vFB;2s^T8jD>uFd%qJXYm!jr zMC>1f4KB=!i)aj+w1W&4RZPy88DIvO0cL<1Ulm+sqIiuEv z^T)hQ4fvjy1@fPPxw>N4n+Rnf9!M8b`61cW1&pbc_9fpwFilXu~J@zif{EMAiH>V86 z#lbju51|Z2&HqwezPPw+r8bTK{kjpf)=Z2m??3!I7kMl~R?N(_sdf0qbC( zq^HOJz~~B4>o|rniUOU(SV<#1#^!1YJQueDPp%<(;o-GnGNKy->I}C63dSi))k@>S zYVt!}PwRE)eQ`y#H>PbKZPQwY?da Date: Thu, 10 Feb 2022 17:46:14 +0100 Subject: [PATCH 12/12] remove log file --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 03f90c4..5f37bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ venv/ .qt_for_python/ src/__thrash/ +src/nohup.out +nohup.out __pycache__/ +