From 138f1893d0aa1fa54f9fd55674a5fc8e24aa07b5 Mon Sep 17 00:00:00 2001 From: Francois Andriot Date: Tue, 23 Sep 2014 18:28:49 -0500 Subject: Convert mountconfig module to TQt3 This relates to Bug 2261 --- mountconfig/mountconfig.py | 292 +++++++++++++++++++++++---------------------- 1 file changed, 152 insertions(+), 140 deletions(-) (limited to 'mountconfig/mountconfig.py') diff --git a/mountconfig/mountconfig.py b/mountconfig/mountconfig.py index 9c00b7d..d7e3641 100755 --- a/mountconfig/mountconfig.py +++ b/mountconfig/mountconfig.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 * from tdeio import * -import sys -import os -import os.path from types import StringType,UnicodeType import pwd import grp @@ -456,7 +468,7 @@ class MountEntryExt(object): def _setBusy(self,parentdialog,flag): global kapp if flag: - kapp.setOverrideCursor( QCursor(Qt.WaitCursor) ) + kapp.setOverrideCursor( TQCursor(TQt.WaitCursor) ) parentdialog.setEnabled(False) # It is necessary to process some of the events in the event queue. @@ -1352,14 +1364,14 @@ class MountTable(object): raise NotImplementedError, "No __setitem__ on MountTable." ############################################################################ -class MountEntryDialogOptions(QWidget): +class MountEntryDialogOptions(TQWidget): deviceexample = i18n("(for example /dev/hdb3)") ######################################################################## def __init__(self,parent,showmountpoint=True,showdevice=True, showfs_freq=True,showfs_passno=True,showuuid=True,showlabel=True): - QWidget.__init__(self,parent) + TQWidget.__init__(self,parent) self.showmountpoint = showmountpoint self.showdevice = showdevice self.showfs_freq = showfs_freq @@ -1373,21 +1385,21 @@ class MountEntryDialogOptions(QWidget): ######################################################################## def _fillPage(self): row = 0 - grid = QGridLayout(self,1,2) + grid = TQGridLayout(self,1,2) grid.setSpacing(KDialog.spacingHint()) grid.setColStretch(0,0) grid.setColStretch(2,0) if self.showmountpoint: - label = QLabel(i18n("Mount Point:"),self) + label = TQLabel(i18n("Mount Point:"),self) grid.addWidget(label,row,0) - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) self.mountpointlineedit = KLineEdit(hbox) hbox.setStretchFactor(self.mountpointlineedit,1) - #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged) + #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged) self.mountpointbutton = KPushButton(i18n("Browse..."),hbox) hbox.setStretchFactor(self.mountpointbutton,0) self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked) @@ -1395,26 +1407,26 @@ class MountEntryDialogOptions(QWidget): row += 1 if self.showdevice: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - label = QLabel(i18n("Device:"),self) + label = TQLabel(i18n("Device:"),self) grid.addWidget(label,row,0) - self.devicecheckbox = QRadioButton(i18n("by name"),hbox) + self.devicecheckbox = TQRadioButton(i18n("by name"),hbox) self.connect(self.devicecheckbox,SIGNAL("clicked()"), \ self.slotDeviceCheckboxClicked) self.devicelineedit = KLineEdit(hbox) grid.addMultiCellWidget(hbox,row,row,1,3) row += 1 - example = QLabel(self.deviceexample,self) + example = TQLabel(self.deviceexample,self) grid.addMultiCellWidget(example,row,row,1,3) row += 1 if self.showuuid: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - self.uuidcheckbox = QRadioButton(i18n("by UUID"),hbox) + self.uuidcheckbox = TQRadioButton(i18n("by UUID"),hbox) self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \ self.slotUUIDCheckboxClicked) self.uuidlineedit = KLineEdit(hbox) @@ -1422,9 +1434,9 @@ class MountEntryDialogOptions(QWidget): row += 1 if self.showlabel: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - self.labelcheckbox = QRadioButton(i18n("by label"),hbox) + self.labelcheckbox = TQRadioButton(i18n("by label"),hbox) self.connect(self.labelcheckbox,SIGNAL("clicked()"), \ self.slotLabelCheckboxClicked) self.labellineedit = KLineEdit(hbox) @@ -1432,48 +1444,48 @@ class MountEntryDialogOptions(QWidget): row += 1 else: if self.showdevice: - label = QLabel(i18n("Device:"),self) + label = TQLabel(i18n("Device:"),self) grid.addWidget(label,row,0) self.devicelineedit = KLineEdit(self) grid.addMultiCellWidget(self.devicelineedit,row,row,1,3) row += 1 - example = QLabel(self.deviceexample,self) + example = TQLabel(self.deviceexample,self) grid.addWidget(example,row,1) if self.showuuid: - label = QLabel(i18n("Device UUID:"),self) + label = TQLabel(i18n("Device UUID:"),self) grid.addWidget(label,row,0) self.uuidlineedit = KLineEdit(self) grid.addMultiCellWidget(self.uuidlineedit,row,row,1,3) row += 1 if self.showlabel: - label = QLabel(i18n("Device Label:"),self) + label = TQLabel(i18n("Device Label:"),self) grid.addWidget(label,row,0) self.labellineedit = KLineEdit(self) grid.addMultiCellWidget(self.labellineedit,row,row,1,3) row += 1 - label = QLabel(i18n("Options:"),self) + label = TQLabel(i18n("Options:"),self) grid.addWidget(label,row,0) self.optionslineedit = KLineEdit(self) grid.addMultiCellWidget(self.optionslineedit,row,row,1,3) row += 1 if self.showfs_freq: - label = QLabel(i18n("fs_freq:"),self) + label = TQLabel(i18n("fs_freq:"),self) grid.addWidget(label,row,0) self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,self) grid.addWidget(self.fsfreqspinbox,row,1) if self.showfs_passno: - label = QLabel(i18n("fs_passno:"),self) + label = TQLabel(i18n("fs_passno:"),self) grid.addWidget(label,row,2) self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,self) grid.addWidget(self.fspassnospinbox,row,3) row += 1 - grid.addWidget(QWidget(self),row,0) + grid.addWidget(TQWidget(self),row,0) for x in range(grid.numRows()): grid.setRowStretch(x,0) @@ -1583,7 +1595,7 @@ class MountEntryDialogOptions(QWidget): fileurl = KURL() fileurl.setPath(self.mountpointlineedit.text()) self.mountpointdialog.setCurrentURL(fileurl) - if self.mountpointdialog.exec_loop()==QDialog.Accepted: + if self.mountpointdialog.exec_loop()==TQDialog.Accepted: self.mountpointlineedit.setText(self.mountpointdialog.url().path()) ######################################################################## @@ -1627,18 +1639,18 @@ class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): def _fillPage(self): row = 0 - grid = QGridLayout(self,1,2) + grid = TQGridLayout(self,1,2) grid.setSpacing(KDialog.spacingHint()) grid.setColStretch(0,0) grid.setRowStretch(6,1) - label = QLabel(i18n("Mount Point:"),self) + label = TQLabel(i18n("Mount Point:"),self) grid.addWidget(label,row,0) - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) self.mountpointlineedit = KLineEdit(hbox) hbox.setStretchFactor(self.mountpointlineedit,1) - #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged) + #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged) self.mountpointbutton = KPushButton(i18n("Browse..."),hbox) hbox.setStretchFactor(self.mountpointbutton,0) self.connect(self.mountpointbutton,SIGNAL("clicked()"), \ @@ -1648,26 +1660,26 @@ class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): if self.showuuid or self.showlabel: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - label = QLabel(i18n("Device:"),self) + label = TQLabel(i18n("Device:"),self) grid.addWidget(label,row,0) - self.devicecheckbox = QRadioButton(i18n("by name"),hbox) + self.devicecheckbox = TQRadioButton(i18n("by name"),hbox) self.connect(self.devicecheckbox,SIGNAL("clicked()"), \ self.slotDeviceCheckboxClicked) self.devicelineedit = KLineEdit(hbox) grid.addWidget(hbox,row,1) row += 1 - example = QLabel(self.deviceexample,self) + example = TQLabel(self.deviceexample,self) grid.addWidget(example,row,1) row += 1 if self.showuuid: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - self.uuidcheckbox = QRadioButton(i18n("by UUID"),hbox) + self.uuidcheckbox = TQRadioButton(i18n("by UUID"),hbox) self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \ self.slotUUIDCheckboxClicked) self.uuidlineedit = KLineEdit(hbox) @@ -1675,9 +1687,9 @@ class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): row += 1 if self.showlabel: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - self.labelcheckbox = QRadioButton(i18n("by label"),hbox) + self.labelcheckbox = TQRadioButton(i18n("by label"),hbox) self.connect(self.labelcheckbox,SIGNAL("clicked()"), \ self.slotLabelCheckboxClicked) self.labellineedit = KLineEdit(hbox) @@ -1685,24 +1697,24 @@ class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): row += 1 else: - label = QLabel(i18n("Device:"),self) + label = TQLabel(i18n("Device:"),self) grid.addWidget(label,row,0) self.devicelineedit = KLineEdit(self) grid.addWidget(self.devicelineedit,row,1) row += 1 - example = QLabel(self.deviceexample,self) + example = TQLabel(self.deviceexample,self) grid.addWidget(example,row,1) row += 1 - self.autocheckbox = QCheckBox(i18n("Enable at start up"),self) + self.autocheckbox = TQCheckBox(i18n("Enable at start up"),self) grid.addWidget(self.autocheckbox,row,1) row += 1 - self.writeablecheckbox = QCheckBox(i18n("Writeable"),self) + self.writeablecheckbox = TQCheckBox(i18n("Writeable"),self) grid.addWidget(self.writeablecheckbox,row,1) row += 1 - label = QLabel(i18n("Mount Permission:"),self) + label = TQLabel(i18n("Mount Permission:"),self) grid.addWidget(label,row,0) self.usermountcombobox = KComboBox(self) self.usermountcombobox.insertItem(i18n("Root user only may enable/disable")) @@ -1714,12 +1726,12 @@ class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): #grid.addWidget(,9,0) button = KPushButton(i18n("Advanced..."),self) - button.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed) + button.setSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed) self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked) - grid.addWidget(button,row,1,Qt.AlignRight) + grid.addWidget(button,row,1,TQt.AlignRight) row += 1 - grid.addWidget(QWidget(self),row,0) + grid.addWidget(TQWidget(self),row,0) for x in range(grid.numRows()): grid.setRowStretch(x,0) @@ -1880,19 +1892,19 @@ class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): global allowuuid, allowlabel row = 0 - grid = QGridLayout(self,11,2) + grid = TQGridLayout(self,11,2) grid.setSpacing(KDialog.spacingHint()) grid.setColStretch(0,0) grid.setColStretch(2,0) grid.setRowStretch(10,1) - label = QLabel(i18n("Mount Point:"),self) + label = TQLabel(i18n("Mount Point:"),self) grid.addWidget(label,row,0) - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) self.mountpointlineedit = KLineEdit(hbox) hbox.setStretchFactor(self.mountpointlineedit,1) - #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged) + #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged) self.mountpointbutton = KPushButton(i18n("Browse..."),hbox) hbox.setStretchFactor(self.mountpointbutton,0) self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked) @@ -1900,26 +1912,26 @@ class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): row += 1 if allowuuid or allowlabel: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - label = QLabel(i18n("Device:"),self) + label = TQLabel(i18n("Device:"),self) grid.addWidget(label,row,0) - self.devicecheckbox = QRadioButton(i18n("by name"),hbox) + self.devicecheckbox = TQRadioButton(i18n("by name"),hbox) self.connect(self.devicecheckbox,SIGNAL("clicked()"), \ self.slotDeviceCheckboxClicked) self.devicelineedit = KLineEdit(hbox) grid.addWidget(hbox,row,1) row += 1 - example = QLabel(self.deviceexample,self) + example = TQLabel(self.deviceexample,self) grid.addWidget(example,row,1) row += 1 if allowuuid and self.showuuid: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - self.uuidcheckbox = QRadioButton(i18n("by UUID"),hbox) + self.uuidcheckbox = TQRadioButton(i18n("by UUID"),hbox) self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \ self.slotUUIDCheckboxClicked) self.uuidlineedit = KLineEdit(hbox) @@ -1927,9 +1939,9 @@ class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): row += 1 if allowlabel and self.showlabel: - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - self.labelcheckbox = QRadioButton(i18n("by label"),hbox) + self.labelcheckbox = TQRadioButton(i18n("by label"),hbox) self.connect(self.labelcheckbox,SIGNAL("clicked()"), \ self.slotLabelCheckboxClicked) self.labellineedit = KLineEdit(hbox) @@ -1938,27 +1950,27 @@ class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): else: - label = QLabel(i18n("Device:"),self) + label = TQLabel(i18n("Device:"),self) grid.addWidget(label,row,0) self.devicelineedit = KLineEdit(self) grid.addMultiCellWidget(self.devicelineedit,row,row,1,3) row += 1 - example = QLabel(self.deviceexample,self) + example = TQLabel(self.deviceexample,self) grid.addWidget(example,row,1) row += 1 - self.autocheckbox = QCheckBox(i18n("Enable at start up"),self) + self.autocheckbox = TQCheckBox(i18n("Enable at start up"),self) grid.addMultiCellWidget(self.autocheckbox,row,row,1,3) row += 1 # Security & Safety line. - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - tmplabel = QLabel(hbox) + tmplabel = TQLabel(hbox) tmplabel.setPixmap(UserIcon("hi16-lock")) hbox.setStretchFactor(tmplabel,0) - tmplabel = QLabel(hbox) + tmplabel = TQLabel(hbox) tmplabel.setText(i18n("Security & Safety")) hbox.setStretchFactor(tmplabel,0) sep = KSeparator(KSeparator.Horizontal,hbox) @@ -1966,23 +1978,23 @@ class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): grid.addMultiCellWidget(hbox,row,row,0,3) row += 1 - self.writeablecheckbox = QCheckBox(i18n("Writeable"),self) + self.writeablecheckbox = TQCheckBox(i18n("Writeable"),self) grid.addMultiCellWidget(self.writeablecheckbox,row,row,1,3) row += 1 - label = QLabel(i18n("Files belong to user:"),self) + label = TQLabel(i18n("Files belong to user:"),self) grid.addWidget(label,row,0) self.uidcombobox = UserComboBox(self) grid.addMultiCellWidget(self.uidcombobox,row,row,1,3) row += 1 - label = QLabel(i18n("Files belong to group:"),self) + label = TQLabel(i18n("Files belong to group:"),self) grid.addWidget(label,row,0) self.gidcombobox = GroupComboBox(self) grid.addMultiCellWidget(self.gidcombobox,row,row,1,3) row += 1 - label = QLabel(i18n("Mount Permission:"),self) + label = TQLabel(i18n("Mount Permission:"),self) grid.addWidget(label,row,0) self.usermountcombobox = KComboBox(self) self.usermountcombobox.insertItem(i18n("Root user only may enable/disable")) @@ -1992,15 +2004,15 @@ class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): grid.addMultiCellWidget(self.usermountcombobox,row,row,1,3) row += 1 - self.suppresspermissionerrorcheckbox = QCheckBox(i18n("Suppress permission errors"),self) + self.suppresspermissionerrorcheckbox = TQCheckBox(i18n("Suppress permission errors"),self) grid.addMultiCellWidget(self.suppresspermissionerrorcheckbox,row,row,1,3) row += 1 row += 1 button = KPushButton(i18n("Advanced..."),self) - button.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed) + button.setSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed) self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked) - grid.addMultiCellWidget(button,row,row,1,3,Qt.AlignRight) + grid.addMultiCellWidget(button,row,row,1,3,TQt.AlignRight) ######################################################################## def displayMountEntry(self,entry): @@ -2135,27 +2147,27 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): ######################################################################## def _fillPage(self): - grid = QGridLayout(self,14,4) + grid = TQGridLayout(self,14,4) grid.setSpacing(KDialog.spacingHint()) grid.setColStretch(0,0) grid.setColStretch(2,0) grid.setRowStretch(12,1) - label = QLabel(i18n("Mount Point:"),self) + label = TQLabel(i18n("Mount Point:"),self) grid.addWidget(label,0,0) - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) self.mountpointlineedit = KLineEdit(hbox) hbox.setStretchFactor(self.mountpointlineedit,1) - #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged) + #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged) self.mountpointbutton = KPushButton(i18n("Browse..."),hbox) hbox.setStretchFactor(self.mountpointbutton,0) self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked) grid.addMultiCellWidget(hbox,0,0,1,3) - label = QLabel(i18n("Network Share:"),self) + label = TQLabel(i18n("Network Share:"),self) grid.addWidget(label,1,0) - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) self.devicelineedit = KLineEdit(hbox) hbox.setStretchFactor(self.devicelineedit,1) @@ -2165,21 +2177,21 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): grid.addMultiCellWidget(hbox,1,1,1,3) # Connect as: - connectaslabel = QLabel(self) + connectaslabel = TQLabel(self) connectaslabel.setText(i18n("Connect as:")) grid.addWidget(connectaslabel,2,0) - self.guestradio = QRadioButton(self) + self.guestradio = TQRadioButton(self) self.guestradio.setChecked(True) grid.addWidget(self.guestradio,2,1) - tmplabel = QLabel(self) + tmplabel = TQLabel(self) tmplabel.setText(i18n("Guest")) grid.addMultiCellWidget(tmplabel,2,2,2,3) self.connect(self.guestradio,SIGNAL("stateChanged(int)"),self.slotGuestRadioClicked) - self.userradio = QRadioButton(self) + self.userradio = TQRadioButton(self) grid.addWidget(self.userradio,3,1) - tmplabel = QLabel(self) + tmplabel = TQLabel(self) tmplabel.setText(i18n("Username:")) grid.addWidget(tmplabel,3,2) self.connect(self.userradio,SIGNAL("stateChanged(int)"),self.slotUserRadioClicked) @@ -2187,43 +2199,43 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): self.usernameedit = KLineEdit(self) grid.addWidget(self.usernameedit,3,3) - tmplabel = QLabel(self) + tmplabel = TQLabel(self) tmplabel.setText(i18n("Password:")) grid.addWidget(tmplabel,4,2) self.passwordedit = KLineEdit(self) grid.addWidget(self.passwordedit,4,3) - self.autocheckbox = QCheckBox(i18n("Enable at start up"),self) + self.autocheckbox = TQCheckBox(i18n("Enable at start up"),self) grid.addMultiCellWidget(self.autocheckbox,5,5,1,3) # Security & Safety line. - hbox = QHBox(self) + hbox = TQHBox(self) hbox.setSpacing(KDialog.spacingHint()) - tmplabel = QLabel(hbox) + tmplabel = TQLabel(hbox) tmplabel.setPixmap(UserIcon("hi16-lock")) hbox.setStretchFactor(tmplabel,0) - tmplabel = QLabel(hbox) + tmplabel = TQLabel(hbox) tmplabel.setText(i18n("Security & Safety")) hbox.setStretchFactor(tmplabel,0) sep = KSeparator(KSeparator.Horizontal,hbox) hbox.setStretchFactor(sep,1) grid.addMultiCellWidget(hbox,6,6,0,3) - self.writeablecheckbox = QCheckBox(i18n("Writeable"),self) + self.writeablecheckbox = TQCheckBox(i18n("Writeable"),self) grid.addMultiCellWidget(self.writeablecheckbox,7,7,1,3) - label = QLabel(i18n("Files belong to user:"),self) + label = TQLabel(i18n("Files belong to user:"),self) grid.addWidget(label,8,0) self.uidcombobox = UserComboBox(self) grid.addMultiCellWidget(self.uidcombobox,8,8,1,3) - label = QLabel(i18n("Files belong to group:"),self) + label = TQLabel(i18n("Files belong to group:"),self) grid.addWidget(label,9,0) self.gidcombobox = GroupComboBox(self) grid.addMultiCellWidget(self.gidcombobox,9,9,1,3) - label = QLabel(i18n("Mount Permission:"),self) + label = TQLabel(i18n("Mount Permission:"),self) grid.addWidget(label,10,0) self.usermountcombobox = KComboBox(self) self.usermountcombobox.insertItem(i18n("Root user only may enable/disable")) @@ -2233,9 +2245,9 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): grid.addMultiCellWidget(self.usermountcombobox,10,10,1,3) button = KPushButton(i18n("Advanced..."),self) - button.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed) + button.setSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed) self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked) - grid.addMultiCellWidget(button,13,13,1,3,Qt.AlignRight) + grid.addMultiCellWidget(button,13,13,1,3,TQt.AlignRight) self.selectsmbdialog = None @@ -2260,8 +2272,8 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): newurlobj = self.selectsmbdialog.choose(urlobj) # This just converts smb:/zootv/data to \\zootv\data. plainurl = KURL(newurlobj) - plainurl.setUser(QString.null) - plainurl.setPass(QString.null) + plainurl.setUser(TQString.null) + plainurl.setPass(TQString.null) parts = [x.replace('\\',"/") for x in unicode(plainurl.url())[4:].split("/") if x !=""] #convert the first part to an IP address nmboutput = subprocess.Popen(["nmblookup",parts[0]], stdout=subprocess.PIPE).stdout @@ -2346,7 +2358,7 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): return self.updatinggui = True - if state==QButton.Off: + if state==TQButton.Off: self.guestradio.setChecked(True) self.userradio.setChecked(False) @@ -2360,7 +2372,7 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): if self.updatinggui: return self.updatinggui = True - if state==QButton.Off: + if state==TQButton.Off: self.userradio.setChecked(True) self.guestradio.setChecked(False) @@ -2370,20 +2382,20 @@ class MountEntryDialogOptionsSMB(MountEntryDialogOptions): self.updatinggui = False ############################################################################ -class ROListBoxItem(QListBoxPixmap): +class ROListBoxItem(TQListBoxPixmap): """A read-only ListBox item that also uses the 'alternate' background colour as background. """ def __init__(self,listbox,pix,text): - QListBoxPixmap.__init__(self,listbox,pix,text) + TQListBoxPixmap.__init__(self,listbox,pix,text) self.setSelectable(False) def paint(self,p): - boldfont = QFont(p.font()) - boldfont.setWeight(QFont.Bold) + boldfont = TQFont(p.font()) + boldfont.setWeight(TQFont.Bold) p.setFont(boldfont) p.setBackgroundColor(TDEGlobalSettings.alternateBackgroundColor()) p.eraseRect(0,0,self.listBox().width(),self.height(self.listBox())) - QListBoxPixmap.paint(self,p) + TQListBoxPixmap.paint(self,p) ############################################################################ class MountEntryDialog(KDialogBase): @@ -2440,15 +2452,15 @@ class MountEntryDialog(KDialogBase): self.comboIndexToMountType = [] self.currentOptionWidget = None - self.topvbox = QVBox(self) + self.topvbox = TQVBox(self) self.setMainWidget(self.topvbox) self.topvbox.setSpacing(self.spacingHint()) - hb = QHBox(self.topvbox) + hb = TQHBox(self.topvbox) hb.setSpacing(self.spacingHint()) self.topvbox.setStretchFactor(hb,0) - label = QLabel(i18n("Type:"),hb) + label = TQLabel(i18n("Type:"),hb) hb.setStretchFactor(label,0) self.mounttypecombo = KComboBox(hb) @@ -2486,25 +2498,25 @@ class MountEntryDialog(KDialogBase): #hb.setStretchFactor(self.runlevelcombo,0) self.connect(self.mounttypecombo, SIGNAL("activated(int)"), self.slotMountTypeChanged) - widget = QWidget(hb) + widget = TQWidget(hb) hb.setStretchFactor(widget,1) # Create the stack of option edit widgets. - gb = QVGroupBox(self.topvbox) + gb = TQVGroupBox(self.topvbox) self.topvbox.setStretchFactor(gb,1) - self.optionsstack = QWidgetStack(gb) + self.optionsstack = TQWidgetStack(gb) for mounttype in self.MountTypeEditors: editpage = self.MountTypeEditors[mounttype](self.optionsstack) self.mountTypeToOptionWidget[mounttype] = editpage self.optionsstack.addWidget(editpage) - self.fsunavailablelabel = QHBox(gb) + self.fsunavailablelabel = TQHBox(gb) self.fsunavailablelabel.setSpacing(KDialog.spacingHint()) - tmplabel = QLabel(self.fsunavailablelabel) + tmplabel = TQLabel(self.fsunavailablelabel) self.fsunavailablelabel.setStretchFactor(tmplabel,0) tmplabel.setPixmap(SmallIcon('info')) - label = QLabel(i18n("This filesystem type is currently unavailable on the running kernel."), + label = TQLabel(i18n("This filesystem type is currently unavailable on the running kernel."), self.fsunavailablelabel) self.fsunavailablelabel.setStretchFactor(label,1) self.fsunavailablelabel.hide() @@ -2521,7 +2533,7 @@ class MountEntryDialog(KDialogBase): self.updatingGUI = True self.selectEntry(self.currentMountEntry.getMountType()) self.updatingGUI = False - if self.exec_loop()==QDialog.Accepted: + if self.exec_loop()==TQDialog.Accepted: # All of the update stuff is in slotOk() return True return False @@ -2537,7 +2549,7 @@ class MountEntryDialog(KDialogBase): self.currentOptionWidget = None self.selectEntry(self.currentMountEntry.mounttype) self.updatingGUI = False - if self.exec_loop()==QDialog.Accepted: + if self.exec_loop()==TQDialog.Accepted: self.mounttable.allentries.append(self.currentMountEntry) self.mounttable.updateFstabOnDisk() return self.currentMountEntry @@ -2657,28 +2669,28 @@ class MountEntryAdvancedCommonUnixDialog(KDialogBase): def __init__(self,parent,name=None): KDialogBase.__init__(self,parent,name,1,"",KDialogBase.Ok|KDialogBase.Cancel) - grid = self.makeGridMainWidget(2,Qt.Horizontal) + grid = self.makeGridMainWidget(2,TQt.Horizontal) grid.setSpacing(self.spacingHint()) - QWidget(grid) - self.accesstimecheckbox = QCheckBox(i18n("Update file access timestamps"),grid) + TQWidget(grid) + self.accesstimecheckbox = TQCheckBox(i18n("Update file access timestamps"),grid) - QWidget(grid) - self.allowexecutablecheckbox = QCheckBox(i18n("Allow Executables"),grid) + TQWidget(grid) + self.allowexecutablecheckbox = TQCheckBox(i18n("Allow Executables"),grid) - QWidget(grid) - self.allowsuidcheckbox = QCheckBox(i18n("Allow the SUID and SGID attributes"),grid) + TQWidget(grid) + self.allowsuidcheckbox = TQCheckBox(i18n("Allow the SUID and SGID attributes"),grid) - QWidget(grid) - self.usedevpointscheckbox = QCheckBox(i18n("Allow device points"),grid) + TQWidget(grid) + self.usedevpointscheckbox = TQCheckBox(i18n("Allow device points"),grid) - label = QLabel(i18n("Options:"),grid) + label = TQLabel(i18n("Options:"),grid) self.optionslineedit = KLineEdit(grid) - label = QLabel(i18n("fs_freq:"),grid) + label = TQLabel(i18n("fs_freq:"),grid) self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,grid) - label = QLabel(i18n("fs_passno:"),grid) + label = TQLabel(i18n("fs_passno:"),grid) self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,grid) ######################################################################## @@ -2706,16 +2718,16 @@ class MountEntryAdvancedPlainDialog(KDialogBase): def __init__(self,parent,name=None): KDialogBase.__init__(self,parent,name,1,"",KDialogBase.Ok|KDialogBase.Cancel) - grid = self.makeGridMainWidget(2,Qt.Horizontal) + grid = self.makeGridMainWidget(2,TQt.Horizontal) grid.setSpacing(self.spacingHint()) - label = QLabel(i18n("Options:"),grid) + label = TQLabel(i18n("Options:"),grid) self.optionslineedit = KLineEdit(grid) - label = QLabel(i18n("fs_freq:"),grid) + label = TQLabel(i18n("fs_freq:"),grid) self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,grid) - label = QLabel(i18n("fs_passno:"),grid) + label = TQLabel(i18n("fs_passno:"),grid) self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,grid) ######################################################################## @@ -2802,7 +2814,7 @@ class MountListViewItem(TDEListViewItem): self.setText(2,"") self.setText(3,self.haldevice.getDev()) self.setText(4,"") - self.setPixmap(4,QPixmap()) + self.setPixmap(4,TQPixmap()) self.__updateIcon() ######################################################################## @@ -2882,21 +2894,21 @@ class MountConfigApp(programbase): self.selectedentry = None self.aboutus = TDEAboutApplication(self) self.sizeviewdialogs = {} - toplayout = QVBoxLayout(topwidget, 0, KDialog.spacingHint()) + toplayout = TQVBoxLayout(topwidget, 0, KDialog.spacingHint()) #topwidget.setEnabled(isroot) - hb = QHBox(topwidget) + hb = TQHBox(topwidget) hb.setSpacing(KDialog.spacingHint()) #if standalone: # hb.setMargin(KDialog.marginHint()) toplayout.addWidget(hb) - label = QLabel(hb) + label = TQLabel(hb) label.setPixmap(UserIcon("kcmpartitions")) hb.setStretchFactor(label,0) - label = QLabel(i18n("Available Disks and Filesystems:"),hb) + label = TQLabel(i18n("Available Disks and Filesystems:"),hb) hb.setStretchFactor(label,1) self.mountlist = TDEListView(topwidget,"Mount list") @@ -2907,17 +2919,17 @@ class MountConfigApp(programbase): self.mountlist.addColumn(i18n("Device")) self.mountlist.addColumn(i18n("Enabled")) self.mountlist.setAllColumnsShowFocus(True) - self.mountlist.setSelectionMode(QListView.Single) + self.mountlist.setSelectionMode(TQListView.Single) self.mountlist.setRootIsDecorated(True) self.mountlist.setSorting(-1) - self.connect(self.mountlist, SIGNAL("selectionChanged(QListViewItem *)"), self.slotListClicked) + self.connect(self.mountlist, SIGNAL("selectionChanged(TQListViewItem *)"), self.slotListClicked) # Doubleclick in item opens modify dialogue. - self.connect(self.mountlist, SIGNAL("doubleClicked(QListViewItem *)"), self.slotModifyClicked) + self.connect(self.mountlist, SIGNAL("doubleClicked(TQListViewItem *)"), self.slotModifyClicked) # Rightclick: Open ContextMenu - self.connect(self.mountlist, SIGNAL("contextMenu(TDEListView*,QListViewItem*,const QPoint&)"), + self.connect(self.mountlist, SIGNAL("contextMenu(TDEListView*,TQListViewItem*,const TQPoint&)"), self.slotContextMenu) - hbox = QHBox(topwidget) + hbox = TQHBox(topwidget) toplayout.addWidget(hbox) hbox.setSpacing(KDialog.spacingHint()) -- cgit v1.2.1