flasher: initial layout
parent
2d4859f1ad
commit
513ec71600
|
|
@ -0,0 +1,25 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QLineEdit, QToolButton, QPlainTextEdit, QProgressBar
|
||||||
|
|
||||||
|
from util import tr
|
||||||
|
|
||||||
|
|
||||||
|
class FirmwareFlasher(QVBoxLayout):
|
||||||
|
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
super().__init__(parent)
|
||||||
|
|
||||||
|
file_selector = QHBoxLayout()
|
||||||
|
file_selector.addWidget(QLineEdit())
|
||||||
|
btn_select_file = QToolButton()
|
||||||
|
btn_select_file.setText(tr("Flasher", "Select file..."))
|
||||||
|
file_selector.addWidget(btn_select_file)
|
||||||
|
self.addLayout(file_selector)
|
||||||
|
self.addWidget(QPlainTextEdit())
|
||||||
|
progress_flash = QHBoxLayout()
|
||||||
|
progress_flash.addWidget(QProgressBar())
|
||||||
|
btn_flash = QToolButton()
|
||||||
|
btn_flash.setText(tr("Flasher", "Flash"))
|
||||||
|
progress_flash.addWidget(btn_flash)
|
||||||
|
self.addLayout(progress_flash)
|
||||||
|
|
@ -2,10 +2,11 @@
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
from PyQt5.QtWidgets import QWidget, QComboBox, QToolButton, QHBoxLayout, QVBoxLayout, QMainWindow, QAction, qApp, \
|
from PyQt5.QtWidgets import QWidget, QComboBox, QToolButton, QHBoxLayout, QVBoxLayout, QMainWindow, QAction, qApp, \
|
||||||
QFileDialog, QDialog
|
QFileDialog, QDialog, QTabWidget
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from firmware_flasher import FirmwareFlasher
|
||||||
from keyboard import Keyboard
|
from keyboard import Keyboard
|
||||||
from keyboard_container import KeyboardContainer
|
from keyboard_container import KeyboardContainer
|
||||||
from keycodes import recreate_layer_keycodes
|
from keycodes import recreate_layer_keycodes
|
||||||
|
|
@ -40,10 +41,21 @@ class MainWindow(QMainWindow):
|
||||||
layout_combobox.addWidget(self.combobox_devices)
|
layout_combobox.addWidget(self.combobox_devices)
|
||||||
layout_combobox.addWidget(btn_refresh_devices)
|
layout_combobox.addWidget(btn_refresh_devices)
|
||||||
|
|
||||||
|
kb_and_codes = QVBoxLayout()
|
||||||
|
kb_and_codes.addWidget(self.keyboard_container)
|
||||||
|
kb_and_codes.addWidget(self.tabbed_keycodes)
|
||||||
|
|
||||||
|
flasher = FirmwareFlasher()
|
||||||
|
|
||||||
|
tabs = QTabWidget()
|
||||||
|
for container, lbl in [(kb_and_codes, "Layout"), (flasher, "Firmware updater")]:
|
||||||
|
w = QWidget()
|
||||||
|
w.setLayout(container)
|
||||||
|
tabs.addTab(w, tr("MainWindow", lbl))
|
||||||
|
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
layout.addLayout(layout_combobox)
|
layout.addLayout(layout_combobox)
|
||||||
layout.addWidget(self.keyboard_container)
|
layout.addWidget(tabs)
|
||||||
layout.addWidget(self.tabbed_keycodes)
|
|
||||||
w = QWidget()
|
w = QWidget()
|
||||||
w.setLayout(layout)
|
w.setLayout(layout)
|
||||||
self.setCentralWidget(w)
|
self.setCentralWidget(w)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue