Branch: master

d28ae74d 2014-09-23 19:40:50 Timothy Pearson
Convert remaining modules to TQt3
This relates to Bug 1995
M grubconfig/grubconfig.py
M powermanager/guidance-power-manager.py
M powermanager/guidance_power_manager_ui.ui
M powermanager/notify.ui
M powermanager/tooltip.ui
M serviceconfig/serviceconfig.py
M userconfig/userconfig.py
M wineconfig/firstrunwizard.py
M wineconfig/kcm_wineconfig.cpp
M wineconfig/wineconfig.py
R displayconfig-TODO
diff --git a/displayconfig-TODO b/displayconfig-TODO
deleted file mode 100644
index 926f7d9..0000000
--- a/displayconfig-TODO
+++ /dev/null
@@ -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
diff --git a/grubconfig/grubconfig.py b/grubconfig/grubconfig.py
index 5b26ab3..bcdf323 100644
--- a/grubconfig/grubconfig.py
+++ b/grubconfig/grubconfig.py
@@ -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 @@
 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 @@
     # - 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 @@
 
 
     # -- 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 ---
 ** Diff limit reached (max: 250 lines) **