From 6b2ccddea6a991612ef5ec611b5cdada5e9b428e Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:22:15 +0200 Subject: [PATCH] clean up & credits --- README.md | 23 ++--------------------- esp_flasher/gui.py | 25 ++++++++++--------------- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 83eb1b8..91e1ece 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,10 @@ [![GitHub Releases](https://img.shields.io/github/downloads/Jason2866/ESP_Flasher/total?label=downloads&color=%231FA3EC&style=for-the-badge)](https://github.com/Jason2866/ESP_Flasher/releases/latest) -This project is a fork of [ESP_Flasher](https://github.com/Jason2866/ESP_Flasher). - Tasmota-ESP-Flasher is an app for ESP8266 / ESP32 designed to make flashing Tasmota on ESPs as simple as possible by: * Pre-built binaries for most used operating systems - * Support for Tasmota factory images + * Support for Tasmota factory images * Hiding all non-essential options for flashing * All necessary options (bootloader, flash mode, safeboot) are set automatically * Flashing is lightning fast @@ -32,7 +30,6 @@ In the odd case of your antivirus going haywire over that application, it's a [f If you want to build this application yourself you need to: - Install Python 3.x -- ~~Install [wxPython 4.x](https://wxpython.org/) manually or run `pip3 install wxpython`~~ - Download this project and run `pip3 install -e .` in the project's root. - Start the GUI using `esp_flasher`. Alternatively, you can use the command line interface ( type `esp_flasher -h` for info) @@ -45,22 +42,6 @@ Info: https://www.silabs.com/community/interface/forum.topic.html/vcp_driver_for Driver: https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip - -## Linux Notes (Fixed, using Qt5, not nessessary anymore) - -~~Installing wxpython for linux can be a bit challenging (especially when you don't want to install from source). -You can use the following command to install a wxpython suitable with your OS and Python version:~~ - -```bash -# Go to https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ and select the correct OS type -# here, we assume ubuntu 20.04 -# sudo apt-get update -# sudo apt install libgtk-3-dev libnotify-dev libsdl2-dev -# pip3 install -U \ -# -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 \ -# wxPython -``` - ## License -[MIT](http://opensource.org/licenses/MIT) © Marcel Stör, Otto Winter, Johann Obermeier \ No newline at end of file +[MIT](http://opensource.org/licenses/MIT) © Otto Winter, Michael Kandziora, Johann Obermeier \ No newline at end of file diff --git a/esp_flasher/gui.py b/esp_flasher/gui.py index a5387c2..f1dc753 100644 --- a/esp_flasher/gui.py +++ b/esp_flasher/gui.py @@ -1,14 +1,15 @@ +# Big thx to Michael Kandziora for this GUI port to PyQt5 import re import sys import threading -import os -import platform -import distro # Added import +import os +import platform +import distro -from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, - QHBoxLayout, QPushButton, QLabel, QComboBox, +from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, + QHBoxLayout, QPushButton, QLabel, QComboBox, QFileDialog, QTextEdit, QGroupBox, QGridLayout) -from PyQt5.QtGui import QColor, QTextCursor, QPalette, QColor +from PyQt5.QtGui import QColor, QTextCursor, QPalette, QColor from PyQt5.QtCore import pyqtSignal, QObject from esp_flasher.helpers import list_serial_ports @@ -94,7 +95,6 @@ def init_ui(self): vbox = QVBoxLayout() - port_group_box = QGroupBox("Serial Port") port_layout = QGridLayout() port_label = QLabel("Select Port:") @@ -108,7 +108,6 @@ def init_ui(self): port_layout.addWidget(reload_button, 0, 2) port_group_box.setLayout(port_layout) - firmware_group_box = QGroupBox("Firmware") firmware_layout = QGridLayout() firmware_label = QLabel("Select Firmware:") @@ -118,7 +117,6 @@ def init_ui(self): firmware_layout.addWidget(self.firmware_button, 0, 1) firmware_group_box.setLayout(firmware_layout) - actions_group_box = QGroupBox("Actions") actions_layout = QHBoxLayout() self.flash_button = QPushButton("Flash ESP") @@ -129,7 +127,6 @@ def init_ui(self): actions_layout.addWidget(self.logs_button) actions_group_box.setLayout(actions_layout) - console_group_box = QGroupBox("Console") console_layout = QVBoxLayout() self.console = QTextEdit() @@ -137,7 +134,6 @@ def init_ui(self): console_layout.addWidget(self.console) console_group_box.setLayout(console_layout) - vbox.addWidget(port_group_box) vbox.addWidget(firmware_group_box) vbox.addWidget(actions_group_box) @@ -177,7 +173,7 @@ def view_logs(self): worker.start() def main(): - + os_name = platform.system() if os_name == 'Darwin': os.environ['QT_QPA_PLATFORM'] = 'cocoa' @@ -190,11 +186,10 @@ def main(): elif os_name == 'Windows': os.environ['QT_QPA_PLATFORM'] = 'windows' else: - os.environ['QT_QPA_PLATFORM'] = 'offscreen' + os.environ['QT_QPA_PLATFORM'] = 'offscreen' app = QApplication(sys.argv) - app.setStyle("Fusion") palette = QPalette() palette.setColor(QPalette.Window, QColor(53, 53, 53)) @@ -210,7 +205,7 @@ def main(): palette.setColor(QPalette.Link, QColor(42, 130, 218)) palette.setColor(QPalette.Highlight, QColor(42, 130, 218)) palette.setColor(QPalette.HighlightedText, QColor(0, 0, 0)) - app.setPalette(palette) + app.setPalette(palette) main_window = MainWindow() main_window.show()