summaryrefslogtreecommitdiffstats
path: root/serviceconfig
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2014-09-23 19:40:50 -0500
committerTimothy Pearson <[email protected]>2014-09-23 19:40:50 -0500
commitd28ae74d212baba2c12bbb61c43a4bf348cd0153 (patch)
tree455d1bb252fc2dc6742f9a2d3afc94fbb1ffb122 /serviceconfig
parent138f1893d0aa1fa54f9fd55674a5fc8e24aa07b5 (diff)
downloadtde-guidance-d28ae74d212baba2c12bbb61c43a4bf348cd0153.tar.gz
tde-guidance-d28ae74d212baba2c12bbb61c43a4bf348cd0153.zip
Convert remaining modules to TQt3
This relates to Bug 1995
Diffstat (limited to 'serviceconfig')
-rwxr-xr-xserviceconfig/serviceconfig.py96
1 files changed, 54 insertions, 42 deletions
diff --git a/serviceconfig/serviceconfig.py b/serviceconfig/serviceconfig.py
index 88fbec7..4e82bf8 100755
--- a/serviceconfig/serviceconfig.py
+++ b/serviceconfig/serviceconfig.py
@@ -16,12 +16,24 @@
# #
###########################################################################
-from qt import *
-from tdeui import *
-from tdecore import *
import sys
import os
import os.path
+# Trinity-specific paths
+tqt_modules = []
+for m_path in sys.path:
+ if os.path.exists(os.path.join(m_path, 'sip4_tqt')):
+ m_sip_dir = os.path.join(m_path, 'sip4_tqt')
+ tqt_modules.insert(0, m_sip_dir)
+ if os.path.exists(os.path.join(m_path, 'python_tqt')):
+ m_pyqt_dir = os.path.join(m_path, 'python_tqt')
+ tqt_modules.insert(0, m_pyqt_dir)
+for m_path in tqt_modules:
+ sys.path.insert(0, m_path)
+
+from qt import *
+from tdeui import *
+from tdecore import *
import posix
import re
from pickle import Pickler,Unpickler
@@ -960,7 +972,7 @@ class SysVInitApp(programbase):
self.updatingGUI = False
self.context = getServiceContext()
- self.servicestolistitems = {} # Map service names to QListViewItems
+ self.servicestolistitems = {} # Map service names to TQListViewItems
self.currentrunlevel = self.context.currentRunLevel()
self.context.loadInfo()
@@ -968,28 +980,28 @@ class SysVInitApp(programbase):
self.aboutus = TDEAboutApplication(self)
if standalone:
- toplayout = QVBoxLayout( self.plainPage(), 0, KDialog.spacingHint() )
- tophb = QSplitter(Qt.Horizontal, self.plainPage())
+ toplayout = TQVBoxLayout( self.plainPage(), 0, KDialog.spacingHint() )
+ tophb = TQSplitter(TQt.Horizontal, self.plainPage())
else:
- toplayout = QVBoxLayout( self, 0, KDialog.spacingHint() )
- tophb = QSplitter(Qt.Horizontal, self)
+ toplayout = TQVBoxLayout( self, 0, KDialog.spacingHint() )
+ tophb = TQSplitter(TQt.Horizontal, self)
toplayout.addWidget(tophb)
- vb = QVBox(tophb)
+ vb = TQVBox(tophb)
vb.setSpacing(KDialog.spacingHint())
- hb = QHBox(vb)
+ hb = TQHBox(vb)
hb.setSpacing(KDialog.spacingHint())
vb.setStretchFactor(hb,0)
- label = QLabel(hb)
+ label = TQLabel(hb)
label.setPixmap(UserIcon("hi32-app-daemons"))
hb.setStretchFactor(label,0)
- label = QLabel(i18n("Run level:"),hb)
+ label = TQLabel(i18n("Run level:"),hb)
hb.setStretchFactor(label,0)
- self.runlevelcombo = QComboBox(hb)
+ self.runlevelcombo = TQComboBox(hb)
# Load up the runlevel combo box.
i = 0
@@ -1003,7 +1015,7 @@ class SysVInitApp(programbase):
self.connect(self.runlevelcombo, SIGNAL("activated(int)"), self.slotRunLevelChanged)
- widget = QWidget(hb)
+ widget = TQWidget(hb)
hb.setStretchFactor(widget,1)
self.servicelistview = TDEListView(vb)
@@ -1011,56 +1023,56 @@ class SysVInitApp(programbase):
self.servicelistview.addColumn(i18n("Start at Boot"))
self.servicelistview.addColumn(i18n("Status"))
self.servicelistview.setAllColumnsShowFocus(True)
- self.servicelistview.setSelectionMode(QListView.Single)
- self.connect(self.servicelistview, SIGNAL("selectionChanged(QListViewItem *)"), self.slotListClicked)
+ self.servicelistview.setSelectionMode(TQListView.Single)
+ self.connect(self.servicelistview, SIGNAL("selectionChanged(TQListViewItem *)"), self.slotListClicked)
# Right hand side of the dialog.
- vb = QVBox(tophb)
+ vb = TQVBox(tophb)
vb.setSpacing(KDialog.spacingHint())
- hgb = QHGroupBox(i18n("Service Details"),vb)
+ hgb = TQHGroupBox(i18n("Service Details"),vb)
vb.setStretchFactor(hgb,1)
- vb2 = QVBox(hgb)
+ vb2 = TQVBox(hgb)
vb2.setSpacing(KDialog.spacingHint())
- label = QLabel(i18n("Description:"),vb2)
+ label = TQLabel(i18n("Description:"),vb2)
vb2.setStretchFactor(label,0)
- self.descriptiontextedit = QTextEdit(vb2)
+ self.descriptiontextedit = TQTextEdit(vb2)
vb2.setStretchFactor(self.descriptiontextedit,2)
self.descriptiontextedit.setReadOnly(True)
- self.startatbootcheckbox = QCheckBox(i18n("Start during boot"),vb2)
+ self.startatbootcheckbox = TQCheckBox(i18n("Start during boot"),vb2)
vb2.setStretchFactor(self.startatbootcheckbox,0)
self.connect(self.startatbootcheckbox, SIGNAL("toggled(bool)"), self.slotBootChanged)
- label = QLabel(i18n("Status:"),vb2)
+ label = TQLabel(i18n("Status:"),vb2)
vb2.setStretchFactor(label,0)
- self.statustext = QTextEdit(vb2)
+ self.statustext = TQTextEdit(vb2)
self.statustext.setReadOnly(True)
vb2.setStretchFactor(self.statustext,1)
- hb2 = QHBox(vb2)
+ hb2 = TQHBox(vb2)
hb2.setSpacing(KDialog.spacingHint())
vb2.setStretchFactor(hb2,0)
- self.startbutton = QPushButton(i18n("Start"),hb2)
+ self.startbutton = TQPushButton(i18n("Start"),hb2)
hb2.setStretchFactor(self.startbutton,1)
self.connect(self.startbutton, SIGNAL("clicked()"), self.slotStartButton)
- self.stopbutton = QPushButton(i18n("Stop"),hb2)
+ self.stopbutton = TQPushButton(i18n("Stop"),hb2)
hb2.setStretchFactor(self.stopbutton,1)
self.connect(self.stopbutton, SIGNAL("clicked()"), self.slotStopButton)
- self.restartbutton = QPushButton(i18n("Restart"),hb2)
+ self.restartbutton = TQPushButton(i18n("Restart"),hb2)
hb2.setStretchFactor(self.restartbutton,1)
self.connect(self.restartbutton, SIGNAL("clicked()"), self.slotRestartButton)
if DISTRO == "Gentoo":
# Gentoo Linux gets an extra button.
- self.zapbutton = QPushButton(i18n("Zap"),hb2)
+ self.zapbutton = TQPushButton(i18n("Zap"),hb2)
hb2.setStretchFactor(self.zapbutton,1)
self.connect(self.zapbutton, SIGNAL("clicked()"), self.slotZapButton)
if not isroot:
self.disableStuff()
else:
- self.connect(self.servicelistview, SIGNAL("contextMenu(TDEListView*,QListViewItem*,const QPoint&)"),
+ self.connect(self.servicelistview, SIGNAL("contextMenu(TDEListView*,TQListViewItem*,const TQPoint&)"),
self.slotServiceContextMenu)
self.__fillListView(self.currentrunlevel)
@@ -1130,7 +1142,7 @@ class SysVInitApp(programbase):
self.__checkServiceStatus()
if DISTRO == "Debian" and (standalone or (not standalone and is_shown)):
- QTimer.singleShot(0,self.__startLoadDescriptions)
+ TQTimer.singleShot(0,self.__startLoadDescriptions)
is_shown = True
@@ -1151,9 +1163,9 @@ class SysVInitApp(programbase):
if item.isAvailableInRunlevel(runlevelobj):
status = item.status.strip().replace("\n",", ")[:32]
if item in runlevelobj.activeservices:
- lvi = QListViewItem(self.servicelistview,item.filename,i18n("Yes"),status)
+ lvi = TQListViewItem(self.servicelistview,item.filename,i18n("Yes"),status)
else:
- lvi = QListViewItem(self.servicelistview,item.filename,i18n("No"),status)
+ lvi = TQListViewItem(self.servicelistview,item.filename,i18n("No"),status)
self.servicestolistitems[item] = lvi
########################################################################
@@ -1276,7 +1288,7 @@ class SysVInitApp(programbase):
self.context.descriptioncache.saveCache()
return
- QTimer.singleShot(0,self.__loadDescriptions)
+ TQTimer.singleShot(0,self.__loadDescriptions)
########################################################################
def __runInitScript(self,title,service,command):
@@ -1380,21 +1392,21 @@ class CommandRunner(KDialogBase):
self.resize(400,200)
vbox = self.makeVBoxMainWidget()
- hbox = QHBox(vbox)
+ hbox = TQHBox(vbox)
hbox.setSpacing(self.spacingHint())
- tmplabel = QLabel(hbox)
+ tmplabel = TQLabel(hbox)
tmplabel.setPixmap(UserIcon("laserwarn"))
hbox.setStretchFactor(tmplabel,0)
- self.headinglabel = QLabel(hbox)
+ self.headinglabel = TQLabel(hbox)
hbox.setStretchFactor(self.headinglabel,1)
- self.outputtextview = QTextView(vbox)
- self.outputtextview.setTextFormat(QTextView.PlainText)
+ self.outputtextview = TQTextView(vbox)
+ self.outputtextview.setTextFormat(TQTextView.PlainText)
- self.kid = QProcess()
- self.kid.setCommunication(QProcess.Stdout|QProcess.Stderr)
+ self.kid = TQProcess()
+ self.kid.setCommunication(TQProcess.Stdout|TQProcess.Stderr)
self.connect(self.kid,SIGNAL("processExited()"),self.slotProcessExited)
self.connect(self.kid,SIGNAL("readyReadStdout()"),self.slotReadyReadStdout)
self.connect(self.kid,SIGNAL("readyReadStderr()"),self.slotReadyReadStderr)
@@ -1416,7 +1428,7 @@ class CommandRunner(KDialogBase):
self.killTimer(self.bootstraptimer)
# Create a slightly new environment where TERM is vt100
- new_env = QStringList()
+ new_env = TQStringList()
for key in os.environ:
if key=="TERM":
new_env.append("TERM=vt100")