Focus the library tab when using the 'Show in library' feature

This commit is contained in:
Mattias Andersson 2016-07-01 11:37:04 +02:00
parent 678ea4c6d1
commit 0b6d531bd3
2 changed files with 7 additions and 2 deletions

View File

@ -1040,8 +1040,7 @@ MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd,
CommandlineOptionsReceived(options);
if (!options.contains_play_options())
LoadPlaybackStatus();
if (!options.contains_play_options()) LoadPlaybackStatus();
qLog(Debug) << "Started";
}
@ -2078,6 +2077,7 @@ void MainWindow::ShowInLibrary() {
"artist:" + songs.first().artist() + " album:" + songs.first().album();
}
library_view_->filter()->ShowInLibrary(search);
FocusLibraryTab();
}
void MainWindow::PlaylistRemoveCurrent() {
@ -2786,6 +2786,10 @@ void MainWindow::AddPodcast() {
app_->internet_model()->Service<PodcastService>()->AddPodcast();
}
void MainWindow::FocusLibraryTab() {
ui_->tabs->SetCurrentWidget(library_view_);
}
void MainWindow::FocusGlobalSearchField() {
ui_->tabs->SetCurrentWidget(global_search_view_);
global_search_view_->FocusSearchField();

View File

@ -273,6 +273,7 @@ signals:
QString line2);
void ScrollToInternetIndex(const QModelIndex& index);
void FocusLibraryTab();
void FocusGlobalSearchField();
void DoGlobalSearch(const QString& query);