X-Git-Url: http://git.maemo.org/git/?p=someplayer;a=blobdiff_plain;f=src%2Fmainwindow.cpp;h=69ff230a4e3f5c67402e02faa09c96297935d581;hp=67141bc7f6572c4d597e9bc018097b43873f0776;hb=d885de77474e87ceca2741ae58fd902d4f37ea24;hpb=bb42bbd3ed98dacfdbaaddb688b992e145861412 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 67141bc..69ff230 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2,7 +2,11 @@ #include "ui_mainwindow.h" #include #include -#include "player.h" +#include + +#include "player/player.h" + +#include "library.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -10,17 +14,50 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openMedia())); - player = new Player(); + 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; } void MainWindow::openMedia() { - QString filename = QFileDialog::getOpenFileName(this, "Open media", "/home/user/"); - player->playSong(filename); +// 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"); }