diff --git a/joystick_diagrams/__main__.py b/joystick_diagrams/__main__.py index 61b079e..22e81bd 100644 --- a/joystick_diagrams/__main__.py +++ b/joystick_diagrams/__main__.py @@ -6,9 +6,6 @@ from PyQt5 import QtCore, QtGui, QtWidgets -QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) -QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) - from joystick_diagrams import config from joystick_diagrams.adaptors.dcs.dcs_world import DCSWorldParser from joystick_diagrams.adaptors.joystick_gremlin.joystick_gremlin import JoystickGremlin @@ -16,12 +13,15 @@ from joystick_diagrams.classes import export from joystick_diagrams.classes.version import version from joystick_diagrams.devices import device_manager -from joystick_diagrams.ui import ui +from joystick_diagrams.ui import main_UI + +QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) # type: ignore +QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) # type: ignore _logger = logging.getLogger(__name__) -class MainWindow(QtWidgets.QMainWindow, ui.Ui_MainWindow): # Refactor pylint: disable=too-many-instance-attributes +class MainWindow(QtWidgets.QMainWindow, main_UI.Ui_MainWindow): # Refactor pylint: disable=too-many-instance-attributes def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.setupUi(self) @@ -31,6 +31,12 @@ def __init__(self, *args, **kwargs): self.dcs_profiles_list.clear() self.jg_profile_list.clear() self.application_information_textbrowser.clear() + self.donate_button.clicked.connect(self.open_version_window) + self.discord_button.clicked.connect( + lambda: QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://discord.gg/G8nRUS2")) + ) + self.version_checked = self.version_check() + # DCS UI Setup self.dcs_selected_directory_label.setText("") self.dcs_parser_instance = None @@ -44,16 +50,6 @@ def __init__(self, *args, **kwargs): self.export_button.clicked.connect(self.export_profiles) self.parser_selector.currentChanged.connect(self.change_export_button) self.change_export_button() - self.donate_button.clicked.connect( - lambda: QtGui.QDesktopServices.openUrl( - QtCore.QUrl( - "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WLLDYGQM5Z39W&source=url" - ) - ) - ) - self.discord_button.clicked.connect( - lambda: QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://discord.gg/G8nRUS2")) - ) # JG UI Setup self.jg_select_profile_button.clicked.connect(self.set_jg_file) @@ -63,6 +59,25 @@ def __init__(self, *args, **kwargs): self.sc_parser_instance = None self.sc_select_button.clicked.connect(self.set_sc_file) + def version_check(self): + check = version.performn_version_check() + + if check: + self.open_version_window() + + return check + + def open_version_window(self): + msg_box = QtWidgets.QMessageBox() + msg_box.setIcon(QtWidgets.QMessageBox.Information) + msg_box.setText( + "A new version is available at Joystick Diagrams website" + ) + msg_box.setWindowTitle("Joystick Diagrams - Update available") + msg_box.setStandardButtons(QtWidgets.QMessageBox.Ok) + + msg_box.exec() + def set_version(self) -> None: """ Set version in UI window diff --git a/joystick_diagrams/classes/version/__init__.py b/joystick_diagrams/classes/version/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/joystick_diagrams/classes/version/version.py b/joystick_diagrams/classes/version/version.py index c57d710..16f0e1f 100644 --- a/joystick_diagrams/classes/version/version.py +++ b/joystick_diagrams/classes/version/version.py @@ -3,18 +3,19 @@ Author: https://github.com/Rexeh """ -from dataclasses import dataclass +import json import logging -from pathlib import Path +import os +from dataclasses import dataclass from hashlib import sha256 -import json +from pathlib import Path from typing import Any -import os + import requests _LOGGER = logging.getLogger(__name__) -VERSION = "1.6" +VERSION = "2.0-ALPHA" VERSION_SERVER = "https://www.joystick-diagrams.com/" TEMPLATE_DIR = "./templates" MANIFEST_DIR = "./" @@ -54,7 +55,11 @@ def fetch_local_manifest() -> str | None: def performn_version_check() -> bool: - """Checks the local version against the latest release""" + """Checks the local version against the latest release# + + Returns True for Matched Versions + Returns False for Unmatched Versions + """ remote_manifest = fetch_remote_manifest() local_manifest = fetch_local_manifest() @@ -109,6 +114,10 @@ def generate_template_manifest() -> dict[str, str]: def compare_versions(running_version: JoystickDiagramVersion, latest_version: JoystickDiagramVersion) -> bool: + """Compares versions based on object __eq__ + + Returns TRUE for MATCH + """ return running_version == latest_version diff --git a/joystick_diagrams/devices/device_manager.py b/joystick_diagrams/devices/device_manager.py index f14a6fa..22b1a75 100644 --- a/joystick_diagrams/devices/device_manager.py +++ b/joystick_diagrams/devices/device_manager.py @@ -1,11 +1,10 @@ import logging from time import sleep -from typing import Any from joystick_diagrams.devices import dill _LOGGER = logging.getLogger(__name__) -_ACTIVE_DEViCES = {} +_ACTIVE_DEViCES: dict[str, str] = {} # GUID : Display Name # Action mappings for device changes DEVICE_ACTIONS = {1: "DEVICE_ADDED", 2: "DEVICE_REMOVED"} @@ -15,11 +14,11 @@ # Cannot debug? def _update_device_register(data: dill._DeviceSummary, action): - _LOGGER.info(f"Device was altered, added to device changes") + _LOGGER.info(f"Device {data} was altered, added to device changes") _device_changes.append([dill.DeviceSummary(data), action]) -dill.DILL.set_device_change_callback(_update_device_register) # Figure out this callable +dill.DILL.set_device_change_callback(_update_device_register) # mypy: ignore # CAN BE DEBUGGED @@ -42,10 +41,4 @@ def run(): if __name__ == "__main__": - lst = [1, 2, 3, 4, 5] - - while len(lst) != 0: - i = lst.pop(0) - print(f"Popped {i}") - - print("finished") + pass diff --git a/joystick_diagrams/ui/ui.py b/joystick_diagrams/ui/main_UI.py similarity index 83% rename from joystick_diagrams/ui/ui.py rename to joystick_diagrams/ui/main_UI.py index 868ef4d..a58c9c8 100644 --- a/joystick_diagrams/ui/ui.py +++ b/joystick_diagrams/ui/main_UI.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'untitled.ui' +# Form implementation generated from reading ui file './qt_ui/main.ui' # -# Created by: PyQt5 UI code generator 5.15.1 +# Created by: PyQt5 UI code generator 5.15.10 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -154,26 +154,24 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) MainWindow.setPalette(palette) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap("images/logo.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap("./qt_ui\\images/logo.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setAutoFillBackground(True) - MainWindow.setStyleSheet('font: 75 12pt "Arial";') + MainWindow.setStyleSheet("font: 75 12pt \"Arial\";") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.export_progress_bar = QtWidgets.QProgressBar(self.centralwidget) self.export_progress_bar.setGeometry(QtCore.QRect(570, 600, 301, 23)) - self.export_progress_bar.setStyleSheet( - "color: white;\n" - "\n" - "QProgressBar::horizontal {\n" - "border: 1px solid gray;\n" - "border-radius: 3px;\n" - "background: white;\n" - "padding: 1px;\n" - "text-align: right;\n" - "margin-right: 4ex;\n" - "};" - ) + self.export_progress_bar.setStyleSheet("color: white;\n" +"\n" +"QProgressBar::horizontal {\n" +"border: 1px solid gray;\n" +"border-radius: 3px;\n" +"background: white;\n" +"padding: 1px;\n" +"text-align: right;\n" +"margin-right: 4ex;\n" +"};") self.export_progress_bar.setMaximum(100) self.export_progress_bar.setProperty("value", 0) self.export_progress_bar.setInvertedAppearance(False) @@ -190,7 +188,7 @@ def setupUi(self, MainWindow): self.version_label.setFocusPolicy(QtCore.Qt.NoFocus) self.version_label.setFrameShadow(QtWidgets.QFrame.Sunken) self.version_label.setText("") - self.version_label.setPixmap(QtGui.QPixmap("images/logo.png")) + self.version_label.setPixmap(QtGui.QPixmap("./qt_ui\\images/logo.png")) self.version_label.setScaledContents(True) self.version_label.setObjectName("version_label") self.parser_selector = QtWidgets.QTabWidget(self.centralwidget) @@ -333,41 +331,39 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.parser_selector.setPalette(palette) self.parser_selector.setAutoFillBackground(False) - self.parser_selector.setStyleSheet( - "QWidget {\n" - "background: #1e1e1e\n" - "}\n" - "\n" - "QTabWidget::pane { /* The tab widget frame */\n" - "border-top: 2px solid #C2C7CB;\n" - "}\n" - "QTabWidget::tab-bar {\n" - "left: 0px; /* move to the right by 5px */\n" - "}\n" - "/* Style the tab using the tab sub-control. Note that it reads QTabBar _not_ QTabWidget */\n" - "QTabBar::tab {\n" - "background: #2d2d2d;\n" - "border-bottom-color: #C2C7CB; /* same as the pane color */\n" - "border-top-left-radius: 4px;\n" - "border-top-right-radius: 4px;\n" - "min-width: 8ex;\n" - "padding: 10px;\n" - "color: white;\n" - "}\n" - "QTabBar::tab:selected, QTabBar::tab:hover {\n" - "background: #1e1e1e;\n" - "}\n" - "QTabBar::tab:selected {\n" - "border-color: #1e1e1e;\n" - "bottom-left-color:white;\n" - "border-right-color:white;\n" - "border: 1px;\n" - "border-bottom-color: #C2C7CB; /* same as pane color */\n" - "}\n" - "QTabBar::tab:!selected {\n" - "margin-top: 2px; /* make non-selected tabs look smaller */\n" - "}" - ) + self.parser_selector.setStyleSheet("QWidget {\n" +"background: #1e1e1e\n" +"}\n" +"\n" +"QTabWidget::pane { /* The tab widget frame */\n" +"border-top: 2px solid #C2C7CB;\n" +"}\n" +"QTabWidget::tab-bar {\n" +"left: 0px; /* move to the right by 5px */\n" +"}\n" +"/* Style the tab using the tab sub-control. Note that it reads QTabBar _not_ QTabWidget */\n" +"QTabBar::tab {\n" +"background: #2d2d2d;\n" +"border-bottom-color: #C2C7CB; /* same as the pane color */\n" +"border-top-left-radius: 4px;\n" +"border-top-right-radius: 4px;\n" +"min-width: 8ex;\n" +"padding: 10px;\n" +"color: white;\n" +"}\n" +"QTabBar::tab:selected, QTabBar::tab:hover {\n" +"background: #1e1e1e;\n" +"}\n" +"QTabBar::tab:selected {\n" +"border-color: #1e1e1e;\n" +"bottom-left-color:white;\n" +"border-right-color:white;\n" +"border: 1px;\n" +"border-bottom-color: #C2C7CB; /* same as pane color */\n" +"}\n" +"QTabBar::tab:!selected {\n" +"margin-top: 2px; /* make non-selected tabs look smaller */\n" +"}") self.parser_selector.setTabPosition(QtWidgets.QTabWidget.North) self.parser_selector.setTabShape(QtWidgets.QTabWidget.Rounded) self.parser_selector.setTabsClosable(False) @@ -377,16 +373,14 @@ def setupUi(self, MainWindow): self.jg_profile_list = QtWidgets.QListWidget(self.jg_tab) self.jg_profile_list.setEnabled(True) self.jg_profile_list.setGeometry(QtCore.QRect(20, 171, 351, 211)) - self.jg_profile_list.setStyleSheet( - "QListView::item {\n" - "color: white\n" - "}\n" - "\n" - "QListView::item:selected {\n" - "background: #007acc;\n" - "color: white\n" - "}" - ) + self.jg_profile_list.setStyleSheet("QListView::item {\n" +"color: white\n" +"}\n" +"\n" +"QListView::item:selected {\n" +"background: #007acc;\n" +"color: white\n" +"}") self.jg_profile_list.setAlternatingRowColors(False) self.jg_profile_list.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) self.jg_profile_list.setObjectName("jg_profile_list") @@ -406,7 +400,8 @@ def setupUi(self, MainWindow): self.jg_available_profiles_label.setObjectName("jg_available_profiles_label") self.jg_select_profile_button = QtWidgets.QPushButton(self.jg_tab) self.jg_select_profile_button.setGeometry(QtCore.QRect(20, 60, 261, 23)) - self.jg_select_profile_button.setStyleSheet("color:white;\n" "border: 1px solid white;") + self.jg_select_profile_button.setStyleSheet("color:white;\n" +"border: 1px solid white;") self.jg_select_profile_button.setObjectName("jg_select_profile_button") self.label = QtWidgets.QLabel(self.jg_tab) self.label.setGeometry(QtCore.QRect(20, 29, 221, 20)) @@ -423,11 +418,7 @@ def setupUi(self, MainWindow): self.label_11.setStyleSheet("color:white") self.label_11.setObjectName("label_11") icon1 = QtGui.QIcon() - icon1.addPixmap( - QtGui.QPixmap("images/3rd_party/jg.ico"), - QtGui.QIcon.Normal, - QtGui.QIcon.Off, - ) + icon1.addPixmap(QtGui.QPixmap("./qt_ui\\images/3rd_party/jg.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.parser_selector.addTab(self.jg_tab, icon1, "") self.dcs_tab = QtWidgets.QWidget() self.dcs_tab.setObjectName("dcs_tab") @@ -437,25 +428,25 @@ def setupUi(self, MainWindow): self.dcs_world_label.setObjectName("dcs_world_label") self.dcs_directory_select_button = QtWidgets.QPushButton(self.dcs_tab) self.dcs_directory_select_button.setGeometry(QtCore.QRect(20, 80, 261, 23)) - self.dcs_directory_select_button.setStyleSheet("color:white;\n" "border: 1px solid white;") + self.dcs_directory_select_button.setStyleSheet("color:white;\n" +"border: 1px solid white;") self.dcs_directory_select_button.setObjectName("dcs_directory_select_button") self.dcs_saved_games_label = QtWidgets.QLabel(self.dcs_tab) self.dcs_saved_games_label.setGeometry(QtCore.QRect(20, 50, 261, 20)) - self.dcs_saved_games_label.setStyleSheet("font-size: 11px;\n" "color:white;") + self.dcs_saved_games_label.setStyleSheet("font-size: 11px;\n" +"color:white;") self.dcs_saved_games_label.setObjectName("dcs_saved_games_label") self.dcs_profiles_list = QtWidgets.QListWidget(self.dcs_tab) self.dcs_profiles_list.setEnabled(True) self.dcs_profiles_list.setGeometry(QtCore.QRect(20, 180, 351, 201)) - self.dcs_profiles_list.setStyleSheet( - "QListView::item {\n" - "color: white\n" - "}\n" - "\n" - "QListView::item:selected {\n" - "background: #007acc;\n" - "color: white\n" - "}" - ) + self.dcs_profiles_list.setStyleSheet("QListView::item {\n" +"color: white\n" +"}\n" +"\n" +"QListView::item:selected {\n" +"background: #007acc;\n" +"color: white\n" +"}") self.dcs_profiles_list.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) self.dcs_profiles_list.setObjectName("dcs_profiles_list") item = QtWidgets.QListWidgetItem() @@ -480,7 +471,8 @@ def setupUi(self, MainWindow): self.dcs_easy_mode_checkbox.setObjectName("dcs_easy_mode_checkbox") self.dcs_selected_directory_label = QtWidgets.QLabel(self.dcs_tab) self.dcs_selected_directory_label.setGeometry(QtCore.QRect(20, 150, 261, 20)) - self.dcs_selected_directory_label.setStyleSheet("font-size: 11px;\n" "color:white;") + self.dcs_selected_directory_label.setStyleSheet("font-size: 11px;\n" +"color:white;") self.dcs_selected_directory_label.setObjectName("dcs_selected_directory_label") self.label_10 = QtWidgets.QLabel(self.dcs_tab) self.label_10.setEnabled(True) @@ -488,11 +480,7 @@ def setupUi(self, MainWindow): self.label_10.setStyleSheet("color:white") self.label_10.setObjectName("label_10") icon2 = QtGui.QIcon() - icon2.addPixmap( - QtGui.QPixmap("images/3rd_party/dcs.ico"), - QtGui.QIcon.Normal, - QtGui.QIcon.Off, - ) + icon2.addPixmap(QtGui.QPixmap("./qt_ui\\images/3rd_party/dcs.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.parser_selector.addTab(self.dcs_tab, icon2, "") self.sc_tab = QtWidgets.QWidget() self.sc_tab.setObjectName("sc_tab") @@ -502,18 +490,16 @@ def setupUi(self, MainWindow): self.sc_label.setObjectName("sc_label") self.sc_description_label = QtWidgets.QLabel(self.sc_tab) self.sc_description_label.setGeometry(QtCore.QRect(30, 50, 261, 20)) - self.sc_description_label.setStyleSheet("font-size: 11px;\n" "color:white;") + self.sc_description_label.setStyleSheet("font-size: 11px;\n" +"color:white;") self.sc_description_label.setObjectName("sc_description_label") self.sc_select_button = QtWidgets.QPushButton(self.sc_tab) self.sc_select_button.setGeometry(QtCore.QRect(30, 80, 261, 23)) - self.sc_select_button.setStyleSheet("color:white;\n" "border: 1px solid white;") + self.sc_select_button.setStyleSheet("color:white;\n" +"border: 1px solid white;") self.sc_select_button.setObjectName("sc_select_button") icon3 = QtGui.QIcon() - icon3.addPixmap( - QtGui.QPixmap("images/3rd_party/sc.png"), - QtGui.QIcon.Normal, - QtGui.QIcon.Off, - ) + icon3.addPixmap(QtGui.QPixmap("./qt_ui\\images/3rd_party/sc.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.parser_selector.addTab(self.sc_tab, icon3, "") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") @@ -530,7 +516,8 @@ def setupUi(self, MainWindow): self.title_label = QtWidgets.QLabel(self.centralwidget) self.title_label.setGeometry(QtCore.QRect(20, 10, 221, 41)) self.title_label.setAutoFillBackground(False) - self.title_label.setStyleSheet("color: white;\n" "font-size: 20px") + self.title_label.setStyleSheet("color: white;\n" +"font-size: 20px") self.title_label.setTextFormat(QtCore.Qt.RichText) self.title_label.setObjectName("title_label") self.export_button = QtWidgets.QPushButton(self.centralwidget) @@ -542,27 +529,19 @@ def setupUi(self, MainWindow): font.setItalic(False) font.setWeight(75) self.export_button.setFont(font) - self.export_button.setStyleSheet( - "QPushButton { color: white; font-weight: bold; background-color: #007acc };\n" - "background-color: #007acc;\n" - "\n" - "QAbstractButton::text {\n" - "color=white;\n" - "}" - ) + self.export_button.setStyleSheet("QPushButton { color: white; font-weight: bold; background-color: #007acc };\n" +"background-color: #007acc;\n" +"\n" +"QAbstractButton::text {\n" +"color=white;\n" +"}") self.export_button.setCheckable(False) self.export_button.setChecked(False) self.export_button.setFlat(False) self.export_button.setObjectName("export_button") self.application_information_textbrowser = QtWidgets.QTextBrowser(self.centralwidget) self.application_information_textbrowser.setGeometry(QtCore.QRect(40, 550, 521, 71)) - self.application_information_textbrowser.setTextInteractionFlags( - QtCore.Qt.LinksAccessibleByKeyboard - | QtCore.Qt.LinksAccessibleByMouse - | QtCore.Qt.TextBrowserInteraction - | QtCore.Qt.TextSelectableByKeyboard - | QtCore.Qt.TextSelectableByMouse - ) + self.application_information_textbrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard|QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextBrowserInteraction|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.application_information_textbrowser.setObjectName("application_information_textbrowser") self.label_8 = QtWidgets.QLabel(self.centralwidget) self.label_8.setGeometry(QtCore.QRect(10, 580, 31, 16)) @@ -583,16 +562,14 @@ def setupUi(self, MainWindow): font.setWeight(75) self.donate_button.setFont(font) self.donate_button.setAutoFillBackground(False) - self.donate_button.setStyleSheet( - "QPushButton { color: white; font-weight: bold; font-size: 10pt; background-color: #229954 };\n" - "background-color: #2ECC71;\n" - "\n" - "QAbstractButton::text {\n" - "color=white;\n" - "}" - ) + self.donate_button.setStyleSheet("QPushButton { color: white; font-weight: bold; font-size: 10pt; background-color: #229954 };\n" +"background-color: #2ECC71;\n" +"\n" +"QAbstractButton::text {\n" +"color=white;\n" +"}") icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap("images/donate.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon4.addPixmap(QtGui.QPixmap("./qt_ui\\images/donate.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.donate_button.setIcon(icon4) self.donate_button.setIconSize(QtCore.QSize(30, 30)) self.donate_button.setObjectName("donate_button") @@ -606,16 +583,14 @@ def setupUi(self, MainWindow): font.setItalic(False) font.setWeight(75) self.discord_button.setFont(font) - self.discord_button.setStyleSheet( - "QPushButton { color: white; font-weight: bold; font-size: 10pt; background-color: #7289DA };\n" - "background-color: #007acc;\n" - "\n" - "QAbstractButton::text {\n" - "color=white;\n" - "}" - ) + self.discord_button.setStyleSheet("QPushButton { color: white; font-weight: bold; font-size: 10pt; background-color: #7289DA };\n" +"background-color: #007acc;\n" +"\n" +"QAbstractButton::text {\n" +"color=white;\n" +"}") icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap("images/discord.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon5.addPixmap(QtGui.QPixmap("./qt_ui\\images/discord.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.discord_button.setIcon(icon5) self.discord_button.setIconSize(QtCore.QSize(30, 30)) self.discord_button.setObjectName("discord_button") @@ -651,10 +626,7 @@ def retranslateUi(self, MainWindow): self.label.setText(_translate("MainWindow", "Select your .XML profile ")) self.jg_option_inherit_checkbox.setText(_translate("MainWindow", "Inherit Joystick Binds from Parents")) self.label_11.setText(_translate("MainWindow", "Settings")) - self.parser_selector.setTabText( - self.parser_selector.indexOf(self.jg_tab), - _translate("MainWindow", "Joystick Gremlin"), - ) + self.parser_selector.setTabText(self.parser_selector.indexOf(self.jg_tab), _translate("MainWindow", "Joystick Gremlin")) self.dcs_world_label.setText(_translate("MainWindow", "DCS World Directory")) self.dcs_directory_select_button.setText(_translate("MainWindow", "Select your installation")) self.dcs_saved_games_label.setText(_translate("MainWindow", "This should be your Saved Games/DCS folder")) @@ -672,41 +644,25 @@ def retranslateUi(self, MainWindow): item.setText(_translate("MainWindow", "F-14B_Rio")) self.dcs_profiles_list.setSortingEnabled(__sortingEnabled) self.label_7.setText(_translate("MainWindow", "Available DCS Profiles")) - self.dcs_easy_mode_checkbox.setText(_translate("MainWindow", 'Exclude "Easy" Mode Profiles')) + self.dcs_easy_mode_checkbox.setText(_translate("MainWindow", "Exclude \"Easy\" Mode Profiles")) self.dcs_selected_directory_label.setText(_translate("MainWindow", "c:test")) self.label_10.setText(_translate("MainWindow", "Settings")) - self.parser_selector.setTabText( - self.parser_selector.indexOf(self.dcs_tab), - _translate("MainWindow", "DCS World"), - ) + self.parser_selector.setTabText(self.parser_selector.indexOf(self.dcs_tab), _translate("MainWindow", "DCS World")) self.sc_label.setText(_translate("MainWindow", "Star Citizen Config")) self.sc_description_label.setText(_translate("MainWindow", "Select your .XML config for Star Citizen")) self.sc_select_button.setText(_translate("MainWindow", "Select your config file")) - self.parser_selector.setTabText( - self.parser_selector.indexOf(self.sc_tab), - _translate("MainWindow", "Star Citizen"), - ) + self.parser_selector.setTabText(self.parser_selector.indexOf(self.sc_tab), _translate("MainWindow", "Star Citizen")) self.label_2.setText(_translate("MainWindow", "Do you have a game/tool you want to see included?")) - self.label_3.setText( - _translate( - "MainWindow", - '

Raise an issue on Github - https://github.com/Rexeh/joystick-diagrams

', - ) - ) + self.label_3.setText(_translate("MainWindow", "

Raise an issue on Github - https://github.com/Rexeh/joystick-diagrams

")) self.parser_selector.setTabText(self.parser_selector.indexOf(self.tab), _translate("MainWindow", "+")) self.title_label.setText(_translate("MainWindow", "Joystick Diagrams")) self.export_button.setText(_translate("MainWindow", "Export Joystick Profiles")) self.application_information_textbrowser.setDocumentTitle(_translate("MainWindow", "Testsd")) - self.application_information_textbrowser.setHtml( - _translate( - "MainWindow", - '\n' - 'Testsd\n" - '

If you\'re seeing this something has gone wrong

', - ) - ) + self.application_information_textbrowser.setHtml(_translate("MainWindow", "\n" +"Testsd\n" +"

If you\'re seeing this something has gone wrong

")) self.label_8.setText(_translate("MainWindow", "Info")) self.label_9.setText(_translate("MainWindow", "1.1.0")) self.donate_button.setText(_translate("MainWindow", "Donate")) diff --git a/makefile b/makefile index fbb1f03..ea4253f 100644 --- a/makefile +++ b/makefile @@ -19,3 +19,7 @@ build-exe: @poetry run setup.py build @echo "Making MSI Build" @poetry run setup.py build bdist_msi + +make-version: + @echo "Making version manifest" + @poetry run python joystick_diagrams/classes/version/version.py \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f74773f..790650d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,12 @@ cx-Freeze = "^6.15.0" mypy = "^1.7.1" isort = "^5.12.0" +[tool.poetry.group.dev.dependencies] +pyuic5-tool = "^0.0.1" + +[tool.poetry.scripts] +version_package = 'joystick_diagrams.version:generate_version' + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" diff --git a/version_manifest.json b/version_manifest.json index 2acdbda..a93e894 100644 --- a/version_manifest.json +++ b/version_manifest.json @@ -1 +1 @@ -{"version": "1.6", "template_hashes": {"CH Fighterstick USB.svg": "ecb58ae3850233772d06a97deb09a33585a6311526fd608204a202e9e06a03a4", "CH Pro Throttle USB.svg": "a85b52eb622d5c28c15364ae4882ce8e589364154a486aea94d53c52770ae917", "HOTAS Warthog Throttle.svg": "ec06478e328471c3dd1081ddb9722d15b06f3c7581d4a43ee5b302de108e4f84", "T.16000M Joystick Left.svg": "9fa8059b9cbecc96033522a3e3307590bb425a6f74b2218ad3bc9aacd764b313", "T.16000M Joystick.svg": "0a893b46544d15253838402cb88d91a3513e793cd2ec742e572291b551ae1951", "TotalControls_Device_1.svg": "4493b84ec00e9a3c3d5ed5bb2252ff3d1c0f43062628074c64afb7c61f1f2ea4", "TotalControls_Device_2.svg": "75273c53282b7aeddbdcc604d63a4162fb8484dcbfdda60ac06ad89a28601d2a", "TWCS Throttle.svg": "128e972df307a9a3236253ecd1299925d1faf569c74cc5f1de3304d162b8ba88", "VKB-Sim Gladiator NXT L.svg": "11f07941223e5349015874f89308b0c0cdba93667dec6cf83ee2f0b8cfc676ed", "VKB-Sim Gladiator NXT R.svg": "5a435f2a9d4b2b021c968771e4a1fb44274ebbcc9b56b5e2ca847a72ee49e526", "VPC Constellation ALPHA R.svg": "ad9cdec0ac1b6acda10913ace837e05a7732a46c10d684baafd04a634bba5cba", "VPC Control Panel #1.svg": "6926094d565b60b4e2e9df7a6957d32e5df41854933f9bb5ae2254ad4737d48f", "VPC Stick MT-50CM.svg": "0602a7b529a194545c45881d98ae3feec21f9084ffbe1aee57d650c77a40212e", "VPC Stick VFX.svg": "33e343e77d4ce72e641343def9c8ee3710ab960bc79d0cdf894decb0cfc494ab", "VPC Stick WarBRD.svg": "c16aac95e6140284ca84ef6637c075befa9aadafb1bd034edb1b7f440f779da8", "VPC Throttle MT-50 CM2.svg": "6445aa8a920890674d8ab9dc0367277afcbb93e9f2b2bb7b31118390c45d6149", "X52_H.O.T.A.S..svg": "a8f9b5efd10942e0cd8354bf0c3b085fdf8532c11b691021906513df305bb4d6", "X56 H.O.T.A.S. Stick.svg": "6a1398ffbd02b51396286967fb8c8ddb795fbb2e9600060214b72af2d2ef6eb5", "X56 H.O.T.A.S. Throttle.svg": "b0d43840a9d8392d4ddb6f7cb1d80c7a4a83a3e3d0d2848d8c4aab7c68ccd70c"}} \ No newline at end of file +{"version": "2.0-ALPHA", "template_hashes": {"CH Fighterstick USB.svg": "ecb58ae3850233772d06a97deb09a33585a6311526fd608204a202e9e06a03a4", "CH Pro Throttle USB.svg": "a85b52eb622d5c28c15364ae4882ce8e589364154a486aea94d53c52770ae917", "HOTAS Warthog Throttle.svg": "ec06478e328471c3dd1081ddb9722d15b06f3c7581d4a43ee5b302de108e4f84", "T.16000M Joystick Left.svg": "9fa8059b9cbecc96033522a3e3307590bb425a6f74b2218ad3bc9aacd764b313", "T.16000M Joystick.svg": "0a893b46544d15253838402cb88d91a3513e793cd2ec742e572291b551ae1951", "TotalControls_Device_1.svg": "4493b84ec00e9a3c3d5ed5bb2252ff3d1c0f43062628074c64afb7c61f1f2ea4", "TotalControls_Device_2.svg": "75273c53282b7aeddbdcc604d63a4162fb8484dcbfdda60ac06ad89a28601d2a", "TWCS Throttle.svg": "128e972df307a9a3236253ecd1299925d1faf569c74cc5f1de3304d162b8ba88", "VKB-Sim Gladiator NXT L.svg": "11f07941223e5349015874f89308b0c0cdba93667dec6cf83ee2f0b8cfc676ed", "VKB-Sim Gladiator NXT R.svg": "5a435f2a9d4b2b021c968771e4a1fb44274ebbcc9b56b5e2ca847a72ee49e526", "VPC Constellation ALPHA R.svg": "ad9cdec0ac1b6acda10913ace837e05a7732a46c10d684baafd04a634bba5cba", "VPC Control Panel #1.svg": "6926094d565b60b4e2e9df7a6957d32e5df41854933f9bb5ae2254ad4737d48f", "VPC Stick MT-50CM.svg": "0602a7b529a194545c45881d98ae3feec21f9084ffbe1aee57d650c77a40212e", "VPC Stick VFX.svg": "33e343e77d4ce72e641343def9c8ee3710ab960bc79d0cdf894decb0cfc494ab", "VPC Stick WarBRD.svg": "c16aac95e6140284ca84ef6637c075befa9aadafb1bd034edb1b7f440f779da8", "VPC Throttle MT-50 CM2.svg": "6445aa8a920890674d8ab9dc0367277afcbb93e9f2b2bb7b31118390c45d6149", "X52_H.O.T.A.S..svg": "a8f9b5efd10942e0cd8354bf0c3b085fdf8532c11b691021906513df305bb4d6", "X56 H.O.T.A.S. Stick.svg": "6a1398ffbd02b51396286967fb8c8ddb795fbb2e9600060214b72af2d2ef6eb5", "X56 H.O.T.A.S. Throttle.svg": "b0d43840a9d8392d4ddb6f7cb1d80c7a4a83a3e3d0d2848d8c4aab7c68ccd70c"}} \ No newline at end of file