Only require 2 stop actions; stop now, or stop after current. Default stop action is always 'stop now'
This commit is contained in:
committed by
craig.p.drummond
parent
cfe341aec2
commit
03488da230
@@ -23,8 +23,10 @@
|
||||
real gain. (URL is still shown in tooltip)
|
||||
14. Detailed tree view for playlists by default.
|
||||
15. Remove config compatibility with Cantata versions older than 0.7
|
||||
16. Make 'stop after current track' and 'stop immediately' assignable to KDE
|
||||
global shortcuts.
|
||||
16. Only require 2 stop actions; stop now, or stop after current. Default stop
|
||||
action is always 'stop now'
|
||||
17. Make 'stop after current track' assignable to KDE global shortcut.
|
||||
18. Add 'stop after current' to tray item menu.
|
||||
|
||||
1.0.3
|
||||
-----
|
||||
|
||||
@@ -266,7 +266,6 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
nextTrackAction = ActionCollection::get()->createAction("nexttrack", i18n("Next Track"), Icons::toolbarNextIcon);
|
||||
playPauseTrackAction = ActionCollection::get()->createAction("playpausetrack", i18n("Play/Pause"), Icons::toolbarPlayIcon);
|
||||
stopPlaybackAction = ActionCollection::get()->createAction("stopplayback", i18n("Stop"), Icons::toolbarStopIcon);
|
||||
stopImmediatelyAction = ActionCollection::get()->createAction("stoptrack", i18n("Stop Immediately"), Icons::toolbarStopIcon);
|
||||
stopAfterCurrentTrackAction = ActionCollection::get()->createAction("stopaftercurrenttrack", i18n("Stop After Current Track"), Icons::toolbarStopIcon);
|
||||
stopAfterTrackAction = ActionCollection::get()->createAction("stopaftertrack", i18n("Stop After Track"), Icons::toolbarStopIcon);
|
||||
increaseVolumeAction = ActionCollection::get()->createAction("increasevolume", i18n("Increase Volume"));
|
||||
@@ -324,7 +323,6 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
nextTrackAction->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Right));
|
||||
playPauseTrackAction->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_C));
|
||||
stopPlaybackAction->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_X));
|
||||
stopImmediatelyAction->setGlobalShortcut(KShortcut());
|
||||
stopAfterCurrentTrackAction->setGlobalShortcut(KShortcut());
|
||||
increaseVolumeAction->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Up));
|
||||
decreaseVolumeAction->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Down));
|
||||
@@ -372,7 +370,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
prevTrackButton->setDefaultAction(prevTrackAction);
|
||||
|
||||
QMenu *stopMenu=new QMenu(this);
|
||||
stopMenu->addAction(stopImmediatelyAction);
|
||||
stopMenu->addAction(stopPlaybackAction);
|
||||
stopMenu->addAction(stopAfterCurrentTrackAction);
|
||||
stopTrackButton->setMenu(stopMenu);
|
||||
stopTrackButton->setPopupMode(QToolButton::DelayedPopup);
|
||||
@@ -714,7 +712,6 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
connect(nextTrackAction, SIGNAL(triggered(bool)), MPDConnection::self(), SLOT(goToNext()));
|
||||
connect(playPauseTrackAction, SIGNAL(triggered(bool)), this, SLOT(playPauseTrack()));
|
||||
connect(stopPlaybackAction, SIGNAL(triggered(bool)), this, SLOT(stopPlayback()));
|
||||
connect(stopImmediatelyAction, SIGNAL(triggered(bool)), this, SLOT(stopImmediately()));
|
||||
connect(stopAfterCurrentTrackAction, SIGNAL(triggered(bool)), this, SLOT(stopAfterCurrentTrack()));
|
||||
connect(stopAfterTrackAction, SIGNAL(triggered(bool)), this, SLOT(stopAfterTrack()));
|
||||
connect(volumeControl, SIGNAL(valueChanged(int)), MPDConnection::self(), SLOT(setVolume(int)));
|
||||
@@ -1350,7 +1347,6 @@ void MainWindow::readSettings()
|
||||
gnomeMediaKeys->setEnabled(Settings::self()->gnomeMediaKeys());
|
||||
}
|
||||
#endif
|
||||
stopAfterCurrent=Settings::self()->stopAfterCurrent();
|
||||
context->readConfig();
|
||||
}
|
||||
|
||||
@@ -1529,21 +1525,11 @@ void MainWindow::toggleStream(bool s)
|
||||
|
||||
void MainWindow::enableStopActions(bool enable)
|
||||
{
|
||||
stopImmediatelyAction->setEnabled(enable);
|
||||
stopAfterCurrentTrackAction->setEnabled(enable);
|
||||
stopPlaybackAction->setEnabled(enable);
|
||||
}
|
||||
|
||||
void MainWindow::stopPlayback()
|
||||
{
|
||||
if (stopAfterCurrent) {
|
||||
stopAfterCurrentTrack();
|
||||
} else {
|
||||
stopImmediately();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::stopImmediately()
|
||||
{
|
||||
if (!fadeWhenStop() || MPDState_Paused==MPDStatus::self()->state() || 0==volume) {
|
||||
emit stop();
|
||||
@@ -1696,8 +1682,8 @@ void MainWindow::realSearchPlayQueue()
|
||||
void MainWindow::updatePlayQueue(const QList<Song> &songs)
|
||||
{
|
||||
playPauseTrackAction->setEnabled(!songs.isEmpty());
|
||||
nextTrackAction->setEnabled(stopImmediatelyAction->isEnabled() && songs.count()>1);
|
||||
prevTrackAction->setEnabled(stopImmediatelyAction->isEnabled() && songs.count()>1);
|
||||
nextTrackAction->setEnabled(stopPlaybackAction->isEnabled() && songs.count()>1);
|
||||
prevTrackAction->setEnabled(stopPlaybackAction->isEnabled() && songs.count()>1);
|
||||
StdActions::self()->savePlayQueueAction->setEnabled(!songs.isEmpty());
|
||||
clearPlayQueueAction->setEnabled(!songs.isEmpty());
|
||||
|
||||
|
||||
@@ -214,7 +214,6 @@ public Q_SLOTS:
|
||||
void showServerInfo();
|
||||
void toggleStream(bool s);
|
||||
void stopPlayback();
|
||||
void stopImmediately();
|
||||
void stopAfterCurrentTrack();
|
||||
void stopAfterTrack();
|
||||
void playPauseTrack();
|
||||
@@ -332,7 +331,6 @@ private:
|
||||
Action *nextTrackAction;
|
||||
Action *playPauseTrackAction;
|
||||
Action *stopPlaybackAction;
|
||||
Action *stopImmediatelyAction;
|
||||
Action *stopAfterCurrentTrackAction;
|
||||
Action *stopAfterTrackAction;
|
||||
Action *increaseVolumeAction;
|
||||
|
||||
@@ -33,8 +33,6 @@ PlaybackSettings::PlaybackSettings(QWidget *p)
|
||||
stopFadeDuration->setSuffix(i18n(" ms"));
|
||||
stopFadeDuration->setRange(Settings::MinFade, Settings::MaxFade);
|
||||
stopFadeDuration->setSingleStep(100);
|
||||
stopAction->addItem(i18n("Stop immediately (or after fadeout)"));
|
||||
stopAction->addItem(i18n("Stop after current track"));
|
||||
}
|
||||
|
||||
void PlaybackSettings::load()
|
||||
@@ -42,7 +40,6 @@ void PlaybackSettings::load()
|
||||
stopOnExit->setChecked(Settings::self()->stopOnExit());
|
||||
stopFadeDuration->setValue(Settings::self()->stopFadeDuration());
|
||||
stopDynamizerOnExit->setChecked(Settings::self()->stopDynamizerOnExit());
|
||||
stopAction->setCurrentIndex(Settings::self()->stopAfterCurrent() ? 1 : 0);
|
||||
}
|
||||
|
||||
void PlaybackSettings::save()
|
||||
@@ -50,5 +47,4 @@ void PlaybackSettings::save()
|
||||
Settings::self()->saveStopOnExit(stopOnExit->isChecked());
|
||||
Settings::self()->saveStopFadeDuration(stopFadeDuration->value());
|
||||
Settings::self()->saveStopDynamizerOnExit(stopDynamizerOnExit->isChecked());
|
||||
Settings::self()->saveStopAfterCurrent(1==stopAction->currentIndex());
|
||||
}
|
||||
|
||||
@@ -60,23 +60,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Default stop action:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>stopAction</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="stopAction"/>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="noteLabel">
|
||||
<property name="text">
|
||||
<string><i><b>NOTE:</b> If you press and hold the stop button, then a menu will be shown allowing you to choose the stop action.</i></string>
|
||||
<string><i><b>NOTE:</b> If you press and hold the stop button, then a menu will be shown allowing you to choose whether to stop playback now, or after the current track.</i></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
||||
@@ -317,11 +317,6 @@ bool Settings::stopDynamizerOnExit()
|
||||
return GET_BOOL("stopDynamizerOnExit", false);
|
||||
}
|
||||
|
||||
bool Settings::stopAfterCurrent()
|
||||
{
|
||||
return GET_BOOL("stopAfterCurrent", false);
|
||||
}
|
||||
|
||||
bool Settings::storeCoversInMpdDir()
|
||||
{
|
||||
return GET_BOOL("storeCoversInMpdDir", true);
|
||||
@@ -782,11 +777,6 @@ void Settings::saveStopDynamizerOnExit(bool v)
|
||||
SET_VALUE_MOD(stopDynamizerOnExit)
|
||||
}
|
||||
|
||||
void Settings::saveStopAfterCurrent(bool v)
|
||||
{
|
||||
SET_VALUE_MOD(stopAfterCurrent)
|
||||
}
|
||||
|
||||
void Settings::saveStoreCoversInMpdDir(bool v)
|
||||
{
|
||||
SET_VALUE_MOD(storeCoversInMpdDir)
|
||||
|
||||
@@ -105,7 +105,6 @@ public:
|
||||
bool minimiseOnClose();
|
||||
bool showPopups();
|
||||
bool stopOnExit();
|
||||
bool stopAfterCurrent();
|
||||
bool stopDynamizerOnExit();
|
||||
bool storeCoversInMpdDir();
|
||||
bool storeLyricsInMpdDir();
|
||||
@@ -181,7 +180,6 @@ public:
|
||||
void saveShowFullScreen(bool v);
|
||||
void saveStopOnExit(bool v);
|
||||
void saveStopDynamizerOnExit(bool v);
|
||||
void saveStopAfterCurrent(bool v);
|
||||
void savePlayQueueHeaderState(const QByteArray &v);
|
||||
void saveSplitterState(const QByteArray &v);
|
||||
void saveSplitterAutoHide(bool v);
|
||||
|
||||
@@ -76,6 +76,7 @@ void TrayItem::setup()
|
||||
trayItemMenu->addAction(mw->prevTrackAction);
|
||||
trayItemMenu->addAction(mw->playPauseTrackAction);
|
||||
trayItemMenu->addAction(mw->stopPlaybackAction);
|
||||
trayItemMenu->addAction(mw->stopAfterCurrentTrackAction);
|
||||
trayItemMenu->addAction(mw->nextTrackAction);
|
||||
trayItem->setContextMenu(trayItemMenu);
|
||||
trayItem->setStatus(KStatusNotifierItem::Active);
|
||||
@@ -96,6 +97,7 @@ void TrayItem::setup()
|
||||
trayItemMenu->addAction(mw->prevTrackAction);
|
||||
trayItemMenu->addAction(mw->playPauseTrackAction);
|
||||
trayItemMenu->addAction(mw->stopPlaybackAction);
|
||||
trayItemMenu->addAction(mw->stopAfterCurrentTrackAction);
|
||||
trayItemMenu->addAction(mw->nextTrackAction);
|
||||
trayItemMenu->addSeparator();
|
||||
trayItemMenu->addAction(mw->restoreAction);
|
||||
|
||||
Reference in New Issue
Block a user