Convert remaining modules to TQt3

This relates to Bug 1995
pull/2/head
Timothy Pearson 10 years ago
parent 138f1893d0
commit d28ae74d21

@ -1,135 +0,0 @@
* How many cards do we have? autodetection?
* Is our card a dualhead card?
* How many monitors are connected?
* difference between one and two card is different device sections
* twinview has one device, one screen, one serverlayout
* xinerama has two devices, two screens, two monitors
twinview <> xinerama:
all sections double
one or two cards:
different device sections
one or two monitors
?? one or two cards
?? twinview or xinerama (driver? different resolutions?)
class XSetup(Object):
Screens[] getScreens()
bool maySetDualhead()
getUseDualhead()
setUseDualhead(bool)
(xoff,yoff) getDualheadPosition() # offset from screen 1 top left corner.
setDualheadOrientation(xoff,yoff)
bool is3DAccelerated()
GFXCard[] getGFXCards()
class Screen(Object):
maySetResolution()
Resolution[] getAvailableResolutions()
getResolution()
setResolution(Resolution)
maySetRefresh()
int getRefreshRate()
setRefreshRate(int)
maySetRotation()
getRotation()
getAvailableRotations()
setRotation()
bool isAvailableMirrorHorizontal()
getMirrorHorizontal()
setMirrorHorizontal()
bool isAvailableMirrorVertical()
getMirrorVertical()
setMirrorVertical()
class Resolution(Object):
int getWidth()
int getHeight()
int[] getRefreshRates():
* What is the current setup? (Xinerama? Singlehead? Twinview?)
- Warning: Xinerama vs. DRI
* "unlinking" the sliders will yield a warning "Using different
resolutions on the screens will disable 3D hardware acceleration on
the second head", which is a Xinerama deficiency).
Note: Probably only Ati and nvidia do support mergedFB properly, other
drivers might lose xinerama features like placement and maximize
- Drag and drop widget
* The fun part: implementing a Drag and Drop widget where the (resizing)
screens can be dragged into their respective relative position,
"snapping" in the more obvious ones, i.e. plain "left of" and "right
of", "above" and "under" (without offset).
- displayconfig.MonitorPreview:
Singleheadpreview: Monitor keeps size
DualheadPreview: like now, monitor resizes to show relative screen size
Displayconfig; Notes abstractielaag
-------------------------------------
* een XSetup heeft N gfxcards.
* een GfxCard heeft N Monitors
* XSetup is een container voor alle objecten uit de abstractielaag.
* XSetup.addMonitor(monitor,gfxcard) waarbij gfxcard al in XSetup zit en een
referentie naar de kaart vormt waarop monitor is aangesloten.
* Een Adaptor heeft een 1:1 relatie met een monitor, en is 'onderdeel' van
een "Screen" (in de zin van Screen section uit xorg.conf)
* Controls zoals resize en de rotatie / mirroring widgets manipuleren een
Adaptor, die intern de Screen manipuleert
* Singlehead resolutie verandert via xrandr en slaat settings op via
displayconfig-restore.py
* Dualhead resolutie aanpassen pakt intern een passende metamode (bij twinview)
en checkt of alle zinvolle metamodes beschikbaar zijn, anders wordt de user
gewaarschuwd dat dit eerst moet gebeuren.
* Adaptor in dualhead / twinview modus worden dus naar een screen vertaald
metamodes heeft.
* Screen moet dan nog support voor metamodes krijgen.
displayconfig:
===============
* Current resolution doesn't get recognized if current != highest resolution
* new tab display powermanagement, just like the existing tab, we need to be
able to at least replace existing functionality
New Widgets:
-------------
* DualheadPreview
* RadioButtons instead of dropdown for Positioning
* Detect if we're already running on dualhead, (en|dis)able widgets accordingly
* Nvidia MergedFB
- Make preview of dualhead more clear (only xinerama or also mergedFB?)
- Generate list of Metamodes from resolutions available
- write dualhead settings to xorg.conf
* Compare dualhead with different drivers WRT xorg.conf
- generic Xinerama (Matrox, others?)
- dualhead for fglrx, SiS ...
- MergedFB as special case for nvidia (sis?)
* Preview should be rotatable (and|or) resizable (and|or) DualHeadpreview?
* Add missing elements to DualHeadTab
- [ ] Use MergedFB (binds two resolution sliders)
- label with warning "You can only use DRI on one head with different resolutions blahblah"
FIXME: enabling Dualhead should:
- Update resolutions with "metamodes"
- disable Rotation/mirroring stuff
- Add ServerLayout to xorg.conf
- Add second Screen to xorg.conf
- Alternatively (if both resolutions are the same enable MergedFB

@ -16,14 +16,26 @@
# #
###########################################################################
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 *
from tdefile import *
import sys, os, string, re
import os.path
import string, re
import shutil
import locale
import tempfile
@ -48,7 +60,7 @@ cat3 = ["kernel"]
class GreyListViewItem(TDEListViewItem):
def paintCell(self, p, cg, column, width, align ):
cgGrey = cg
cgGrey.setColor(QColorGroup.Text,QColor("grey"))
cgGrey.setColor(TQColorGroup.Text,TQColor("grey"))
TDEListViewItem.paintCell(self, p, cgGrey, column, width, align)
cg.restore()
@ -81,19 +93,19 @@ class GrubConfigAppClass(programbase):
# - GRUB Options Tab -
if standalone:
usershbox = self.addHBoxPage(i18n("Grub Options"))
vbox = QVBox(usershbox)
vbox = TQVBox(usershbox)
else:
vbox = QVBox(tabcontrol)
vbox = TQVBox(tabcontrol)
vbox.setMargin(KDialog.marginHint())
# -- Operating Systems List & MakeDefault Button --
horizontalbox = QHBox(vbox)
horizontalbox = TQHBox(vbox)
self.itemslistview = TDEListView(horizontalbox)
self.itemslistview.addColumn("")
self.itemslistview.setSorting(-1)
self.itemslistview.header().hide()
self.itemslistviewitems = []
arrowsbox = QVBox(horizontalbox)
arrowsbox = TQVBox(horizontalbox)
self.upbutton = KPushButton(i18n("Move Up"),arrowsbox)
self.connect(self.upbutton,SIGNAL("clicked()"),self.slotUpButtonClicked)
@ -105,88 +117,88 @@ class GrubConfigAppClass(programbase):
# -- Boot Options Group Box --
bootoptionsbasebox = QVGroupBox(vbox,"Boot Options")
bootoptionsbasebox = TQVGroupBox(vbox,"Boot Options")
bootoptionsbasebox.setTitle(i18n("Boot Options"));
bootoptionsbasevbox = QWidget(bootoptionsbasebox)
bootoptionsbasevbox = TQWidget(bootoptionsbasebox)
infogrid = QGridLayout(bootoptionsbasevbox,3,2)
infogrid = TQGridLayout(bootoptionsbasevbox,3,2)
infogrid.setSpacing(KDialog.spacingHint())
# --- Timeout ---
label = QLabel(i18n("Timeout:"),bootoptionsbasevbox)
label = TQLabel(i18n("Timeout:"),bootoptionsbasevbox)
infogrid.addWidget(label,0,0)
timeoutbox = QHBox(bootoptionsbasevbox)
timeoutbox = TQHBox(bootoptionsbasevbox)
timeoutbox.setSpacing(KDialog.spacingHint())
self.timeout = KIntSpinBox(timeoutbox,"Timeout")
if "timeout" in self.globalvars:
self.timeout.setValue(int(self.globalvars['timeout'][0]))
label = QLabel(i18n("seconds"),timeoutbox)
label = TQLabel(i18n("seconds"),timeoutbox)
infogrid.addWidget(timeoutbox,0,1)
infogrid.addWidget(self.timeout,0,1)
# --- Hide Menu on Boot ---
self.hidemenuonboot = QCheckBox(i18n("Hide Menu on Boot"),bootoptionsbasevbox)
self.hidemenuonboot = TQCheckBox(i18n("Hide Menu on Boot"),bootoptionsbasevbox)
if 'hiddenmenu' in self.globalvars:
self.hidemenuonboot.setChecked(int(self.globalvars['hiddenmenu'][0]))
infogrid.addWidget(self.hidemenuonboot,1,1)
# --- Make Last OS Default ---
self.lastdefault = QCheckBox(i18n("Make Last Operating System Default"),bootoptionsbasevbox)
self.lastdefault = TQCheckBox(i18n("Make Last Operating System Default"),bootoptionsbasevbox)
infogrid.addWidget(self.lastdefault,2,1)
# -- Security Group Box --
securitybox = QVGroupBox(vbox,"Security")
securitybox = TQVGroupBox(vbox,"Security")
securitybox.setTitle(i18n("Security"));
securityvbox = QWidget(securitybox)
securityvbox = TQWidget(securitybox)
infogrid = QGridLayout(securityvbox,2,2)
infogrid = TQGridLayout(securityvbox,2,2)
infogrid.setSpacing(KDialog.spacingHint())
# --- Password ---
label = QLabel(i18n("Password:"),securityvbox)
label = TQLabel(i18n("Password:"),securityvbox)
infogrid.addWidget(label,0,0)
self.userpassword = KPasswordEdit(securityvbox)
infogrid.addWidget(self.userpassword,0,1)
# --- Repeat Password ---
label = QLabel(i18n("Repeat Password:"),securityvbox)
label = TQLabel(i18n("Repeat Password:"),securityvbox)
infogrid.addWidget(label,1,0)
self.userrepeatpassword = KPasswordEdit(securityvbox)
infogrid.addWidget(self.userrepeatpassword,1,1)
# -- Splash Screen Group Box --
splashbox = QVGroupBox(vbox,"Splash screen")
splashbox = TQVGroupBox(vbox,"Splash screen")
splashbox.setTitle(i18n("Splash screen"));
# --- Background Color ---
labelandeditbox = QHBox(splashbox)
label = QLabel(i18n("Background Color:"),labelandeditbox)
self.backgroundcolor = QComboBox(labelandeditbox)
labelandeditbox = TQHBox(splashbox)
label = TQLabel(i18n("Background Color:"),labelandeditbox)
self.backgroundcolor = TQComboBox(labelandeditbox)
# --- Highlight Color ---
labelandeditbox = QHBox(splashbox)
label = QLabel(i18n("Highlight Color:"),labelandeditbox)
self.highlightcolor = QComboBox(labelandeditbox)
labelandeditbox = TQHBox(splashbox)
label = TQLabel(i18n("Highlight Color:"),labelandeditbox)
self.highlightcolor = TQComboBox(labelandeditbox)
# - Operating Systems Tab -
if standalone:
groupsvbox = self.addVBoxPage(i18n("Operating Systems"))
vb = QVBox(groupsvbox)
vb = TQVBox(groupsvbox)
else:
groupsvbox = QVBox(tabcontrol)
groupsvbox = TQVBox(tabcontrol)
roupsvbox.setMargin(KDialog.marginHint())
vb = QVBox(groupsvbox)
vb = TQVBox(groupsvbox)
# -- Operating Systems List --
horizontalbox = QHBox(vb)
horizontalbox = TQHBox(vb)
self.oslistview = TDEListView(horizontalbox)
self.oslistview.addColumn("")
self.oslistview.addColumn("")
@ -196,72 +208,72 @@ class GrubConfigAppClass(programbase):
self.connect(self.oslistview,SIGNAL("selectionChanged()"),self.oslistviewitemSelected)
# -- Operating Systems Details Box --
osdetailsbox = QVGroupBox(vb,"Operating System Details")
# label = QLabel(i18n("Security"),securitybox)
detailsvbox = QWidget(osdetailsbox)
osdetailsbox = TQVGroupBox(vb,"Operating System Details")
# label = TQLabel(i18n("Security"),securitybox)
detailsvbox = TQWidget(osdetailsbox)
infogrid = QGridLayout(detailsvbox,7,2)
infogrid = TQGridLayout(detailsvbox,7,2)
infogrid.setSpacing(KDialog.spacingHint())
osdetailsbox.setTitle(i18n("Operating System Details"));
# --- List in GRUB Menu ---
self.listingrub = QCheckBox(i18n("List in GRUB Menu"),detailsvbox)
self.listingrub = TQCheckBox(i18n("List in GRUB Menu"),detailsvbox)
infogrid.addWidget(self.listingrub,0,1)
# --- Display Name ---
label = QLabel(i18n("Display Name:"),detailsvbox)
label = TQLabel(i18n("Display Name:"),detailsvbox)
infogrid.addWidget(label,1,0)
self.displaynamelabel = QLineEdit("",detailsvbox)
self.displaynamelabel = TQLineEdit("",detailsvbox)
infogrid.addWidget(self.displaynamelabel,1,1)
self.connect(self.displaynamelabel,SIGNAL("textChanged(const QString &)"),self.slotDisplayNameLabelChanged)
self.connect(self.displaynamelabel,SIGNAL("textChanged(const TQString &)"),self.slotDisplayNameLabelChanged)
# --- Operating System ---
label = QLabel(i18n("Operating System:"),detailsvbox)
label = TQLabel(i18n("Operating System:"),detailsvbox)
infogrid.addWidget(label,2,0)
self.operatingsystem = QComboBox(detailsvbox)
self.operatingsystem = TQComboBox(detailsvbox)
infogrid.addWidget(self.operatingsystem,2,1)
# --- Kernel ---
label = QLabel(i18n("Kernel:"),detailsvbox)
label = TQLabel(i18n("Kernel:"),detailsvbox)
infogrid.addWidget(label,3,0)
self.kernel = KURLRequester(detailsvbox)
infogrid.addWidget(self.kernel,3,1)
# --- Failsafe Kernel ---
# not sure if that is possible - requested by seele
label = QLabel(i18n("Failsafe Kernel:"),detailsvbox)
label = TQLabel(i18n("Failsafe Kernel:"),detailsvbox)
infogrid.addWidget(label,4,0)
self.failsafekernel = QComboBox(detailsvbox)
self.failsafekernel = TQComboBox(detailsvbox)
infogrid.addWidget(self.failsafekernel,4,1)
# --- Initial RAM Disk ---
label = QLabel(i18n("Initial RAM Disk:"),detailsvbox)
label = TQLabel(i18n("Initial RAM Disk:"),detailsvbox)
infogrid.addWidget(label,5,0)
self.initrd = KURLRequester(detailsvbox)
infogrid.addWidget(self.initrd,5,1)
# --- Root Filesystem ---
label = QLabel(i18n("Root Filesystem:"),detailsvbox)
label = TQLabel(i18n("Root Filesystem:"),detailsvbox)
infogrid.addWidget(label,6,0)
self.rootfilesystem = QComboBox(detailsvbox)
self.rootfilesystem = TQComboBox(detailsvbox)
infogrid.addWidget(self.rootfilesystem,6,1)
# -- Boot Options Box --
bootoptionsbox = QVGroupBox(vb,"Boot Options")
# label = QLabel(i18n("Security"),securitybox)
bootoptionsbox = TQVGroupBox(vb,"Boot Options")
# label = TQLabel(i18n("Security"),securitybox)
bootoptionsbox.setTitle(i18n("Boot Options"));
self.acpibox = QCheckBox(i18n("Power Management (ACPI) "),bootoptionsbox)
self.debugbox = QCheckBox(i18n("Debugging Messages "),bootoptionsbox)
self.selinuxbox = QCheckBox(i18n("SELinux Support "),bootoptionsbox)
self.splashbox = QCheckBox(i18n("Splash Screen"),bootoptionsbox)
self.acpibox = TQCheckBox(i18n("Power Management (ACPI) "),bootoptionsbox)
self.debugbox = TQCheckBox(i18n("Debugging Messages "),bootoptionsbox)
self.selinuxbox = TQCheckBox(i18n("SELinux Support "),bootoptionsbox)
self.splashbox = TQCheckBox(i18n("Splash Screen"),bootoptionsbox)
labelandeditbox = QHBox(bootoptionsbox)
label = QLabel(i18n("Custom Options:"),labelandeditbox)
labelandeditbox = TQHBox(bootoptionsbox)
label = TQLabel(i18n("Custom Options:"),labelandeditbox)
self.customoptions = KLineEdit("",labelandeditbox)
# -- (static) UI finished --

@ -22,8 +22,8 @@ Specification at https://wiki.kubuntu.org/KubuntuPowerManagement
Issues:
- We have to keep polling HAL rather than listening for signals because the Python DBUS bindings
don't have Qt mainloop integration
- Written in Python so will be slow to load up, will probably port to C++ Qt 4.2 in future
don't have TQt mainloop integration
- Written in Python so will be slow to load up, will probably port to C++ TQt 4.2 in future
- Should also handle UPS and bluetooth batteries
- systray applet should be hidden if no battery, but then how do you suspend if no battery?
(ksmserver integration please)
@ -32,8 +32,21 @@ Issues:
- dcop calls need patch to dcopexport.py, already submitted upstream
"""
import os
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)
import subprocess
import dbus
@ -69,7 +82,7 @@ class Notify(NotifyWidget):
def setCaption(self,caption):
""" Text to show in bold letters. """
self.Caption.setText(QString("<b>")+caption+QString("</b>"))
self.Caption.setText(TQString("<b>")+caption+QString("</b>"))
def setText(self,msg):
"""" Set actual notification message. """
@ -87,7 +100,7 @@ class PowerManager(PowerManagerUI):
# therefore, it gets our parent as parent.
self.systray = KSystemTray(parent)
self.icon = "battery-charging-100"
self.systray.setPixmap(QPixmap(UserIcon(self.icon)))
self.systray.setPixmap(TQPixmap(UserIcon(self.icon)))
self.connect(self.systray, SIGNAL("quitSelected()"), self.quit)
# Configuration filename
@ -110,7 +123,7 @@ class PowerManager(PowerManagerUI):
# Polling: evil. can't receive signals in python-dbus unless we have a glib mainloop,
# so we need to poll
self.pollTimer = QTimer(self)
self.pollTimer = TQTimer(self)
self.connect(self.pollTimer, SIGNAL("timeout()"), self.poll)
self.pollTimer.start(POLL_INTERVAL) # 5 second poll, maybe make this configurable
self.poll(False)
@ -136,20 +149,20 @@ class PowerManager(PowerManagerUI):
self.LaptopLidRadios.setEnabled(False)
def _initCB(self, combo, options, values):
""" Initialize QComboBox with proper values from provided options. """
""" Initialize TQComboBox with proper values from provided options. """
combo.clear()
for option in options:
combo.insertItem(values[option])
def _getCB(self, combo, options):
""" Get current item from QComboBox from config file (string) value. """
""" Get current item from TQComboBox from config file (string) value. """
try:
return options[combo.currentItem()]
except IndexError:
return ""
def _setCB(self, combo, options, default, value):
""" Set current item in QComboBox from string value. """
""" Set current item in TQComboBox from string value. """
try:
num = options.index(value)
except ValueError:
@ -158,14 +171,14 @@ class PowerManager(PowerManagerUI):
combo.setCurrentItem(num)
def _getRB(self, radios, options):
""" Get current item from QRadioButton from config file (string) value. """
""" Get current item from TQRadioButton from config file (string) value. """
try:
return options[radios.selectedId()]
except IndexError:
return ""
def _setRB(self, radios, options, default, value):
""" Set current item in QRadioButton from string value. """
""" Set current item in TQRadioButton from string value. """
try:
num = options.index(value)
except ValueError:
@ -250,9 +263,9 @@ class PowerManager(PowerManagerUI):
self.connect(self.BatteryBrightnessSlider, SIGNAL("valueChanged(int)"), self.changeBatteryBrightness)
#Add a blank tooltip, the tooltipgroup signals are then used for our KPassivePopup
toolTipGroup = QToolTipGroup(self.systray)
QToolTip.add(self.systray, "", toolTipGroup, "blah")
self.connect(toolTipGroup, SIGNAL("showTip(const QString&)"), self.showTip)
toolTipGroup = TQToolTipGroup(self.systray)
TQToolTip.add(self.systray, "", toolTipGroup, "blah")
self.connect(toolTipGroup, SIGNAL("showTip(const TQString&)"), self.showTip)
self.connect(toolTipGroup, SIGNAL("removeTip()"), self.hideTip)
# Popup tooltip showing battery level
@ -353,7 +366,7 @@ class PowerManager(PowerManagerUI):
# And change the icon in the systray, remove the restore option
# This way, we're basically becoming a systray applet, you can
# hibernate and suspend from
self.systray.setPixmap(QPixmap(UserIcon(self.icon)))
self.systray.setPixmap(TQPixmap(UserIcon(self.icon)))
if self.powermanager.hasAC:
self.wasOnBattery = self.powermanager.onBattery()
@ -368,8 +381,8 @@ class PowerManager(PowerManagerUI):
self.PoweredBrightnessSlider.setValue(self.config.readNumEntry("poweredBrightness", brightness_high)) #default highest
tt_text = "Every step increases or decreases the brightness by %i%%" % int(100/brightness_high)
QToolTip.add(self.BatteryBrightnessSlider, tt_text)
QToolTip.add(self.PoweredBrightnessSlider, tt_text)
TQToolTip.add(self.BatteryBrightnessSlider, tt_text)
TQToolTip.add(self.PoweredBrightnessSlider, tt_text)
self.lockScreenOnResume.setChecked(self.config.readBoolEntry("lockOnResume", True))
@ -418,7 +431,7 @@ class PowerManager(PowerManagerUI):
self.config.sync()
def quit(self):
""" Quit application. """
""" TQuit application. """
kapp.quit()
def showTip(self, text=""):
@ -457,7 +470,7 @@ class PowerManager(PowerManagerUI):
value=self.BatteryBrightnessSlider.value()*100/self.BatteryBrightnessSlider.maxValue()
else:
value=self.PoweredBrightnessSlider.value()*100/self.PoweredBrightnessSlider.maxValue()
return QString(str(value))
return TQString(str(value))
def hideTip(self):
""" Hide the tooltip."""
@ -599,15 +612,15 @@ class PowerManager(PowerManagerUI):
oldIcon = self.icon
self.icon = self._getIcon()
if self.icon != oldIcon:
self.systray.setPixmap(QPixmap(UserIcon(self.icon)))
self.BattPixmap.setPixmap(QPixmap(UserIcon(self.icon)))
self.systray.setPixmap(TQPixmap(UserIcon(self.icon)))
self.BattPixmap.setPixmap(TQPixmap(UserIcon(self.icon)))
def notify(self, msg, icon=None):
""" Send a notification popup. """
if icon:
icon = QPixmap(icon)
icon = TQPixmap(icon)
else:
icon = QPixmap(SmallIcon("messagebox_info"))
icon = TQPixmap(SmallIcon("messagebox_info"))
try:
del self.warningPopup
except:
@ -615,7 +628,7 @@ class PowerManager(PowerManagerUI):
self.warningPopup = KPassivePopup(self.systray)
label = Notify(self.warningPopup, msg, icon)
self.warningPopup.setView(label)
position = QPoint(5,5)
position = TQPoint(5,5)
self.warningPopup.show(position)
def poll(self,notify=True):
@ -728,20 +741,20 @@ class PowerManager(PowerManagerUI):
if self.act_call[action] != None:
note = i18n("Laptop lid is closed, %1 now.").arg(self.act_notify[action])
self.notify(note, self.act_icon[action])
QTimer.singleShot(2000, self.act_call[action])
TQTimer.singleShot(2000, self.act_call[action])
else:
self.powermanager.lidClosedState = False
def _addBatteryWidgets(self):
""" Adds progressbars to show battery status to the tooltip."""
BattLayout = QHBoxLayout(None,0,6,"BattLayout")
BattLayout = TQHBoxLayout(None,0,6,"BattLayout")
self.BattPixmap = QLabel(self.tooltip,"BattLabLayout")
self.BattPixmap.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,self.BattPixmap.sizePolicy().hasHeightForWidth()))
self.BattPixmap.setPixmap(QPixmap(UserIcon(self.icon)))
self.BattPixmap = TQLabel(self.tooltip,"BattLabLayout")
self.BattPixmap.setSizePolicy(TQSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed,0,0,self.BattPixmap.sizePolicy().hasHeightForWidth()))
self.BattPixmap.setPixmap(TQPixmap(UserIcon(self.icon)))
self.BattPixmap.setScaledContents(1)
BattLayout.addWidget(self.BattPixmap)
self.BattMainLabel = QLabel(self.tooltip,"BattMainLabel")
self.BattMainLabel = TQLabel(self.tooltip,"BattMainLabel")
self.BattMainLabel.setText(i18n("<b>Battery:</b>"))
BattLayout.addWidget(self.BattMainLabel)
@ -754,13 +767,13 @@ class PowerManager(PowerManagerUI):
self.BattProgress = {}
i = 1
for batt in self.powermanager.batteries:
self.BattLayout[batt] = QHBoxLayout(None,0,6,"BattBarLayout")
self.BattLabel[batt] = QLabel(self.tooltip,"BattLabel")
self.BattLayout[batt] = TQHBoxLayout(None,0,6,"BattBarLayout")
self.BattLabel[batt] = TQLabel(self.tooltip,"BattLabel")
if len(self.powermanager.batteries) > 1:
self.BattLabel[batt].setText(i18n("Battery %i" % i))
self.BattLayout[batt].addWidget(self.BattLabel[batt])
self.BattProgress[batt] = KProgress(self.tooltip,"BattProgress")
self.BattProgress[batt].setMinimumSize(QSize(200,0))
self.BattProgress[batt].setMinimumSize(TQSize(200,0))
self.BattLayout[batt].addWidget(self.BattProgress[batt])
self.tooltip.layout().addLayout(self.BattLayout[batt])
i += 1
@ -791,14 +804,14 @@ class PowerManager(PowerManagerUI):
if len(self.powermanager.cpus) == 0:
return
LabelLayout = QHBoxLayout(None,0,6,"layout5")
LabelLayout = TQHBoxLayout(None,0,6,"layout5")
self.CpuPixmap = QLabel(self.tooltip,"CpuPixmap")
self.CpuPixmap.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,self.CpuPixmap.sizePolicy().hasHeightForWidth()))
self.CpuPixmap.setPixmap(QPixmap(UserIcon("processor")))
self.CpuPixmap = TQLabel(self.tooltip,"CpuPixmap")
self.CpuPixmap.setSizePolicy(TQSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed,0,0,self.CpuPixmap.sizePolicy().hasHeightForWidth()))
self.CpuPixmap.setPixmap(TQPixmap(UserIcon("processor")))
self.CpuPixmap.setScaledContents(1)
LabelLayout.addWidget(self.CpuPixmap)
self.CpuMainLabel = QLabel(self.tooltip,"CpuMainLabel")
self.CpuMainLabel = TQLabel(self.tooltip,"CpuMainLabel")
self.CpuMainLabel.setText(i18n("<b>CPU Frequency:</b>"))
LabelLayout.addWidget(self.CpuMainLabel)
@ -811,8 +824,8 @@ class PowerManager(PowerManagerUI):
self.CpuProgress = {}
i = 1
for cpu in self.powermanager.cpus:
self.CpuLayout[cpu] = QHBoxLayout(None,0,6,"layout2")
self.CpuLabel[cpu] = QLabel(self.tooltip,"CpuLabel")
self.CpuLayout[cpu] = TQHBoxLayout(None,0,6,"layout2")
self.CpuLabel[cpu] = TQLabel(self.tooltip,"CpuLabel")
if len(self.powermanager.cpus) > 1:
self.CpuLabel[cpu].setText(i18n("Processor %i" % i))
self.CpuLayout[cpu].addWidget(self.CpuLabel[cpu])
@ -967,7 +980,7 @@ class PowerManager(PowerManagerUI):
note = i18n("You are about to run out of battery power, %1 now.").arg(self.act_notify[action])
self.notify(note, self.act_icon[action])
if self.act_call[action] != None:
QTimer.singleShot(2000, self.act_call[action])
TQTimer.singleShot(2000, self.act_call[action])
else:
self.powermanager.criticalBatteryState = False
if currentLevel <= warningLevel and self.batt_level < CHARGE_LEVEL_THRESHOLD:
@ -998,7 +1011,7 @@ class PowerManager(PowerManagerUI):
if idlesec > idleTime:
note = i18n("System idle for at least %1 minutes, %2 now.").arg(idleTime).arg(self.act_notify[action])
self.notify(note, self.act_icon[action])
QTimer.singleShot(2000, self.act_call[action])
TQTimer.singleShot(2000, self.act_call[action])
@ -1113,7 +1126,7 @@ if __name__ == "__main__":
aboutdata.addAuthor("Sebastian Kügler", "Developer", "sebas@kde.org","http://vizZzion.org")
aboutdata.addAuthor("Jonathan Riddell", "Developer", "jriddell@ubuntu.com")
aboutdata.addAuthor("Luka Renko", "Developer", "lure@kubuntu.org")
aboutdata.setProgramLogo(QImage("power-manager.png"))
aboutdata.setProgramLogo(TQImage("power-manager.png"))
TDECmdLineArgs.init(sys.argv, aboutdata)
#kapp = KUniqueApplication(True, True, False)
#kapp = TDEApplication()

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>PowerManagerUI</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>PowerManagerUI</cstring>
</property>
@ -22,7 +22,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>GeneralSettingsBox</cstring>
</property>
@ -33,7 +33,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>lockScreenOnResume</cstring>
</property>
@ -43,7 +43,7 @@
</widget>
</vbox>
</widget>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>MainsPoweredBox</cstring>
</property>
@ -62,7 +62,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout17</cstring>
</property>
@ -70,7 +70,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>PoweredBrightnessLabel</cstring>
</property>
@ -78,7 +78,7 @@
<string>Brightness</string>
</property>
</widget>
<widget class="QSlider">
<widget class="TQSlider">
<property name="name">
<cstring>PoweredBrightnessSlider</cstring>
</property>
@ -112,7 +112,7 @@
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout13</cstring>
</property>
@ -137,7 +137,7 @@
</size>
</property>
</spacer>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>PoweredIdleLabel</cstring>
</property>
@ -145,7 +145,7 @@
<string>When the system is idle for more than</string>
</property>
</widget>
<widget class="QSpinBox">
<widget class="TQSpinBox">
<property name="name">
<cstring>PoweredIdleTime</cstring>
</property>
@ -159,14 +159,14 @@
<string>To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action.</string>
</property>
</widget>
<widget class="QComboBox">
<widget class="TQComboBox">
<property name="name">
<cstring>PoweredIdleCombo</cstring>
</property>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout13_2_2</cstring>
</property>
@ -191,7 +191,7 @@
</size>
</property>
</spacer>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>PoweredFreqLabel</cstring>
</property>
@ -199,7 +199,7 @@
<string>CPU frequency scaling policy</string>
</property>
</widget>
<widget class="QComboBox">
<widget class="TQComboBox">
<property name="name">
<cstring>PoweredFreqCombo</cstring>
</property>
@ -208,7 +208,7 @@
</widget>
</vbox>
</widget>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>BatteryBox</cstring>
</property>
@ -227,7 +227,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout16</cstring>
</property>
@ -235,7 +235,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>BatteryBrightnessLabel</cstring>
</property>
@ -243,7 +243,7 @@
<string>Brightness</string>
</property>
</widget>
<widget class="QSlider">
<widget class="TQSlider">
<property name="name">
<cstring>BatteryBrightnessSlider</cstring>
</property>
@ -268,7 +268,7 @@
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout14</cstring>
</property>
@ -276,12 +276,12 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QComboBox" row="1" column="4">
<widget class="TQComboBox" row="1" column="4">
<property name="name">
<cstring>BatteryIdleCombo</cstring>
</property>
</widget>
<widget class="QLabel" row="1" column="2">
<widget class="TQLabel" row="1" column="2">
<property name="name">
<cstring>BatteryIdleLabel</cstring>
</property>
@ -289,12 +289,12 @@
<string>When the system is idle for more than</string>
</property>
</widget>
<widget class="QComboBox" row="0" column="4">
<widget class="TQComboBox" row="0" column="4">
<property name="name">
<cstring>BatteryCriticalCombo</cstring>
</property>
</widget>
<widget class="QLabel" row="0" column="1" rowspan="1" colspan="2">
<widget class="TQLabel" row="0" column="1" rowspan="1" colspan="2">
<property name="name">
<cstring>BatteryCriticalLabel</cstring>
</property>
@ -302,7 +302,7 @@
<string>When battery remaining time drops below</string>
</property>
</widget>
<widget class="QSpinBox" row="1" column="3">
<widget class="TQSpinBox" row="1" column="3">
<property name="name">
<cstring>BatteryIdleTime</cstring>
</property>
@ -316,7 +316,7 @@
<string>To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action.</string>
</property>
</widget>
<widget class="QSpinBox" row="0" column="3">
<widget class="TQSpinBox" row="0" column="3">
<property name="name">
<cstring>CriticalRemainTime</cstring>
</property>
@ -366,7 +366,7 @@
</spacer>
</grid>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout13_2</cstring>
</property>
@ -391,7 +391,7 @@
</size>
</property>
</spacer>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>BatteryFreqLabel</cstring>
</property>
@ -399,7 +399,7 @@
<string>CPU frequency scaling policy</string>
</property>
</widget>
<widget class="QComboBox">
<widget class="TQComboBox">
<property name="name">
<cstring>BatteryFreqCombo</cstring>
</property>
@ -408,7 +408,7 @@
</widget>
</vbox>
</widget>
<widget class="QButtonGroup">
<widget class="TQButtonGroup">
<property name="name">
<cstring>LaptopLidRadios</cstring>
</property>
@ -433,7 +433,7 @@
<property name="spacing">
<number>5</number>
</property>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>laptopClosedNone</cstring>
</property>
@ -441,7 +441,7 @@
<string>Do nothing</string>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>laptopClosedBlank</cstring>
</property>
@ -449,7 +449,7 @@
<string>Lock screen</string>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>laptopClosedSuspend</cstring>
</property>
@ -463,7 +463,7 @@
<string>Suspend is a sleep state, the system will consume only very little energy when suspended</string>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>laptopClosedHibernate</cstring>
</property>
@ -477,7 +477,7 @@
<string>Hibernate or "Suspend to Disk" is a deep sleepstate, allowing the system to power off completely</string>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>laptopClosedShutdown</cstring>
</property>

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>NotifyWidget</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>NotifyWidgetUI</cstring>
</property>
@ -33,7 +33,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="0" column="0" rowspan="2" colspan="1">
<widget class="TQLabel" row="0" column="0" rowspan="2" colspan="1">
<property name="name">
<cstring>Icon</cstring>
</property>
@ -52,7 +52,7 @@
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" row="1" column="1">
<widget class="TQLabel" row="1" column="1">
<property name="name">
<cstring>Text</cstring>
</property>
@ -60,7 +60,7 @@
<string></string>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
<widget class="TQLabel" row="0" column="1">
<property name="name">
<cstring>Caption</cstring>
</property>
@ -70,6 +70,6 @@
</widget>
</grid>
</widget>
<pixmapfunction>QPixmap</pixmapfunction>
<pixmapfunction>TQPixmap</pixmapfunction>
<layoutdefaults spacing="6" margin="11"/>
</UI>

@ -1,7 +1,7 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ToolTip</class>
<comment>Python:from tdeui import *</comment>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>ToolTip</cstring>
</property>
@ -48,6 +48,6 @@
<slots>
<slot>ToolTip_destroyed( TQObject * )</slot>
</slots>
<pixmapfunction>QPixmap</pixmapfunction>
<pixmapfunction>TQPixmap</pixmapfunction>
<layoutdefaults spacing="6" margin="11"/>
</UI>

@ -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")

@ -29,6 +29,7 @@ for m_path in sys.path:
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 *

@ -44,70 +44,70 @@ class FirstRunWizard(KWizard):
self.setupPageExistingWine()
self.setupPageCreateWine()
self.slotCreateExistingToggled(0)
#self.connect(self,SIGNAL("selected(const QString &)"),self.slotPageChanged)
#self.connect(self,SIGNAL("selected(const TQString &)"),self.slotPageChanged)
#self.resize(QSize(600,480).expandedTo(self.minimumSizeHint()))
self.clearWState(Qt.WState_Polished)
#self.resize(TQSize(600,480).expandedTo(self.minimumSizeHint()))
self.clearWState(TQt.WState_Polished)
def setupPage1(self):
page1 = QHBox(self,"page1")
page1 = TQHBox(self,"page1")
self.kdewinepicture = QLabel(page1,"kdewinepicture")
self.kdewinepicture.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(QSize(140,320))
self.kdewinepicture.setPixmap(QPixmap(self.imagedir+"kdewinewizard.png"))
self.kdewinepicture = TQLabel(page1,"kdewinepicture")
self.kdewinepicture.setSizePolicy(TQSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(TQSize(140,320))
self.kdewinepicture.setPixmap(TQPixmap(self.imagedir+"kdewinewizard.png"))
#self.kdewinepicture.setScaledContents(1)
spacer = QWidget(page1)
spacer.setMinimumSize(QSize(6,300))
spacer = TQWidget(page1)
spacer.setMinimumSize(TQSize(6,300))
pagebody = QVBox(page1,"pagebody")
pagebody = TQVBox(page1,"pagebody")
page1.setStretchFactor(pagebody,1)
introtext = QLabel(pagebody,"introtext")
introtext = TQLabel(pagebody,"introtext")
introtext.setText(i18n("It appears that you do not yet have a Windows drive set up.\n" +\
"This wizard will help set it up so that you can run windows applications.\n"))
spacer = QWidget(pagebody)
spacer.setMinimumSize(QSize(6,20))
spacer = TQWidget(pagebody)
spacer.setMinimumSize(TQSize(6,20))
self.createinstall = True
createwinepathchoice = QRadioButton(i18n("Set up the fake windows installation " +\
createwinepathchoice = TQRadioButton(i18n("Set up the fake windows installation " +\
"in the following directory:"),pagebody)
self.winepath = self.default_winepath
hbox = QHBox(pagebody)
hbox = TQHBox(pagebody)
hbox.setSpacing(KDialog.spacingHint())
self.winefolderedit = KLineEdit(self.winepath,hbox)
self.urlcompletion = KURLCompletion(KURLCompletion.DirCompletion)
self.winefolderedit.setCompletionObject(self.urlcompletion)
self.winefolderedit.setCompletionMode(TDEGlobalSettings.CompletionPopup)
self.connect(self.winefolderedit,SIGNAL("textChanged(const QString &)"),self.slotWineFolderEdited)
self.connect(self.winefolderedit,SIGNAL("textChanged(const TQString &)"),self.slotWineFolderEdited)
self.browsecreatebutton = KPushButton(i18n("Browse"),hbox)
self.connect(self.browsecreatebutton,SIGNAL("clicked()"),self.slotBrowseClicked)
spacer = QWidget(pagebody)
spacer.setMinimumSize(QSize(6,10))
spacer = TQWidget(pagebody)
spacer.setMinimumSize(TQSize(6,10))
existingwinepathchoice = QRadioButton(i18n("There is already a fake windows installation " +\
existingwinepathchoice = TQRadioButton(i18n("There is already a fake windows installation " +\
"in the following directory:"),pagebody)
hbox = QHBox(pagebody)
hbox = TQHBox(pagebody)
hbox.setSpacing(KDialog.spacingHint())
self.existingwinefolderedit = KLineEdit("",hbox)
self.urlcompletion = KURLCompletion(KURLCompletion.DirCompletion)
self.existingwinefolderedit.setCompletionObject(self.urlcompletion)
self.existingwinefolderedit.setCompletionMode(TDEGlobalSettings.CompletionPopup)
self.connect(self.existingwinefolderedit,SIGNAL("textChanged(const QString &)"),self.slotWineFolderEdited)
self.connect(self.existingwinefolderedit,SIGNAL("textChanged(const TQString &)"),self.slotWineFolderEdited)
self.browseexistingbutton = KPushButton(i18n("Browse"),hbox)
self.connect(self.browseexistingbutton,SIGNAL("clicked()"),self.slotBrowseClicked)
self.createexistingchoicesgroup = QButtonGroup(pagebody,"createexistingchoicesgroup")
self.createexistingchoicesgroup = TQButtonGroup(pagebody,"createexistingchoicesgroup")
self.createexistingchoicesgroup.insert(createwinepathchoice,0)
self.createexistingchoicesgroup.insert(existingwinepathchoice,1)
self.createexistingchoicesgroup.setExclusive(True)
@ -115,7 +115,7 @@ class FirstRunWizard(KWizard):
self.createexistingchoicesgroup.setButton(0)
self.connect(self.createexistingchoicesgroup,SIGNAL("clicked(int)"),self.slotCreateExistingToggled)
bottomspacer = QWidget(pagebody)
bottomspacer = TQWidget(pagebody)
pagebody.setStretchFactor(bottomspacer,1)
self.addPage( page1, i18n("Setting up your windows drive") )
@ -126,30 +126,30 @@ class FirstRunWizard(KWizard):
self.setFinishEnabled( page1, False )
def setupPageExistingWine(self):
self.pageexisting = QHBox(self,"pageexisting")
self.pageexisting = TQHBox(self,"pageexisting")
self.kdewinepicture = QLabel(self.pageexisting,"kdewinepicture")
self.kdewinepicture.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(QSize(140,320))
self.kdewinepicture.setPixmap(QPixmap(self.imagedir+"kdewinewizard.png"))
self.kdewinepicture = TQLabel(self.pageexisting,"kdewinepicture")
self.kdewinepicture.setSizePolicy(TQSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(TQSize(140,320))
self.kdewinepicture.setPixmap(TQPixmap(self.imagedir+"kdewinewizard.png"))
#self.kdewinepicture.setScaledContents(1)
spacer = QWidget(self.pageexisting)
spacer.setMinimumSize(QSize(6,300))
spacer = TQWidget(self.pageexisting)
spacer.setMinimumSize(TQSize(6,300))
valid = wineread.VerifyWineDrive(self.winepath)
pagebody = QVBox(self.pageexisting,"pagebody")
pagebody = TQVBox(self.pageexisting,"pagebody")
self.pageexisting.setStretchFactor(pagebody,1)
existstext = QLabel(pagebody,"existstext")
existstext = TQLabel(pagebody,"existstext")
if valid:
existstext.setText(i18n("A fake windows installation was found."))
else:
existstext.setText(i18n("No fake windows installation was found in\n" +\
self.winepath + "\nPlease go back and create one."))
bottomspacer = QWidget(pagebody)
bottomspacer = TQWidget(pagebody)
pagebody.setStretchFactor(bottomspacer,1)
self.addPage( self.pageexisting, i18n("Setting up your windows drive") )
@ -160,25 +160,25 @@ class FirstRunWizard(KWizard):
self.setFinishEnabled( self.pageexisting, True )
def setupPageCreateWine(self):
self.pagecreate = QHBox(self,"pagecreate")
self.pagecreate = TQHBox(self,"pagecreate")
self.kdewinepicture = QLabel(self.pagecreate,"kdewinepicture")
self.kdewinepicture.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(QSize(140,320))
self.kdewinepicture.setPixmap(QPixmap(self.imagedir+"kdewinewizard.png"))
self.kdewinepicture = TQLabel(self.pagecreate,"kdewinepicture")
self.kdewinepicture.setSizePolicy(TQSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(TQSize(140,320))
self.kdewinepicture.setPixmap(TQPixmap(self.imagedir+"kdewinewizard.png"))
#self.kdewinepicture.setScaledContents(1)
spacer = QWidget(self.pagecreate)
spacer.setMinimumSize(QSize(6,300))
spacer = TQWidget(self.pagecreate)
spacer.setMinimumSize(TQSize(6,300))
pagebody = QVBox(self.pagecreate,"pagebody")
pagebody = TQVBox(self.pagecreate,"pagebody")
self.pagecreate.setStretchFactor(pagebody,1)
self.createdtext = QLabel(pagebody,"existstext")
self.createdtext = TQLabel(pagebody,"existstext")
self.createdtext.setText(i18n("A fake windows installation was created for you in\n" +\
self.winepath))
bottomspacer = QWidget(pagebody)
bottomspacer = TQWidget(pagebody)
pagebody.setStretchFactor(bottomspacer,1)
self.addPage( self.pagecreate, i18n("Setting up your windows drive") )
@ -189,21 +189,21 @@ class FirstRunWizard(KWizard):
self.setFinishEnabled( self.pagecreate, True )
def setupPageVersion(self):
self.pageversion = QHBox(self,"pageversion")
self.pageversion = TQHBox(self,"pageversion")
self.kdewinepicture = QLabel(self.pageversion,"kdewinepicture")
self.kdewinepicture.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(QSize(140,320))
self.kdewinepicture.setPixmap(QPixmap(self.imagedir+"kdewinewizard.png"))
self.kdewinepicture = TQLabel(self.pageversion,"kdewinepicture")
self.kdewinepicture.setSizePolicy(TQSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed,0,0,self.kdewinepicture.sizePolicy().hasHeightForWidth()))
self.kdewinepicture.setMinimumSize(TQSize(140,320))
self.kdewinepicture.setPixmap(TQPixmap(self.imagedir+"kdewinewizard.png"))
#self.kdewinepicture.setScaledContents(1)
spacer = QWidget(self.pageversion)
spacer.setMinimumSize(QSize(6,300))
spacer = TQWidget(self.pageversion)
spacer.setMinimumSize(TQSize(6,300))
pagebody = QVBox(self.pageversion,"pagebody")
pagebody = TQVBox(self.pageversion,"pagebody")
self.pageversion.setStretchFactor(pagebody,1)
versiontext = QLabel(pagebody,"versiontext")
versiontext = TQLabel(pagebody,"versiontext")
versiontext.setText(i18n("What windows version would you like to emulate?\n"))
self.winversions = wineread.winversions
@ -214,7 +214,7 @@ class FirstRunWizard(KWizard):
self.connect(self.versioncombo,SIGNAL("activated(int)"),self.slotVersionActivated)
self.__selectWinVer(self.verid)
bottomspacer = QWidget(pagebody)
bottomspacer = TQWidget(pagebody)
pagebody.setStretchFactor(bottomspacer,1)
self.addPage( self.pageversion, i18n("Setting up your windows drive") )

@ -1,10 +1,10 @@
/*
* pykcm_launcher.cpp
*
*
* Launch Control Centre modules written in Python using an embedded Python
* interpreter.
* Based on David Boddie's PyKDE-components.
* Based on David Boddie's PyTDE-components.
*/
// pythonize.h must be included first.
@ -15,17 +15,15 @@
#include <klibloader.h>
#include <kstandarddirs.h>
#include <ksimpleconfig.h>
#include <qstring.h>
#include <tqstring.h>
#include <sip.h>
#define MODULE_DIR "/opt/trinity/share/apps/guidance"
#define EXTRA_MODULE_DIR "/opt/trinity/share/python-support/tde-guidance-trinity"
#define EXTRA_MODULE_DIR_TWO "/opt/trinity/share/python-support/guidance-backends-trinity"
#define EXTRA_MODULE_DIR_THREE "/opt/trinity/share/python-support/tde-guidance-powermanager-trinity"
#define MODULE_DIR "/root/TEMP5/tde-guidance-trinity-14.0.0-r131/debian/tmp/opt/trinity/share/apps/guidance"
#define EXTRA_MODULE_DIR "None"
#define MODULE_NAME "wineconfig"
#define FACTORY "create_wineconfig"
#define CPP_FACTORY create_wineconfig
#define LIB_PYTHON "libpython2.5.so"
#define LIB_PYTHON "libpython2.7.so"
#define debug 1
static TDECModule *report_error(char *msg) {
@ -33,48 +31,42 @@ static TDECModule *report_error(char *msg) {
return NULL;
}
static TDECModule* return_instance( QWidget *parent, const char *name ) {
static TDECModule* return_instance( TQWidget *parent, const char *name ) {
TDECModule* tdecmodule;
PyObject *pyTDECModuleTuple;
PyObject *pyTDECModuleTuple;
PyObject *pyTDECModule;
Pythonize *pyize; // Pythonize object to manage the Python interpreter.
int isErr;
// Try to determine what py script we're loading. Note that "name"
// typically appears to be NULL.
QString script(MODULE_NAME);
TQString script(MODULE_NAME);
// Reload libpython, but this time tell the runtime linker to make the
// symbols global and available for later loaded libraries/module.
KLibLoader::self()->globalLibrary(LIB_PYTHON);
// Start the interpreter.
pyize = initialize();
if (!pyize) {
return report_error ("***Failed to start interpreter\n");
}
// Add the path to the python script to the interpreter search path.
QString path = QString(MODULE_DIR);
if(path == QString::null) {
TQString path = TQString(MODULE_DIR);
if(path == TQString::null) {
return report_error ("***Failed to locate script path");
}
if(!pyize->appendToSysPath (path.latin1 ())) {
return report_error ("***Failed to set sys.path\n");
}
QString extrapath = QString(EXTRA_MODULE_DIR);
// Add the extra path to the python script to the interpreter search path.
TQString extrapath = TQString(EXTRA_MODULE_DIR);
if(!pyize->appendToSysPath (extrapath.latin1 ())) {
return report_error ("***Failed to set extra sys.path\n");
}
QString extrapath_two = QString(EXTRA_MODULE_DIR_TWO);
if(!pyize->appendToSysPath (extrapath_two.latin1 ())) {
return report_error ("***Failed to set extra 2 sys.path\n");
return report_error ("***Failed to set extra sys.path\n");
}
QString extrapath_three = QString(EXTRA_MODULE_DIR_THREE);
if(!pyize->appendToSysPath (extrapath_three.latin1 ())) {
return report_error ("***Failed to set extra 3 sys.path\n");
}
// Load the Python script.
PyObject *pyModule = pyize->importModule ((char *)script.latin1 ());
if(!pyModule) {
@ -83,14 +75,14 @@ static TDECModule* return_instance( QWidget *parent, const char *name ) {
}
// Inject a helper function
QString bridge = QString("import sip\n"
"import qt\n"
TQString bridge = TQString("from sip4_tqt import sip\n"
"from python_tqt import qt\n"
"def kcontrol_bridge_" FACTORY "(parent,name):\n"
" if parent!=0:\n"
#if SIP_VERSION >= 0x040200
" wparent = sip.wrapinstance(parent,qt.QWidget)\n"
#else
" wparent = sip.wrapinstance(parent,'QWidget')\n"
" wparent = sip.wrapinstance(parent,qt.TQWidget)\n"
#else
" wparent = sip.wrapinstance(parent,'TQWidget')\n"
#endif
" else:\n"
" wparent = None\n"
@ -103,7 +95,7 @@ static TDECModule* return_instance( QWidget *parent, const char *name ) {
if(!kcmFactory) {
return report_error ("***failed to find module factory\n");
}
// Call the factory function. Set up the args.
PyObject *pyParent = PyLong_FromVoidPtr(parent);
PyObject *pyName = PyString_FromString(MODULE_NAME);
@ -125,7 +117,7 @@ static TDECModule* return_instance( QWidget *parent, const char *name ) {
// Stop this from getting garbage collected.
Py_INCREF(PyTuple_GET_ITEM(pyTDECModuleTuple,0));
// convert the TDECModule PyObject to a real C++ TDECModule *.
isErr = 0;
pyTDECModule = PyTuple_GET_ITEM(pyTDECModuleTuple,1);
@ -134,8 +126,8 @@ static TDECModule* return_instance( QWidget *parent, const char *name ) {
return report_error ("***failed sip conversion to C++ pointer\n");
}
pyize->decref(pyTDECModuleTuple);
// PyKDE can't run the module without this - Pythonize
// PyTDE can't run the module without this - Pythonize
// grabs the lock at initialization and we have to give
// it back before exiting. At this point, we no longer need
// it.
@ -150,7 +142,7 @@ static TDECModule* return_instance( QWidget *parent, const char *name ) {
extern "C" {
// Factory function that kcontrol will call.
TDECModule* CPP_FACTORY(QWidget *parent, const char *name) {
TDECModule* CPP_FACTORY(TQWidget *parent, const char *name) {
return return_instance(parent, name);
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save