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'))
13 def create_menu(self
):
14 menu_bar
= self
.menuBar()
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
)
34 menu_edit
= menu_bar
.addMenu('Edit')
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
)
57 QtGui
.QMessageBox
.aboutQt(self
)
60 def act_create_new_db(self
):
62 a
.create_new("foo", "/home/miksayer/Files/Music")
66 QtGui
.QMessageBox
.aboutQt(self
)
70 QtGui
.QMessageBox
.about(self
, 'Catalog', 'Catalog, version 0.01')