Skip to content

Commit 0ca26d5

Browse files
committed
Factor out PySide2
1 parent 5d6554a commit 0ca26d5

37 files changed

+157
-79
lines changed

node_launcher/gui/application.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
from PySide2 import QtCore
2-
from PySide2.QtCore import QCoreApplication, Slot, QTimer, Qt
3-
from PySide2.QtWidgets import QApplication, QWidget, QMessageBox
1+
import sys
2+
3+
from node_launcher.gui.qt import (
4+
QtCore,
5+
QCoreApplication,
6+
Slot,
7+
QTimer,
8+
Qt,
9+
QApplication,
10+
QWidget,
11+
QMessageBox
12+
)
413

514
from node_launcher.constants import NODE_LAUNCHER_RELEASE, UPGRADE
615
from node_launcher.gui.system_tray import SystemTray
@@ -10,7 +19,7 @@
1019

1120
class Application(QApplication):
1221
def __init__(self):
13-
super().__init__()
22+
super().__init__(sys.argv)
1423

1524
self.node_set = NodeSet()
1625
self.parent = QWidget()

node_launcher/gui/components/copy_button.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from PySide2.QtCore import QTimer
2-
from PySide2.QtGui import QClipboard
3-
from PySide2.QtWidgets import QVBoxLayout, QPushButton
1+
from node_launcher.gui.qt import QTimer, QClipboard, QVBoxLayout, QPushButton
42

53

64
class CopyButton(QVBoxLayout):

node_launcher/gui/components/grid_layout.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from PySide2 import QtWidgets
2-
from PySide2.QtWidgets import QWidget
1+
from node_launcher.gui.qt import QtWidgets, QWidget
32

43

54
class QGridLayout(QtWidgets.QGridLayout):

node_launcher/gui/components/horizontal_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from PySide2.QtWidgets import QFrame
1+
from node_launcher.gui.qt import QFrame
22

33

44
class HorizontalLine(QFrame):

node_launcher/gui/components/image_label.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from PySide2 import QtWidgets
2-
from PySide2.QtCore import Qt
3-
from PySide2.QtGui import QPixmap
1+
from node_launcher.gui.qt import QtWidgets, Qt, QPixmap
42

53
from node_launcher.assets.asset_access import asset_access
64

node_launcher/gui/components/section_name.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from PySide2.QtWidgets import QLabel
1+
from node_launcher.gui.qt import QLabel
22

33

44
class SectionName(QLabel):

node_launcher/gui/components/selectable_text.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from PySide2.QtCore import Qt
2-
from PySide2.QtWidgets import QLabel
1+
from node_launcher.gui.qt import Qt, QLabel
32

43

54
class SelectableText(QLabel):

node_launcher/gui/components/thread_worker.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import time
2+
import traceback
3+
import sys
24

35
import grpc
4-
from PySide2.QtCore import QRunnable, Slot, QThreadPool, Signal, QObject, QTimer
56

6-
import traceback, sys
7-
8-
from PySide2.QtWidgets import QMainWindow, QVBoxLayout, QLabel, QPushButton, \
9-
QWidget, QApplication
7+
from node_launcher.gui.qt import (
8+
QMainWindow, QVBoxLayout, QLabel, QPushButton,
9+
QWidget, QApplication, QRunnable, Slot, QThreadPool, Signal, QObject, QTimer
10+
)
1011

1112

1213
class WorkerSignals(QObject):

node_launcher/gui/components/warning_text.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from PySide2.QtCore import Qt
2-
from PySide2.QtWidgets import QLabel
1+
from node_launcher.gui.qt import QLabel
32

43

54
class WarningText(QLabel):

node_launcher/gui/menu.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from PySide2.QtCore import QCoreApplication
2-
from PySide2.QtGui import QKeySequence, QClipboard
3-
from PySide2.QtWidgets import QMenu
1+
from node_launcher.gui.qt import QCoreApplication, QKeySequence, QClipboard, QMenu
42

53
from node_launcher.constants import BITCOIN_CLI_COMMANDS, LNCLI_COMMANDS
64
from node_launcher.gui.system_tray_widgets import (

0 commit comments

Comments
 (0)