-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcd_wizard.py
executable file
·80 lines (54 loc) · 1.88 KB
/
cd_wizard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env python
"""Wizard to guide user to:
- insert cd
- please rip with eac
- check for a good rip
- upload with metadata (freedb, musicmind)
"""
from PyQt4 import QtGui
def createIntroPage():
page = QtGui.QWizardPage()
page.setTitle("Introduction")
page.setSubTitle("This wizard will help you archive your CDs in your Personal Music Locker")
label = QtGui.QLabel("Please insert a CD")
label.setWordWrap(True)
layout = QtGui.QVBoxLayout()
layout.addWidget(label)
page.setLayout(layout)
return page
def choose_cd():
page = QtGui.QWizardPage()
page.setTitle("Choose CD Drive")
layout = QtGui.QVBoxLayout()
#file_dialog = QtGui.QFileDialog()
#file_dialog.setFileMode(QtGui.QFileDialog.Directory)
#file_dialog.setOptions(QtGui.QFileDialog.ShowDirsOnly)
#file_dialog.setDirectory("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
#layout.addWidget(file_dialog)
def handle_button():
path = QtGui.QFileDialog.getExistingDirectory(None, 'Select CD', "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", QtGui.QFileDialog.ShowDirsOnly)
print path
button = QtGui.QPushButton('Select CD')
button.clicked.connect(handle_button)
layout.addWidget(button)
page.setLayout(layout)
return page
def createConclusionPage():
page = QtGui.QWizardPage()
page.setTitle("Conclusion")
label = QtGui.QLabel("You are now added this CD to your locker!")
label.setWordWrap(True)
layout = QtGui.QVBoxLayout()
layout.addWidget(label)
page.setLayout(layout)
return page
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
wizard = QtGui.QWizard()
wizard.addPage(createIntroPage())
wizard.addPage(choose_cd())
wizard.addPage(createConclusionPage())
wizard.setWindowTitle("Music Locker Uploader")
wizard.show()
sys.exit(wizard.exec_())