1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-11 09:24:50 +01:00

did more double click playlist work, prettified variable names

This commit is contained in:
Ethan Warth 2015-07-22 02:06:02 -05:00
parent 20d25090fb
commit 89e0e283a2
3 changed files with 51 additions and 36 deletions

View File

@ -42,25 +42,26 @@ BehaviourSettingsPage::BehaviourSettingsPage(SettingsDialog* dialog)
ui_->doubleclick_addmode->setItemData(2, MainWindow::AddBehaviour_OpenInNew);
ui_->doubleclick_addmode->setItemData(3, MainWindow::AddBehaviour_Enqueue);
ui_->doubleclick_addmode2CPL->setItemData(0, MainWindow::PLAddBehaviour_Play);
ui_->doubleclick_addmode2CPL->setItemData(1,
MainWindow::PLAddBehaviour_Append);
ui_->doubleclick_addmode2CPL->setItemData(2,
MainWindow::PLAddBehaviour_PlayNext);
ui_->doubleclick_addmode2CPL->setItemData(3,
MainWindow::PLAddBehaviour_Nothing);
ui_->doubleclick_playmode->setItemData(0, MainWindow::PlayBehaviour_Never);
ui_->doubleclick_playmode->setItemData(1,
MainWindow::PlayBehaviour_IfStopped);
ui_->doubleclick_playmode->setItemData(2, MainWindow::PlayBehaviour_Always);
ui_->doubleclick_playmode2CPL->setItemData(0,
MainWindow::PLPlayBehaviour_Never);
ui_->doubleclick_playmode2CPL->setItemData(1,
MainWindow::PLPlayBehaviour_IfStopped);
ui_->doubleclick_playmode2CPL->setItemData(2,
MainWindow::PLPlayBehaviour_Always);
ui_->doubleclick_playlist_addmode->setItemData(0,
MainWindow::PlaylistAddBehaviour_Play);
ui_->doubleclick_playlist_addmode->setItemData(1,
MainWindow::PlaylistAddBehaviour_Enqueue);
ui_->doubleclick_playlist_addmode->setItemData(2,
MainWindow::PlaylistAddBehaviour_PlayNext);
ui_->doubleclick_playlist_addmode->setItemData(3,
MainWindow::PlaylistAddBehaviour_Nothing);
ui_->doubleclick_playlist_playmode->setItemData(0,
MainWindow::PlaylistPlayBehaviour_Never);
ui_->doubleclick_playlist_playmode->setItemData(1,
MainWindow::PlaylistPlayBehaviour_IfStopped);
ui_->doubleclick_playlist_playmode->setItemData(2,
MainWindow::PlaylistPlayBehaviour_Always);
ui_->menu_playmode->setItemData(0, MainWindow::PlayBehaviour_Never);
ui_->menu_playmode->setItemData(1, MainWindow::PlayBehaviour_IfStopped);
@ -124,13 +125,14 @@ void BehaviourSettingsPage::Load() {
ui_->doubleclick_playmode->findData(
s.value("doubleclick_playmode", MainWindow::PlayBehaviour_IfStopped)
.toInt()));
ui_->doubleclick_addmode2CPL->setCurrentIndex(
ui_->doubleclick_addmode2CPL->findData(
s.value("doubleclick_addmode2CPL", MainWindow::PLAddBehaviour_Play).toInt()));
ui_->doubleclick_playmode2CPL->setCurrentIndex(
ui_->doubleclick_playmode2CPL->findData(
s.value("doubleclick_playmode2CPL", MainWindow::PLPlayBehaviour_IfStopped)
.toInt()));
ui_->doubleclick_playlist_addmode->setCurrentIndex(
ui_->doubleclick_playlist_addmode->findData(
s.value("doubleclick_playlist_addmode",
MainWindow::PlaylistAddBehaviour_Play).toInt()));
ui_->doubleclick_playlist_playmode->setCurrentIndex(
ui_->doubleclick_playlist_playmode->findData(
s.value("doubleclick_playlist_playmode",
MainWindow::PlaylistPlayBehaviour_IfStopped).toInt()));
ui_->menu_playmode->setCurrentIndex(ui_->menu_playmode->findData(
s.value("menu_playmode", MainWindow::PlayBehaviour_IfStopped).toInt()));
@ -214,16 +216,14 @@ void BehaviourSettingsPage::Save() {
ui_->doubleclick_playmode->itemData(
ui_->doubleclick_playmode->currentIndex())
.toInt());
MainWindow::PLAddBehaviour doubleclick_addmode2CPL =
MainWindow::PLAddBehaviour(
ui_->doubleclick_addmode2CPL->itemData(
ui_->doubleclick_addmode2CPL->currentIndex())
.toInt());
MainWindow::PLPlayBehaviour doubleclick_playmode2CPL =
MainWindow::PLPlayBehaviour(
ui_->doubleclick_playmode2CPL->itemData(
ui_->doubleclick_playmode2CPL->currentIndex())
.toInt());
MainWindow::PlaylistAddBehaviour doubleclick_playlist_addmode =
MainWindow::PlaylistAddBehaviour(
ui_->doubleclick_playlist_addmode->itemData(
ui_->doubleclick_playlist_addmode->currentIndex()).toInt());
MainWindow::PlaylistPlayBehaviour doubleclick_playlist_playmode =
MainWindow::PlaylistPlayBehaviour(
ui_->doubleclick_playlist_playmode->itemData(
ui_->doubleclick_playlist_playmode->currentIndex()).toInt());
MainWindow::PlayBehaviour menu_playmode = MainWindow::PlayBehaviour(
ui_->menu_playmode->itemData(ui_->menu_playmode->currentIndex()).toInt());
@ -248,8 +248,8 @@ void BehaviourSettingsPage::Save() {
s.setValue("startupbehaviour", int(behaviour));
s.setValue("doubleclick_addmode", doubleclick_addmode);
s.setValue("doubleclick_playmode", doubleclick_playmode);
s.setValue("doubleclick_addmode2CPL", doubleclick_addmode2CPL);
s.setValue("doubleclick_playmode2CPL", doubleclick_playmode2CPL);
s.setValue("doubleclick_playlist_addmode", doubleclick_playlist_addmode);
s.setValue("doubleclick_playlist_playmode", doubleclick_playlist_playmode);
s.setValue("menu_playmode", menu_playmode);
s.setValue("resume_playback_after_start",
ui_->resume_after_start_->isChecked());

View File

@ -266,9 +266,9 @@
<property name="title">
<string>Double clicking a song in the playlist will...</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2CPL">
<layout class="QHBoxLayout" name="horizontalLayout_doubleclick_playlist">
<item>
<widget class="QComboBox" name="doubleclick_addmode2CPL">
<widget class="QComboBox" name="doubleclick_playlist_addmode">
<property name="currentIndex">
<number>0</number>
</property>
@ -295,7 +295,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="doubleclick_playmode2CPL">
<widget class="QComboBox" name="doubleclick_playlist_playmode">
<property name="currentIndex">
<number>1</number>
</property>

View File

@ -117,6 +117,21 @@ class MainWindow : public QMainWindow, public PlatformInterface {
PlayBehaviour_Always = 3,
};
// Don't change the values
enum PlaylistAddBehaviour {
PlaylistAddBehaviour_Play = 1,
PlaylistAddBehaviour_Enqueue = 2,
PlaylistAddBehaviour_PlayNext = 3,
PlaylistAddBehaviour_Nothing = 4
};
// Don't change the values
enum PlaylistPlayBehaviour {
PlaylistPlayBehaviour_Never = 1,
PlaylistPlayBehaviour_IfStopped = 2,
PlaylistPlayBehaviour_Always = 3,
};
void SetHiddenInTray(bool hidden);
void CommandlineOptionsReceived(const CommandlineOptions& options);