1 #include "mainwindow.h"
2 #include "ui_mainwindow.h"
7 #include "player/player.h"
11 MainWindow::MainWindow(QWidget *parent) :
13 ui(new Ui::MainWindow)
16 connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openMedia()));
17 connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQt()));
18 connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
19 connect(ui->actionPlayer, SIGNAL(triggered()), this, SLOT(player()));
20 connect(ui->actionLibrary, SIGNAL(triggered()), this, SLOT(library()));
22 _playerForm = new PlayerForm();
23 _libraryForm = new LibraryForm();
24 ui->stackedWidget->insertWidget(0, _playerForm);
25 ui->stackedWidget->insertWidget(1, _libraryForm);
26 _playerForm->setAttribute(Qt::WA_Maemo5StackedWindow);
27 _libraryForm->setAttribute(Qt::WA_Maemo5StackedWindow);
28 connect(_playerForm, SIGNAL(library()), this, SLOT(library()));
32 MainWindow::~MainWindow()
39 void MainWindow::openMedia()
41 // SomePlayer::DataObjects::Library *l = new SomePlayer::DataObjects::Library("/tmp", "/tmp");
42 // l->addDirectory("/mnt/music/Three Days Grace");
45 void MainWindow::aboutQt() {
46 QMessageBox::aboutQt(this, "About Qt");
49 void MainWindow::about() {
50 QMessageBox::about(this, "About SomePlayer", "Alternate music player for Maemo 5 "
51 "written in C++ with Qt4\n\n"
52 "Author: Nikolay Tischenko aka \"somebody\" <niktischenko@gmail.com>");
55 void MainWindow::player() {
56 ui->stackedWidget->setCurrentIndex(0);
57 setWindowTitle("SomePlayer");
60 void MainWindow::library() {
61 ui->stackedWidget->setCurrentIndex(1);
62 setWindowTitle("SomePlayer Library");