By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 1995
Collapse All | Expand All

(-)a/mountconfig/SMBShareSelectDialog.py (-22 / +22 lines)
Lines 36-53 class SMBShareSelectDialog(KDialogBase): Link Here
36
        
36
        
37
        vbox = self.makeVBoxMainWidget()
37
        vbox = self.makeVBoxMainWidget()
38
38
39
        hbox = QHBox(vbox)
39
        hbox = TTQHBox(vbox)
40
        hbox.setSpacing(self.spacingHint())
40
        hbox.setSpacing(self.spacingHint())
41
        tmplabel = QLabel(hbox)
41
        tmplabel = TQLabel(hbox)
42
        tmplabel.setPixmap(UserIcon("hi32-samba"))
42
        tmplabel.setPixmap(UserIcon("hi32-samba"))
43
        
43
        
44
        hbox.setStretchFactor(tmplabel,0)
44
        hbox.setStretchFactor(tmplabel,0)
45
45
46
        self.headinglabel = QLabel(hbox)
46
        self.headinglabel = TQLabel(hbox)
47
        self.headinglabel.setText(i18n("Select a network share"))
47
        self.headinglabel.setText(i18n("Select a network share"))
48
        hbox.setStretchFactor(self.headinglabel,1)
48
        hbox.setStretchFactor(self.headinglabel,1)
49
49
50
        hbox2 = QHBox(vbox)
50
        hbox2 = TQHBox(vbox)
51
        
51
        
52
        # The main treeview where the action happens.
52
        # The main treeview where the action happens.
53
        self.treeview = TDEListView(hbox2)
53
        self.treeview = TDEListView(hbox2)
Lines 55-63 class SMBShareSelectDialog(KDialogBase): Link Here
55
        self.treeview.header().hide()
55
        self.treeview.header().hide()
56
        self.treeview.setRootIsDecorated(True)
56
        self.treeview.setRootIsDecorated(True)
57
        
57
        
58
        self.connect(self.treeview,SIGNAL("expanded(QListViewItem *)"),self.slotNodeExpanded)
58
        self.connect(self.treeview,SIGNAL("expanded(TQListViewItem *)"),self.slotNodeExpanded)
59
        self.connect(self.treeview,SIGNAL("selectionChanged(QListViewItem *)"),self.slotNodeSelected)
59
        self.connect(self.treeview,SIGNAL("selectionChanged(TQListViewItem *)"),self.slotNodeSelected)
60
        self.connect(self.treeview,SIGNAL("clicked(QListViewItem *)"),self.slotClicked)
60
        self.connect(self.treeview,SIGNAL("clicked(TQListViewItem *)"),self.slotClicked)
61
        self.dirlister = KDirLister()
61
        self.dirlister = KDirLister()
62
        self.dirlister.setDirOnlyMode(True)
62
        self.dirlister.setDirOnlyMode(True)
63
        self.dirlister.setAutoUpdate(False)
63
        self.dirlister.setAutoUpdate(False)
Lines 69-106 class SMBShareSelectDialog(KDialogBase): Link Here
69
        self.enableButtonOK(False)
69
        self.enableButtonOK(False)
70
70
71
        # The "Connect as" part
71
        # The "Connect as" part
72
        widget = QWidget(hbox2)
72
        widget = TQWidget(hbox2)
73
        grid = QGridLayout(widget,6,4,KDialog.spacingHint())
73
        grid = TQGridLayout(widget,6,4,KDialog.spacingHint())
74
        grid.setRowStretch(5,1)
74
        grid.setRowStretch(5,1)
75
75
76
        tmplabel = QLabel(widget)
76
        tmplabel = TQLabel(widget)
77
        tmplabel.setPixmap(UserIcon("hi16-password"))
77
        tmplabel.setPixmap(UserIcon("hi16-password"))
78
        grid.addWidget(tmplabel,0,0)
78
        grid.addWidget(tmplabel,0,0)
79
79
80
        self.connectaslabel = QLabel(widget)
80
        self.connectaslabel = TQLabel(widget)
81
        self.connectaslabel.setText("Connect to 'XXX' as:")
81
        self.connectaslabel.setText("Connect to 'XXX' as:")
82
        grid.addMultiCellWidget(self.connectaslabel,0,0,1,3)
82
        grid.addMultiCellWidget(self.connectaslabel,0,0,1,3)
83
        
83
        
84
        self.guestradio = QRadioButton(widget)
84
        self.guestradio = TQRadioButton(widget)
85
        self.guestradio.setChecked(True)
85
        self.guestradio.setChecked(True)
86
        grid.addWidget(self.guestradio,1,1)
86
        grid.addWidget(self.guestradio,1,1)
87
        tmplabel = QLabel(widget)
87
        tmplabel = TQLabel(widget)
88
        tmplabel.setText(i18n("Guest"))
88
        tmplabel.setText(i18n("Guest"))
89
        grid.addWidget(tmplabel,1,2)
89
        grid.addWidget(tmplabel,1,2)
90
        self.connect(self.guestradio,SIGNAL("stateChanged(int)"),self.slotGuestRadioClicked)
90
        self.connect(self.guestradio,SIGNAL("stateChanged(int)"),self.slotGuestRadioClicked)
91
        
91
        
92
        self.userradio = QRadioButton(widget)
92
        self.userradio = TQRadioButton(widget)
93
        grid.addWidget(self.userradio,2,1)
93
        grid.addWidget(self.userradio,2,1)
94
        tmplabel = QLabel(widget)
94
        tmplabel = TQLabel(widget)
95
        tmplabel.setText(i18n("Username:"))
95
        tmplabel.setText(i18n("Username:"))
96
        grid.addWidget(tmplabel,2,2)
96
        grid.addWidget(tmplabel,2,2)
97
        self.connect(self.userradio,SIGNAL("stateChanged(int)"),self.slotUserRadioClicked)
97
        self.connect(self.userradio,SIGNAL("stateChanged(int)"),self.slotUserRadioClicked)
98
        
98
        
99
        self.usernameedit = KLineEdit(widget)
99
        self.usernameedit = KLineEdit(widget)
100
        grid.addWidget(self.usernameedit,2,3)
100
        grid.addWidget(self.usernameedit,2,3)
101
        self.connect(self.usernameedit,SIGNAL("textChanged(const QString &)"),self.slotUsernameChanged)
101
        self.connect(self.usernameedit,SIGNAL("textChanged(const TQString &)"),self.slotUsernameChanged)
102
        
102
        
103
        tmplabel = QLabel(widget)
103
        tmplabel = TQLabel(widget)
104
        tmplabel.setText(i18n("Password:"))
104
        tmplabel.setText(i18n("Password:"))
105
        grid.addWidget(tmplabel,3,2)
105
        grid.addWidget(tmplabel,3,2)
106
        
106
        
Lines 206-212 class SMBShareSelectDialog(KDialogBase): Link Here
206
        for entry in items:
206
        for entry in items:
207
            newitem = SMBShareListViewItem(self.lookupqueue[0], unicode(entry.name()), KURL(entry.url()), self)
207
            newitem = SMBShareListViewItem(self.lookupqueue[0], unicode(entry.name()), KURL(entry.url()), self)
208
            self.url_to_list_item_map[unicode(entry.url().prettyURL())] = newitem
208
            self.url_to_list_item_map[unicode(entry.url().prettyURL())] = newitem
209
            # Notice how I copied the KURL object and QString (to a python string)
209
            # Notice how I copied the KURL object and TQString (to a python string)
210
        
210
        
211
    ########################################################################
211
    ########################################################################
212
    def slotDirListCompleted(self):
212
    def slotDirListCompleted(self):
Lines 263-272 class SMBShareSelectDialog(KDialogBase): Link Here
263
        
263
        
264
        # Set the username/password for the machine item.
264
        # Set the username/password for the machine item.
265
        if self.guestradio.isChecked():
265
        if self.guestradio.isChecked():
266
            machineitem.getURL().setUser(QString.null)
266
            machineitem.getURL().setUser(TQString.null)
267
            machineitem.getURL().setPass(QString.null)
267
            machineitem.getURL().setPass(TQString.null)
268
            selectedurl.setUser(QString.null)
268
            selectedurl.setUser(TQString.null)
269
            selectedurl.setPass(QString.null)
269
            selectedurl.setPass(TQString.null)
270
        else:
270
        else:
271
            machineitem.getURL().setUser(self.usernameedit.text())
271
            machineitem.getURL().setUser(self.usernameedit.text())
272
            machineitem.getURL().setPass(self.passwordedit.text())
272
            machineitem.getURL().setPass(self.passwordedit.text())
(-)a/mountconfig/SimpleCommandRunner.py (-2 / +2 lines)
Lines 21-30 debug = False Link Here
21
#debug = True
21
#debug = True
22
22
23
23
24
class SimpleCommandRunner(QObject):
24
class SimpleCommandRunner(TQObject):
25
    ########################################################################
25
    ########################################################################
26
    def __init__(self):
26
    def __init__(self):
27
        QObject.__init__(self)
27
        TQObject.__init__(self)
28
28
29
    ########################################################################
29
    ########################################################################
30
    def run(self,cmdlist,STDOUT_only=False):
30
    def run(self,cmdlist,STDOUT_only=False):
(-)a/mountconfig/fuser.py (-5 / +5 lines)
Lines 30-36 from SimpleCommandRunner import * Link Here
30
30
31
standalone = __name__ == "__main__"
31
standalone = __name__ == "__main__"
32
32
33
class FileProcess(QListViewItem):
33
class FileProcess(TQListViewItem):
34
    """ A FileProcess is simply one line from lsof, one filedescriptor that's in use 
34
    """ A FileProcess is simply one line from lsof, one filedescriptor that's in use 
35
        by a process represented as a listviewitem in the lsof processtable. """
35
        by a process represented as a listviewitem in the lsof processtable. """
36
36
Lines 47-53 class FileProcess(QListViewItem): Link Here
47
        "pfile":3 }
47
        "pfile":3 }
48
48
49
    def __init__(self,parent,pid,isparent=False):
49
    def __init__(self,parent,pid,isparent=False):
50
        QListViewItem.__init__(self,parent)
50
        TQListViewItem.__init__(self,parent)
51
        self.setPid(pid)
51
        self.setPid(pid)
52
        self.isparent = isparent
52
        self.isparent = isparent
53
        self.pfile = ""
53
        self.pfile = ""
Lines 146-153 class FUser(FUserUI): Link Here
146
        self.warningimage.setPixmap(MainBarIcon("messagebox_warning"))
146
        self.warningimage.setPixmap(MainBarIcon("messagebox_warning"))
147
147
148
        # Delayed initialisation.
148
        # Delayed initialisation.
149
        QTimer.singleShot(0,self.isMounted)
149
        TQTimer.singleShot(0,self.isMounted)
150
        QTimer.singleShot(0,self.refreshProcesslist)
150
        TQTimer.singleShot(0,self.refreshProcesslist)
151
151
152
    def setApp(self,app):
152
    def setApp(self,app):
153
        """ We need a reference to the (K|Q)Application for certain things, e.g. setting 
153
        """ We need a reference to the (K|Q)Application for certain things, e.g. setting 
Lines 172-178 class FUser(FUserUI): Link Here
172
        """ Read lsof output and add the processdescriptors to the listview. """
172
        """ Read lsof output and add the processdescriptors to the listview. """
173
        kapp = self.app
173
        kapp = self.app
174
174
175
        kapp.setOverrideCursor(QCursor(Qt.BusyCursor))
175
        kapp.setOverrideCursorT(TQCursor(TQt.BusyCursor))
176
176
177
        self.processlist.clear()
177
        self.processlist.clear()
178
        rc, output = SimpleCommandRunner().run([self.lsof_bin,'-FpcLn',self.device],True)
178
        rc, output = SimpleCommandRunner().run([self.lsof_bin,'-FpcLn',self.device],True)
(-)a/mountconfig/fuser_ui.ui (-9 / +9 lines)
Lines 3-9 Link Here
3
<comment>Python:from tdeui import *
3
<comment>Python:from tdeui import *
4
Python:from tdecore import *</comment>
4
Python:from tdecore import *</comment>
5
<author>Sebastian Kuegler</author>
5
<author>Sebastian Kuegler</author>
6
<widget class="QDialog">
6
<widget class="TQDialog">
7
    <property name="name">
7
    <property name="name">
8
        <cstring>Process</cstring>
8
        <cstring>Process</cstring>
9
    </property>
9
    </property>
Lines 42-48 Python:from tdecore import *</comment> Link Here
42
        <property name="name">
42
        <property name="name">
43
            <cstring>unnamed</cstring>
43
            <cstring>unnamed</cstring>
44
        </property>
44
        </property>
45
        <widget class="QLayoutWidget">
45
        <widget class="TQLayoutWidget">
46
            <property name="name">
46
            <property name="name">
47
                <cstring>layout10</cstring>
47
                <cstring>layout10</cstring>
48
            </property>
48
            </property>
Lines 50-56 Python:from tdecore import *</comment> Link Here
50
                <property name="name">
50
                <property name="name">
51
                    <cstring>unnamed</cstring>
51
                    <cstring>unnamed</cstring>
52
                </property>
52
                </property>
53
                <widget class="QLabel">
53
                <widget class="TQLabel">
54
                    <property name="name">
54
                    <property name="name">
55
                        <cstring>warningimage</cstring>
55
                        <cstring>warningimage</cstring>
56
                    </property>
56
                    </property>
Lines 69-75 Python:from tdecore import *</comment> Link Here
69
                        <bool>false</bool>
69
                        <bool>false</bool>
70
                    </property>
70
                    </property>
71
                </widget>
71
                </widget>
72
                <widget class="QLabel">
72
                <widget class="TQLabel">
73
                    <property name="name">
73
                    <property name="name">
74
                        <cstring>explanationlabel</cstring>
74
                        <cstring>explanationlabel</cstring>
75
                    </property>
75
                    </property>
Lines 99-105 Killing a process may cause data loss. Make sure all work is saved before killin Link Here
99
                </widget>
99
                </widget>
100
            </hbox>
100
            </hbox>
101
        </widget>
101
        </widget>
102
        <widget class="QFrame">
102
        <widget class="TQFrame">
103
            <property name="name">
103
            <property name="name">
104
                <cstring>processframe</cstring>
104
                <cstring>processframe</cstring>
105
            </property>
105
            </property>
Lines 127-133 Killing a process may cause data loss. Make sure all work is saved before killin Link Here
127
                <property name="spacing">
127
                <property name="spacing">
128
                    <number>4</number>
128
                    <number>4</number>
129
                </property>
129
                </property>
130
                <widget class="QLayoutWidget" row="0" column="0">
130
                <widget class="TQLayoutWidget" row="0" column="0">
131
                    <property name="name">
131
                    <property name="name">
132
                        <cstring>layout7</cstring>
132
                        <cstring>layout7</cstring>
133
                    </property>
133
                    </property>
Lines 135-141 Killing a process may cause data loss. Make sure all work is saved before killin Link Here
135
                        <property name="name">
135
                        <property name="name">
136
                            <cstring>unnamed</cstring>
136
                            <cstring>unnamed</cstring>
137
                        </property>
137
                        </property>
138
                        <widget class="QListView">
138
                        <widget class="TQListView">
139
                            <column>
139
                            <column>
140
                                <property name="text">
140
                                <property name="text">
141
                                    <string>Process</string>
141
                                    <string>Process</string>
Lines 207-213 Killing a process may cause data loss. Make sure all work is saved before killin Link Here
207
                                <enum>LastColumn</enum>
207
                                <enum>LastColumn</enum>
208
                            </property>
208
                            </property>
209
                        </widget>
209
                        </widget>
210
                        <widget class="QLayoutWidget">
210
                        <widget class="TQLayoutWidget">
211
                            <property name="name">
211
                            <property name="name">
212
                                <cstring>layout11</cstring>
212
                                <cstring>layout11</cstring>
213
                            </property>
213
                            </property>
Lines 262-268 Killing a process may cause data loss. Make sure all work is saved before killin Link Here
262
                </widget>
262
                </widget>
263
            </grid>
263
            </grid>
264
        </widget>
264
        </widget>
265
        <widget class="QLayoutWidget">
265
        <widget class="TQLayoutWidget">
266
            <property name="name">
266
            <property name="name">
267
                <cstring>layout12</cstring>
267
                <cstring>layout12</cstring>
268
            </property>
268
            </property>
(-)a/mountconfig/mountconfig.py (-140 / +152 lines)
Lines 16-29 Link Here
16
#                                                                         #
16
#                                                                         #
17
###########################################################################
17
###########################################################################
18
18
19
import sys
20
import os
21
import os.path
22
# Trinity-specific paths
23
tqt_modules = []
24
for m_path in sys.path:
25
    if os.path.exists(os.path.join(m_path, 'sip4_tqt')):
26
        m_sip_dir = os.path.join(m_path, 'sip4_tqt')
27
        tqt_modules.insert(0, m_sip_dir)
28
    if os.path.exists(os.path.join(m_path, 'python_tqt')):
29
        m_pyqt_dir = os.path.join(m_path, 'python_tqt')
30
        tqt_modules.insert(0, m_pyqt_dir)
31
for m_path in tqt_modules:
32
    sys.path.insert(0, m_path)
33
19
from qt import *
34
from qt import *
20
from tdeui import *
35
from tdeui import *
21
from tdecore import *
36
from tdecore import *
22
from tdefile import *
37
from tdefile import *
23
from tdeio import *
38
from tdeio import *
24
import sys
25
import os
26
import os.path
27
from types import StringType,UnicodeType
39
from types import StringType,UnicodeType
28
import pwd
40
import pwd
29
import grp
41
import grp
Lines 456-462 class MountEntryExt(object): Link Here
456
    def _setBusy(self,parentdialog,flag):
468
    def _setBusy(self,parentdialog,flag):
457
        global kapp
469
        global kapp
458
        if flag:
470
        if flag:
459
            kapp.setOverrideCursor( QCursor(Qt.WaitCursor) )
471
            kapp.setOverrideCursor( TQCursor(TQt.WaitCursor) )
460
            parentdialog.setEnabled(False)
472
            parentdialog.setEnabled(False)
461
473
462
            # It is necessary to process some of the events in the event queue.
474
            # It is necessary to process some of the events in the event queue.
Lines 1352-1365 class MountTable(object): Link Here
1352
        raise NotImplementedError, "No __setitem__ on MountTable."
1364
        raise NotImplementedError, "No __setitem__ on MountTable."
1353
1365
1354
############################################################################
1366
############################################################################
1355
class MountEntryDialogOptions(QWidget):
1367
class MountEntryDialogOptions(TQWidget):
1356
1368
1357
    deviceexample = i18n("(for example /dev/hdb3)")
1369
    deviceexample = i18n("(for example /dev/hdb3)")
1358
1370
1359
    ########################################################################
1371
    ########################################################################
1360
    def __init__(self,parent,showmountpoint=True,showdevice=True,
1372
    def __init__(self,parent,showmountpoint=True,showdevice=True,
1361
                    showfs_freq=True,showfs_passno=True,showuuid=True,showlabel=True):
1373
                    showfs_freq=True,showfs_passno=True,showuuid=True,showlabel=True):
1362
        QWidget.__init__(self,parent)
1374
        TQWidget.__init__(self,parent)
1363
        self.showmountpoint = showmountpoint
1375
        self.showmountpoint = showmountpoint
1364
        self.showdevice = showdevice
1376
        self.showdevice = showdevice
1365
        self.showfs_freq = showfs_freq
1377
        self.showfs_freq = showfs_freq
Lines 1373-1393 class MountEntryDialogOptions(QWidget): Link Here
1373
    ########################################################################
1385
    ########################################################################
1374
    def _fillPage(self):
1386
    def _fillPage(self):
1375
        row = 0
1387
        row = 0
1376
        grid = QGridLayout(self,1,2)
1388
        grid = TQGridLayout(self,1,2)
1377
        grid.setSpacing(KDialog.spacingHint())
1389
        grid.setSpacing(KDialog.spacingHint())
1378
        grid.setColStretch(0,0)
1390
        grid.setColStretch(0,0)
1379
        grid.setColStretch(2,0)
1391
        grid.setColStretch(2,0)
1380
1392
1381
        if self.showmountpoint:
1393
        if self.showmountpoint:
1382
1394
1383
            label = QLabel(i18n("Mount Point:"),self)
1395
            label = TQLabel(i18n("Mount Point:"),self)
1384
            grid.addWidget(label,row,0)
1396
            grid.addWidget(label,row,0)
1385
1397
1386
            hbox = QHBox(self)
1398
            hbox = TQHBox(self)
1387
            hbox.setSpacing(KDialog.spacingHint())
1399
            hbox.setSpacing(KDialog.spacingHint())
1388
            self.mountpointlineedit = KLineEdit(hbox)
1400
            self.mountpointlineedit = KLineEdit(hbox)
1389
            hbox.setStretchFactor(self.mountpointlineedit,1)
1401
            hbox.setStretchFactor(self.mountpointlineedit,1)
1390
            #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged)
1402
            #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged)
1391
            self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
1403
            self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
1392
            hbox.setStretchFactor(self.mountpointbutton,0)
1404
            hbox.setStretchFactor(self.mountpointbutton,0)
1393
            self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked)
1405
            self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked)
Lines 1395-1420 class MountEntryDialogOptions(QWidget): Link Here
1395
            row += 1
1407
            row += 1
1396
1408
1397
        if self.showdevice:
1409
        if self.showdevice:
1398
            hbox = QHBox(self)
1410
            hbox = TQHBox(self)
1399
            hbox.setSpacing(KDialog.spacingHint())
1411
            hbox.setSpacing(KDialog.spacingHint())
1400
1412
1401
            label = QLabel(i18n("Device:"),self)
1413
            label = TQLabel(i18n("Device:"),self)
1402
            grid.addWidget(label,row,0)
1414
            grid.addWidget(label,row,0)
1403
1415
1404
            self.devicecheckbox = QRadioButton(i18n("by name"),hbox)
1416
            self.devicecheckbox = TQRadioButton(i18n("by name"),hbox)
1405
            self.connect(self.devicecheckbox,SIGNAL("clicked()"), \
1417
            self.connect(self.devicecheckbox,SIGNAL("clicked()"), \
1406
                self.slotDeviceCheckboxClicked)
1418
                self.slotDeviceCheckboxClicked)
1407
            self.devicelineedit = KLineEdit(hbox)
1419
            self.devicelineedit = KLineEdit(hbox)
1408
            grid.addMultiCellWidget(hbox,row,row,1,3)
1420
            grid.addMultiCellWidget(hbox,row,row,1,3)
1409
            row += 1
1421
            row += 1
1410
            example = QLabel(self.deviceexample,self)
1422
            example = TQLabel(self.deviceexample,self)
1411
            grid.addMultiCellWidget(example,row,row,1,3)
1423
            grid.addMultiCellWidget(example,row,row,1,3)
1412
            row += 1
1424
            row += 1
1413
1425
1414
        if self.showuuid:
1426
        if self.showuuid:
1415
            hbox = QHBox(self)
1427
            hbox = TQHBox(self)
1416
            hbox.setSpacing(KDialog.spacingHint())
1428
            hbox.setSpacing(KDialog.spacingHint())
1417
            self.uuidcheckbox = QRadioButton(i18n("by UUID"),hbox)
1429
            self.uuidcheckbox = TQRadioButton(i18n("by UUID"),hbox)
1418
            self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \
1430
            self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \
1419
                self.slotUUIDCheckboxClicked)
1431
                self.slotUUIDCheckboxClicked)
1420
            self.uuidlineedit = KLineEdit(hbox)
1432
            self.uuidlineedit = KLineEdit(hbox)
Lines 1422-1430 class MountEntryDialogOptions(QWidget): Link Here
1422
            row += 1
1434
            row += 1
1423
1435
1424
        if self.showlabel:
1436
        if self.showlabel:
1425
            hbox = QHBox(self)
1437
            hbox = TQHBox(self)
1426
            hbox.setSpacing(KDialog.spacingHint())
1438
            hbox.setSpacing(KDialog.spacingHint())
1427
            self.labelcheckbox = QRadioButton(i18n("by label"),hbox)
1439
            self.labelcheckbox = TQRadioButton(i18n("by label"),hbox)
1428
            self.connect(self.labelcheckbox,SIGNAL("clicked()"), \
1440
            self.connect(self.labelcheckbox,SIGNAL("clicked()"), \
1429
                self.slotLabelCheckboxClicked)
1441
                self.slotLabelCheckboxClicked)
1430
            self.labellineedit = KLineEdit(hbox)
1442
            self.labellineedit = KLineEdit(hbox)
Lines 1432-1479 class MountEntryDialogOptions(QWidget): Link Here
1432
            row += 1
1444
            row += 1
1433
        else:
1445
        else:
1434
            if self.showdevice:
1446
            if self.showdevice:
1435
                label = QLabel(i18n("Device:"),self)
1447
                label = TQLabel(i18n("Device:"),self)
1436
                grid.addWidget(label,row,0)
1448
                grid.addWidget(label,row,0)
1437
                self.devicelineedit = KLineEdit(self)
1449
                self.devicelineedit = KLineEdit(self)
1438
                grid.addMultiCellWidget(self.devicelineedit,row,row,1,3)
1450
                grid.addMultiCellWidget(self.devicelineedit,row,row,1,3)
1439
                row += 1
1451
                row += 1
1440
                example = QLabel(self.deviceexample,self)
1452
                example = TQLabel(self.deviceexample,self)
1441
                grid.addWidget(example,row,1)
1453
                grid.addWidget(example,row,1)
1442
1454
1443
            if self.showuuid:
1455
            if self.showuuid:
1444
                label = QLabel(i18n("Device UUID:"),self)
1456
                label = TQLabel(i18n("Device UUID:"),self)
1445
                grid.addWidget(label,row,0)
1457
                grid.addWidget(label,row,0)
1446
                self.uuidlineedit = KLineEdit(self)
1458
                self.uuidlineedit = KLineEdit(self)
1447
                grid.addMultiCellWidget(self.uuidlineedit,row,row,1,3)
1459
                grid.addMultiCellWidget(self.uuidlineedit,row,row,1,3)
1448
                row += 1
1460
                row += 1
1449
1461
1450
            if self.showlabel:
1462
            if self.showlabel:
1451
                label = QLabel(i18n("Device Label:"),self)
1463
                label = TQLabel(i18n("Device Label:"),self)
1452
                grid.addWidget(label,row,0)
1464
                grid.addWidget(label,row,0)
1453
                self.labellineedit = KLineEdit(self)
1465
                self.labellineedit = KLineEdit(self)
1454
                grid.addMultiCellWidget(self.labellineedit,row,row,1,3)
1466
                grid.addMultiCellWidget(self.labellineedit,row,row,1,3)
1455
                row += 1
1467
                row += 1
1456
1468
1457
        label = QLabel(i18n("Options:"),self)
1469
        label = TQLabel(i18n("Options:"),self)
1458
        grid.addWidget(label,row,0)
1470
        grid.addWidget(label,row,0)
1459
        self.optionslineedit = KLineEdit(self)
1471
        self.optionslineedit = KLineEdit(self)
1460
        grid.addMultiCellWidget(self.optionslineedit,row,row,1,3)
1472
        grid.addMultiCellWidget(self.optionslineedit,row,row,1,3)
1461
        row += 1
1473
        row += 1
1462
1474
1463
        if self.showfs_freq:
1475
        if self.showfs_freq:
1464
            label = QLabel(i18n("fs_freq:"),self)
1476
            label = TQLabel(i18n("fs_freq:"),self)
1465
            grid.addWidget(label,row,0)
1477
            grid.addWidget(label,row,0)
1466
            self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,self)
1478
            self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,self)
1467
            grid.addWidget(self.fsfreqspinbox,row,1)
1479
            grid.addWidget(self.fsfreqspinbox,row,1)
1468
1480
1469
        if self.showfs_passno:
1481
        if self.showfs_passno:
1470
            label = QLabel(i18n("fs_passno:"),self)
1482
            label = TQLabel(i18n("fs_passno:"),self)
1471
            grid.addWidget(label,row,2)
1483
            grid.addWidget(label,row,2)
1472
            self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,self)
1484
            self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,self)
1473
            grid.addWidget(self.fspassnospinbox,row,3)
1485
            grid.addWidget(self.fspassnospinbox,row,3)
1474
        row += 1
1486
        row += 1
1475
1487
1476
        grid.addWidget(QWidget(self),row,0)
1488
        grid.addWidget(TQWidget(self),row,0)
1477
1489
1478
        for x in range(grid.numRows()):
1490
        for x in range(grid.numRows()):
1479
            grid.setRowStretch(x,0)
1491
            grid.setRowStretch(x,0)
Lines 1583-1589 class MountEntryDialogOptions(QWidget): Link Here
1583
        fileurl = KURL()
1595
        fileurl = KURL()
1584
        fileurl.setPath(self.mountpointlineedit.text())
1596
        fileurl.setPath(self.mountpointlineedit.text())
1585
        self.mountpointdialog.setCurrentURL(fileurl)
1597
        self.mountpointdialog.setCurrentURL(fileurl)
1586
        if self.mountpointdialog.exec_loop()==QDialog.Accepted:
1598
        if self.mountpointdialog.exec_loop()==TQDialog.Accepted:
1587
            self.mountpointlineedit.setText(self.mountpointdialog.url().path())
1599
            self.mountpointlineedit.setText(self.mountpointdialog.url().path())
1588
1600
1589
    ########################################################################
1601
    ########################################################################
Lines 1627-1644 class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): Link Here
1627
    def _fillPage(self):
1639
    def _fillPage(self):
1628
1640
1629
        row = 0
1641
        row = 0
1630
        grid = QGridLayout(self,1,2)
1642
        grid = TQGridLayout(self,1,2)
1631
        grid.setSpacing(KDialog.spacingHint())
1643
        grid.setSpacing(KDialog.spacingHint())
1632
        grid.setColStretch(0,0)
1644
        grid.setColStretch(0,0)
1633
        grid.setRowStretch(6,1)
1645
        grid.setRowStretch(6,1)
1634
1646
1635
        label = QLabel(i18n("Mount Point:"),self)
1647
        label = TQLabel(i18n("Mount Point:"),self)
1636
        grid.addWidget(label,row,0)
1648
        grid.addWidget(label,row,0)
1637
        hbox = QHBox(self)
1649
        hbox = TQHBox(self)
1638
        hbox.setSpacing(KDialog.spacingHint())
1650
        hbox.setSpacing(KDialog.spacingHint())
1639
        self.mountpointlineedit = KLineEdit(hbox)
1651
        self.mountpointlineedit = KLineEdit(hbox)
1640
        hbox.setStretchFactor(self.mountpointlineedit,1)
1652
        hbox.setStretchFactor(self.mountpointlineedit,1)
1641
        #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged)
1653
        #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged)
1642
        self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
1654
        self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
1643
        hbox.setStretchFactor(self.mountpointbutton,0)
1655
        hbox.setStretchFactor(self.mountpointbutton,0)
1644
        self.connect(self.mountpointbutton,SIGNAL("clicked()"), \
1656
        self.connect(self.mountpointbutton,SIGNAL("clicked()"), \
Lines 1648-1673 class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): Link Here
1648
1660
1649
        if self.showuuid or self.showlabel:
1661
        if self.showuuid or self.showlabel:
1650
1662
1651
            hbox = QHBox(self)
1663
            hbox = TQHBox(self)
1652
            hbox.setSpacing(KDialog.spacingHint())
1664
            hbox.setSpacing(KDialog.spacingHint())
1653
1665
1654
            label = QLabel(i18n("Device:"),self)
1666
            label = TQLabel(i18n("Device:"),self)
1655
            grid.addWidget(label,row,0)
1667
            grid.addWidget(label,row,0)
1656
1668
1657
            self.devicecheckbox = QRadioButton(i18n("by name"),hbox)
1669
            self.devicecheckbox = TQRadioButton(i18n("by name"),hbox)
1658
            self.connect(self.devicecheckbox,SIGNAL("clicked()"), \
1670
            self.connect(self.devicecheckbox,SIGNAL("clicked()"), \
1659
                self.slotDeviceCheckboxClicked)
1671
                self.slotDeviceCheckboxClicked)
1660
            self.devicelineedit = KLineEdit(hbox)
1672
            self.devicelineedit = KLineEdit(hbox)
1661
            grid.addWidget(hbox,row,1)
1673
            grid.addWidget(hbox,row,1)
1662
            row += 1
1674
            row += 1
1663
            example = QLabel(self.deviceexample,self)
1675
            example = TQLabel(self.deviceexample,self)
1664
            grid.addWidget(example,row,1)
1676
            grid.addWidget(example,row,1)
1665
            row += 1
1677
            row += 1
1666
1678
1667
            if self.showuuid:
1679
            if self.showuuid:
1668
                hbox = QHBox(self)
1680
                hbox = TQHBox(self)
1669
                hbox.setSpacing(KDialog.spacingHint())
1681
                hbox.setSpacing(KDialog.spacingHint())
1670
                self.uuidcheckbox = QRadioButton(i18n("by UUID"),hbox)
1682
                self.uuidcheckbox = TQRadioButton(i18n("by UUID"),hbox)
1671
                self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \
1683
                self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \
1672
                    self.slotUUIDCheckboxClicked)
1684
                    self.slotUUIDCheckboxClicked)
1673
                self.uuidlineedit = KLineEdit(hbox)
1685
                self.uuidlineedit = KLineEdit(hbox)
Lines 1675-1683 class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): Link Here
1675
                row += 1
1687
                row += 1
1676
1688
1677
            if self.showlabel:
1689
            if self.showlabel:
1678
                hbox = QHBox(self)
1690
                hbox = TQHBox(self)
1679
                hbox.setSpacing(KDialog.spacingHint())
1691
                hbox.setSpacing(KDialog.spacingHint())
1680
                self.labelcheckbox = QRadioButton(i18n("by label"),hbox)
1692
                self.labelcheckbox = TQRadioButton(i18n("by label"),hbox)
1681
                self.connect(self.labelcheckbox,SIGNAL("clicked()"), \
1693
                self.connect(self.labelcheckbox,SIGNAL("clicked()"), \
1682
                    self.slotLabelCheckboxClicked)
1694
                    self.slotLabelCheckboxClicked)
1683
                self.labellineedit = KLineEdit(hbox)
1695
                self.labellineedit = KLineEdit(hbox)
Lines 1685-1708 class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): Link Here
1685
                row += 1
1697
                row += 1
1686
1698
1687
        else:
1699
        else:
1688
            label = QLabel(i18n("Device:"),self)
1700
            label = TQLabel(i18n("Device:"),self)
1689
            grid.addWidget(label,row,0)
1701
            grid.addWidget(label,row,0)
1690
            self.devicelineedit = KLineEdit(self)
1702
            self.devicelineedit = KLineEdit(self)
1691
            grid.addWidget(self.devicelineedit,row,1)
1703
            grid.addWidget(self.devicelineedit,row,1)
1692
            row += 1
1704
            row += 1
1693
            example = QLabel(self.deviceexample,self)
1705
            example = TQLabel(self.deviceexample,self)
1694
            grid.addWidget(example,row,1)
1706
            grid.addWidget(example,row,1)
1695
            row += 1
1707
            row += 1
1696
1708
1697
        self.autocheckbox = QCheckBox(i18n("Enable at start up"),self)
1709
        self.autocheckbox = TQCheckBox(i18n("Enable at start up"),self)
1698
        grid.addWidget(self.autocheckbox,row,1)
1710
        grid.addWidget(self.autocheckbox,row,1)
1699
        row += 1
1711
        row += 1
1700
1712
1701
        self.writeablecheckbox = QCheckBox(i18n("Writeable"),self)
1713
        self.writeablecheckbox = TQCheckBox(i18n("Writeable"),self)
1702
        grid.addWidget(self.writeablecheckbox,row,1)
1714
        grid.addWidget(self.writeablecheckbox,row,1)
1703
        row += 1
1715
        row += 1
1704
1716
1705
        label = QLabel(i18n("Mount Permission:"),self)
1717
        label = TQLabel(i18n("Mount Permission:"),self)
1706
        grid.addWidget(label,row,0)
1718
        grid.addWidget(label,row,0)
1707
        self.usermountcombobox = KComboBox(self)
1719
        self.usermountcombobox = KComboBox(self)
1708
        self.usermountcombobox.insertItem(i18n("Root user only may enable/disable"))
1720
        self.usermountcombobox.insertItem(i18n("Root user only may enable/disable"))
Lines 1714-1725 class MountEntryDialogOptionsCommonUnix(MountEntryDialogOptions): Link Here
1714
1726
1715
        #grid.addWidget(,9,0)
1727
        #grid.addWidget(,9,0)
1716
        button = KPushButton(i18n("Advanced..."),self)
1728
        button = KPushButton(i18n("Advanced..."),self)
1717
        button.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed)
1729
        button.setSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed)
1718
        self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked)
1730
        self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked)
1719
        grid.addWidget(button,row,1,Qt.AlignRight)
1731
        grid.addWidget(button,row,1,TQt.AlignRight)
1720
        row += 1
1732
        row += 1
1721
1733
1722
        grid.addWidget(QWidget(self),row,0)
1734
        grid.addWidget(TQWidget(self),row,0)
1723
1735
1724
        for x in range(grid.numRows()):
1736
        for x in range(grid.numRows()):
1725
            grid.setRowStretch(x,0)
1737
            grid.setRowStretch(x,0)
Lines 1880-1898 class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): Link Here
1880
        global allowuuid, allowlabel
1892
        global allowuuid, allowlabel
1881
1893
1882
        row = 0
1894
        row = 0
1883
        grid = QGridLayout(self,11,2)
1895
        grid = TQGridLayout(self,11,2)
1884
        grid.setSpacing(KDialog.spacingHint())
1896
        grid.setSpacing(KDialog.spacingHint())
1885
        grid.setColStretch(0,0)
1897
        grid.setColStretch(0,0)
1886
        grid.setColStretch(2,0)
1898
        grid.setColStretch(2,0)
1887
        grid.setRowStretch(10,1)
1899
        grid.setRowStretch(10,1)
1888
1900
1889
        label = QLabel(i18n("Mount Point:"),self)
1901
        label = TQLabel(i18n("Mount Point:"),self)
1890
        grid.addWidget(label,row,0)
1902
        grid.addWidget(label,row,0)
1891
        hbox = QHBox(self)
1903
        hbox = TQHBox(self)
1892
        hbox.setSpacing(KDialog.spacingHint())
1904
        hbox.setSpacing(KDialog.spacingHint())
1893
        self.mountpointlineedit = KLineEdit(hbox)
1905
        self.mountpointlineedit = KLineEdit(hbox)
1894
        hbox.setStretchFactor(self.mountpointlineedit,1)
1906
        hbox.setStretchFactor(self.mountpointlineedit,1)
1895
        #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged)
1907
        #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged)
1896
        self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
1908
        self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
1897
        hbox.setStretchFactor(self.mountpointbutton,0)
1909
        hbox.setStretchFactor(self.mountpointbutton,0)
1898
        self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked)
1910
        self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked)
Lines 1900-1925 class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): Link Here
1900
        row += 1
1912
        row += 1
1901
1913
1902
        if allowuuid or allowlabel:
1914
        if allowuuid or allowlabel:
1903
            hbox = QHBox(self)
1915
            hbox = TQHBox(self)
1904
            hbox.setSpacing(KDialog.spacingHint())
1916
            hbox.setSpacing(KDialog.spacingHint())
1905
1917
1906
            label = QLabel(i18n("Device:"),self)
1918
            label = TQLabel(i18n("Device:"),self)
1907
            grid.addWidget(label,row,0)
1919
            grid.addWidget(label,row,0)
1908
1920
1909
            self.devicecheckbox = QRadioButton(i18n("by name"),hbox)
1921
            self.devicecheckbox = TQRadioButton(i18n("by name"),hbox)
1910
            self.connect(self.devicecheckbox,SIGNAL("clicked()"), \
1922
            self.connect(self.devicecheckbox,SIGNAL("clicked()"), \
1911
                self.slotDeviceCheckboxClicked)
1923
                self.slotDeviceCheckboxClicked)
1912
            self.devicelineedit = KLineEdit(hbox)
1924
            self.devicelineedit = KLineEdit(hbox)
1913
            grid.addWidget(hbox,row,1)
1925
            grid.addWidget(hbox,row,1)
1914
            row += 1
1926
            row += 1
1915
            example = QLabel(self.deviceexample,self)
1927
            example = TQLabel(self.deviceexample,self)
1916
            grid.addWidget(example,row,1)
1928
            grid.addWidget(example,row,1)
1917
            row += 1
1929
            row += 1
1918
1930
1919
            if allowuuid and self.showuuid:
1931
            if allowuuid and self.showuuid:
1920
                hbox = QHBox(self)
1932
                hbox = TQHBox(self)
1921
                hbox.setSpacing(KDialog.spacingHint())
1933
                hbox.setSpacing(KDialog.spacingHint())
1922
                self.uuidcheckbox = QRadioButton(i18n("by UUID"),hbox)
1934
                self.uuidcheckbox = TQRadioButton(i18n("by UUID"),hbox)
1923
                self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \
1935
                self.connect(self.uuidcheckbox,SIGNAL("clicked()"), \
1924
                    self.slotUUIDCheckboxClicked)
1936
                    self.slotUUIDCheckboxClicked)
1925
                self.uuidlineedit = KLineEdit(hbox)
1937
                self.uuidlineedit = KLineEdit(hbox)
Lines 1927-1935 class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): Link Here
1927
                row += 1
1939
                row += 1
1928
1940
1929
            if allowlabel and self.showlabel:
1941
            if allowlabel and self.showlabel:
1930
                hbox = QHBox(self)
1942
                hbox = TQHBox(self)
1931
                hbox.setSpacing(KDialog.spacingHint())
1943
                hbox.setSpacing(KDialog.spacingHint())
1932
                self.labelcheckbox = QRadioButton(i18n("by label"),hbox)
1944
                self.labelcheckbox = TQRadioButton(i18n("by label"),hbox)
1933
                self.connect(self.labelcheckbox,SIGNAL("clicked()"), \
1945
                self.connect(self.labelcheckbox,SIGNAL("clicked()"), \
1934
                    self.slotLabelCheckboxClicked)
1946
                    self.slotLabelCheckboxClicked)
1935
                self.labellineedit = KLineEdit(hbox)
1947
                self.labellineedit = KLineEdit(hbox)
Lines 1938-1964 class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): Link Here
1938
1950
1939
        else:
1951
        else:
1940
1952
1941
            label = QLabel(i18n("Device:"),self)
1953
            label = TQLabel(i18n("Device:"),self)
1942
            grid.addWidget(label,row,0)
1954
            grid.addWidget(label,row,0)
1943
            self.devicelineedit = KLineEdit(self)
1955
            self.devicelineedit = KLineEdit(self)
1944
            grid.addMultiCellWidget(self.devicelineedit,row,row,1,3)
1956
            grid.addMultiCellWidget(self.devicelineedit,row,row,1,3)
1945
            row += 1
1957
            row += 1
1946
1958
1947
            example = QLabel(self.deviceexample,self)
1959
            example = TQLabel(self.deviceexample,self)
1948
            grid.addWidget(example,row,1)
1960
            grid.addWidget(example,row,1)
1949
            row += 1
1961
            row += 1
1950
1962
1951
        self.autocheckbox = QCheckBox(i18n("Enable at start up"),self)
1963
        self.autocheckbox = TQCheckBox(i18n("Enable at start up"),self)
1952
        grid.addMultiCellWidget(self.autocheckbox,row,row,1,3)
1964
        grid.addMultiCellWidget(self.autocheckbox,row,row,1,3)
1953
        row += 1
1965
        row += 1
1954
1966
1955
        # Security & Safety line.
1967
        # Security & Safety line.
1956
        hbox = QHBox(self)
1968
        hbox = TQHBox(self)
1957
        hbox.setSpacing(KDialog.spacingHint())
1969
        hbox.setSpacing(KDialog.spacingHint())
1958
        tmplabel = QLabel(hbox)
1970
        tmplabel = TQLabel(hbox)
1959
        tmplabel.setPixmap(UserIcon("hi16-lock"))
1971
        tmplabel.setPixmap(UserIcon("hi16-lock"))
1960
        hbox.setStretchFactor(tmplabel,0)
1972
        hbox.setStretchFactor(tmplabel,0)
1961
        tmplabel = QLabel(hbox)
1973
        tmplabel = TQLabel(hbox)
1962
        tmplabel.setText(i18n("Security & Safety"))
1974
        tmplabel.setText(i18n("Security & Safety"))
1963
        hbox.setStretchFactor(tmplabel,0)
1975
        hbox.setStretchFactor(tmplabel,0)
1964
        sep = KSeparator(KSeparator.Horizontal,hbox)
1976
        sep = KSeparator(KSeparator.Horizontal,hbox)
Lines 1966-1988 class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): Link Here
1966
        grid.addMultiCellWidget(hbox,row,row,0,3)
1978
        grid.addMultiCellWidget(hbox,row,row,0,3)
1967
        row += 1
1979
        row += 1
1968
1980
1969
        self.writeablecheckbox = QCheckBox(i18n("Writeable"),self)
1981
        self.writeablecheckbox = TQCheckBox(i18n("Writeable"),self)
1970
        grid.addMultiCellWidget(self.writeablecheckbox,row,row,1,3)
1982
        grid.addMultiCellWidget(self.writeablecheckbox,row,row,1,3)
1971
        row += 1
1983
        row += 1
1972
1984
1973
        label = QLabel(i18n("Files belong to user:"),self)
1985
        label = TQLabel(i18n("Files belong to user:"),self)
1974
        grid.addWidget(label,row,0)
1986
        grid.addWidget(label,row,0)
1975
        self.uidcombobox = UserComboBox(self)
1987
        self.uidcombobox = UserComboBox(self)
1976
        grid.addMultiCellWidget(self.uidcombobox,row,row,1,3)
1988
        grid.addMultiCellWidget(self.uidcombobox,row,row,1,3)
1977
        row += 1
1989
        row += 1
1978
1990
1979
        label = QLabel(i18n("Files belong to group:"),self)
1991
        label = TQLabel(i18n("Files belong to group:"),self)
1980
        grid.addWidget(label,row,0)
1992
        grid.addWidget(label,row,0)
1981
        self.gidcombobox = GroupComboBox(self)
1993
        self.gidcombobox = GroupComboBox(self)
1982
        grid.addMultiCellWidget(self.gidcombobox,row,row,1,3)
1994
        grid.addMultiCellWidget(self.gidcombobox,row,row,1,3)
1983
        row += 1
1995
        row += 1
1984
1996
1985
        label = QLabel(i18n("Mount Permission:"),self)
1997
        label = TQLabel(i18n("Mount Permission:"),self)
1986
        grid.addWidget(label,row,0)
1998
        grid.addWidget(label,row,0)
1987
        self.usermountcombobox = KComboBox(self)
1999
        self.usermountcombobox = KComboBox(self)
1988
        self.usermountcombobox.insertItem(i18n("Root user only may enable/disable"))
2000
        self.usermountcombobox.insertItem(i18n("Root user only may enable/disable"))
Lines 1992-2006 class MountEntryDialogOptionsVFAT(MountEntryDialogOptions): Link Here
1992
        grid.addMultiCellWidget(self.usermountcombobox,row,row,1,3)
2004
        grid.addMultiCellWidget(self.usermountcombobox,row,row,1,3)
1993
        row += 1
2005
        row += 1
1994
2006
1995
        self.suppresspermissionerrorcheckbox = QCheckBox(i18n("Suppress permission errors"),self)
2007
        self.suppresspermissionerrorcheckbox = TQCheckBox(i18n("Suppress permission errors"),self)
1996
        grid.addMultiCellWidget(self.suppresspermissionerrorcheckbox,row,row,1,3)
2008
        grid.addMultiCellWidget(self.suppresspermissionerrorcheckbox,row,row,1,3)
1997
        row += 1
2009
        row += 1
1998
2010
1999
        row += 1
2011
        row += 1
2000
        button = KPushButton(i18n("Advanced..."),self)
2012
        button = KPushButton(i18n("Advanced..."),self)
2001
        button.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed)
2013
        button.setSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed)
2002
        self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked)
2014
        self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked)
2003
        grid.addMultiCellWidget(button,row,row,1,3,Qt.AlignRight)
2015
        grid.addMultiCellWidget(button,row,row,1,3,TQt.AlignRight)
2004
2016
2005
    ########################################################################
2017
    ########################################################################
2006
    def displayMountEntry(self,entry):
2018
    def displayMountEntry(self,entry):
Lines 2135-2161 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2135
2147
2136
    ########################################################################
2148
    ########################################################################
2137
    def _fillPage(self):
2149
    def _fillPage(self):
2138
        grid = QGridLayout(self,14,4)
2150
        grid = TQGridLayout(self,14,4)
2139
        grid.setSpacing(KDialog.spacingHint())
2151
        grid.setSpacing(KDialog.spacingHint())
2140
        grid.setColStretch(0,0)
2152
        grid.setColStretch(0,0)
2141
        grid.setColStretch(2,0)
2153
        grid.setColStretch(2,0)
2142
        grid.setRowStretch(12,1)
2154
        grid.setRowStretch(12,1)
2143
2155
2144
        label = QLabel(i18n("Mount Point:"),self)
2156
        label = TQLabel(i18n("Mount Point:"),self)
2145
        grid.addWidget(label,0,0)
2157
        grid.addWidget(label,0,0)
2146
        hbox = QHBox(self)
2158
        hbox = TQHBox(self)
2147
        hbox.setSpacing(KDialog.spacingHint())
2159
        hbox.setSpacing(KDialog.spacingHint())
2148
        self.mountpointlineedit = KLineEdit(hbox)
2160
        self.mountpointlineedit = KLineEdit(hbox)
2149
        hbox.setStretchFactor(self.mountpointlineedit,1)
2161
        hbox.setStretchFactor(self.mountpointlineedit,1)
2150
        #self.connect(self.homediredit, SIGNAL("textChanged(const QString &)"), self.slotHomeDirChanged)
2162
        #self.connect(self.homediredit, SIGNAL("textChanged(const TQString &)"), self.slotHomeDirChanged)
2151
        self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
2163
        self.mountpointbutton = KPushButton(i18n("Browse..."),hbox)
2152
        hbox.setStretchFactor(self.mountpointbutton,0)
2164
        hbox.setStretchFactor(self.mountpointbutton,0)
2153
        self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked)
2165
        self.connect(self.mountpointbutton,SIGNAL("clicked()"),self.slotBrowseMountPointClicked)
2154
        grid.addMultiCellWidget(hbox,0,0,1,3)
2166
        grid.addMultiCellWidget(hbox,0,0,1,3)
2155
2167
2156
        label = QLabel(i18n("Network Share:"),self)
2168
        label = TQLabel(i18n("Network Share:"),self)
2157
        grid.addWidget(label,1,0)
2169
        grid.addWidget(label,1,0)
2158
        hbox = QHBox(self)
2170
        hbox = TQHBox(self)
2159
        hbox.setSpacing(KDialog.spacingHint())
2171
        hbox.setSpacing(KDialog.spacingHint())
2160
        self.devicelineedit = KLineEdit(hbox)
2172
        self.devicelineedit = KLineEdit(hbox)
2161
        hbox.setStretchFactor(self.devicelineedit,1)
2173
        hbox.setStretchFactor(self.devicelineedit,1)
Lines 2165-2185 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2165
        grid.addMultiCellWidget(hbox,1,1,1,3)
2177
        grid.addMultiCellWidget(hbox,1,1,1,3)
2166
2178
2167
        # Connect as:
2179
        # Connect as:
2168
        connectaslabel = QLabel(self)
2180
        connectaslabel = TQLabel(self)
2169
        connectaslabel.setText(i18n("Connect as:"))
2181
        connectaslabel.setText(i18n("Connect as:"))
2170
        grid.addWidget(connectaslabel,2,0)
2182
        grid.addWidget(connectaslabel,2,0)
2171
2183
2172
        self.guestradio = QRadioButton(self)
2184
        self.guestradio = TQRadioButton(self)
2173
        self.guestradio.setChecked(True)
2185
        self.guestradio.setChecked(True)
2174
        grid.addWidget(self.guestradio,2,1)
2186
        grid.addWidget(self.guestradio,2,1)
2175
        tmplabel = QLabel(self)
2187
        tmplabel = TQLabel(self)
2176
        tmplabel.setText(i18n("Guest"))
2188
        tmplabel.setText(i18n("Guest"))
2177
        grid.addMultiCellWidget(tmplabel,2,2,2,3)
2189
        grid.addMultiCellWidget(tmplabel,2,2,2,3)
2178
        self.connect(self.guestradio,SIGNAL("stateChanged(int)"),self.slotGuestRadioClicked)
2190
        self.connect(self.guestradio,SIGNAL("stateChanged(int)"),self.slotGuestRadioClicked)
2179
2191
2180
        self.userradio = QRadioButton(self)
2192
        self.userradio = TQRadioButton(self)
2181
        grid.addWidget(self.userradio,3,1)
2193
        grid.addWidget(self.userradio,3,1)
2182
        tmplabel = QLabel(self)
2194
        tmplabel = TQLabel(self)
2183
        tmplabel.setText(i18n("Username:"))
2195
        tmplabel.setText(i18n("Username:"))
2184
        grid.addWidget(tmplabel,3,2)
2196
        grid.addWidget(tmplabel,3,2)
2185
        self.connect(self.userradio,SIGNAL("stateChanged(int)"),self.slotUserRadioClicked)
2197
        self.connect(self.userradio,SIGNAL("stateChanged(int)"),self.slotUserRadioClicked)
Lines 2187-2229 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2187
        self.usernameedit = KLineEdit(self)
2199
        self.usernameedit = KLineEdit(self)
2188
        grid.addWidget(self.usernameedit,3,3)
2200
        grid.addWidget(self.usernameedit,3,3)
2189
2201
2190
        tmplabel = QLabel(self)
2202
        tmplabel = TQLabel(self)
2191
        tmplabel.setText(i18n("Password:"))
2203
        tmplabel.setText(i18n("Password:"))
2192
        grid.addWidget(tmplabel,4,2)
2204
        grid.addWidget(tmplabel,4,2)
2193
2205
2194
        self.passwordedit = KLineEdit(self)
2206
        self.passwordedit = KLineEdit(self)
2195
        grid.addWidget(self.passwordedit,4,3)
2207
        grid.addWidget(self.passwordedit,4,3)
2196
2208
2197
        self.autocheckbox = QCheckBox(i18n("Enable at start up"),self)
2209
        self.autocheckbox = TQCheckBox(i18n("Enable at start up"),self)
2198
        grid.addMultiCellWidget(self.autocheckbox,5,5,1,3)
2210
        grid.addMultiCellWidget(self.autocheckbox,5,5,1,3)
2199
2211
2200
        # Security & Safety line.
2212
        # Security & Safety line.
2201
        hbox = QHBox(self)
2213
        hbox = TQHBox(self)
2202
        hbox.setSpacing(KDialog.spacingHint())
2214
        hbox.setSpacing(KDialog.spacingHint())
2203
        tmplabel = QLabel(hbox)
2215
        tmplabel = TQLabel(hbox)
2204
        tmplabel.setPixmap(UserIcon("hi16-lock"))
2216
        tmplabel.setPixmap(UserIcon("hi16-lock"))
2205
        hbox.setStretchFactor(tmplabel,0)
2217
        hbox.setStretchFactor(tmplabel,0)
2206
        tmplabel = QLabel(hbox)
2218
        tmplabel = TQLabel(hbox)
2207
        tmplabel.setText(i18n("Security & Safety"))
2219
        tmplabel.setText(i18n("Security & Safety"))
2208
        hbox.setStretchFactor(tmplabel,0)
2220
        hbox.setStretchFactor(tmplabel,0)
2209
        sep = KSeparator(KSeparator.Horizontal,hbox)
2221
        sep = KSeparator(KSeparator.Horizontal,hbox)
2210
        hbox.setStretchFactor(sep,1)
2222
        hbox.setStretchFactor(sep,1)
2211
        grid.addMultiCellWidget(hbox,6,6,0,3)
2223
        grid.addMultiCellWidget(hbox,6,6,0,3)
2212
2224
2213
        self.writeablecheckbox = QCheckBox(i18n("Writeable"),self)
2225
        self.writeablecheckbox = TQCheckBox(i18n("Writeable"),self)
2214
        grid.addMultiCellWidget(self.writeablecheckbox,7,7,1,3)
2226
        grid.addMultiCellWidget(self.writeablecheckbox,7,7,1,3)
2215
2227
2216
        label = QLabel(i18n("Files belong to user:"),self)
2228
        label = TQLabel(i18n("Files belong to user:"),self)
2217
        grid.addWidget(label,8,0)
2229
        grid.addWidget(label,8,0)
2218
        self.uidcombobox = UserComboBox(self)
2230
        self.uidcombobox = UserComboBox(self)
2219
        grid.addMultiCellWidget(self.uidcombobox,8,8,1,3)
2231
        grid.addMultiCellWidget(self.uidcombobox,8,8,1,3)
2220
2232
2221
        label = QLabel(i18n("Files belong to group:"),self)
2233
        label = TQLabel(i18n("Files belong to group:"),self)
2222
        grid.addWidget(label,9,0)
2234
        grid.addWidget(label,9,0)
2223
        self.gidcombobox = GroupComboBox(self)
2235
        self.gidcombobox = GroupComboBox(self)
2224
        grid.addMultiCellWidget(self.gidcombobox,9,9,1,3)
2236
        grid.addMultiCellWidget(self.gidcombobox,9,9,1,3)
2225
2237
2226
        label = QLabel(i18n("Mount Permission:"),self)
2238
        label = TQLabel(i18n("Mount Permission:"),self)
2227
        grid.addWidget(label,10,0)
2239
        grid.addWidget(label,10,0)
2228
        self.usermountcombobox = KComboBox(self)
2240
        self.usermountcombobox = KComboBox(self)
2229
        self.usermountcombobox.insertItem(i18n("Root user only may enable/disable"))
2241
        self.usermountcombobox.insertItem(i18n("Root user only may enable/disable"))
Lines 2233-2241 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2233
        grid.addMultiCellWidget(self.usermountcombobox,10,10,1,3)
2245
        grid.addMultiCellWidget(self.usermountcombobox,10,10,1,3)
2234
2246
2235
        button = KPushButton(i18n("Advanced..."),self)
2247
        button = KPushButton(i18n("Advanced..."),self)
2236
        button.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed)
2248
        button.setSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed)
2237
        self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked)
2249
        self.connect(button,SIGNAL("clicked()"),self.slotAdvancedClicked)
2238
        grid.addMultiCellWidget(button,13,13,1,3,Qt.AlignRight)
2250
        grid.addMultiCellWidget(button,13,13,1,3,TQt.AlignRight)
2239
2251
2240
        self.selectsmbdialog = None
2252
        self.selectsmbdialog = None
2241
2253
Lines 2260-2267 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2260
        newurlobj = self.selectsmbdialog.choose(urlobj)
2272
        newurlobj = self.selectsmbdialog.choose(urlobj)
2261
        # This just converts smb:/zootv/data to \\zootv\data.
2273
        # This just converts smb:/zootv/data to \\zootv\data.
2262
        plainurl = KURL(newurlobj)
2274
        plainurl = KURL(newurlobj)
2263
        plainurl.setUser(QString.null)
2275
        plainurl.setUser(TQString.null)
2264
        plainurl.setPass(QString.null)
2276
        plainurl.setPass(TQString.null)
2265
        parts = [x.replace('\\',"/") for x in unicode(plainurl.url())[4:].split("/") if x !=""]
2277
        parts = [x.replace('\\',"/") for x in unicode(plainurl.url())[4:].split("/") if x !=""]
2266
        #convert the first part to an IP address
2278
        #convert the first part to an IP address
2267
        nmboutput = subprocess.Popen(["nmblookup",parts[0]], stdout=subprocess.PIPE).stdout
2279
        nmboutput = subprocess.Popen(["nmblookup",parts[0]], stdout=subprocess.PIPE).stdout
Lines 2346-2352 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2346
            return
2358
            return
2347
        self.updatinggui = True
2359
        self.updatinggui = True
2348
2360
2349
        if state==QButton.Off:
2361
        if state==TQButton.Off:
2350
            self.guestradio.setChecked(True)
2362
            self.guestradio.setChecked(True)
2351
        self.userradio.setChecked(False)
2363
        self.userradio.setChecked(False)
2352
2364
Lines 2360-2366 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2360
        if self.updatinggui:
2372
        if self.updatinggui:
2361
            return
2373
            return
2362
        self.updatinggui = True
2374
        self.updatinggui = True
2363
        if state==QButton.Off:
2375
        if state==TQButton.Off:
2364
            self.userradio.setChecked(True)
2376
            self.userradio.setChecked(True)
2365
        self.guestradio.setChecked(False)
2377
        self.guestradio.setChecked(False)
2366
2378
Lines 2370-2389 class MountEntryDialogOptionsSMB(MountEntryDialogOptions): Link Here
2370
        self.updatinggui = False
2382
        self.updatinggui = False
2371
2383
2372
############################################################################
2384
############################################################################
2373
class ROListBoxItem(QListBoxPixmap):
2385
class ROListBoxItem(TQListBoxPixmap):
2374
    """A read-only ListBox item that also uses the 'alternate' background colour
2386
    """A read-only ListBox item that also uses the 'alternate' background colour
2375
    as background.
2387
    as background.
2376
    """
2388
    """
2377
    def __init__(self,listbox,pix,text):
2389
    def __init__(self,listbox,pix,text):
2378
        QListBoxPixmap.__init__(self,listbox,pix,text)
2390
        TQListBoxPixmap.__init__(self,listbox,pix,text)
2379
        self.setSelectable(False)
2391
        self.setSelectable(False)
2380
    def paint(self,p):
2392
    def paint(self,p):
2381
        boldfont = QFont(p.font())
2393
        boldfont = TQFont(p.font())
2382
        boldfont.setWeight(QFont.Bold)
2394
        boldfont.setWeight(TQFont.Bold)
2383
        p.setFont(boldfont)
2395
        p.setFont(boldfont)
2384
        p.setBackgroundColor(TDEGlobalSettings.alternateBackgroundColor())
2396
        p.setBackgroundColor(TDEGlobalSettings.alternateBackgroundColor())
2385
        p.eraseRect(0,0,self.listBox().width(),self.height(self.listBox()))
2397
        p.eraseRect(0,0,self.listBox().width(),self.height(self.listBox()))
2386
        QListBoxPixmap.paint(self,p)
2398
        TQListBoxPixmap.paint(self,p)
2387
2399
2388
############################################################################
2400
############################################################################
2389
class MountEntryDialog(KDialogBase):
2401
class MountEntryDialog(KDialogBase):
Lines 2440-2454 class MountEntryDialog(KDialogBase): Link Here
2440
        self.comboIndexToMountType = []
2452
        self.comboIndexToMountType = []
2441
        self.currentOptionWidget = None
2453
        self.currentOptionWidget = None
2442
2454
2443
        self.topvbox = QVBox(self)
2455
        self.topvbox = TQVBox(self)
2444
        self.setMainWidget(self.topvbox)
2456
        self.setMainWidget(self.topvbox)
2445
        self.topvbox.setSpacing(self.spacingHint())
2457
        self.topvbox.setSpacing(self.spacingHint())
2446
2458
2447
        hb = QHBox(self.topvbox)
2459
        hb = TQHBox(self.topvbox)
2448
        hb.setSpacing(self.spacingHint())
2460
        hb.setSpacing(self.spacingHint())
2449
        self.topvbox.setStretchFactor(hb,0)
2461
        self.topvbox.setStretchFactor(hb,0)
2450
2462
2451
        label = QLabel(i18n("Type:"),hb)
2463
        label = TQLabel(i18n("Type:"),hb)
2452
        hb.setStretchFactor(label,0)
2464
        hb.setStretchFactor(label,0)
2453
        self.mounttypecombo = KComboBox(hb)
2465
        self.mounttypecombo = KComboBox(hb)
2454
2466
Lines 2486-2510 class MountEntryDialog(KDialogBase): Link Here
2486
        #hb.setStretchFactor(self.runlevelcombo,0)
2498
        #hb.setStretchFactor(self.runlevelcombo,0)
2487
        self.connect(self.mounttypecombo, SIGNAL("activated(int)"), self.slotMountTypeChanged)
2499
        self.connect(self.mounttypecombo, SIGNAL("activated(int)"), self.slotMountTypeChanged)
2488
2500
2489
        widget = QWidget(hb)
2501
        widget = TQWidget(hb)
2490
        hb.setStretchFactor(widget,1)
2502
        hb.setStretchFactor(widget,1)
2491
2503
2492
        # Create the stack of option edit widgets.
2504
        # Create the stack of option edit widgets.
2493
        gb = QVGroupBox(self.topvbox)
2505
        gb = TQVGroupBox(self.topvbox)
2494
        self.topvbox.setStretchFactor(gb,1)
2506
        self.topvbox.setStretchFactor(gb,1)
2495
        self.optionsstack = QWidgetStack(gb)
2507
        self.optionsstack = TQWidgetStack(gb)
2496
2508
2497
        for mounttype in self.MountTypeEditors:
2509
        for mounttype in self.MountTypeEditors:
2498
            editpage = self.MountTypeEditors[mounttype](self.optionsstack)
2510
            editpage = self.MountTypeEditors[mounttype](self.optionsstack)
2499
            self.mountTypeToOptionWidget[mounttype] = editpage
2511
            self.mountTypeToOptionWidget[mounttype] = editpage
2500
            self.optionsstack.addWidget(editpage)
2512
            self.optionsstack.addWidget(editpage)
2501
2513
2502
        self.fsunavailablelabel = QHBox(gb)
2514
        self.fsunavailablelabel = TQHBox(gb)
2503
        self.fsunavailablelabel.setSpacing(KDialog.spacingHint())
2515
        self.fsunavailablelabel.setSpacing(KDialog.spacingHint())
2504
        tmplabel = QLabel(self.fsunavailablelabel)
2516
        tmplabel = TQLabel(self.fsunavailablelabel)
2505
        self.fsunavailablelabel.setStretchFactor(tmplabel,0)
2517
        self.fsunavailablelabel.setStretchFactor(tmplabel,0)
2506
        tmplabel.setPixmap(SmallIcon('info'))
2518
        tmplabel.setPixmap(SmallIcon('info'))
2507
        label = QLabel(i18n("This filesystem type is currently unavailable on the running kernel."),
2519
        label = TQLabel(i18n("This filesystem type is currently unavailable on the running kernel."),
2508
                            self.fsunavailablelabel)
2520
                            self.fsunavailablelabel)
2509
        self.fsunavailablelabel.setStretchFactor(label,1)
2521
        self.fsunavailablelabel.setStretchFactor(label,1)
2510
        self.fsunavailablelabel.hide()
2522
        self.fsunavailablelabel.hide()
Lines 2521-2527 class MountEntryDialog(KDialogBase): Link Here
2521
        self.updatingGUI = True
2533
        self.updatingGUI = True
2522
        self.selectEntry(self.currentMountEntry.getMountType())
2534
        self.selectEntry(self.currentMountEntry.getMountType())
2523
        self.updatingGUI = False
2535
        self.updatingGUI = False
2524
        if self.exec_loop()==QDialog.Accepted:
2536
        if self.exec_loop()==TQDialog.Accepted:
2525
            # All of the update stuff is in slotOk()
2537
            # All of the update stuff is in slotOk()
2526
            return True
2538
            return True
2527
        return False
2539
        return False
Lines 2537-2543 class MountEntryDialog(KDialogBase): Link Here
2537
        self.currentOptionWidget = None
2549
        self.currentOptionWidget = None
2538
        self.selectEntry(self.currentMountEntry.mounttype)
2550
        self.selectEntry(self.currentMountEntry.mounttype)
2539
        self.updatingGUI = False
2551
        self.updatingGUI = False
2540
        if self.exec_loop()==QDialog.Accepted:
2552
        if self.exec_loop()==TQDialog.Accepted:
2541
            self.mounttable.allentries.append(self.currentMountEntry)
2553
            self.mounttable.allentries.append(self.currentMountEntry)
2542
            self.mounttable.updateFstabOnDisk()
2554
            self.mounttable.updateFstabOnDisk()
2543
            return self.currentMountEntry
2555
            return self.currentMountEntry
Lines 2657-2684 class MountEntryAdvancedCommonUnixDialog(KDialogBase): Link Here
2657
    def __init__(self,parent,name=None):
2669
    def __init__(self,parent,name=None):
2658
        KDialogBase.__init__(self,parent,name,1,"",KDialogBase.Ok|KDialogBase.Cancel)
2670
        KDialogBase.__init__(self,parent,name,1,"",KDialogBase.Ok|KDialogBase.Cancel)
2659
2671
2660
        grid = self.makeGridMainWidget(2,Qt.Horizontal)
2672
        grid = self.makeGridMainWidget(2,TQt.Horizontal)
2661
        grid.setSpacing(self.spacingHint())
2673
        grid.setSpacing(self.spacingHint())
2662
2674
2663
        QWidget(grid)
2675
        TQWidget(grid)
2664
        self.accesstimecheckbox = QCheckBox(i18n("Update file access timestamps"),grid)
2676
        self.accesstimecheckbox = TQCheckBox(i18n("Update file access timestamps"),grid)
2665
2677
2666
        QWidget(grid)
2678
        TQWidget(grid)
2667
        self.allowexecutablecheckbox = QCheckBox(i18n("Allow Executables"),grid)
2679
        self.allowexecutablecheckbox = TQCheckBox(i18n("Allow Executables"),grid)
2668
2680
2669
        QWidget(grid)
2681
        TQWidget(grid)
2670
        self.allowsuidcheckbox = QCheckBox(i18n("Allow the SUID and SGID attributes"),grid)
2682
        self.allowsuidcheckbox = TQCheckBox(i18n("Allow the SUID and SGID attributes"),grid)
2671
2683
2672
        QWidget(grid)
2684
        TQWidget(grid)
2673
        self.usedevpointscheckbox = QCheckBox(i18n("Allow device points"),grid)
2685
        self.usedevpointscheckbox = TQCheckBox(i18n("Allow device points"),grid)
2674
2686
2675
        label = QLabel(i18n("Options:"),grid)
2687
        label = TQLabel(i18n("Options:"),grid)
2676
        self.optionslineedit = KLineEdit(grid)
2688
        self.optionslineedit = KLineEdit(grid)
2677
2689
2678
        label = QLabel(i18n("fs_freq:"),grid)
2690
        label = TQLabel(i18n("fs_freq:"),grid)
2679
        self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,grid)
2691
        self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,grid)
2680
2692
2681
        label = QLabel(i18n("fs_passno:"),grid)
2693
        label = TQLabel(i18n("fs_passno:"),grid)
2682
        self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,grid)
2694
        self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,grid)
2683
2695
2684
    ########################################################################
2696
    ########################################################################
Lines 2706-2721 class MountEntryAdvancedPlainDialog(KDialogBase): Link Here
2706
    def __init__(self,parent,name=None):
2718
    def __init__(self,parent,name=None):
2707
        KDialogBase.__init__(self,parent,name,1,"",KDialogBase.Ok|KDialogBase.Cancel)
2719
        KDialogBase.__init__(self,parent,name,1,"",KDialogBase.Ok|KDialogBase.Cancel)
2708
2720
2709
        grid = self.makeGridMainWidget(2,Qt.Horizontal)
2721
        grid = self.makeGridMainWidget(2,TQt.Horizontal)
2710
        grid.setSpacing(self.spacingHint())
2722
        grid.setSpacing(self.spacingHint())
2711
2723
2712
        label = QLabel(i18n("Options:"),grid)
2724
        label = TQLabel(i18n("Options:"),grid)
2713
        self.optionslineedit = KLineEdit(grid)
2725
        self.optionslineedit = KLineEdit(grid)
2714
2726
2715
        label = QLabel(i18n("fs_freq:"),grid)
2727
        label = TQLabel(i18n("fs_freq:"),grid)
2716
        self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,grid)
2728
        self.fsfreqspinbox = KIntSpinBox (0,1000,1,0,10,grid)
2717
2729
2718
        label = QLabel(i18n("fs_passno:"),grid)
2730
        label = TQLabel(i18n("fs_passno:"),grid)
2719
        self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,grid)
2731
        self.fspassnospinbox = KIntSpinBox (0,1000,1,0,10,grid)
2720
2732
2721
    ########################################################################
2733
    ########################################################################
Lines 2802-2808 class MountListViewItem(TDEListViewItem): Link Here
2802
            self.setText(2,"")
2814
            self.setText(2,"")
2803
            self.setText(3,self.haldevice.getDev())
2815
            self.setText(3,self.haldevice.getDev())
2804
            self.setText(4,"")
2816
            self.setText(4,"")
2805
            self.setPixmap(4,QPixmap())
2817
            self.setPixmap(4,TQPixmap())
2806
        self.__updateIcon()
2818
        self.__updateIcon()
2807
2819
2808
    ########################################################################
2820
    ########################################################################
Lines 2882-2902 class MountConfigApp(programbase): Link Here
2882
        self.selectedentry = None
2894
        self.selectedentry = None
2883
        self.aboutus = TDEAboutApplication(self)
2895
        self.aboutus = TDEAboutApplication(self)
2884
        self.sizeviewdialogs = {}
2896
        self.sizeviewdialogs = {}
2885
        toplayout = QVBoxLayout(topwidget, 0, KDialog.spacingHint())
2897
        toplayout = TQVBoxLayout(topwidget, 0, KDialog.spacingHint())
2886
        #topwidget.setEnabled(isroot)
2898
        #topwidget.setEnabled(isroot)
2887
2899
2888
        hb = QHBox(topwidget)
2900
        hb = TQHBox(topwidget)
2889
        hb.setSpacing(KDialog.spacingHint())
2901
        hb.setSpacing(KDialog.spacingHint())
2890
        #if standalone:
2902
        #if standalone:
2891
        #    hb.setMargin(KDialog.marginHint())
2903
        #    hb.setMargin(KDialog.marginHint())
2892
2904
2893
        toplayout.addWidget(hb)
2905
        toplayout.addWidget(hb)
2894
2906
2895
        label = QLabel(hb)
2907
        label = TQLabel(hb)
2896
        label.setPixmap(UserIcon("kcmpartitions"))
2908
        label.setPixmap(UserIcon("kcmpartitions"))
2897
        hb.setStretchFactor(label,0)
2909
        hb.setStretchFactor(label,0)
2898
2910
2899
        label = QLabel(i18n("Available Disks and Filesystems:"),hb)
2911
        label = TQLabel(i18n("Available Disks and Filesystems:"),hb)
2900
        hb.setStretchFactor(label,1)
2912
        hb.setStretchFactor(label,1)
2901
2913
2902
        self.mountlist = TDEListView(topwidget,"Mount list")
2914
        self.mountlist = TDEListView(topwidget,"Mount list")
Lines 2907-2923 class MountConfigApp(programbase): Link Here
2907
        self.mountlist.addColumn(i18n("Device"))
2919
        self.mountlist.addColumn(i18n("Device"))
2908
        self.mountlist.addColumn(i18n("Enabled"))
2920
        self.mountlist.addColumn(i18n("Enabled"))
2909
        self.mountlist.setAllColumnsShowFocus(True)
2921
        self.mountlist.setAllColumnsShowFocus(True)
2910
        self.mountlist.setSelectionMode(QListView.Single)
2922
        self.mountlist.setSelectionMode(TQListView.Single)
2911
        self.mountlist.setRootIsDecorated(True)
2923
        self.mountlist.setRootIsDecorated(True)
2912
        self.mountlist.setSorting(-1)
2924
        self.mountlist.setSorting(-1)
2913
        self.connect(self.mountlist, SIGNAL("selectionChanged(QListViewItem *)"), self.slotListClicked)
2925
        self.connect(self.mountlist, SIGNAL("selectionChanged(TQListViewItem *)"), self.slotListClicked)
2914
        # Doubleclick in item opens modify dialogue.
2926
        # Doubleclick in item opens modify dialogue.
2915
        self.connect(self.mountlist, SIGNAL("doubleClicked(QListViewItem *)"), self.slotModifyClicked)
2927
        self.connect(self.mountlist, SIGNAL("doubleClicked(TQListViewItem *)"), self.slotModifyClicked)
2916
        # Rightclick: Open ContextMenu
2928
        # Rightclick: Open ContextMenu
2917
        self.connect(self.mountlist, SIGNAL("contextMenu(TDEListView*,QListViewItem*,const QPoint&)"),
2929
        self.connect(self.mountlist, SIGNAL("contextMenu(TDEListView*,TQListViewItem*,const TQPoint&)"),
2918
                    self.slotContextMenu)
2930
                    self.slotContextMenu)
2919
2931
2920
        hbox = QHBox(topwidget)
2932
        hbox = TQHBox(topwidget)
2921
        toplayout.addWidget(hbox)
2933
        toplayout.addWidget(hbox)
2922
        hbox.setSpacing(KDialog.spacingHint())
2934
        hbox.setSpacing(KDialog.spacingHint())
2923
2935
(-)a/mountconfig/sizeview.py (-75 / +75 lines)
Lines 22-38 def getLabel(blocks): Link Here
22
    return i18n("%1 Tb").arg(round(float(blocks)/1024.0,1))
22
    return i18n("%1 Tb").arg(round(float(blocks)/1024.0,1))
23
23
24
24
25
class SizeViewApplication(QApplication):
25
class SizeViewApplication(TQApplication):
26
    """ Boilerplate """
26
    """ Boilerplate """
27
    def __init__(self,devicename,devicepath,args=[]):
27
    def __init__(self,devicename,devicepath,args=[]):
28
        QApplication.__init__(self,args)
28
        TQApplication.__init__(self,args)
29
29
30
        self.maindialog = SizeView(None,devicename,devicepath)
30
        self.maindialog = SizeView(None,devicename,devicepath)
31
        self.setMainWidget(self.maindialog)
31
        self.setMainWidget(self.maindialog)
32
        self.maindialog.show()
32
        self.maindialog.show()
33
        self.exec_loop()     
33
        self.exec_loop()     
34
34
35
class SizeView(QDialog):
35
class SizeView(TQDialog):
36
    """ A SizeView represents a horizontal list of PartitionGroupWidgets.
36
    """ A SizeView represents a horizontal list of PartitionGroupWidgets.
37
        It supplies the code to read the sizes and the values that have 
37
        It supplies the code to read the sizes and the values that have 
38
        to be filled in, using the /proc filesystem and the program "df".
38
        to be filled in, using the /proc filesystem and the program "df".
Lines 50-56 class SizeView(QDialog): Link Here
50
50
51
    def __init__(self,parent,devicename,devicepath=None):
51
    def __init__(self,parent,devicename,devicepath=None):
52
        self.partitionwidgets = []
52
        self.partitionwidgets = []
53
        QDialog.__init__(self,None,None,0,0)
53
        TQDialog.__init__(self,None,None,0,0)
54
        self.dialogtitle = i18n("Diskspace & Partitions")
54
        self.dialogtitle = i18n("Diskspace & Partitions")
55
        self.setCaption(self.dialogtitle)
55
        self.setCaption(self.dialogtitle)
56
        self.devicename = devicename
56
        self.devicename = devicename
Lines 84-90 class SizeView(QDialog): Link Here
84
            pwidg.setMountPoint(mountpoint)
84
            pwidg.setMountPoint(mountpoint)
85
            pwidg.setUsed(used)
85
            pwidg.setUsed(used)
86
            pwidg.setAvailable(available)
86
            pwidg.setAvailable(available)
87
            pwidg.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding,QSizePolicy.MinimumExpanding,0,0,
87
            pwidg.setSizePolicy(TQSizePolicy(TQSizePolicy.MinimumExpanding,TQSizePolicy.MinimumExpanding,0,0,
88
                pwidg.sizePolicy().hasHeightForWidth()))
88
                pwidg.sizePolicy().hasHeightForWidth()))
89
            self.partitionwidgets.append(pwidg)
89
            self.partitionwidgets.append(pwidg)
90
            number += 1
90
            number += 1
Lines 103-115 class SizeView(QDialog): Link Here
103
103
104
        # Build main Gridlayout.
104
        # Build main Gridlayout.
105
        total_rows = rows+2
105
        total_rows = rows+2
106
        self.grid = QGridLayout(self,total_rows,2,5)
106
        self.grid = TQGridLayout(self,total_rows,2,5)
107
        #self.setSizeGripEnabled(1)
107
        #self.setSizeGripEnabled(1)
108
108
109
        self.buttonCancel = QPushButton(i18n("Close"),self,"buttonCancel")
109
        self.buttonCancel = TQPushButton(i18n("Close"),self,"buttonCancel")
110
        self.buttonCancel.setAutoDefault(1)
110
        self.buttonCancel.setAutoDefault(1)
111
        self.buttonCancel.setFixedWidth(80)
111
        self.buttonCancel.setFixedWidth(80)
112
        self.grid.addWidget(self.buttonCancel,total_rows-1,1,Qt.AlignRight)
112
        self.grid.addWidget(self.buttonCancel,total_rows-1,1,TQt.AlignRight)
113
113
114
        self.grid.setRowStretch(0,0)
114
        self.grid.setRowStretch(0,0)
115
        self.grid.setRowStretch(total_rows-1,0)
115
        self.grid.setRowStretch(total_rows-1,0)
Lines 118-127 class SizeView(QDialog): Link Here
118
        for row in range(1,total_rows-1):
118
        for row in range(1,total_rows-1):
119
            self.grid.setRowStretch(row,5)
119
            self.grid.setRowStretch(row,5)
120
120
121
        self.clearWState(Qt.WState_Polished)
121
        self.clearWState(TQt.WState_Polished)
122
        self.connect(self.buttonCancel,SIGNAL("clicked()"),self.hide)
122
        self.connect(self.buttonCancel,SIGNAL("clicked()"),self.hide)
123
123
124
        #self.mainlabel = QLabel("<font size=+2><b>"+self.dialogtitle+"</b></font>",self)
124
        #self.mainlabel = TQLabel("<font size=+2><b>"+self.dialogtitle+"</b></font>",self)
125
        #self.grid.addWidget(self.mainlabel,0,0)
125
        #self.grid.addWidget(self.mainlabel,0,0)
126
126
127
        self.diskgroup = DiskGroup(self,self.devicename,self.dev_path,self.partitions,self.totalsize,self.mountpoints)
127
        self.diskgroup = DiskGroup(self,self.devicename,self.dev_path,self.partitions,self.totalsize,self.mountpoints)
Lines 187-208 class SizeView(QDialog): Link Here
187
        for p in self.partitions:
187
        for p in self.partitions:
188
            print p, self.partitions[p], self.partitions[p]
188
            print p, self.partitions[p], self.partitions[p]
189
    """
189
    """
190
class DiskGroup(QGroupBox):
190
class DiskGroup(TQGroupBox):
191
    """ Shows an overview of the physical layout of the disks, with the different partitions on it. """
191
    """ Shows an overview of the physical layout of the disks, with the different partitions on it. """
192
192
193
    def __init__(self,parent,device,dev_path,partitions,totalsize,mountpoints):
193
    def __init__(self,parent,device,dev_path,partitions,totalsize,mountpoints):
194
194
195
        QGroupBox.__init__(self,parent,"DiskViewGroup")
195
        TQGroupBox.__init__(self,parent,"DiskViewGroup")
196
        self.setTitle(i18n("Disk %1%2").arg(dev_path).arg(device))
196
        self.setTitle(i18n("Disk %1%2").arg(dev_path).arg(device))
197
        self.mountpoints = mountpoints
197
        self.mountpoints = mountpoints
198
        self.partitions = partitions
198
        self.partitions = partitions
199
        self.totalsize = totalsize
199
        self.totalsize = totalsize
200
200
201
        self.setColumnLayout(0,Qt.Vertical)
201
        self.setColumnLayout(0,TQt.Vertical)
202
        self.layout().setSpacing(6)
202
        self.layout().setSpacing(6)
203
        self.layout().setMargin(11)
203
        self.layout().setMargin(11)
204
        DiskViewGroupLayout = QVBoxLayout(self.layout())
204
        DiskViewGroupLayout = TQVBoxLayout(self.layout())
205
        DiskViewGroupLayout.setAlignment(Qt.AlignTop)
205
        DiskViewGroupLayout.setAlignment(TQt.AlignTop)
206
        colors = ["dark orange","dodger blue","gold","green","firebrick","navy","darkorange","darkblue"]
206
        colors = ["dark orange","dodger blue","gold","green","firebrick","navy","darkorange","darkblue"]
207
207
208
        self.diskview = DiskView(self,self.percentages(),colors)
208
        self.diskview = DiskView(self,self.percentages(),colors)
Lines 221-227 class DiskGroup(QGroupBox): Link Here
221
221
222
        # We multiply the number of cols by 3, first for the colorlabel, second for the name, third for spacing.
222
        # We multiply the number of cols by 3, first for the colorlabel, second for the name, third for spacing.
223
        cols = cols*3
223
        cols = cols*3
224
        DiskViewPartitionListLayout = QGridLayout(DiskViewGroupLayout,rows,cols)
224
        DiskViewPartitionListLayout = TQGridLayout(DiskViewGroupLayout,rows,cols)
225
225
226
        i = cl = r = c = 0
226
        i = cl = r = c = 0
227
        ps = ls = {}
227
        ps = ls = {}
Lines 232-238 class DiskGroup(QGroupBox): Link Here
232
                lbl = self.mountpoints[dev]
232
                lbl = self.mountpoints[dev]
233
            except KeyError:
233
            except KeyError:
234
                lbl = "not mounted"
234
                lbl = "not mounted"
235
            ls[i] = QLabel(self,lbl+'<br /> ('+dev_path+dev+')',self)
235
            ls[i] = TQLabel(self,lbl+'<br /> ('+dev_path+dev+')',self)
236
            DiskViewPartitionListLayout.addWidget(ls[i],r,c+1)
236
            DiskViewPartitionListLayout.addWidget(ls[i],r,c+1)
237
            cl += 1
237
            cl += 1
238
            if cl == len(colors):
238
            if cl == len(colors):
Lines 256-262 class DiskGroup(QGroupBox): Link Here
256
        return self.perc
256
        return self.perc
257
257
258
258
259
class PartitionGroup(QGroupBox):
259
class PartitionGroup(TQGroupBox):
260
    """ Represents a groupbox with the filled bar and a couple of labels with
260
    """ Represents a groupbox with the filled bar and a couple of labels with
261
        information about the partition in it."""
261
        information about the partition in it."""
262
262
Lines 264-312 class PartitionGroup(QGroupBox): Link Here
264
    title = str(i18n("Partition"))
264
    title = str(i18n("Partition"))
265
265
266
    def __init__(self,device,parent,fill_percent,number,part_types,dev_path):
266
    def __init__(self,device,parent,fill_percent,number,part_types,dev_path):
267
        QGroupBox.__init__(self,parent)
267
        TQGroupBox.__init__(self,parent)
268
        self.part_types = part_types
268
        self.part_types = part_types
269
        self.dev_path = dev_path
269
        self.dev_path = dev_path
270
        self.setGeometry(QRect(110,100,370,203))
270
        self.setGeometry(TQRect(110,100,370,203))
271
        self.setColumnLayout(0,Qt.Vertical)
271
        self.setColumnLayout(0,TQt.Vertical)
272
        self.layout().setSpacing(3)
272
        self.layout().setSpacing(3)
273
        self.layout().setMargin(5)
273
        self.layout().setMargin(5)
274
        self.setMinimumSize(280,120)
274
        self.setMinimumSize(280,120)
275
275
276
        partitiongroup_layout = QGridLayout(self.layout())
276
        partitiongroup_layout = TQGridLayout(self.layout())
277
        partitiongroup_layout.setAlignment(Qt.AlignTop)
277
        partitiongroup_layout.setAlignment(TQt.AlignTop)
278
        self.available = QLabel(i18n("available"),self)
278
        self.available = TQLabel(i18n("available"),self)
279
        partitiongroup_layout.addWidget(self.available,3,4)
279
        partitiongroup_layout.addWidget(self.available,3,4)
280
280
281
        self.device = QLabel(i18n("device"),self)
281
        self.device = TQLabel(i18n("device"),self)
282
        partitiongroup_layout.addMultiCellWidget(self.device,1,1,3,4)
282
        partitiongroup_layout.addMultiCellWidget(self.device,1,1,3,4)
283
283
284
        self.partpixmap = PartitionView(self,fill_percent,self.part_types,device)
284
        self.partpixmap = PartitionView(self,fill_percent,self.part_types,device)
285
        self.partpixmap.setScaledContents(1)
285
        self.partpixmap.setScaledContents(1)
286
286
287
        partitiongroup_layout.addMultiCellWidget(self.partpixmap,0,0,0,4)
287
        partitiongroup_layout.addMultiCellWidget(self.partpixmap,0,0,0,4)
288
        self.textLabel1_3 = QLabel("textLabel1_3",self)
288
        self.textLabel1_3 = TQLabel("textLabel1_3",self)
289
        partitiongroup_layout.addWidget(self.textLabel1_3,3,0)
289
        partitiongroup_layout.addWidget(self.textLabel1_3,3,0)
290
        self.totalsize = QLabel("totalsize",self)
290
        self.totalsize = TQLabel("totalsize",self)
291
        partitiongroup_layout.addWidget(self.totalsize,2,1)
291
        partitiongroup_layout.addWidget(self.totalsize,2,1)
292
        self.textLabel1_2 = QLabel(self,"textLabel1_2")
292
        self.textLabel1_2 = TQLabel(self,"textLabel1_2")
293
        partitiongroup_layout.addWidget(self.textLabel1_2,2,0)
293
        partitiongroup_layout.addWidget(self.textLabel1_2,2,0)
294
        self.textLabel1 = QLabel(self,"textLabel1")
294
        self.textLabel1 = TQLabel(self,"textLabel1")
295
        partitiongroup_layout.addWidget(self.textLabel1,1,0)
295
        partitiongroup_layout.addWidget(self.textLabel1,1,0)
296
        self.textLabel3_2 = QLabel(self,"textLabel3_2")
296
        self.textLabel3_2 = TQLabel(self,"textLabel3_2")
297
        partitiongroup_layout.addMultiCellWidget(self.textLabel3_2,2,2,2,3)
297
        partitiongroup_layout.addMultiCellWidget(self.textLabel3_2,2,2,2,3)
298
        self.percentfilled = QLabel(self,"percentfree")
298
        self.percentfilled = TQLabel(self,"percentfree")
299
        partitiongroup_layout.addWidget(self.percentfilled,2,4)
299
        partitiongroup_layout.addWidget(self.percentfilled,2,4)
300
        self.textLabel3_3 = QLabel(self,"textLabel3_3")
300
        self.textLabel3_3 = TQLabel(self,"textLabel3_3")
301
        partitiongroup_layout.addWidget(self.textLabel3_3,3,2)
301
        partitiongroup_layout.addWidget(self.textLabel3_3,3,2)
302
        self.textLabel3 = QLabel(self,"textLabel3")
302
        self.textLabel3 = TQLabel(self,"textLabel3")
303
        partitiongroup_layout.addWidget(self.textLabel3,1,2)
303
        partitiongroup_layout.addWidget(self.textLabel3,1,2)
304
        self.used = QLabel(self,"used")
304
        self.used = TQLabel(self,"used")
305
        partitiongroup_layout.addWidget(self.used,3,1)
305
        partitiongroup_layout.addWidget(self.used,3,1)
306
        self.mountpoint = QLabel(self,"mountpoint")
306
        self.mountpoint = TQLabel(self,"mountpoint")
307
        self.mountpoint.setMinimumSize(QSize(60,0))
307
        self.mountpoint.setMinimumSize(TQSize(60,0))
308
        partitiongroup_layout.addWidget(self.mountpoint,1,1)
308
        partitiongroup_layout.addWidget(self.mountpoint,1,1)
309
        self.clearWState(Qt.WState_Polished)
309
        self.clearWState(TQt.WState_Polished)
310
310
311
        self.setTitle(i18n("%1. Partition").arg(number))
311
        self.setTitle(i18n("%1. Partition").arg(number))
312
        self.textLabel1_3.setText(i18n("Used:"))
312
        self.textLabel1_3.setText(i18n("Used:"))
Lines 345-377 class PartitionGroup(QGroupBox): Link Here
345
    def setAvailable(self,available):
345
    def setAvailable(self,available):
346
        self.available.setText(getLabel(available))
346
        self.available.setText(getLabel(available))
347
347
348
class LegendLabel(QLabel):
348
class LegendLabel(TQLabel):
349
    """ Show some color in the DiskView legend """
349
    """ Show some color in the DiskView legend """
350
350
351
    def __init__(self,parent,color="green",style=QBrush.SolidPattern):
351
    def __init__(self,parent,color="green",style=TQBrush.SolidPattern):
352
        QLabel.__init__(self,parent,"bla")
352
        TQLabel.__init__(self,parent,"bla")
353
        self.w = 40
353
        self.w = 40
354
        self.h = 20
354
        self.h = 20
355
        self.pmsize = QSize(self.w,self.h)
355
        self.pmsize = TQSize(self.w,self.h)
356
        self.pm = QPixmap(self.pmsize)
356
        self.pm = TQPixmap(self.pmsize)
357
        self.linewidth = 2
357
        self.linewidth = 2
358
        self.color = QColor(color)
358
        self.color = TQColor(color)
359
        self.style = style
359
        self.style = style
360
        self.framecolor = QColor("black")
360
        self.framecolor = TQColor("black")
361
        self.paintMe()
361
        self.paintMe()
362
        self.setPixmap(self.pm)
362
        self.setPixmap(self.pm)
363
        self.setScaledContents(1)
363
        self.setScaledContents(1)
364
        self.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed,0,0,
364
        self.setSizePolicy(TQSizePolicy(TQSizePolicy.Fixed,TQSizePolicy.Fixed,0,0,
365
            self.sizePolicy().hasHeightForWidth()))
365
            self.sizePolicy().hasHeightForWidth()))
366
366
367
    def paintMe(self):
367
    def paintMe(self):
368
        p = QPainter(self.pm)
368
        p = TQPainter(self.pm)
369
        p.fillRect(0,0,self.w,self.h,QBrush(self.color,self.style))
369
        p.fillRect(0,0,self.w,self.h,TQBrush(self.color,self.style))
370
        p.setPen(QPen(QColor("black"),self.linewidth))
370
        p.setPen(TQPen(TQColor("black"),self.linewidth))
371
        p.drawRect(self.linewidth/2,self.linewidth/2,self.w-self.linewidth/2,self.h-self.linewidth/2)
371
        p.drawRect(self.linewidth/2,self.linewidth/2,self.w-self.linewidth/2,self.h-self.linewidth/2)
372
        p.end()
372
        p.end()
373
373
374
class PartitionView(QLabel):
374
class PartitionView(TQLabel):
375
    """ PartitionView is a label carryig a pixmap. This class's main purpose is handlig layout
375
    """ PartitionView is a label carryig a pixmap. This class's main purpose is handlig layout
376
        of the underlying pixmap."""
376
        of the underlying pixmap."""
377
    w = 250
377
    w = 250
Lines 379-391 class PartitionView(QLabel): Link Here
379
    def __init__(self,parent,fill_percent,part_types,device):
379
    def __init__(self,parent,fill_percent,part_types,device):
380
        self.part_types = part_types
380
        self.part_types = part_types
381
        self.fill_percent = fill_percent
381
        self.fill_percent = fill_percent
382
        QLabel.__init__(self,parent,"pview")
382
        TQLabel.__init__(self,parent,"pview")
383
        self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding,0,0,
383
        self.setSizePolicy(TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding,0,0,
384
            self.sizePolicy().hasHeightForWidth()))
384
            self.sizePolicy().hasHeightForWidth()))
385
        self.setMinimumSize(QSize(self.w,self.h))        
385
        self.setMinimumSize(TQSize(self.w,self.h))        
386
        self.setPixmap(PartitionPixmap(QSize(self.w,self.h),self.fill_percent,self.part_types,device))
386
        self.setPixmap(PartitionPixmap(TQSize(self.w,self.h),self.fill_percent,self.part_types,device))
387
        self.setScaledContents(1)
387
        self.setScaledContents(1)
388
        self.setAlignment(QLabel.AlignCenter)
388
        self.setAlignment(TQLabel.AlignCenter)
389
389
390
class DiskView(PartitionView):
390
class DiskView(PartitionView):
391
    """ PartitionView is a label carryig a pixmap. This class's main purpose is handlig layout
391
    """ PartitionView is a label carryig a pixmap. This class's main purpose is handlig layout
Lines 396-410 class DiskView(PartitionView): Link Here
396
    linewidth = 2
396
    linewidth = 2
397
397
398
    def __init__(self,parent,percents,colors):
398
    def __init__(self,parent,percents,colors):
399
        QLabel.__init__(self,parent)
399
        TQLabel.__init__(self,parent)
400
400
401
        self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding,0,0,
401
        self.setSizePolicy(TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding,0,0,
402
            self.sizePolicy().hasHeightForWidth()))
402
            self.sizePolicy().hasHeightForWidth()))
403
        self.setPixmap(DiskPixmap(percents,colors,(self.w,self.h)))
403
        self.setPixmap(DiskPixmap(percents,colors,(self.w,self.h)))
404
        self.setScaledContents(1)
404
        self.setScaledContents(1)
405
        self.setAlignment(QLabel.AlignCenter)
405
        self.setAlignment(TQLabel.AlignCenter)
406
406
407
class DiskPixmap(QPixmap):
407
class DiskPixmap(TQPixmap):
408
408
409
    linewidth = 2 # Width of surrounding frame
409
    linewidth = 2 # Width of surrounding frame
410
410
Lines 412-429 class DiskPixmap(QPixmap): Link Here
412
        self.percents = percents
412
        self.percents = percents
413
        self.w,self.h = w,h
413
        self.w,self.h = w,h
414
        self.colors = colors
414
        self.colors = colors
415
        QPixmap.__init__(self,w,h)
415
        TQPixmap.__init__(self,w,h)
416
        self.paintMe()
416
        self.paintMe()
417
417
418
    def paintMe(self):
418
    def paintMe(self):
419
        p = QPainter(self)
419
        p = TQPainter(self)
420
        w,h = self.w,self.h
420
        w,h = self.w,self.h
421
        i = 0
421
        i = 0
422
        x0 = 0
422
        x0 = 0
423
        y = 0
423
        y = 0
424
424
425
        # Paint background, this is interesting for empty partitions.
425
        # Paint background, this is interesting for empty partitions.
426
        p.fillRect(0,0,w,h,QBrush(QColor("white")))
426
        p.fillRect(0,0,w,h,TQBrush(TQColor("white")))
427
427
428
        parts = self.percents.keys()
428
        parts = self.percents.keys()
429
        parts.sort()
429
        parts.sort()
Lines 433-455 class DiskPixmap(QPixmap): Link Here
433
            # We need to adjust a little to avoid to get wholes.
433
            # We need to adjust a little to avoid to get wholes.
434
            if x0>0: xa = 2
434
            if x0>0: xa = 2
435
            if W < self.w: wa = 2
435
            if W < self.w: wa = 2
436
            p.fillRect(x0-xa,0,W+wa,h,QBrush(QColor(self.colors[i])))
436
            p.fillRect(x0-xa,0,W+wa,h,TQBrush(TQColor(self.colors[i])))
437
            i += 1
437
            i += 1
438
            x0 += W
438
            x0 += W
439
439
440
        # Paint Frame around it.
440
        # Paint Frame around it.
441
        p.setPen(QPen(QColor("black"),self.linewidth))
441
        p.setPen(TQPen(TQColor("black"),self.linewidth))
442
        p.drawRect(self.linewidth/2,self.linewidth/2,self.width()-self.linewidth/2,self.height()-self.linewidth/2)
442
        p.drawRect(self.linewidth/2,self.linewidth/2,self.width()-self.linewidth/2,self.height()-self.linewidth/2)
443
        p.end()
443
        p.end()
444
444
445
445
446
class PartitionPixmap(QPixmap):
446
class PartitionPixmap(TQPixmap):
447
    """ A PartitionPixmap is a two colored bar with a black frame. The first color represents the 
447
    """ A PartitionPixmap is a two colored bar with a black frame. The first color represents the 
448
        percentage that's used, the second one the free percentage."""
448
        percentage that's used, the second one the free percentage."""
449
    linewidth = 2 # Width of surrounding frame
449
    linewidth = 2 # Width of surrounding frame
450
450
451
    def __init__(self,pmsize,fill_percent,part_types,device):
451
    def __init__(self,pmsize,fill_percent,part_types,device):
452
        QPixmap.__init__(self,pmsize)
452
        TQPixmap.__init__(self,pmsize)
453
453
454
        self.pmsize = pmsize # Size of the pixmap
454
        self.pmsize = pmsize # Size of the pixmap
455
        self.part_types = part_types # Array to look up the type of the partition
455
        self.part_types = part_types # Array to look up the type of the partition
Lines 461-481 class PartitionPixmap(QPixmap): Link Here
461
        self.paintMe()
461
        self.paintMe()
462
462
463
    def paintMe(self):
463
    def paintMe(self):
464
        p = QPainter(self)
464
        p = TQPainter(self)
465
        try:
465
        try:
466
            fill_percent = int(self.fill_percent)
466
            fill_percent = int(self.fill_percent)
467
            if self.part_types[self.device] == "swap":
467
            if self.part_types[self.device] == "swap":
468
                # Swap partitions get blueish colors.
468
                # Swap partitions get blueish colors.
469
                color_used = QColor("blue")
469
                color_used = TQColor("blue")
470
                color_free = QColor("lightblue")
470
                color_free = TQColor("lightblue")
471
            else:
471
            else:
472
                # Regular partitions get a red / green color combo.
472
                # Regular partitions get a red / green color combo.
473
                color_used = QColor("red")
473
                color_used = TQColor("red")
474
                color_free = QColor("forest green")
474
                color_free = TQColor("forest green")
475
        except (KeyError,TypeError):
475
        except (KeyError,TypeError):
476
            # Partition has no fillsize, might be empty or not mounted partition
476
            # Partition has no fillsize, might be empty or not mounted partition
477
            p.fillRect(0,0,self.w,self.h,QBrush(QColor("darkgrey")))
477
            p.fillRect(0,0,self.w,self.h,TQBrush(TQColor("darkgrey")))
478
            p.setPen(QPen(QColor("black"),self.linewidth))
478
            p.setPen(TQPen(TQColor("black"),self.linewidth))
479
            p.drawRect(self.linewidth/2,self.linewidth/2,self.w-self.linewidth/2,self.h-self.linewidth/2)
479
            p.drawRect(self.linewidth/2,self.linewidth/2,self.w-self.linewidth/2,self.h-self.linewidth/2)
480
            p.end()
480
            p.end()
481
            return
481
            return
Lines 486-500 class PartitionPixmap(QPixmap): Link Here
486
        x = y = 0
486
        x = y = 0
487
        w = W - (W*(1-(fill_percent/100.00)))
487
        w = W - (W*(1-(fill_percent/100.00)))
488
        h = H
488
        h = H
489
        p.fillRect(x,y,w,h,QBrush(color_used))
489
        p.fillRect(x,y,w,h,TQBrush(color_used))
490
490
491
        # Paint green part == space left
491
        # Paint green part == space left
492
        x = w
492
        x = w
493
        w = W - w
493
        w = W - w
494
        p.fillRect(x,y,w,h,QBrush(color_free))
494
        p.fillRect(x,y,w,h,TQBrush(color_free))
495
495
496
        # Paint Frame around it.
496
        # Paint Frame around it.
497
        p.setPen(QPen(QColor("black"),self.linewidth))
497
        p.setPen(TQPen(TQColor("black"),self.linewidth))
498
        p.drawRect(self.linewidth/2,self.linewidth/2,W-self.linewidth/2,H-self.linewidth/2)
498
        p.drawRect(self.linewidth/2,self.linewidth/2,W-self.linewidth/2,H-self.linewidth/2)
499
499
500
        p.end()
500
        p.end()

Return to bug 1995