Remove refresh buttons in status bar, and place into main menu. Also, prompt for confirmation before perforing refresh.

This commit is contained in:
craig.p.drummond
2014-01-23 19:54:40 +00:00
committed by craig.p.drummond
parent 83316553fc
commit 8a9463a813
12 changed files with 29 additions and 21 deletions

View File

@@ -85,6 +85,8 @@
and don't allow saving to these playlsts.
50. Remove find buttons in status bar, and use Ctrl-F for both find in views
and find in playqueue. Action depends upon which view has focus.
51. Remove refresh buttons in status bar, and place into main menu. Also,
prompt for confirmation before perforing refresh.
1.2.2
-----

View File

@@ -39,7 +39,6 @@ AlbumsPage::AlbumsPage(QWidget *p)
setupUi(this);
addToPlayQueue->setDefaultAction(StdActions::self()->addToPlayQueueAction);
replacePlayQueue->setDefaultAction(StdActions::self()->replacePlayQueueAction);
libraryUpdate->setDefaultAction(StdActions::self()->refreshAction);
view->addAction(StdActions::self()->addToPlayQueueAction);
view->addAction(StdActions::self()->addRandomToPlayQueueAction);

View File

@@ -46,9 +46,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="ToolButton" name="libraryUpdate"/>
</item>
<item>
<widget class="GenreCombo" name="genreCombo"/>
</item>

View File

@@ -40,7 +40,6 @@ FolderPage::FolderPage(QWidget *p)
setupUi(this);
addToPlayQueue->setDefaultAction(StdActions::self()->addToPlayQueueAction);
replacePlayQueue->setDefaultAction(StdActions::self()->replacePlayQueueAction);
libraryUpdate->setDefaultAction(StdActions::self()->refreshAction);
#ifndef Q_OS_WIN
browseAction = ActionCollection::get()->createAction("openfilemanager", i18n("Open In File Manager"), "system-file-manager");
#endif

View File

@@ -46,9 +46,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="ToolButton" name="libraryUpdate"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">

View File

@@ -45,7 +45,6 @@ LibraryPage::LibraryPage(QWidget *p)
setupUi(this);
addToPlayQueue->setDefaultAction(StdActions::self()->addToPlayQueueAction);
replacePlayQueue->setDefaultAction(StdActions::self()->replacePlayQueueAction);
libraryUpdate->setDefaultAction(StdActions::self()->refreshAction);
view->addAction(StdActions::self()->addToPlayQueueAction);
view->addAction(StdActions::self()->addRandomToPlayQueueAction);

View File

@@ -46,9 +46,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="ToolButton" name="libraryUpdate"/>
</item>
<item>
<widget class="GenreCombo" name="genreCombo"/>
</item>

View File

@@ -581,6 +581,8 @@ MainWindow::MainWindow(QWidget *parent)
serverInfoAction=ActionCollection::get()->createAction("mpdinfo", i18n("Server information..."), "network-server");
connect(serverInfoAction, SIGNAL(triggered(bool)),this, SLOT(showServerInfo()));
serverInfoAction->setEnabled(Settings::self()->firstRun());
refreshDbAction = ActionCollection::get()->createAction("refresh", i18n("Refresh Database"), "view-refresh");
doDbRefreshAction = new Action(refreshDbAction->icon(), i18n("Refresh"), this);
#ifdef ENABLE_KDE_SUPPORT
mainMenu->addAction(prefAction);
shortcutsAction=static_cast<Action *>(KStandardAction::keyBindings(this, SLOT(configureShortcuts()), ActionCollection::get()));
@@ -595,6 +597,7 @@ MainWindow::MainWindow(QWidget *parent)
#endif
connect(prefAction, SIGNAL(triggered(bool)),this, SLOT(showPreferencesDialog()));
mainMenu->addAction(prefAction);
mainMenu->addAction(refreshDbAction);
mainMenu->addSeparator();
mainMenu->addAction(StdActions::self()->searchAction);
mainMenu->addSeparator();
@@ -611,6 +614,7 @@ MainWindow::MainWindow(QWidget *parent)
if (Utils::Unity==Utils::currentDe()) {
#endif
QMenu *menu=new QMenu(i18n("&File"), this);
menu->addAction(refreshDbAction);
menu->addAction(quitAction);
menuBar()->addMenu(menu);
menu=new QMenu(i18n("&Edit"), this);
@@ -745,8 +749,10 @@ MainWindow::MainWindow(QWidget *parent)
connect(Dynamic::self(), SIGNAL(running(bool)), dynamicLabel, SLOT(setVisible(bool)));
connect(Dynamic::self(), SIGNAL(running(bool)), this, SLOT(controlDynamicButton()));
#endif
connect(StdActions::self()->refreshAction, SIGNAL(triggered(bool)), this, SLOT(refresh()));
connect(StdActions::self()->refreshAction, SIGNAL(triggered(bool)), MPDConnection::self(), SLOT(update()));
connect(refreshDbAction, SIGNAL(triggered(bool)), this, SLOT(refreshDbPromp()));
connect(doDbRefreshAction, SIGNAL(toggled(bool)), this, SLOT(refreshDb()));
connect(doDbRefreshAction, SIGNAL(triggered(bool)), MPDConnection::self(), SLOT(update()));
connect(doDbRefreshAction, SIGNAL(triggered(bool)), messageWidget, SLOT(animatedHide()));
connect(connectAction, SIGNAL(triggered(bool)), this, SLOT(connectToMpd()));
connect(StdActions::self()->prevTrackAction, SIGNAL(triggered(bool)), MPDConnection::self(), SLOT(goToPrevious()));
connect(StdActions::self()->nextTrackAction, SIGNAL(triggered(bool)), MPDConnection::self(), SLOT(goToNext()));
@@ -1171,7 +1177,21 @@ void MainWindow::streamUrl(const QString &u)
#endif
}
void MainWindow::refresh()
void MainWindow::refreshDbPromp()
{
if (Settings::self()->playQueueConfirmClear()) {
if (QDialogButtonBox::GnomeLayout==style()->styleHint(QStyle::SH_DialogButtonLayout)) {
messageWidget->setActions(QList<QAction*>() << cancelAction << doDbRefreshAction);
} else {
messageWidget->setActions(QList<QAction*>() << doDbRefreshAction << cancelAction);
}
messageWidget->setWarning(i18n("Refresh MPD Database?"), false);
} else {
clearPlayQueue();
}
}
void MainWindow::refreshDb()
{
MusicLibraryModel::self()->removeCache();
DirViewModel::self()->removeCache();

View File

@@ -206,7 +206,8 @@ public Q_SLOTS:
void connectToMpd();
void connectToMpd(const MPDConnectionDetails &details);
void streamUrl(const QString &u);
void refresh();
void refreshDbPromp();
void refreshDb();
#ifndef ENABLE_KDE_SUPPORT
void showAboutDialog();
#endif
@@ -329,6 +330,8 @@ private:
PlayQueueProxyModel playQueueProxyModel;
bool autoScrollPlayQueue;
Action *prefAction;
Action *refreshDbAction;
Action *doDbRefreshAction;
#ifdef ENABLE_KDE_SUPPORT
Action *shortcutsAction;
#endif

View File

@@ -44,7 +44,6 @@ PlaylistsPage::PlaylistsPage(QWidget *p)
removeDuplicatesAction=new Action(i18n("Remove Duplicates"), this);
removeDuplicatesAction->setEnabled(false);
replacePlayQueue->setDefaultAction(StdActions::self()->replacePlayQueueAction);
libraryUpdate->setDefaultAction(StdActions::self()->refreshAction);
connect(genreCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(searchItems()));
connect(PlaylistsModel::self(), SIGNAL(updateGenres(const QSet<QString> &)), genreCombo, SLOT(update(const QSet<QString> &)));

View File

@@ -46,9 +46,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="ToolButton" name="libraryUpdate"/>
</item>
<item>
<widget class="GenreCombo" name="genreCombo"/>
</item>

View File

@@ -85,7 +85,6 @@ StdActions::StdActions()
deleteSongsAction = ActionCollection::get()->createAction("deletesongs", i18n("Delete Songs"), "edit-delete");
#endif
setCoverAction = ActionCollection::get()->createAction("setcover", i18n("Set Image"));
refreshAction = ActionCollection::get()->createAction("refresh", i18n("Refresh Database"), "view-refresh");
backAction = ActionCollection::get()->createAction("back", i18n("Back"), "go-previous");
backAction->setShortcut(QKeySequence::Back);
removeAction = ActionCollection::get()->createAction("removeitems", i18n("Remove"), "list-remove");