AudioDB class changes
[audiocatalog.git] / src / mainwindow.py
blob16a0887c08bdbdf7bb540772c603a05b3630808b
1 from PyQt4 import QtGui, QtCore
2 from audiodb import AudioDB
4 class CatalogMainWindow(QtGui.QMainWindow):
5 def __init__(self, parent=None):
6 QtGui.QWidget.__init__(self, parent)
7 # self.setGeometry(300, 300, 250, 150)
8 self.setWindowTitle('Catalog')
9 self.setWindowIcon(QtGui.QIcon('../icons/icon.png'))
10 self.statusBar()
11 self.create_menu()
13 def create_menu(self):
14 menu_bar = self.menuBar()
16 # Menu File
17 menu_file = menu_bar.addMenu('File')
19 file_new = QtGui.QAction(QtGui.QIcon('../icons/new.png'), 'Create new database...', self)
20 file_new.setStatusTip('Create new audio database')
21 file_new.triggered.connect(self.act_create_new_db)
22 menu_file.addAction(file_new)
24 menu_file.addSeparator()
27 file_exit = QtGui.QAction(QtGui.QIcon('../icons/exit.png'), 'Exit', self)
28 file_exit.setShortcut('Ctrl+Q')
29 file_exit.setStatusTip('Exit')
30 file_exit.triggered.connect(self.act_exit)
31 menu_file.addAction(file_exit)
33 # Menu Edit
34 menu_edit = menu_bar.addMenu('Edit')
36 # Menu Help
37 menu_help = menu_bar.addMenu('Help')
38 help_help = QtGui.QAction(QtGui.QIcon('../icons/exit.png'), 'Help', self)
39 help_help.setShortcut('F1')
40 help_help.setStatusTip('Help')
41 help_help.triggered.connect(self.act_help)
42 menu_help.addAction(help_help)
44 menu_help.addSeparator()
46 help_about = QtGui.QAction(QtGui.QIcon('../icons/exit.png'), 'About...', self)
47 help_about.setStatusTip('About')
48 help_about.triggered.connect(self.act_about)
49 menu_help.addAction(help_about)
55 @QtCore.pyqtSlot()
56 def act_exit(self):
57 QtGui.QMessageBox.aboutQt(self)
59 @QtCore.pyqtSlot()
60 def act_create_new_db(self):
61 a = AudioDB()
62 a.create_new("foo", "/home/miksayer/Files/Music")
64 @QtCore.pyqtSlot()
65 def act_help(self):
66 QtGui.QMessageBox.aboutQt(self)
68 @QtCore.pyqtSlot()
69 def act_about(self):
70 QtGui.QMessageBox.about(self, 'Catalog', 'Catalog, version 0.01')