diff options
author | Clayton G. Hobbs <clay@lakeserv.net> | 2015-12-26 22:43:12 -0500 |
---|---|---|
committer | Clayton G. Hobbs <clay@lakeserv.net> | 2015-12-26 22:43:12 -0500 |
commit | 2a641364bf8fc3cc4069d2d2c42b75241e6dc3f2 (patch) | |
tree | eed87314f415db72ce65ecc81baa9ef3a0a79548 /QtUI.py | |
parent | a6e27df2ccf8a22d76b2ff795dee2f86f52b3970 (diff) |
Removed QT interface, renamed interfaces to Kaylee
I'm a GTK man myself. I don't know if I have Python QT bindings installed on any of my computers. It follows then that I would not maintain the QT interface well, let alone use it at all. It has therefore been removed to avoid having someone try to use it only to find that it's broken.
Diffstat (limited to 'QtUI.py')
-rw-r--r-- | QtUI.py | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/QtUI.py b/QtUI.py deleted file mode 100644 index 728ff80..0000000 --- a/QtUI.py +++ /dev/null @@ -1,115 +0,0 @@ -#This is part of Blather -# -- this code is licensed GPLv3 -# Copyright 2013 Jezra -import sys -import gobject -# Qt stuff -from PySide.QtCore import Signal, Qt -from PySide.QtGui import QApplication, QWidget, QMainWindow, QVBoxLayout -from PySide.QtGui import QLabel, QPushButton, QCheckBox, QIcon, QAction - -class UI(gobject.GObject): - __gsignals__ = { - 'command' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING,)) - } - - def __init__(self,args,continuous): - self.continuous = continuous - gobject.GObject.__init__(self) - #start by making our app - self.app = QApplication(args) - #make a window - self.window = QMainWindow() - #give the window a name - self.window.setWindowTitle("BlatherQt") - self.window.setMaximumSize(400,200) - center = QWidget() - self.window.setCentralWidget(center) - - layout = QVBoxLayout() - center.setLayout(layout) - #make a listen/stop button - self.lsbutton = QPushButton("Listen") - layout.addWidget(self.lsbutton) - #make a continuous button - self.ccheckbox = QCheckBox("Continuous Listen") - layout.addWidget(self.ccheckbox) - - #connect the buttons - self.lsbutton.clicked.connect(self.lsbutton_clicked) - self.ccheckbox.clicked.connect(self.ccheckbox_clicked) - - #add a label to the UI to display the last command - self.label = QLabel() - layout.addWidget(self.label) - - #add the actions for quiting - quit_action = QAction(self.window) - quit_action.setShortcut('Ctrl+Q') - quit_action.triggered.connect(self.accel_quit) - self.window.addAction(quit_action) - - def accel_quit(self): - #emit the quit - self.emit("command", "quit") - - def ccheckbox_clicked(self): - checked = self.ccheckbox.isChecked() - if checked: - #disable lsbutton - self.lsbutton.setEnabled(False) - self.lsbutton_stopped() - self.emit('command', "continuous_listen") - self.set_icon_active() - else: - self.lsbutton.setEnabled(True) - self.emit('command', "continuous_stop") - self.set_icon_inactive() - - def lsbutton_stopped(self): - self.lsbutton.setText("Listen") - - def lsbutton_clicked(self): - val = self.lsbutton.text() - if val == "Listen": - self.emit("command", "listen") - self.lsbutton.setText("Stop") - #clear the label - self.label.setText("") - self.set_icon_active() - else: - self.lsbutton_stopped() - self.emit("command", "stop") - self.set_icon_inactive() - - def run(self): - self.set_icon_inactive() - self.window.show() - if self.continuous: - self.set_icon_active() - self.ccheckbox.setCheckState(Qt.Checked) - self.ccheckbox_clicked() - self.app.exec_() - self.emit("command", "quit") - - def finished(self, text): - #if the continuous isn't pressed - if not self.ccheckbox.isChecked(): - self.lsbutton_stopped() - self.label.setText(text) - - def set_icon(self, icon): - self.window.setWindowIcon(QIcon(icon)) - - def set_icon_active_asset(self, i): - self.icon_active = i - - def set_icon_inactive_asset(self, i): - self.icon_inactive = i - - def set_icon_active(self): - self.window.setWindowIcon(QIcon(self.icon_active)) - - def set_icon_inactive(self): - self.window.setWindowIcon(QIcon(self.icon_inactive)) - |