X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;h=20dc3a9347a752cb86db1c7b42661eb71a79a82c;hb=de6604ba0154d3233889a330b8f229c952614021;hp=50380884e44dc822ee7a201d4717032a127ca1eb;hpb=c92d96e01d110d72cee8e8d307667507bf5d6fff;p=someplayer diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5038088..20dc3a9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -14,10 +14,25 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openMedia())); + connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQt())); + connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about())); + connect(ui->actionPlayer, SIGNAL(triggered()), this, SLOT(player())); + connect(ui->actionLibrary, SIGNAL(triggered()), this, SLOT(library())); + setAnimated(true); + _playerForm = new PlayerForm(); + _libraryForm = new LibraryForm(); + ui->stackedWidget->insertWidget(0, _playerForm); + ui->stackedWidget->insertWidget(1, _libraryForm); + _playerForm->setAttribute(Qt::WA_Maemo5StackedWindow); + _libraryForm->setAttribute(Qt::WA_Maemo5StackedWindow); + connect(_playerForm, SIGNAL(library()), this, SLOT(library())); + library(); } MainWindow::~MainWindow() { + delete _playerForm; + delete _libraryForm; delete ui; } @@ -26,3 +41,23 @@ void MainWindow::openMedia() // SomePlayer::DataObjects::Library *l = new SomePlayer::DataObjects::Library("/tmp", "/tmp"); // l->addDirectory("/mnt/music/Three Days Grace"); } + +void MainWindow::aboutQt() { + QMessageBox::aboutQt(this, "About Qt"); +} + +void MainWindow::about() { + QMessageBox::about(this, "About SomePlayer", "Alternate music player for Maemo 5 " + "written in C++ with Qt4\n\n" + "Author: Nikolay Tischenko aka \"somebody\" "); +} + +void MainWindow::player() { + ui->stackedWidget->setCurrentIndex(0); + setWindowTitle("SomePlayer"); +} + +void MainWindow::library() { + ui->stackedWidget->setCurrentIndex(1); + setWindowTitle("SomePlayer Library"); +}