Add 'setCollection' to Cantata's DBUS interface.

BUG: 634
This commit is contained in:
craig.p.drummond
2015-02-25 18:24:22 +00:00
committed by craig.p.drummond
parent 7d256e5db8
commit fe45cefb5b
4 changed files with 20 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
height. This should apply to all Linux Gtk-like styles, not just QGtkStyle.
12. Use '#' for track number column title in table view.
13. Allow setting of column alignments in table views.
14. Add 'setCollection' to Cantata's DBUS interface.
1.5.2
-----

View File

@@ -12,5 +12,8 @@
<method name="load">
<arg name="urls" type="as" direction="in"/>
</method>
<method name="setCollection">
<arg type="s" name="name" direction="in"/>
</method>
</interface>
</node>

View File

@@ -2366,6 +2366,21 @@ void MainWindow::dynamicStatus(const QString &message)
#endif
}
void MainWindow::setCollection(const QString &collection)
{
if (!connectionsAction->isVisible()) {
return;
}
foreach (QAction *act, connectionsAction->menu()->actions()) {
if (Utils::strippedText(act->text())==collection) {
if (!act->isChecked()) {
act->trigger();
}
break;
}
}
}
void MainWindow::showPlayQueueSearch()
{
playQueueSearchWidget->activate();

View File

@@ -166,6 +166,7 @@ public Q_SLOTS:
void showError(const QString &message, bool showActions=false);
void showInformation(const QString &message);
void dynamicStatus(const QString &message);
void setCollection(const QString &collection);
void hideWindow();
void restoreWindow();
void load(const QStringList &urls) { playQueueModel.load(urls); }