Modules |
Files |
Inheritance Tree |
Inheritance Graph |
Name Index |
Config
File: Synopsis/UI/Qt/sourceinsertwizard.py
1| # Form implementation generated from reading ui file 'sourceinsertwizard.ui'
2| #
3| # Created: Tue Nov 12 00:23:21 2002
4| # by: The PyQt User Interface Compiler (pyuic)
5| #
6| # WARNING! All changes made in this file will be lost!
7|
8|
9| from qt import *
10|
11|
12| class SourceInsertWizard(QWizard):
13| def __init__(self,parent = None,name = None,modal = 0,fl = 0):
14| QWizard.__init__(self,parent,name,modal,fl)
15|
16| if name == None:
17| self.setName("SourceInsertWizard")
18|
19| self.resize(600,480)
20| self.setCaption(self.trUtf8("Source Action - Insert Rule Wizard"))
21| f = QFont(self.font())
22| f.setPointSize(20)
23| self.setTitleFont(f)
24|
25|
26| self.page = QWidget(self,"page")
27| pageLayout = QVBoxLayout(self.page,11,6,"pageLayout")
28|
29| self.TextLabel9 = QLabel(self.page,"TextLabel9")
30| self.TextLabel9.setText(self.trUtf8("Select the direction for this rule.\n"
31| "\n"
32| "By making a rule 'Exclude', you can ignore certain files that you don't want documented. For example, you might want a glob expression to ignore the CVS directories."))
33| self.TextLabel9.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
34| pageLayout.addWidget(self.TextLabel9)
35|
36| self.ButtonGroup2 = QButtonGroup(self.page,"ButtonGroup2")
37| self.ButtonGroup2.setTitle(self.trUtf8("Rule direction"))
38| self.ButtonGroup2.setColumnLayout(0,Qt.Vertical)
39| self.ButtonGroup2.layout().setSpacing(6)
40| self.ButtonGroup2.layout().setMargin(11)
41| ButtonGroup2Layout = QVBoxLayout(self.ButtonGroup2.layout())
42| ButtonGroup2Layout.setAlignment(Qt.AlignTop)
43|
44| self.IncludeRadio = QRadioButton(self.ButtonGroup2,"IncludeRadio")
45| self.IncludeRadio.setText(self.trUtf8("Include these files"))
46| self.IncludeRadio.setChecked(1)
47| ButtonGroup2Layout.addWidget(self.IncludeRadio)
48|
49| self.ExcludeRadio = QRadioButton(self.ButtonGroup2,"ExcludeRadio")
50| self.ExcludeRadio.setText(self.trUtf8("Exclude these files"))
51| ButtonGroup2Layout.addWidget(self.ExcludeRadio)
52| pageLayout.addWidget(self.ButtonGroup2)
53| spacer = QSpacerItem(0,158,QSizePolicy.Minimum,QSizePolicy.Expanding)
54| pageLayout.addItem(spacer)
55| self.addPage(self.page,self.trUtf8("Select Rule Direction"))
56|
57| self.select_type = QWidget(self,"select_type")
58| select_typeLayout = QVBoxLayout(self.select_type,11,6,"select_typeLayout")
59|
60| self.TextLabel3 = QLabel(self.select_type,"TextLabel3")
61| self.TextLabel3.setText(self.trUtf8("Select the type of source file rule you want to insert:"))
62| select_typeLayout.addWidget(self.TextLabel3)
63|
64| self.ButtonGroup1 = QButtonGroup(self.select_type,"ButtonGroup1")
65| self.ButtonGroup1.setTitle(self.trUtf8("Rule Type"))
66| self.ButtonGroup1.setColumnLayout(0,Qt.Vertical)
67| self.ButtonGroup1.layout().setSpacing(6)
68| self.ButtonGroup1.layout().setMargin(11)
69| ButtonGroup1Layout = QVBoxLayout(self.ButtonGroup1.layout())
70| ButtonGroup1Layout.setAlignment(Qt.AlignTop)
71|
72| self.SimpleRadio = QRadioButton(self.ButtonGroup1,"SimpleRadio")
73| self.SimpleRadio.setText(self.trUtf8("Simple"))
74| self.SimpleRadio.setChecked(1)
75| ButtonGroup1Layout.addWidget(self.SimpleRadio)
76|
77| self.TextLabel4 = QLabel(self.ButtonGroup1,"TextLabel4")
78| self.TextLabel4.setText(self.trUtf8("A rule that selects a simple list of filenames"))
79| self.TextLabel4.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
80| self.TextLabel4.setIndent(22)
81| ButtonGroup1Layout.addWidget(self.TextLabel4)
82|
83| self.DirRadio = QRadioButton(self.ButtonGroup1,"DirRadio")
84| self.DirRadio.setText(self.trUtf8("Directory and Glob expression"))
85| ButtonGroup1Layout.addWidget(self.DirRadio)
86|
87| self.TextLabel5 = QLabel(self.ButtonGroup1,"TextLabel5")
88| self.TextLabel5.setText(self.trUtf8("A rule that specifies one or more directories and a glob expression to use for selecting files. The glob expression (eg: *.hpp) can also select multiple types (eg: \"*.hpp\", \"*.cpp\")"))
89| self.TextLabel5.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
90| self.TextLabel5.setIndent(22)
91| ButtonGroup1Layout.addWidget(self.TextLabel5)
92|
93| self.BaseRadio = QRadioButton(self.ButtonGroup1,"BaseRadio")
94| self.BaseRadio.setText(self.trUtf8("Recursive Directory and Glob expression"))
95| ButtonGroup1Layout.addWidget(self.BaseRadio)
96|
97| self.TextLabel5_2 = QLabel(self.ButtonGroup1,"TextLabel5_2")
98| self.TextLabel5_2.setText(self.trUtf8("A rule that specifies one or more directories and a glob expression to use for selecting files, but will also recurse into sub-directories to find matching files"))
99| self.TextLabel5_2.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
100| self.TextLabel5_2.setIndent(22)
101| ButtonGroup1Layout.addWidget(self.TextLabel5_2)
102| select_typeLayout.addWidget(self.ButtonGroup1)
103| spacer_2 = QSpacerItem(0,33,QSizePolicy.Minimum,QSizePolicy.Expanding)
104| select_typeLayout.addItem(spacer_2)
105|
106| self.TextLabel6 = QLabel(self.select_type,"TextLabel6")
107| self.TextLabel6.setText(self.trUtf8("Note that in all cases, the directories can be made relative to the current directory, rather than specifying absolute paths."))
108| self.TextLabel6.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
109| select_typeLayout.addWidget(self.TextLabel6)
110| self.addPage(self.select_type,self.trUtf8("Select Rule Type"))
111|
112| self.simple = QWidget(self,"simple")
113| simpleLayout = QVBoxLayout(self.simple,11,6,"simpleLayout")
114|
115| self.TextLabel7 = QLabel(self.simple,"TextLabel7")
116| self.TextLabel7.setText(self.trUtf8("Select the files you want to include in this rule:"))
117| simpleLayout.addWidget(self.TextLabel7)
118|
119| self.GroupBox3 = QGroupBox(self.simple,"GroupBox3")
120| self.GroupBox3.setTitle(self.trUtf8("Files"))
121| self.GroupBox3.setColumnLayout(0,Qt.Vertical)
122| self.GroupBox3.layout().setSpacing(6)
123| self.GroupBox3.layout().setMargin(11)
124| GroupBox3Layout = QVBoxLayout(self.GroupBox3.layout())
125| GroupBox3Layout.setAlignment(Qt.AlignTop)
126|
127| self.FileList = QListView(self.GroupBox3,"FileList")
128| self.FileList.addColumn(self.trUtf8("Filename"))
129| self.FileList.setSelectionMode(QListView.Extended)
130| GroupBox3Layout.addWidget(self.FileList)
131|
132| Layout4 = QHBoxLayout(None,0,6,"Layout4")
133|
134| self.AddFilesButton = QPushButton(self.GroupBox3,"AddFilesButton")
135| self.AddFilesButton.setText(self.trUtf8("Add files"))
136| Layout4.addWidget(self.AddFilesButton)
137| spacer_3 = QSpacerItem(131,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
138| Layout4.addItem(spacer_3)
139|
140| self.RemoveFileButton = QPushButton(self.GroupBox3,"RemoveFileButton")
141| self.RemoveFileButton.setEnabled(0)
142| self.RemoveFileButton.setText(self.trUtf8("Remove from list"))
143| Layout4.addWidget(self.RemoveFileButton)
144| GroupBox3Layout.addLayout(Layout4)
145| simpleLayout.addWidget(self.GroupBox3)
146| self.addPage(self.simple,self.trUtf8("Select Files"))
147|
148| self.page_2 = QWidget(self,"page_2")
149| pageLayout_2 = QVBoxLayout(self.page_2,11,6,"pageLayout_2")
150|
151| self.TextLabel7_2 = QLabel(self.page_2,"TextLabel7_2")
152| self.TextLabel7_2.setText(self.trUtf8("Select the directories you want to include in this rule:"))
153| pageLayout_2.addWidget(self.TextLabel7_2)
154|
155| self.GroupBox3_2 = QGroupBox(self.page_2,"GroupBox3_2")
156| self.GroupBox3_2.setTitle(self.trUtf8("Directories"))
157| self.GroupBox3_2.setColumnLayout(0,Qt.Vertical)
158| self.GroupBox3_2.layout().setSpacing(6)
159| self.GroupBox3_2.layout().setMargin(11)
160| GroupBox3_2Layout = QVBoxLayout(self.GroupBox3_2.layout())
161| GroupBox3_2Layout.setAlignment(Qt.AlignTop)
162|
163| self.DirList = QListView(self.GroupBox3_2,"DirList")
164| self.DirList.addColumn(self.trUtf8("Path"))
165| self.DirList.setSelectionMode(QListView.Extended)
166| GroupBox3_2Layout.addWidget(self.DirList)
167|
168| Layout7 = QHBoxLayout(None,0,6,"Layout7")
169|
170| self.AddDirectoryButton = QPushButton(self.GroupBox3_2,"AddDirectoryButton")
171| self.AddDirectoryButton.setText(self.trUtf8("Add directory"))
172| Layout7.addWidget(self.AddDirectoryButton)
173| spacer_4 = QSpacerItem(121,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
174| Layout7.addItem(spacer_4)
175|
176| self.RemoveDirectoryButton = QPushButton(self.GroupBox3_2,"RemoveDirectoryButton")
177| self.RemoveDirectoryButton.setEnabled(0)
178| self.RemoveDirectoryButton.setText(self.trUtf8("Remove directory"))
179| Layout7.addWidget(self.RemoveDirectoryButton)
180| GroupBox3_2Layout.addLayout(Layout7)
181| pageLayout_2.addWidget(self.GroupBox3_2)
182| self.addPage(self.page_2,self.trUtf8("Select Directories"))
183|
184| self.page_3 = QWidget(self,"page_3")
185| pageLayout_3 = QVBoxLayout(self.page_3,11,6,"pageLayout_3")
186|
187| self.TextLabel11 = QLabel(self.page_3,"TextLabel11")
188| self.TextLabel11.setText(self.trUtf8("Enter the glob expression for selecting files. You can enter multiple expressions by using a comma. Extra whitespace is removed. To use a real space or comma in the filename, quote it with a \"\\\" character, eg:\n"
189| "\n"
190| "*.cc - select all files ending in .cc\n"
191| "*.c, *.h - select all files ending in .c or .h\n"
192| "temp?.hpp - the ? matches one character, eg: temp1.hpp and temp2.hpp but not tempAll.hpp\n"
193| "*\\ * - Any file with a space in it\n"
194| "* - All files"))
195| self.TextLabel11.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
196| pageLayout_3.addWidget(self.TextLabel11)
197|
198| self.TextLabel12 = QLabel(self.page_3,"TextLabel12")
199| self.TextLabel12.setText(self.trUtf8("Glob Expression:"))
200| pageLayout_3.addWidget(self.TextLabel12)
201|
202| self.FileGlobEdit = QLineEdit(self.page_3,"FileGlobEdit")
203| self.FileGlobEdit.setText(self.trUtf8("*"))
204| pageLayout_3.addWidget(self.FileGlobEdit)
205| spacer_5 = QSpacerItem(0,50,QSizePolicy.Minimum,QSizePolicy.Expanding)
206| pageLayout_3.addItem(spacer_5)
207| self.addPage(self.page_3,self.trUtf8("Select File Glob Expression"))
208|
209| self.page_4 = QWidget(self,"page_4")
210| pageLayout_4 = QVBoxLayout(self.page_4,11,6,"pageLayout_4")
211|
212| self.TextLabel13 = QLabel(self.page_4,"TextLabel13")
213| self.TextLabel13.setText(self.trUtf8("Each filename matched by previous rules will be compared to this Glob expression. If it matches then the file will be removed from the list of files for this Source Action.\n"
214| "\n"
215| "Note that the expression is compared to the whole filename, but a / is always prefixed to simplify the matching of directory names.\n"
216| "\n"
217| "Eg: */CVS/* matches all CVS directories\n"
218| "Eg: */.* matches all hidden files (those that start with a . are hidden by convention in Unix).\n"
219| "Eg: /Subdir/OldFile.hpp matches one file in the given project sub-directory\n"
220| "Eg: */stdafx.h matches the file stdafx.h in any directory"))
221| self.TextLabel13.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
222| pageLayout_4.addWidget(self.TextLabel13)
223|
224| self.TextLabel14 = QLabel(self.page_4,"TextLabel14")
225| self.TextLabel14.setText(self.trUtf8("Enter Glob Expression or select from list:"))
226| pageLayout_4.addWidget(self.TextLabel14)
227|
228| self.ExcludeCombo = QComboBox(0,self.page_4,"ExcludeCombo")
229| self.ExcludeCombo.insertItem(self.trUtf8("<type here or click arrow for a list>"))
230| self.ExcludeCombo.insertItem(self.trUtf8("*/CVS/*"))
231| self.ExcludeCombo.insertItem(self.trUtf8("*/.*"))
232| self.ExcludeCombo.insertItem(self.trUtf8("*/stdafx.*"))
233| self.ExcludeCombo.setEditable(1)
234| self.ExcludeCombo.setInsertionPolicy(QComboBox.AtTop)
235| pageLayout_4.addWidget(self.ExcludeCombo)
236| spacer_6 = QSpacerItem(0,41,QSizePolicy.Minimum,QSizePolicy.Expanding)
237| pageLayout_4.addItem(spacer_6)
238| self.addPage(self.page_4,self.trUtf8("Select Exclude Expression"))
239|
240| self.page_5 = QWidget(self,"page_5")
241| pageLayout_5 = QVBoxLayout(self.page_5,11,6,"pageLayout_5")
242|
243| self.TextLabel1 = QLabel(self.page_5,"TextLabel1")
244| self.TextLabel1.setText(self.trUtf8("Using absolute pathnames is generally not a good idea, since it limits the ability to distribute the config file with your software.\n"
245| "\n"
246| "You can make any directories you have specified relative to either the current directory, or a specified directory."))
247| self.TextLabel1.setAlignment(QLabel.WordBreak | QLabel.AlignVCenter)
248| pageLayout_5.addWidget(self.TextLabel1)
249|
250| self.ButtonGroup3 = QButtonGroup(self.page_5,"ButtonGroup3")
251| self.ButtonGroup3.setTitle(self.trUtf8("Select relative option"))
252| self.ButtonGroup3.setColumnLayout(0,Qt.Vertical)
253| self.ButtonGroup3.layout().setSpacing(6)
254| self.ButtonGroup3.layout().setMargin(11)
255| ButtonGroup3Layout = QVBoxLayout(self.ButtonGroup3.layout())
256| ButtonGroup3Layout.setAlignment(Qt.AlignTop)
257|
258| self.RelativeNoneRadio = QRadioButton(self.ButtonGroup3,"RelativeNoneRadio")
259| self.RelativeNoneRadio.setText(self.trUtf8("Don't change my directories"))
260| self.RelativeNoneRadio.setChecked(1)
261| ButtonGroup3Layout.addWidget(self.RelativeNoneRadio)
262|
263| self.RelativeCurrentRadio = QRadioButton(self.ButtonGroup3,"RelativeCurrentRadio")
264| self.RelativeCurrentRadio.setText(self.trUtf8("Make directories relative to current directory"))
265| ButtonGroup3Layout.addWidget(self.RelativeCurrentRadio)
266|
267| self.CurrentDirectoryLabel = QLabel(self.ButtonGroup3,"CurrentDirectoryLabel")
268| self.CurrentDirectoryLabel.setEnabled(0)
269| self.CurrentDirectoryLabel.setText(self.trUtf8("Current Directory: foo"))
270| self.CurrentDirectoryLabel.setIndent(20)
271| ButtonGroup3Layout.addWidget(self.CurrentDirectoryLabel)
272|
273| self.RelativeThisRadio = QRadioButton(self.ButtonGroup3,"RelativeThisRadio")
274| self.RelativeThisRadio.setText(self.trUtf8("Make directories relative to this directory:"))
275| ButtonGroup3Layout.addWidget(self.RelativeThisRadio)
276|
277| Layout6 = QHBoxLayout(None,0,6,"Layout6")
278|
279| self.RelativeThisEdit = QLineEdit(self.ButtonGroup3,"RelativeThisEdit")
280| self.RelativeThisEdit.setEnabled(0)
281| self.RelativeThisEdit.setSizePolicy(QSizePolicy(7,0,0,1,self.RelativeThisEdit.sizePolicy().hasHeightForWidth()))
282| self.RelativeThisEdit.setText(self.trUtf8("Click the ... button to select a directory"))
283| Layout6.addWidget(self.RelativeThisEdit)
284|
285| self.RelativeThisButton = QPushButton(self.ButtonGroup3,"RelativeThisButton")
286| self.RelativeThisButton.setEnabled(0)
287| self.RelativeThisButton.setMaximumSize(QSize(32,32767))
288| self.RelativeThisButton.setText(self.trUtf8("..."))
289| Layout6.addWidget(self.RelativeThisButton)
290| ButtonGroup3Layout.addLayout(Layout6)
291| pageLayout_5.addWidget(self.ButtonGroup3)
292| self.addPage(self.page_5,self.trUtf8("Make directories relative"))
293|
294| self.page_6 = QWidget(self,"page_6")
295| pageLayout_6 = QVBoxLayout(self.page_6,11,6,"pageLayout_6")
296|
297| self.TextLabel8 = QLabel(self.page_6,"TextLabel8")
298| self.TextLabel8.setText(self.trUtf8("That's it!\n"
299| "\n"
300| "Your new Source Rule is now complete.\n"
301| "\n"
302| "Click Finish to accept this new rule, or go Back to make changes."))
303| pageLayout_6.addWidget(self.TextLabel8)
304|
305| self.RuleInfo = QTextEdit(self.page_6,"RuleInfo")
306| self.RuleInfo.setText(self.trUtf8("Text info for rule goes here ..."))
307| self.RuleInfo.setReadOnly(1)
308| pageLayout_6.addWidget(self.RuleInfo)
309| self.addPage(self.page_6,self.trUtf8("Finished"))
310|
311| self.connect(self.IncludeRadio,SIGNAL("clicked()"),self.IncludeRadio_clicked)
312| self.connect(self.ExcludeRadio,SIGNAL("clicked()"),self.ExcludeRadio_clicked)
313| self.connect(self.SimpleRadio,SIGNAL("clicked()"),self.SimpleRadio_clicked)
314| self.connect(self.DirRadio,SIGNAL("clicked()"),self.DirRadio_clicked)
315| self.connect(self.BaseRadio,SIGNAL("clicked()"),self.BaseRadio_clicked)
316| self.connect(self.AddFilesButton,SIGNAL("clicked()"),self.AddFilesButton_clicked)
317| self.connect(self.RemoveFileButton,SIGNAL("clicked()"),self.RemoveFileButton_clicked)
318| self.connect(self.FileList,SIGNAL("selectionChanged()"),self.FileList_selectionChanged)
319| self.connect(self.RelativeNoneRadio,SIGNAL("clicked()"),self.RelativeNoneRadio_clicked)
320| self.connect(self.RelativeCurrentRadio,SIGNAL("clicked()"),self.RelativeCurrentRadio_clicked)
321| self.connect(self.RelativeThisRadio,SIGNAL("clicked()"),self.RelativeThisRadio_clicked)
322| self.connect(self.RelativeThisButton,SIGNAL("clicked()"),self.RelativeThisButton_clicked)
323| self.connect(self.AddDirectoryButton,SIGNAL("clicked()"),self.AddDirectoryButton_clicked)
324| self.connect(self.RemoveDirectoryButton,SIGNAL("clicked()"),self.RemoveDirectoryButton_clicked)
325| self.connect(self.DirList,SIGNAL("selectionChanged()"),self.DirList_selectionChanged)
326|
327| self.init()
328|
329| def init(self):
330|
331| # default path is 0, 1, 2, 6
332| self.setAppropriate(QWizard.page(self, 3), 0)
333| self.setAppropriate(QWizard.page(self, 4), 0)
334| self.setAppropriate(QWizard.page(self, 5), 0)
335| self.rule_type = 'simple'
336| self.relative_option = 0 # not relative
337| self.setFinishEnabled(QWizard.page(self,7), 1)
338|
339|
340| def SelectFilesButton_clicked(self):
341| print "SourceInsertWizard.SelectFilesButton_clicked(): Not implemented yet"
342|
343| def IncludeRadio_clicked(self):
344|
345| self.rule_type = 'simple'
346| self.setAppropriate(QWizard.page(self, 1), 1)
347| self.setAppropriate(QWizard.page(self, 2), 1)
348| self.setAppropriate(QWizard.page(self, 3), 0)
349| self.setAppropriate(QWizard.page(self, 4), 0)
350| self.setAppropriate(QWizard.page(self, 5), 0)
351| self.setAppropriate(QWizard.page(self, 6), 1)
352|
353|
354| def ExcludeRadio_clicked(self):
355|
356| self.rule_type = 'exclude'
357| self.setAppropriate(QWizard.page(self, 1), 0)
358| self.setAppropriate(QWizard.page(self, 2), 0)
359| self.setAppropriate(QWizard.page(self, 3), 0)
360| self.setAppropriate(QWizard.page(self, 4), 0)
361| self.setAppropriate(QWizard.page(self, 5), 1)
362| self.setAppropriate(QWizard.page(self, 6), 0)
363|
364|
365| def SimpleRadio_clicked(self):
366|
367| self.rule_type = 'simple'
368| self.setAppropriate(QWizard.page(self, 2), 1)
369| self.setAppropriate(QWizard.page(self, 3), 0)
370| self.setAppropriate(QWizard.page(self, 4), 0)
371|
372|
373| def DirRadio_clicked(self):
374|
375| self.rule_type = 'glob'
376| self.setAppropriate(QWizard.page(self, 2), 0)
377| self.setAppropriate(QWizard.page(self, 3), 1)
378| self.setAppropriate(QWizard.page(self, 4), 1)
379|
380|
381| def BaseRadio_clicked(self):
382|
383| self.rule_type = 'recursive glob'
384| self.setAppropriate(QWizard.page(self, 2), 0)
385| self.setAppropriate(QWizard.page(self, 3), 1)
386| self.setAppropriate(QWizard.page(self, 4), 1)
387|
388|
389| def AddFilesButton_clicked(self):
390|
391| names = QFileDialog.getOpenFileNames(
392| "Files (*.h *.hh *.hpp *.c *.cc *.cpp *.py *.idl)",
393| None,
394| self,
395| "select files dialog",
396| "Select the files to include in the rule:")
397| if names:
398| # Find existing names
399| existing = []
400| item = self.FileList.firstChild()
401| while item:
402| existing.append(str(item.text(0)))
403| item = item.nextSibling()
404| print existing
405| for name in names:
406| if str(name) not in existing:
407| QListViewItem(self.FileList, name)
408|
409|
410| def RemoveFileButton_clicked(self):
411|
412| item = self.FileList.firstChild()
413| while item:
414| next = item.nextSibling()
415| if self.FileList.isSelected(item):
416| self.FileList.takeItem(item)
417| item = next
418|
419|
420| def FileList_selectionChanged(self):
421|
422| item = self.FileList.firstChild()
423| while item:
424| if self.FileList.isSelected(item):
425| self.RemoveFileButton.setEnabled(1)
426| return
427| item = item.nextSibling()
428| self.RemoveFileButton.setEnabled(0)
429|
430|
431| def RelativeNoneRadio_clicked(self):
432|
433| self.relative_option = 0
434| self.CurrentDirectoryLabel.setEnabled(0)
435| self.RelativeThisEdit.setEnabled(0)
436| self.RelativeThisButton.setEnabled(0)
437|
438|
439| def RelativeCurrentRadio_clicked(self):
440|
441| self.relative_option = 1
442| self.CurrentDirectoryLabel.setEnabled(1)
443| self.RelativeThisEdit.setEnabled(0)
444| self.RelativeThisButton.setEnabled(0)
445|
446|
447| def RelativeThisRadio_clicked(self):
448|
449| self.relative_option = 2
450| self.CurrentDirectoryLabel.setEnabled(0)
451| self.RelativeThisEdit.setEnabled(1)
452| self.RelativeThisButton.setEnabled(1)
453|
454|
455| def RelativeThisButton_clicked(self):
456|
457| dir = QFileDialog.getExistingDirectory(None, self, "getdir", "Select relative directory", 1)
458| if dir:
459| self.RelativeThisEdit.setText(str(dir))
460|
461|
462| def AddDirectoryButton_clicked(self):
463|
464| path = QFileDialog.getExistingDirectory(
465| None,
466| self,
467| "select dir dialog",
468| "Select the directory to include in the rule:", 1)
469| if path:
470| # Find existing names
471| existing = []
472| item = self.DirList.firstChild()
473| while item:
474| existing.append(str(item.text(0)))
475| item = item.nextSibling()
476| if str(path) not in existing:
477| QListViewItem(self.DirList, path)
478|
479|
480| def RemoveDirectoryButton_clicked(self):
481|
482| item = self.DirList.firstChild()
483| while item:
484| next = item.nextSibling()
485| if self.DirList.isSelected(item):
486| self.DirList.takeItem(item)
487| item = next
488|
489|
490| def DirList_selectionChanged(self):
491|
492| item = self.DirList.firstChild()
493| while item:
494| if self.DirList.isSelected(item):
495| self.RemoveDirectoryButton.setEnabled(1)
496| return
497| item = item.nextSibling()
498| self.RemoveDirectoryButton.setEnabled(0)
499|