-void MainWindow::showBusyWidget(QString caption) {
- _busy_widget->setText(caption);
- ui->menuBar->setEnabled(false);
- hideSearchPanel();
- ui->stackedWidget->setCurrentIndex(2);
-}
-
-void MainWindow::_toggle_search_line() {
- if (ui->searchLine->isVisible()) {
- ui->searchLine->setText("");
- ui->searchLine->hide();
- ui->nextButton->hide();
- ui->prevButton->hide();
- _cancelSearch();
- } else {
- ui->searchLine->show();
- ui->nextButton->show();
- ui->prevButton->show();
- ui->searchLine->setFocus(Qt::MouseFocusReason);
- }
-}
-
-void MainWindow::showSearchPanel() {
- ui->searchButton->show();
-}
-
-void MainWindow::hideSearchPanel() {
- ui->searchLine->setText("");
- ui->searchLine->hide();
- ui->nextButton->hide();
- ui->prevButton->hide();
- ui->searchButton->hide();
- _cancelSearch();
-}
-
-void MainWindow::_search(QString pattern) {
- if (ui->stackedWidget->currentIndex() == 0) { // player
- _player_form->search(pattern);
- } else if (ui->stackedWidget->currentIndex() == 1) { // library
- _library_form->search(pattern);
- }
-}
-
-void MainWindow::_nextItem() {
- if (ui->stackedWidget->currentIndex() == 0) { // player
- _player_form->nextItem();
- } else if (ui->stackedWidget->currentIndex() == 1) { // library
- _library_form->nextItem();
- }
-}
-
-void MainWindow::_prevItem() {
- if (ui->stackedWidget->currentIndex() == 0) { // player
- _player_form->prevItem();
- } else if (ui->stackedWidget->currentIndex() == 1) { // library
- _library_form->prevItem();
- }
-}
-
-void MainWindow::_cancelSearch() {
- if (ui->stackedWidget->currentIndex() == 0) { // player
- _player_form->cancelSearch();
- } else if (ui->stackedWidget->currentIndex() == 1) { // library
- _library_form->cancelSearch();
- }
-}
-
-void MainWindow::_toggle_full_screen() {
- if (isFullScreen()) {
- ui->fscreenButton->setIcon(QIcon(":/icons/"+_icons_theme+"/fullscreen.png"));
- showNormal();
- } else {
- ui->fscreenButton->setIcon(QIcon(":/icons/"+_icons_theme+"/window.png"));
- showFullScreen();
- }
-}
-
-void MainWindow::_add_files() {
- QStringList files = QFileDialog::getOpenFileNames(this, "Add file");
- if (!files.isEmpty()) _player_form->addFiles(files);
-}
-