diff options
Diffstat (limited to 'grubconfig')
-rw-r--r-- | grubconfig/grubconfig.py | 124 |
1 files changed, 68 insertions, 56 deletions
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 @@ 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 -- |