X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;h=a7d59d07e06dbd2be3d104d9e85a11fc1f5ce329;hb=40103460aba82191a72f1e6d852b70f96e6fbdae;hp=0570563e4213f989a426c633b59c382d812477d5;hpb=5fa76f57fd5bd74b268196f08d411e69124222fc;p=someplayer diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0570563..a7d59d0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -50,11 +50,13 @@ MainWindow::MainWindow(QWidget *parent) : QAction *add_directory = ui->menuLibrary->addAction("Add directory"); QAction *save_playlist = ui->menuLibrary->addAction("Save playlist"); QAction *clear_playlist = ui->menuLibrary->addAction("Clear current playlist"); + QAction *add_files = ui->menuLibrary->addAction("Add file to current playlist"); connect(_player_form, SIGNAL(library()), this, SLOT(library())); connect(_library_form, SIGNAL(player()), this, SLOT(player())); connect(add_directory, SIGNAL(triggered()), this, SLOT(_add_directory())); connect(save_playlist, SIGNAL(triggered()), this, SLOT(_save_playlist())); connect(clear_playlist, SIGNAL(triggered()), this, SLOT(_clear_current_playlist())); + connect(add_files, SIGNAL(triggered()), this, SLOT(_add_files())); connect(_library, SIGNAL(done()), this, SLOT(library())); connect(_library_form, SIGNAL(done()), this, SLOT(library())); connect(_library_form, SIGNAL(busy(QString)), this, SLOT(showBusyWidget(QString))); @@ -197,3 +199,8 @@ void MainWindow::_toggle_full_screen() { showFullScreen(); } } + +void MainWindow::_add_files() { + QStringList files = QFileDialog::getOpenFileNames(this, "Add file"); + if (!files.isEmpty()) _player_form->addFiles(files); +}