diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..566a8d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +venv/ +.qt_for_python/ +OneDriveGUI/__thrash/ +__pycache__/ diff --git a/OneDriveGUI/OneDriveGUI.py b/OneDriveGUI/OneDriveGUI.py new file mode 100644 index 0000000..19742c4 --- /dev/null +++ b/OneDriveGUI/OneDriveGUI.py @@ -0,0 +1,654 @@ +import os +import psutil +import re +import subprocess +import sys +from configparser import ConfigParser + +from PySide6.QtCore import QThread, QTimer, QUrl, Signal, QFileInfo +from PySide6.QtGui import QIcon +from PySide6.QtWidgets import (QWidget, QApplication, QMainWindow, QMenu, QSystemTrayIcon, QListWidget, QListWidgetItem, QFileIconProvider, QStackedLayout, QVBoxLayout, QLabel) + +from ui.ui_login import Ui_LoginWindow +from ui.ui_settings import Ui_settings_window +from ui.ui_list_item_widget import Ui_list_item_widget + +from ui.ui_mainwindow import Ui_MainWindow +from ui.ui_process_status_page import Ui_status_page + +from ui.ui_profile_settings_page import Ui_profile_settings + +CONFIG_FILE = os.path.expanduser('/home/bob/.config/onedrive/accounts/boris@pozdena.eu/config') +PROFILES_FILE = os.path.expanduser('~/.config/onedrive-gui/profiles') + + +class SettingsWindow(QWidget, Ui_settings_window): + def __init__(self): + super(SettingsWindow, self).__init__() + + # Set up the user interface from Designer. + self.setupUi(self) + + + + self.stackedLayout = QStackedLayout() + + for account in global_config: + print(account) + self.listWidget.addItem(account) + self.page = ProfileSettingsPage(account) + self.stackedLayout.addWidget(self.page) + + self.horizontalLayout.addLayout(self.stackedLayout) + self.listWidget.itemSelectionChanged.connect(self.switch_account_settings_page) + self.show() + + def switch_account_settings_page(self): + self.stackedLayout.setCurrentIndex(self.listWidget.currentRow()) + + + 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)) + + +class ProfileStatusPage(QWidget, Ui_status_page): + def __init__(self, profile): + super(ProfileStatusPage, self).__init__() + + # Set up the user interface from Designer. + self.setupUi(self) + + # Show selected profile name + self.label_4.setText(profile) + + # # Open Settings window + self.pushButton_settings.clicked.connect(self.show_settings_window) + + # Open login form TODO: testing + # self.pushButton_2.setText("login") + # self.pushButton_2.clicked.connect(lambda: self.show_login()) + + def show_settings_window(self): + self.settings_window = SettingsWindow() + self.settings_window.show() + + +class ProfileSettingsPage(QWidget, Ui_profile_settings): + def __init__(self, profile): + super(ProfileSettingsPage, self).__init__() + + # Set up the user interface from Designer. + self.setupUi(self) + + self.lineEdit_6.setText(global_config[profile]['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) + + # 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.ui.pushButton_4.clicked.connect(lambda: save_config(settings)) + + # # 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 / 1000 / 1000, 2)) + " Mbit/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 / 1000 / 1000, 2)) + " Mbit/s")) + + + + +class TaskList(QWidget, Ui_list_item_widget): + def __init__(self): + super(TaskList, self).__init__() + + # Set up the user interface from Designer. + self.setupUi(self) + + + + def set_icon (self, file_path): + self.fileInfo = QFileInfo(file_path) + self.iconProvider = QFileIconProvider() + self.icon = self.iconProvider.icon(self.fileInfo) + + # icon = QIcon(icon_file) + self.toolButton.setIcon(self.icon) + + def set_file_name(self, file_path): + self.ls_label_file_name.setText(file_path) + + def set_progress(self, percentage): + self.ls_progressBar.setValue(percentage) + + def set_label_1(self, text): + self.ls_label_1.setOpenExternalLinks(True) + self.ls_label_1.setText(text) + + def set_label_2(self, text): + self.ls_label_2.setText(text) + + def hide_progress_bar(self, transfer_status: bool): + # pass + if transfer_status: + self.ls_progressBar.hide() + # self.ls_label_task.hide() + # self.ls_label_status.hide() + # self.ls_label_dir.show() + else: + self.ls_progressBar.show() + # self.ls_label_task.show() + # self.ls_label_status.show() + # self.ls_label_dir.hide() + + +class WorkerThread(QThread): + update_credentials = Signal() + update_progress = Signal(dict) + update_progress_new = Signal(dict, str) + trigger_resync = Signal() + + def __init__(self, profile): + super(WorkerThread, self).__init__() + print(f"starting worker for profile {profile}") + print(global_config[profile]) + self.config_file = global_config[profile]['config_file'] + self.config_folder = re.search(r"(.+)/.+$", self.config_file) + print(self.config_file) + self._command = f"onedrive --confdir='{self.config_folder.group(1)}' --monitor -v" + print(f"command is: {self._command}") + self._profile_name = profile + + def run(self, resync=False): + matches = ['Downloading file', 'Downloading new file', 'Uploading file', 'Uploading new file', + 'Uploading modified file', 'Downloading modified file'] + file_name = None + + + + self.onedrive_process = subprocess.Popen(self._command + '--resync' if resync else self._command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True, + universal_newlines=True) + + # TODO: De-monster once all possible situations are handled correctly. + while self.onedrive_process.poll() is None: + if self.onedrive_process.stdout: + stdout = self.onedrive_process.stdout.readline() + # print(f"worker: {stdout.strip()}") + print(f'[{self._profile_name}] ' + stdout.strip()) + + if 'Authorize this app visiting' in stdout: + self.onedrive_process.kill() + self.update_credentials.emit() + + elif any(x in stdout for x in matches): # capture file uploads and downloads + # self.tray.setIcon(QIcon("resources/images/icons8-cloud-sync-40_2.png")) + print('# ' + stdout) + file_operation = re.search(r'\b([Uploading|Downloading]+)*', stdout) + file_name = re.search(r".*/(.+)\s+\.+", stdout) + file_path = re.search(r"\b[file]+\s(.+)\s+\.\.\.", stdout) + transfer_complete = 'done' in stdout + progress = '0' # if transfer_complete else '0' + + transfer_progress = { + "file_operation": file_operation.group(1), + "file_name": 'unknown file name' if file_name is None else file_name.group(1), + "progress": progress, + "transfer_complete": transfer_complete} + + transfer_progress_new = { + "file_operation": file_operation.group(1), + "file_path": 'unknown file name' if file_path is None else file_path.group(1), + "progress": progress, + "transfer_complete": transfer_complete} + + if transfer_complete: + self.update_progress.emit(transfer_progress) + self.update_progress_new.emit(transfer_progress_new, self._profile_name) + + elif '% |' in stdout and file_name is not None: # capture upload/download progress + file_operation = re.search(r'\b([Uploading|Downloading]+)*', stdout) + progress = re.search(r'\s([0-9]+)%', stdout) + transfer_complete = progress.group(1) == '100' + + 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.group(1), + "transfer_complete": transfer_complete} + + transfer_progress_new = { + "file_operation": file_operation.group(1), + "file_path": 'unknown file name' if file_path is None else file_path.group(1), + "progress": progress.group(1), + "transfer_complete": transfer_complete} + + self.update_progress.emit(transfer_progress) + self.update_progress_new.emit(transfer_progress_new, self._profile_name) + + elif 'Sync with OneDrive is complete' in stdout: + pass + # self.tray.setIcon(QIcon("resources/images/icons8-cloud-done-40_2.png")) + + elif 'Remaining free space on OneDrive' in stdout: + pass + + elif 'Processing' in stdout: + pass + # self.tray.setIcon(QIcon("resources/images/icons8-cloud-sync-40_2.png")) + + else: + pass + # print('@@ no match') + + if self.onedrive_process.stderr: + stderr = self.onedrive_process.stderr.readline() + 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.") + self.trigger_resync.emit() + + self.run(resync=True) + else: + print('@@ERROR' + stderr) + + +class MainWindow(QMainWindow, Ui_MainWindow): + + def __init__(self): + self.workers= {} + + super(MainWindow, self).__init__() + self.setupUi(self) + # + # Menu + # + + # Update OneDrive Status + self.actionRefresh_Service_Status.triggered.connect(lambda: self.onedrive_process_status()) + + # Start OneDrive service + self.actionStart_Service.triggered.connect(lambda: os.system('systemctl --user start onedrive')) + + + # Stop OneDrive service + self.actionStop_Service.triggered.connect(lambda: os.system('systemctl --user stop onedrive')) + + + # Restart OneDrive service + 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')) + + + # Stop OneDrive monitoring + self.actionStop_Monitor.triggered.connect(lambda: os.system('pkill onedrive')) + + + # Refresh Sync Status + self.actionObtain_Sync_Status.triggered.connect(lambda: self.label_4.setText("Retreiving status...")) + self.actionObtain_Sync_Status.triggered.connect(lambda: self.onedrive_sync_status()) + + # Start second account + self.actionstart.triggered.connect(lambda: self.start_onedrive_monitor('bpozdena@gmail.com')) + + + self.comboBox.activated.connect(self.switch_account_status_page) + self.stackedLayout = QStackedLayout() + + self.profile_status_pages = {} + for profile in global_config: + self.comboBox.addItem(profile) + self.profile_status_pages[profile] = ProfileStatusPage(profile) + self.stackedLayout.addWidget(self.profile_status_pages[profile]) + + self.verticalLayout_2.addLayout(self.stackedLayout) + + + + # self.label_5.hide() + # self.progressBar.hide() + # self.progressBar.setValue(0) + + # self.refresh_process_status = QTimer() + # self.refresh_process_status.setSingleShot(False) + # self.refresh_process_status.timeout.connect(lambda: self.onedrive_process_status()) + # self.refresh_process_status.start(1000) + + + # System Tray + self.tray = QSystemTrayIcon() + if self.tray.isSystemTrayAvailable(): + + icon = QIcon("resources/images/icons8-clouds-48.png") + menu = QMenu() + + 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) + quit_action = menu.addAction("Quit") + quit_action.triggered.connect(sys.exit) + + self.tray.setIcon(icon) + self.tray.setContextMenu(menu) + self.tray.show() + self.tray.setToolTip("This is OneDriveGUI") + + else: + self.tray = None + + def switch_account_status_page(self): + self.stackedLayout.setCurrentIndex(self.comboBox.currentIndex()) + + def onedrive_process_status(self): + # Check OneDrive status + for onedrive_process in psutil.process_iter(): + if onedrive_process.name().lower() == 'onedrive' and onedrive_process.status() != 'zombie': + self.label_3.setText("running") + return True + + self.label_3.setText("not running") + self.tray.setIcon(QIcon("resources/images/icons8-cloud-cross-40_2.png")) + self.progressBar.hide() + self.label_5.hide() + return False + + def onedrive_sync_status(self): + # Check OneDrive sync status + status = subprocess.check_output(['onedrive', '--display-sync-status']) + if 'in sync' in str(status): + self.label_4.setText("In Sync") + self.tray.setIcon(QIcon("resources/images/icons8-cloud-done-40_2.png")) + return True + else: + self.label_4.setText("Out of Sync") + self.tray.setIcon(QIcon("resources/images/icons8-cloud-sync-40_2.png")) + return False + + + + def start_onedrive_monitor(self, profile_name): + + + # for profile in global_config: + self.workers[profile_name] = WorkerThread(profile_name) + self.workers[profile_name].start() + + # self.worker = WorkerThread() + # self.worker.start() + # self.worker.update_credentials.connect(self.show_login) + # self.worker.update_progress.connect(self.event_update_progress) + # self.worker.trigger_resync.connect(self.show_login) + self.workers[profile_name].update_progress_new.connect(self.event_update_progress_new) + + def event_update_progress(self, data): + """ + data: + transfer_progress = { + "file_operation": file_operation.group(1), + "file_name": file_name.group(1), + "progress": progress.group(1), + "transfer_complete": transfer_complete + } + """ + + print(data) + if self.label_5.isHidden(): + self.label_5.show() + self.progressBar.show() + self.label_5.setText(data['file_operation'] + ' ' + data['file_name']) + self.progressBar.setValue(int(data['progress'])) + + if data["transfer_complete"]: + self.listWidget.insertItem(0, data['file_operation'] + ' of ' + data['file_name'] + ' completed.') + if not self.label_5.isHidden(): + self.label_5.hide() + self.progressBar.hide() + + + def event_update_progress_new(self, data, profile): + """ + data: + transfer_progress = { + "file_operation": file_operation.group(1), + "file_path": file_path.group(1), + "progress": progress.group(1), + "transfer_complete": transfer_complete + } + + TODO: De-monster once all possible situations are handled correctly. + """ + _sync_dir = os.path.expanduser(global_config[profile]['onedrive']['sync_dir'].strip('"')) + # profile_status_page = self.profile_status_pages[profile] + + print(data) + file_path = f'{_sync_dir}' + "/" + data['file_path'] + absolute_path = QFileInfo(file_path).absolutePath() + parent_dir = re.search(r".+/([^/]+)/.+$", file_path) + file_size = QFileInfo(file_path).size() + file_size_human = humanize_file_size(file_size) + file_name = QFileInfo(file_path).fileName() + file_path2 = QFileInfo(file_path).filePath() + progress = data['progress'] + progress_data = file_size / 100 * int(progress) + progress_data_human = humanize_file_size(progress_data) + + print("absolute path " + absolute_path) + + print("parent dir " + parent_dir.group(1)) + 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) + + if int(data['progress']) == 0 and data['transfer_complete'] == True: + myQCustomQWidget = TaskList() + myQCustomQWidget.set_file_name(file_name) + myQCustomQWidget.set_progress(100) + myQCustomQWidget.set_icon(file_path) + myQCustomQWidget.hide_progress_bar(data['transfer_complete']) + myQCustomQWidget.set_label_1(f"Available in {parent_dir.group(1)}") + myQCustomQWidget.set_label_2(f'{file_size_human}') + # Create QListWidgetItem + myQListWidgetItem = QListWidgetItem() + # Set size hint + myQListWidgetItem.setSizeHint(myQCustomQWidget.sizeHint()) + # Add QListWidgetItem into QListWidget + self.profile_status_pages[profile].listWidget.insertItem(0, myQListWidgetItem) + self.profile_status_pages[profile].listWidget.setItemWidget(myQListWidgetItem, myQCustomQWidget) + + + elif int(data['progress']) == 0 and data['transfer_complete'] == False: + myQCustomQWidget = TaskList() + myQCustomQWidget.set_file_name(file_name) + myQCustomQWidget.set_progress(0) + myQCustomQWidget.set_icon(file_path) + myQCustomQWidget.hide_progress_bar(data['transfer_complete']) + myQCustomQWidget.set_label_1(data['file_operation']) + myQCustomQWidget.set_label_2(f'{progress_data_human} of {file_size_human}') + + # Create QListWidgetItem + myQListWidgetItem = QListWidgetItem() + # Set size hint + myQListWidgetItem.setSizeHint(myQCustomQWidget.sizeHint()) + # Add QListWidgetItem into QListWidget + self.profile_status_pages[profile].listWidget.insertItem(0, myQListWidgetItem) + self.profile_status_pages[profile].listWidget.setItemWidget(myQListWidgetItem, myQCustomQWidget) + + elif int(data['progress']) == 100 and data['transfer_complete'] == True: + self.profile_status_pages[profile].listWidget.takeItem(0) + + myQCustomQWidget = TaskList() + myQCustomQWidget.set_file_name(file_name) + myQCustomQWidget.set_progress(int(data['progress'])) + myQCustomQWidget.set_icon(file_path) + myQCustomQWidget.hide_progress_bar(data['transfer_complete']) + myQCustomQWidget.set_label_1(f"Available in {parent_dir.group(1)}") + myQCustomQWidget.set_label_2(f'{file_size_human}') + + # Create QListWidgetItem + myQListWidgetItem = QListWidgetItem() + # Set size hint + myQListWidgetItem.setSizeHint(myQCustomQWidget.sizeHint()) + # Add QListWidgetItem into QListWidget + self.profile_status_pages[profile].listWidget.insertItem(0, myQListWidgetItem) + self.profile_status_pages[profile].listWidget.setItemWidget(myQListWidgetItem, myQCustomQWidget) + + + else: + self.profile_status_pages[profile].listWidget.takeItem(0) + + myQCustomQWidget = TaskList() + myQCustomQWidget.set_file_name(file_name) + myQCustomQWidget.set_progress(int(data['progress'])) + myQCustomQWidget.set_icon(file_path) + myQCustomQWidget.hide_progress_bar(data['transfer_complete']) + myQCustomQWidget.set_label_1(data['file_operation']) + myQCustomQWidget.set_label_2(f'{progress_data_human} of {file_size_human}') + + # Create QListWidgetItem + myQListWidgetItem = QListWidgetItem() + # Set size hint + myQListWidgetItem.setSizeHint(myQCustomQWidget.sizeHint()) + # Add QListWidgetItem into QListWidget + self.profile_status_pages[profile].listWidget.insertItem(0, myQListWidgetItem) + self.profile_status_pages[profile].listWidget.setItemWidget(myQListWidgetItem, myQCustomQWidget) + + + + + def show_login(self): + # Show login window + 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.get_response_url(self.lw.loginFrame.url().toString())) + + def get_response_url(self, response_url): + # Get response URL from OneDrive OAuth2 + if 'nativeclient?code=' in response_url: + os.system(f'onedrive --auth-response "{response_url}"') + print("Login performed") + self.window1.hide() + else: + pass + + + +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 profile_reader(): + _profiles = ConfigParser() + _profiles.read(PROFILES_FILE) + profiles = _profiles._sections + + for profile in profiles: + profile_name = profile + profile_config_file = profiles[profile]['config_file'] + _od_config = read_config(profile_config_file) + od_config = _od_config._sections + + profiles[profile].update(od_config) + + + return profiles + + + + + +def save_config(new_settings): + # Save OneDrive config after configuration change. + # new_settings.write + print(new_settings) + print(new_settings['onedrive']['sync_dir']) + print('saved') + + 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) + + +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__": + settings = read_config(CONFIG_FILE) + global_config = profile_reader() + + app = QApplication(sys.argv) + window = MainWindow() + + window.show() + app.exec() diff --git a/OneDriveGUI/resources/images/icons8-cloud-cross-40_2.png b/OneDriveGUI/resources/images/icons8-cloud-cross-40_2.png new file mode 100644 index 0000000..76f3a6b Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-cloud-cross-40_2.png differ diff --git a/OneDriveGUI/resources/images/icons8-cloud-done-40_2.png b/OneDriveGUI/resources/images/icons8-cloud-done-40_2.png new file mode 100644 index 0000000..37a8ee9 Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-cloud-done-40_2.png differ diff --git a/OneDriveGUI/resources/images/icons8-cloud-sync-40_2.png b/OneDriveGUI/resources/images/icons8-cloud-sync-40_2.png new file mode 100644 index 0000000..f1d310a Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-cloud-sync-40_2.png differ diff --git a/OneDriveGUI/resources/images/icons8-clouds-48.png b/OneDriveGUI/resources/images/icons8-clouds-48.png new file mode 100644 index 0000000..7b7533c Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-clouds-48.png differ diff --git a/OneDriveGUI/resources/images/icons8-documents-folder-50.png b/OneDriveGUI/resources/images/icons8-documents-folder-50.png new file mode 100644 index 0000000..0363392 Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-documents-folder-50.png differ diff --git a/OneDriveGUI/resources/images/icons8-play-48.png b/OneDriveGUI/resources/images/icons8-play-48.png new file mode 100644 index 0000000..289f629 Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-play-48.png differ diff --git a/OneDriveGUI/resources/images/icons8-settings-50.png b/OneDriveGUI/resources/images/icons8-settings-50.png new file mode 100644 index 0000000..01d72cb Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-settings-50.png differ diff --git a/OneDriveGUI/resources/images/icons8-stop-50.png b/OneDriveGUI/resources/images/icons8-stop-50.png new file mode 100644 index 0000000..84d0f63 Binary files /dev/null and b/OneDriveGUI/resources/images/icons8-stop-50.png differ diff --git a/OneDriveGUI/ui/list_item_widget.ui b/OneDriveGUI/ui/list_item_widget.ui new file mode 100644 index 0000000..e065e8d --- /dev/null +++ b/OneDriveGUI/ui/list_item_widget.ui @@ -0,0 +1,127 @@ + + + list_item_widget + + + + 0 + 0 + 426 + 60 + + + + + 50 + 60 + + + + Form + + + + 5 + + + 2 + + + 2 + + + 6 + + + 5 + + + 2 + + + + + true + + + + 0 + 0 + + + + false + + + ... + + + + ../resources/images/icons8-clouds-48.png../resources/images/icons8-clouds-48.png + + + + 30 + 40 + + + + + + + + + 340 + 16777215 + + + + + 10 + 75 + true + + + + FileName + + + + + + + 60KB of 100KB + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Downloading/Uploading + + + + + + + + 16777215 + 5 + + + + 24 + + + false + + + + + + + + diff --git a/OneDriveGUI/ui/login.ui b/OneDriveGUI/ui/login.ui new file mode 100644 index 0000000..c4291dd --- /dev/null +++ b/OneDriveGUI/ui/login.ui @@ -0,0 +1,71 @@ + + + LoginWindow + + + + 0 + 0 + 640 + 480 + + + + + 0 + 0 + + + + + 640 + 480 + + + + + 640 + 480 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + https://www.seznam.cz/ + + + + + + + + + QWebEngineView + QWidget +
QtWebEngineWidgets/QWebEngineView
+ 1 +
+
+ + +
diff --git a/OneDriveGUI/ui/mainwindow.ui b/OneDriveGUI/ui/mainwindow.ui new file mode 100644 index 0000000..8052ab5 --- /dev/null +++ b/OneDriveGUI/ui/mainwindow.ui @@ -0,0 +1,159 @@ + + + MainWindow + + + + 0 + 0 + 497 + 808 + + + + OneDriveGUI + + + + ../../../OneDriveGUI_POC_recovered-multi/icons8-clouds-48.png../../../OneDriveGUI_POC_recovered-multi/icons8-clouds-48.png + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + 0 + 0 + 497 + 30 + + + + + Advanced + + + + Debug + + + + Service + + + + + + + + Monitor + + + + + + + + Status + + + + + + + + + + + account2 + + + + + + + + + + + fghgfh + + + + + Start Service + + + + + Stop Service + + + + + Restart Service + + + + + Start Monitor + + + + + Stop Monitor + + + + + Force Resync + + + + + Refresh Service Status + + + + + Obtain Sync Status + + + + + Test Service + + + + + start + + + + + + diff --git a/OneDriveGUI/ui/mainwindow.ui.autosave b/OneDriveGUI/ui/mainwindow.ui.autosave new file mode 100644 index 0000000..4a1f09c --- /dev/null +++ b/OneDriveGUI/ui/mainwindow.ui.autosave @@ -0,0 +1,298 @@ + + + MainWindow + + + + 0 + 0 + 589 + 683 + + + + OneDriveGUI + + + + ../icons8-clouds-48.png../icons8-clouds-48.png + + + + + + + + + OneDrive Process Status: + + + + + + + + + ... + + + + + + + + + + + ... + + + + + + + + + Sync Status: + + + + + + + + + + + TextLabel + + + + + + + + 300 + 16777215 + + + + 0 + + + + + + + + + QAbstractItemView::NoSelection + + + false + + + + New Item + + + + + + + + false + + + + row1 + + + + + row2 + + + + + Task + + + + + Filename + + + + + Progress + + + + + complete + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + Open Folder + + + + + + + + 0 + 0 + + + + Sync + + + + + + + + 0 + 0 + + + + Settings + + + + + + + + + + + 0 + 0 + 589 + 19 + + + + + Advanced + + + + Debug + + + + Service + + + + + + + + Monitor + + + + + + + + Status + + + + + + + + + + + + + + + + fghgfh + + + + + Start Service + + + + + Stop Service + + + + + Restart Service + + + + + Start Monitor + + + + + Stop Monitor + + + + + Force Resync + + + + + Refresh Service Status + + + + + Obtain Sync Status + + + + + Test Service + + + + + + diff --git a/OneDriveGUI/ui/process_status_page.ui b/OneDriveGUI/ui/process_status_page.ui new file mode 100644 index 0000000..2073c04 --- /dev/null +++ b/OneDriveGUI/ui/process_status_page.ui @@ -0,0 +1,137 @@ + + + status_page + + + + 0 + 0 + 441 + 763 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 100 + + + + background-color: rgb(0, 120, 212); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + ... + + + + + + + ... + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Onedrive is ... + + + Qt::AlignCenter + + + + + + + + + + QAbstractItemView::NoSelection + + + false + + + + + + + + + + 0 + 0 + + + + Open Folder + + + + + + + + 0 + 0 + + + + Sync + + + + + + + + 0 + 0 + + + + Settings + + + + + + + + + + diff --git a/OneDriveGUI/ui/profile_settings_page.ui b/OneDriveGUI/ui/profile_settings_page.ui new file mode 100644 index 0000000..2ad68a0 --- /dev/null +++ b/OneDriveGUI/ui/profile_settings_page.ui @@ -0,0 +1,258 @@ + + + profile_settings + + + + 0 + 0 + 588 + 785 + + + + Form + + + + + + + + 2 + + + + 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 + + + + + + + + + Rate Limit + + + + + 110 + 50 + 113 + 22 + + + + Qt::ImhDigitsOnly + + + + + + 10 + 50 + 101 + 16 + + + + Rate Limit [B/s] + + + + + + 250 + 50 + 71 + 16 + + + + (Mbit/s) + + + + + + Page + + + + + + + + + + Save + + + + + + + + diff --git a/OneDriveGUI/ui/settings.ui b/OneDriveGUI/ui/settings.ui new file mode 100644 index 0000000..892d21e --- /dev/null +++ b/OneDriveGUI/ui/settings.ui @@ -0,0 +1,60 @@ + + + settings_window + + + + 0 + 0 + 601 + 817 + + + + Form + + + + + + + + + + + 200 + 0 + + + + + + + + Remove profile + + + + + + + Create new profile + + + + + + + Import existing profile + + + + + + + + + + + + diff --git a/OneDriveGUI/ui/test.ui b/OneDriveGUI/ui/test.ui new file mode 100644 index 0000000..73a7a61 --- /dev/null +++ b/OneDriveGUI/ui/test.ui @@ -0,0 +1,23 @@ + + + + + + Form + + + + 0 + 0 + 240 + 320 + + + + Form + + + + + + diff --git a/OneDriveGUI/ui/ui_list_item_widget.py b/OneDriveGUI/ui/ui_list_item_widget.py new file mode 100644 index 0000000..f2088d9 --- /dev/null +++ b/OneDriveGUI/ui/ui_list_item_widget.py @@ -0,0 +1,86 @@ +# -*- 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, 60) + list_item_widget.setMinimumSize(QSize(50, 60)) + self.gridLayout = QGridLayout(list_item_widget) + self.gridLayout.setObjectName(u"gridLayout") + self.gridLayout.setHorizontalSpacing(5) + self.gridLayout.setVerticalSpacing(2) + self.gridLayout.setContentsMargins(5, 2, 2, 6) + self.toolButton = QToolButton(list_item_widget) + self.toolButton.setObjectName(u"toolButton") + self.toolButton.setEnabled(True) + self.toolButton.setMinimumSize(QSize(0, 0)) + 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(30, 40)) + + 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.ls_label_file_name.setMaximumSize(QSize(340, 16777215)) + font = QFont() + font.setPointSize(10) + font.setBold(True) + self.ls_label_file_name.setFont(font) + + self.gridLayout.addWidget(self.ls_label_file_name, 0, 1, 1, 2) + + self.ls_label_2 = QLabel(list_item_widget) + self.ls_label_2.setObjectName(u"ls_label_2") + self.ls_label_2.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + + self.gridLayout.addWidget(self.ls_label_2, 2, 2, 2, 1) + + self.ls_label_1 = QLabel(list_item_widget) + self.ls_label_1.setObjectName(u"ls_label_1") + + self.gridLayout.addWidget(self.ls_label_1, 2, 1, 2, 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_2.setText(QCoreApplication.translate("list_item_widget", u"60KB of 100KB", None)) + self.ls_label_1.setText(QCoreApplication.translate("list_item_widget", u"Downloading/Uploading ", None)) + # retranslateUi + diff --git a/OneDriveGUI/ui/ui_login.py b/OneDriveGUI/ui/ui_login.py new file mode 100644 index 0000000..a8b5ebe --- /dev/null +++ b/OneDriveGUI/ui/ui_login.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'login.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.QtWebEngineWidgets import QWebEngineView +from PySide6.QtWidgets import (QApplication, QHBoxLayout, QSizePolicy, QWidget) + +class Ui_LoginWindow(object): + def setupUi(self, LoginWindow): + if not LoginWindow.objectName(): + LoginWindow.setObjectName(u"LoginWindow") + LoginWindow.resize(640, 480) + sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(LoginWindow.sizePolicy().hasHeightForWidth()) + LoginWindow.setSizePolicy(sizePolicy) + LoginWindow.setMinimumSize(QSize(640, 480)) + LoginWindow.setMaximumSize(QSize(640, 480)) + self.horizontalLayout = QHBoxLayout(LoginWindow) + self.horizontalLayout.setSpacing(0) + self.horizontalLayout.setObjectName(u"horizontalLayout") + 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.horizontalLayout.addWidget(self.loginFrame) + + + self.retranslateUi(LoginWindow) + + QMetaObject.connectSlotsByName(LoginWindow) + # setupUi + + def retranslateUi(self, LoginWindow): + LoginWindow.setWindowTitle(QCoreApplication.translate("LoginWindow", u"Form", None)) + # retranslateUi + diff --git a/OneDriveGUI/ui/ui_mainwindow.py b/OneDriveGUI/ui/ui_mainwindow.py new file mode 100644 index 0000000..213e30a --- /dev/null +++ b/OneDriveGUI/ui/ui_mainwindow.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'mainwindow.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 (QAction, QBrush, QColor, QConicalGradient, + QCursor, QFont, QFontDatabase, QGradient, + QIcon, QImage, QKeySequence, QLinearGradient, + QPainter, QPalette, QPixmap, QRadialGradient, + QTransform) +from PySide6.QtWidgets import (QApplication, QComboBox, QMainWindow, QMenu, + QMenuBar, QSizePolicy, QVBoxLayout, QWidget) + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + if not MainWindow.objectName(): + MainWindow.setObjectName(u"MainWindow") + MainWindow.resize(497, 808) + icon = QIcon() + icon.addFile(u"../../../OneDriveGUI_POC_recovered-multi/icons8-clouds-48.png", QSize(), QIcon.Normal, QIcon.Off) + MainWindow.setWindowIcon(icon) + self.actionfghgfh = QAction(MainWindow) + self.actionfghgfh.setObjectName(u"actionfghgfh") + self.actionStart_Service = QAction(MainWindow) + self.actionStart_Service.setObjectName(u"actionStart_Service") + self.actionStop_Service = QAction(MainWindow) + self.actionStop_Service.setObjectName(u"actionStop_Service") + self.actionRestart_Service = QAction(MainWindow) + self.actionRestart_Service.setObjectName(u"actionRestart_Service") + self.actionStart_Monitor = QAction(MainWindow) + self.actionStart_Monitor.setObjectName(u"actionStart_Monitor") + self.actionStop_Monitor = QAction(MainWindow) + self.actionStop_Monitor.setObjectName(u"actionStop_Monitor") + self.actionForce_Resync = QAction(MainWindow) + self.actionForce_Resync.setObjectName(u"actionForce_Resync") + self.actionRefresh_Service_Status = QAction(MainWindow) + self.actionRefresh_Service_Status.setObjectName(u"actionRefresh_Service_Status") + self.actionObtain_Sync_Status = QAction(MainWindow) + self.actionObtain_Sync_Status.setObjectName(u"actionObtain_Sync_Status") + self.actionTest_Service = QAction(MainWindow) + self.actionTest_Service.setObjectName(u"actionTest_Service") + self.actionstart = QAction(MainWindow) + self.actionstart.setObjectName(u"actionstart") + self.centralwidget = QWidget(MainWindow) + self.centralwidget.setObjectName(u"centralwidget") + self.verticalLayout = QVBoxLayout(self.centralwidget) + self.verticalLayout.setSpacing(0) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_2 = QVBoxLayout() + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.comboBox = QComboBox(self.centralwidget) + self.comboBox.setObjectName(u"comboBox") + + self.verticalLayout_2.addWidget(self.comboBox) + + + self.verticalLayout.addLayout(self.verticalLayout_2) + + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QMenuBar(MainWindow) + self.menubar.setObjectName(u"menubar") + self.menubar.setGeometry(QRect(0, 0, 497, 30)) + self.menuAdvanced = QMenu(self.menubar) + self.menuAdvanced.setObjectName(u"menuAdvanced") + self.menuDebug = QMenu(self.menuAdvanced) + self.menuDebug.setObjectName(u"menuDebug") + self.menuService = QMenu(self.menuDebug) + self.menuService.setObjectName(u"menuService") + self.menuMonitor = QMenu(self.menuDebug) + self.menuMonitor.setObjectName(u"menuMonitor") + self.menuStatus = QMenu(self.menuDebug) + self.menuStatus.setObjectName(u"menuStatus") + self.menuaccount2 = QMenu(self.menuAdvanced) + self.menuaccount2.setObjectName(u"menuaccount2") + MainWindow.setMenuBar(self.menubar) + + self.menubar.addAction(self.menuAdvanced.menuAction()) + self.menuAdvanced.addAction(self.menuDebug.menuAction()) + self.menuAdvanced.addAction(self.menuaccount2.menuAction()) + self.menuDebug.addAction(self.menuService.menuAction()) + self.menuDebug.addAction(self.menuMonitor.menuAction()) + self.menuDebug.addAction(self.menuStatus.menuAction()) + self.menuService.addAction(self.actionStart_Service) + self.menuService.addAction(self.actionStop_Service) + self.menuService.addAction(self.actionRestart_Service) + self.menuMonitor.addAction(self.actionStart_Monitor) + self.menuMonitor.addAction(self.actionStop_Monitor) + self.menuMonitor.addAction(self.actionForce_Resync) + self.menuStatus.addAction(self.actionRefresh_Service_Status) + self.menuStatus.addAction(self.actionObtain_Sync_Status) + self.menuaccount2.addAction(self.actionstart) + + self.retranslateUi(MainWindow) + + QMetaObject.connectSlotsByName(MainWindow) + # setupUi + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"OneDriveGUI", None)) + self.actionfghgfh.setText(QCoreApplication.translate("MainWindow", u"fghgfh", None)) + self.actionStart_Service.setText(QCoreApplication.translate("MainWindow", u"Start Service", None)) + self.actionStop_Service.setText(QCoreApplication.translate("MainWindow", u"Stop Service", None)) + self.actionRestart_Service.setText(QCoreApplication.translate("MainWindow", u"Restart Service", None)) + self.actionStart_Monitor.setText(QCoreApplication.translate("MainWindow", u"Start Monitor", None)) + self.actionStop_Monitor.setText(QCoreApplication.translate("MainWindow", u"Stop Monitor", None)) + self.actionForce_Resync.setText(QCoreApplication.translate("MainWindow", u"Force Resync", None)) + self.actionRefresh_Service_Status.setText(QCoreApplication.translate("MainWindow", u"Refresh Service Status", None)) + self.actionObtain_Sync_Status.setText(QCoreApplication.translate("MainWindow", u"Obtain Sync Status", None)) + self.actionTest_Service.setText(QCoreApplication.translate("MainWindow", u"Test Service", None)) + self.actionstart.setText(QCoreApplication.translate("MainWindow", u"start", None)) + self.menuAdvanced.setTitle(QCoreApplication.translate("MainWindow", u"Advanced", None)) + self.menuDebug.setTitle(QCoreApplication.translate("MainWindow", u"Debug", None)) + self.menuService.setTitle(QCoreApplication.translate("MainWindow", u"Service", None)) + self.menuMonitor.setTitle(QCoreApplication.translate("MainWindow", u"Monitor", None)) + self.menuStatus.setTitle(QCoreApplication.translate("MainWindow", u"Status", None)) + self.menuaccount2.setTitle(QCoreApplication.translate("MainWindow", u"account2", None)) + # retranslateUi + diff --git a/OneDriveGUI/ui/ui_process_status_page.py b/OneDriveGUI/ui/ui_process_status_page.py new file mode 100644 index 0000000..8903c05 --- /dev/null +++ b/OneDriveGUI/ui/ui_process_status_page.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'process_status_page.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 (QAbstractItemView, QApplication, QFrame, QGridLayout, + QHBoxLayout, QLabel, QListWidget, QListWidgetItem, + QPushButton, QSizePolicy, QVBoxLayout, QWidget) + +class Ui_status_page(object): + def setupUi(self, status_page): + if not status_page.objectName(): + status_page.setObjectName(u"status_page") + status_page.resize(441, 763) + self.verticalLayout = QVBoxLayout(status_page) + self.verticalLayout.setSpacing(0) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.frame = QFrame(status_page) + self.frame.setObjectName(u"frame") + self.frame.setMinimumSize(QSize(0, 100)) + self.frame.setStyleSheet(u"background-color: rgb(0, 120, 212);") + self.frame.setFrameShape(QFrame.StyledPanel) + self.frame.setFrameShadow(QFrame.Raised) + self.gridLayout = QGridLayout(self.frame) + self.gridLayout.setObjectName(u"gridLayout") + self.label_4 = QLabel(self.frame) + self.label_4.setObjectName(u"label_4") + + self.gridLayout.addWidget(self.label_4, 2, 0, 1, 1) + + self.label_3 = QLabel(self.frame) + self.label_3.setObjectName(u"label_3") + self.label_3.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + + self.gridLayout.addWidget(self.label_3, 2, 2, 1, 1) + + self.label_6 = QLabel(self.frame) + self.label_6.setObjectName(u"label_6") + self.label_6.setAlignment(Qt.AlignCenter) + + self.gridLayout.addWidget(self.label_6, 1, 0, 1, 3) + + + self.verticalLayout.addWidget(self.frame) + + self.listWidget = QListWidget(status_page) + self.listWidget.setObjectName(u"listWidget") + self.listWidget.setSelectionMode(QAbstractItemView.NoSelection) + self.listWidget.setSortingEnabled(False) + + self.verticalLayout.addWidget(self.listWidget) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton = QPushButton(status_page) + self.pushButton.setObjectName(u"pushButton") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) + self.pushButton.setSizePolicy(sizePolicy) + + self.horizontalLayout.addWidget(self.pushButton) + + self.pushButton_2 = QPushButton(status_page) + self.pushButton_2.setObjectName(u"pushButton_2") + sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth()) + self.pushButton_2.setSizePolicy(sizePolicy) + + self.horizontalLayout.addWidget(self.pushButton_2) + + self.pushButton_settings = QPushButton(status_page) + self.pushButton_settings.setObjectName(u"pushButton_settings") + sizePolicy.setHeightForWidth(self.pushButton_settings.sizePolicy().hasHeightForWidth()) + self.pushButton_settings.setSizePolicy(sizePolicy) + + self.horizontalLayout.addWidget(self.pushButton_settings) + + + self.verticalLayout.addLayout(self.horizontalLayout) + + + self.retranslateUi(status_page) + + QMetaObject.connectSlotsByName(status_page) + # setupUi + + def retranslateUi(self, status_page): + status_page.setWindowTitle(QCoreApplication.translate("status_page", u"Form", None)) + self.label_4.setText(QCoreApplication.translate("status_page", u"...", None)) + self.label_3.setText(QCoreApplication.translate("status_page", u"...", None)) + self.label_6.setText(QCoreApplication.translate("status_page", u"Onedrive is ...", None)) + self.pushButton.setText(QCoreApplication.translate("status_page", u"Open Folder", 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/OneDriveGUI/ui/ui_profile_settings_page.py b/OneDriveGUI/ui/ui_profile_settings_page.py new file mode 100644 index 0000000..58da91c --- /dev/null +++ b/OneDriveGUI/ui/ui_profile_settings_page.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'profile_settings_page.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, QLabel, + QLineEdit, QListWidget, QListWidgetItem, QPushButton, + QSizePolicy, QSpacerItem, QTabWidget, QVBoxLayout, + QWidget) + +class Ui_profile_settings(object): + def setupUi(self, profile_settings): + if not profile_settings.objectName(): + profile_settings.setObjectName(u"profile_settings") + profile_settings.resize(588, 785) + self.verticalLayout_2 = QVBoxLayout(profile_settings) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget = QTabWidget(profile_settings) + self.tabWidget.setObjectName(u"tabWidget") + self.exemptions_tab_2 = QWidget() + self.exemptions_tab_2.setObjectName(u"exemptions_tab_2") + self.verticalLayout_5 = QVBoxLayout(self.exemptions_tab_2) + self.verticalLayout_5.setObjectName(u"verticalLayout_5") + self.gridLayout_5 = QGridLayout() + self.gridLayout_5.setObjectName(u"gridLayout_5") + self.checkBox_3 = QCheckBox(self.exemptions_tab_2) + self.checkBox_3.setObjectName(u"checkBox_3") + + self.gridLayout_5.addWidget(self.checkBox_3, 1, 0, 1, 2) + + self.label_7 = QLabel(self.exemptions_tab_2) + self.label_7.setObjectName(u"label_7") + + self.gridLayout_5.addWidget(self.label_7, 0, 0, 1, 1) + + self.lineEdit_6 = QLineEdit(self.exemptions_tab_2) + self.lineEdit_6.setObjectName(u"lineEdit_6") + + self.gridLayout_5.addWidget(self.lineEdit_6, 0, 1, 1, 1) + + self.pushButton_3 = QPushButton(self.exemptions_tab_2) + self.pushButton_3.setObjectName(u"pushButton_3") + + self.gridLayout_5.addWidget(self.pushButton_3, 0, 2, 1, 1) + + + self.verticalLayout_5.addLayout(self.gridLayout_5) + + self.label_8 = QLabel(self.exemptions_tab_2) + self.label_8.setObjectName(u"label_8") + + self.verticalLayout_5.addWidget(self.label_8) + + self.gridLayout_6 = QGridLayout() + self.gridLayout_6.setObjectName(u"gridLayout_6") + self.lineEdit_7 = QLineEdit(self.exemptions_tab_2) + self.lineEdit_7.setObjectName(u"lineEdit_7") + + self.gridLayout_6.addWidget(self.lineEdit_7, 1, 0, 1, 1) + + self.pushButton_9 = QPushButton(self.exemptions_tab_2) + self.pushButton_9.setObjectName(u"pushButton_9") + + self.gridLayout_6.addWidget(self.pushButton_9, 1, 1, 1, 1) + + self.pushButton_10 = QPushButton(self.exemptions_tab_2) + self.pushButton_10.setObjectName(u"pushButton_10") + sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_10.sizePolicy().hasHeightForWidth()) + self.pushButton_10.setSizePolicy(sizePolicy) + + self.gridLayout_6.addWidget(self.pushButton_10, 0, 1, 1, 1) + + self.listWidget_3 = QListWidget(self.exemptions_tab_2) + self.listWidget_3.setObjectName(u"listWidget_3") + + self.gridLayout_6.addWidget(self.listWidget_3, 0, 0, 1, 1) + + + self.verticalLayout_5.addLayout(self.gridLayout_6) + + self.label_9 = QLabel(self.exemptions_tab_2) + self.label_9.setObjectName(u"label_9") + + self.verticalLayout_5.addWidget(self.label_9) + + self.gridLayout_7 = QGridLayout() + self.gridLayout_7.setObjectName(u"gridLayout_7") + self.pushButton_11 = QPushButton(self.exemptions_tab_2) + self.pushButton_11.setObjectName(u"pushButton_11") + sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.pushButton_11.sizePolicy().hasHeightForWidth()) + self.pushButton_11.setSizePolicy(sizePolicy1) + + self.gridLayout_7.addWidget(self.pushButton_11, 0, 1, 1, 1) + + self.listWidget_4 = QListWidget(self.exemptions_tab_2) + self.listWidget_4.setObjectName(u"listWidget_4") + sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.listWidget_4.sizePolicy().hasHeightForWidth()) + self.listWidget_4.setSizePolicy(sizePolicy2) + + self.gridLayout_7.addWidget(self.listWidget_4, 0, 0, 1, 1) + + self.lineEdit_8 = QLineEdit(self.exemptions_tab_2) + self.lineEdit_8.setObjectName(u"lineEdit_8") + + self.gridLayout_7.addWidget(self.lineEdit_8, 1, 0, 1, 1) + + self.pushButton_12 = QPushButton(self.exemptions_tab_2) + self.pushButton_12.setObjectName(u"pushButton_12") + sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.pushButton_12.sizePolicy().hasHeightForWidth()) + self.pushButton_12.setSizePolicy(sizePolicy3) + + self.gridLayout_7.addWidget(self.pushButton_12, 1, 1, 1, 1) + + + self.verticalLayout_5.addLayout(self.gridLayout_7) + + self.tabWidget.addTab(self.exemptions_tab_2, "") + self.logging_tab_2 = QWidget() + self.logging_tab_2.setObjectName(u"logging_tab_2") + self.verticalLayout_6 = QVBoxLayout(self.logging_tab_2) + self.verticalLayout_6.setObjectName(u"verticalLayout_6") + self.gridLayout_8 = QGridLayout() + self.gridLayout_8.setObjectName(u"gridLayout_8") + self.checkBox_4 = QCheckBox(self.logging_tab_2) + self.checkBox_4.setObjectName(u"checkBox_4") + + self.gridLayout_8.addWidget(self.checkBox_4, 0, 0, 1, 2) + + self.label_10 = QLabel(self.logging_tab_2) + self.label_10.setObjectName(u"label_10") + + self.gridLayout_8.addWidget(self.label_10, 1, 0, 1, 1) + + self.lineEdit_9 = QLineEdit(self.logging_tab_2) + self.lineEdit_9.setObjectName(u"lineEdit_9") + + self.gridLayout_8.addWidget(self.lineEdit_9, 1, 1, 1, 1) + + self.pushButton_4 = QPushButton(self.logging_tab_2) + self.pushButton_4.setObjectName(u"pushButton_4") + + self.gridLayout_8.addWidget(self.pushButton_4, 1, 2, 1, 1) + + + self.verticalLayout_6.addLayout(self.gridLayout_8) + + self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_6.addItem(self.verticalSpacer_2) + + self.tabWidget.addTab(self.logging_tab_2, "") + self.tab_5 = QWidget() + self.tab_5.setObjectName(u"tab_5") + self.lineEdit_10 = QLineEdit(self.tab_5) + self.lineEdit_10.setObjectName(u"lineEdit_10") + self.lineEdit_10.setGeometry(QRect(110, 50, 113, 22)) + self.lineEdit_10.setInputMethodHints(Qt.ImhDigitsOnly) + self.label_11 = QLabel(self.tab_5) + self.label_11.setObjectName(u"label_11") + self.label_11.setGeometry(QRect(10, 50, 101, 16)) + self.label_12 = QLabel(self.tab_5) + self.label_12.setObjectName(u"label_12") + self.label_12.setGeometry(QRect(250, 50, 71, 16)) + self.tabWidget.addTab(self.tab_5, "") + self.tab_6 = QWidget() + self.tab_6.setObjectName(u"tab_6") + self.tabWidget.addTab(self.tab_6, "") + + self.verticalLayout.addWidget(self.tabWidget) + + + self.verticalLayout_2.addLayout(self.verticalLayout) + + self.pushButton_13 = QPushButton(profile_settings) + self.pushButton_13.setObjectName(u"pushButton_13") + + self.verticalLayout_2.addWidget(self.pushButton_13) + + + self.retranslateUi(profile_settings) + + self.tabWidget.setCurrentIndex(2) + + + QMetaObject.connectSlotsByName(profile_settings) + # setupUi + + def retranslateUi(self, profile_settings): + profile_settings.setWindowTitle(QCoreApplication.translate("profile_settings", u"Form", None)) + self.checkBox_3.setText(QCoreApplication.translate("profile_settings", u"Skip Hidden Files", None)) + self.label_7.setText(QCoreApplication.translate("profile_settings", u"Sync Folder:", None)) + self.pushButton_3.setText(QCoreApplication.translate("profile_settings", u"Browse", None)) + self.label_8.setText(QCoreApplication.translate("profile_settings", u"Skip files:", None)) + self.pushButton_9.setText(QCoreApplication.translate("profile_settings", u"Add", None)) + self.pushButton_10.setText(QCoreApplication.translate("profile_settings", u"Remove", None)) + self.label_9.setText(QCoreApplication.translate("profile_settings", u"Skip directories:", None)) + self.pushButton_11.setText(QCoreApplication.translate("profile_settings", u"Remove", None)) + self.pushButton_12.setText(QCoreApplication.translate("profile_settings", u"Add", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.exemptions_tab_2), QCoreApplication.translate("profile_settings", u"Monitored Files", None)) + self.checkBox_4.setText(QCoreApplication.translate("profile_settings", u"Enable Logging", None)) + self.label_10.setText(QCoreApplication.translate("profile_settings", u"Log location:", None)) + self.pushButton_4.setText(QCoreApplication.translate("profile_settings", u"Browse", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.logging_tab_2), QCoreApplication.translate("profile_settings", u"Logging", None)) + self.label_11.setText(QCoreApplication.translate("profile_settings", u"Rate Limit [B/s]", None)) + self.label_12.setText(QCoreApplication.translate("profile_settings", u"(Mbit/s)", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), QCoreApplication.translate("profile_settings", u"Rate Limit", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_6), QCoreApplication.translate("profile_settings", u"Page", None)) + self.pushButton_13.setText(QCoreApplication.translate("profile_settings", u"Save", None)) + # retranslateUi + diff --git a/OneDriveGUI/ui/ui_settings.py b/OneDriveGUI/ui/ui_settings.py new file mode 100644 index 0000000..38af2d6 --- /dev/null +++ b/OneDriveGUI/ui/ui_settings.py @@ -0,0 +1,71 @@ +# -*- 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, QHBoxLayout, QListWidget, QListWidgetItem, + QPushButton, QSizePolicy, QVBoxLayout, QWidget) + +class Ui_settings_window(object): + def setupUi(self, settings_window): + if not settings_window.objectName(): + settings_window.setObjectName(u"settings_window") + settings_window.resize(601, 817) + self.verticalLayout_2 = QVBoxLayout(settings_window) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.verticalLayout = QVBoxLayout() + self.verticalLayout.setObjectName(u"verticalLayout") + self.listWidget = QListWidget(settings_window) + self.listWidget.setObjectName(u"listWidget") + self.listWidget.setMinimumSize(QSize(200, 0)) + + self.verticalLayout.addWidget(self.listWidget) + + self.pushButton_3 = QPushButton(settings_window) + self.pushButton_3.setObjectName(u"pushButton_3") + + self.verticalLayout.addWidget(self.pushButton_3) + + self.pushButton_2 = QPushButton(settings_window) + self.pushButton_2.setObjectName(u"pushButton_2") + + self.verticalLayout.addWidget(self.pushButton_2) + + self.pushButton = QPushButton(settings_window) + self.pushButton.setObjectName(u"pushButton") + + self.verticalLayout.addWidget(self.pushButton) + + + self.horizontalLayout.addLayout(self.verticalLayout) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + + self.retranslateUi(settings_window) + + QMetaObject.connectSlotsByName(settings_window) + # setupUi + + def retranslateUi(self, settings_window): + settings_window.setWindowTitle(QCoreApplication.translate("settings_window", u"Form", None)) + self.pushButton_3.setText(QCoreApplication.translate("settings_window", u"Remove profile", None)) + self.pushButton_2.setText(QCoreApplication.translate("settings_window", u"Create new profile", None)) + self.pushButton.setText(QCoreApplication.translate("settings_window", u"Import existing profile", None)) + # retranslateUi + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4fce7fe --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +psutil==5.9.0 +PySide6==6.2.2.1