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

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

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

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

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

@ -16,12 +16,24 @@
# # # #
########################################################################### ###########################################################################
from qt import *
from tdeui import *
from tdecore import *
import sys import sys
import os import os
import os.path 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 posix
import re import re
from pickle import Pickler,Unpickler from pickle import Pickler,Unpickler
@ -960,7 +972,7 @@ class SysVInitApp(programbase):
self.updatingGUI = False self.updatingGUI = False
self.context = getServiceContext() self.context = getServiceContext()
self.servicestolistitems = {} # Map service names to QListViewItems self.servicestolistitems = {} # Map service names to TQListViewItems
self.currentrunlevel = self.context.currentRunLevel() self.currentrunlevel = self.context.currentRunLevel()
self.context.loadInfo() self.context.loadInfo()
@ -968,28 +980,28 @@ class SysVInitApp(programbase):
self.aboutus = TDEAboutApplication(self) self.aboutus = TDEAboutApplication(self)
if standalone: if standalone:
toplayout = QVBoxLayout( self.plainPage(), 0, KDialog.spacingHint() ) toplayout = TQVBoxLayout( self.plainPage(), 0, KDialog.spacingHint() )
tophb = QSplitter(Qt.Horizontal, self.plainPage()) tophb = TQSplitter(TQt.Horizontal, self.plainPage())
else: else:
toplayout = QVBoxLayout( self, 0, KDialog.spacingHint() ) toplayout = TQVBoxLayout( self, 0, KDialog.spacingHint() )
tophb = QSplitter(Qt.Horizontal, self) tophb = TQSplitter(TQt.Horizontal, self)
toplayout.addWidget(tophb) toplayout.addWidget(tophb)
vb = QVBox(tophb) vb = TQVBox(tophb)
vb.setSpacing(KDialog.spacingHint()) vb.setSpacing(KDialog.spacingHint())
hb = QHBox(vb) hb = TQHBox(vb)
hb.setSpacing(KDialog.spacingHint()) hb.setSpacing(KDialog.spacingHint())
vb.setStretchFactor(hb,0) vb.setStretchFactor(hb,0)
label = QLabel(hb) label = TQLabel(hb)
label.setPixmap(UserIcon("hi32-app-daemons")) label.setPixmap(UserIcon("hi32-app-daemons"))
hb.setStretchFactor(label,0) hb.setStretchFactor(label,0)
label = QLabel(i18n("Run level:"),hb) label = TQLabel(i18n("Run level:"),hb)
hb.setStretchFactor(label,0) hb.setStretchFactor(label,0)
self.runlevelcombo = QComboBox(hb) self.runlevelcombo = TQComboBox(hb)
# Load up the runlevel combo box. # Load up the runlevel combo box.
i = 0 i = 0
@ -1003,7 +1015,7 @@ class SysVInitApp(programbase):
self.connect(self.runlevelcombo, SIGNAL("activated(int)"), self.slotRunLevelChanged) self.connect(self.runlevelcombo, SIGNAL("activated(int)"), self.slotRunLevelChanged)
widget = QWidget(hb) widget = TQWidget(hb)
hb.setStretchFactor(widget,1) hb.setStretchFactor(widget,1)
self.servicelistview = TDEListView(vb) self.servicelistview = TDEListView(vb)
@ -1011,56 +1023,56 @@ class SysVInitApp(programbase):
self.servicelistview.addColumn(i18n("Start at Boot")) self.servicelistview.addColumn(i18n("Start at Boot"))
self.servicelistview.addColumn(i18n("Status")) self.servicelistview.addColumn(i18n("Status"))
self.servicelistview.setAllColumnsShowFocus(True) self.servicelistview.setAllColumnsShowFocus(True)
self.servicelistview.setSelectionMode(QListView.Single) self.servicelistview.setSelectionMode(TQListView.Single)
self.connect(self.servicelistview, SIGNAL("selectionChanged(QListViewItem *)"), self.slotListClicked) self.connect(self.servicelistview, SIGNAL("selectionChanged(TQListViewItem *)"), self.slotListClicked)
# Right hand side of the dialog. # Right hand side of the dialog.
vb = QVBox(tophb) vb = TQVBox(tophb)
vb.setSpacing(KDialog.spacingHint()) vb.setSpacing(KDialog.spacingHint())
hgb = QHGroupBox(i18n("Service Details"),vb) hgb = TQHGroupBox(i18n("Service Details"),vb)
vb.setStretchFactor(hgb,1) vb.setStretchFactor(hgb,1)
vb2 = QVBox(hgb) vb2 = TQVBox(hgb)
vb2.setSpacing(KDialog.spacingHint()) vb2.setSpacing(KDialog.spacingHint())
label = QLabel(i18n("Description:"),vb2) label = TQLabel(i18n("Description:"),vb2)
vb2.setStretchFactor(label,0) vb2.setStretchFactor(label,0)
self.descriptiontextedit = QTextEdit(vb2) self.descriptiontextedit = TQTextEdit(vb2)
vb2.setStretchFactor(self.descriptiontextedit,2) vb2.setStretchFactor(self.descriptiontextedit,2)
self.descriptiontextedit.setReadOnly(True) 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) vb2.setStretchFactor(self.startatbootcheckbox,0)
self.connect(self.startatbootcheckbox, SIGNAL("toggled(bool)"), self.slotBootChanged) self.connect(self.startatbootcheckbox, SIGNAL("toggled(bool)"), self.slotBootChanged)
label = QLabel(i18n("Status:"),vb2) label = TQLabel(i18n("Status:"),vb2)
vb2.setStretchFactor(label,0) vb2.setStretchFactor(label,0)
self.statustext = QTextEdit(vb2) self.statustext = TQTextEdit(vb2)
self.statustext.setReadOnly(True) self.statustext.setReadOnly(True)
vb2.setStretchFactor(self.statustext,1) vb2.setStretchFactor(self.statustext,1)
hb2 = QHBox(vb2) hb2 = TQHBox(vb2)
hb2.setSpacing(KDialog.spacingHint()) hb2.setSpacing(KDialog.spacingHint())
vb2.setStretchFactor(hb2,0) vb2.setStretchFactor(hb2,0)
self.startbutton = QPushButton(i18n("Start"),hb2) self.startbutton = TQPushButton(i18n("Start"),hb2)
hb2.setStretchFactor(self.startbutton,1) hb2.setStretchFactor(self.startbutton,1)
self.connect(self.startbutton, SIGNAL("clicked()"), self.slotStartButton) 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) hb2.setStretchFactor(self.stopbutton,1)
self.connect(self.stopbutton, SIGNAL("clicked()"), self.slotStopButton) 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) hb2.setStretchFactor(self.restartbutton,1)
self.connect(self.restartbutton, SIGNAL("clicked()"), self.slotRestartButton) self.connect(self.restartbutton, SIGNAL("clicked()"), self.slotRestartButton)
if DISTRO == "Gentoo": if DISTRO == "Gentoo":
# Gentoo Linux gets an extra button. # Gentoo Linux gets an extra button.
self.zapbutton = QPushButton(i18n("Zap"),hb2) self.zapbutton = TQPushButton(i18n("Zap"),hb2)
hb2.setStretchFactor(self.zapbutton,1) hb2.setStretchFactor(self.zapbutton,1)
self.connect(self.zapbutton, SIGNAL("clicked()"), self.slotZapButton) self.connect(self.zapbutton, SIGNAL("clicked()"), self.slotZapButton)
if not isroot: if not isroot:
self.disableStuff() self.disableStuff()
else: else:
self.connect(self.servicelistview, SIGNAL("contextMenu(TDEListView*,QListViewItem*,const QPoint&)"), self.connect(self.servicelistview, SIGNAL("contextMenu(TDEListView*,TQListViewItem*,const TQPoint&)"),
self.slotServiceContextMenu) self.slotServiceContextMenu)
self.__fillListView(self.currentrunlevel) self.__fillListView(self.currentrunlevel)
@ -1130,7 +1142,7 @@ class SysVInitApp(programbase):
self.__checkServiceStatus() self.__checkServiceStatus()
if DISTRO == "Debian" and (standalone or (not standalone and is_shown)): if DISTRO == "Debian" and (standalone or (not standalone and is_shown)):
QTimer.singleShot(0,self.__startLoadDescriptions) TQTimer.singleShot(0,self.__startLoadDescriptions)
is_shown = True is_shown = True
@ -1151,9 +1163,9 @@ class SysVInitApp(programbase):
if item.isAvailableInRunlevel(runlevelobj): if item.isAvailableInRunlevel(runlevelobj):
status = item.status.strip().replace("\n",", ")[:32] status = item.status.strip().replace("\n",", ")[:32]
if item in runlevelobj.activeservices: if item in runlevelobj.activeservices:
lvi = QListViewItem(self.servicelistview,item.filename,i18n("Yes"),status) lvi = TQListViewItem(self.servicelistview,item.filename,i18n("Yes"),status)
else: else:
lvi = QListViewItem(self.servicelistview,item.filename,i18n("No"),status) lvi = TQListViewItem(self.servicelistview,item.filename,i18n("No"),status)
self.servicestolistitems[item] = lvi self.servicestolistitems[item] = lvi
######################################################################## ########################################################################
@ -1276,7 +1288,7 @@ class SysVInitApp(programbase):
self.context.descriptioncache.saveCache() self.context.descriptioncache.saveCache()
return return
QTimer.singleShot(0,self.__loadDescriptions) TQTimer.singleShot(0,self.__loadDescriptions)
######################################################################## ########################################################################
def __runInitScript(self,title,service,command): def __runInitScript(self,title,service,command):
@ -1380,21 +1392,21 @@ class CommandRunner(KDialogBase):
self.resize(400,200) self.resize(400,200)
vbox = self.makeVBoxMainWidget() vbox = self.makeVBoxMainWidget()
hbox = QHBox(vbox) hbox = TQHBox(vbox)
hbox.setSpacing(self.spacingHint()) hbox.setSpacing(self.spacingHint())
tmplabel = QLabel(hbox) tmplabel = TQLabel(hbox)
tmplabel.setPixmap(UserIcon("laserwarn")) tmplabel.setPixmap(UserIcon("laserwarn"))
hbox.setStretchFactor(tmplabel,0) hbox.setStretchFactor(tmplabel,0)
self.headinglabel = QLabel(hbox) self.headinglabel = TQLabel(hbox)
hbox.setStretchFactor(self.headinglabel,1) hbox.setStretchFactor(self.headinglabel,1)
self.outputtextview = QTextView(vbox) self.outputtextview = TQTextView(vbox)
self.outputtextview.setTextFormat(QTextView.PlainText) self.outputtextview.setTextFormat(TQTextView.PlainText)
self.kid = QProcess() self.kid = TQProcess()
self.kid.setCommunication(QProcess.Stdout|QProcess.Stderr) self.kid.setCommunication(TQProcess.Stdout|TQProcess.Stderr)
self.connect(self.kid,SIGNAL("processExited()"),self.slotProcessExited) self.connect(self.kid,SIGNAL("processExited()"),self.slotProcessExited)
self.connect(self.kid,SIGNAL("readyReadStdout()"),self.slotReadyReadStdout) self.connect(self.kid,SIGNAL("readyReadStdout()"),self.slotReadyReadStdout)
self.connect(self.kid,SIGNAL("readyReadStderr()"),self.slotReadyReadStderr) self.connect(self.kid,SIGNAL("readyReadStderr()"),self.slotReadyReadStderr)
@ -1416,7 +1428,7 @@ class CommandRunner(KDialogBase):
self.killTimer(self.bootstraptimer) self.killTimer(self.bootstraptimer)
# Create a slightly new environment where TERM is vt100 # Create a slightly new environment where TERM is vt100
new_env = QStringList() new_env = TQStringList()
for key in os.environ: for key in os.environ:
if key=="TERM": if key=="TERM":
new_env.append("TERM=vt100") new_env.append("TERM=vt100")

@ -29,6 +29,7 @@ for m_path in sys.path:
tqt_modules.insert(0, m_pyqt_dir) tqt_modules.insert(0, m_pyqt_dir)
for m_path in tqt_modules: for m_path in tqt_modules:
sys.path.insert(0, m_path) sys.path.insert(0, m_path)
from qt import * from qt import *
from tdeui import * from tdeui import *
from tdecore import * from tdecore import *

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

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

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