Rewrite parts of context to be adjustable and adjust album to width
This commit is contained in:
@@ -46,30 +46,33 @@ const char *ContextSettingsPage::kSettingsGroupLabels[ContextSettingsOrder::NELE
|
||||
"Engine and Device",
|
||||
"Albums by Artist",
|
||||
"Song Lyrics",
|
||||
"Album",
|
||||
};
|
||||
const char *ContextSettingsPage::kSettingsGroupEnable[ContextSettingsOrder::NELEMS] = {
|
||||
"TechnicalDataEnable",
|
||||
"EngineAndDeviceEnable",
|
||||
"AlbumsByArtistEnable",
|
||||
"SongLyricsEnable",
|
||||
"AlbumEnable",
|
||||
};
|
||||
|
||||
ContextSettingsPage::ContextSettingsPage(SettingsDialog* dialog)
|
||||
: SettingsPage(dialog), ui_(new Ui_ContextSettingsPage) {
|
||||
ContextSettingsPage::ContextSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_ContextSettingsPage) {
|
||||
|
||||
ui_->setupUi(this);
|
||||
setWindowIcon(IconLoader::Load("view-choose"));
|
||||
|
||||
checkboxes[ContextSettingsOrder::TECHNICAL_DATA] = ui_->context_item1_enable;
|
||||
checkboxes[ContextSettingsOrder::ENGINE_AND_DEVICE] = ui_->context_item2_enable;
|
||||
checkboxes[ContextSettingsOrder::ALBUMS_BY_ARTIST] = ui_->context_item3_enable;
|
||||
checkboxes[ContextSettingsOrder::SONG_LYRICS] = ui_->context_item4_enable;
|
||||
checkboxes[ContextSettingsOrder::ALBUM] = ui_->context_item1_enable;
|
||||
checkboxes[ContextSettingsOrder::TECHNICAL_DATA] = ui_->context_item2_enable;
|
||||
checkboxes[ContextSettingsOrder::ENGINE_AND_DEVICE] = ui_->context_item3_enable;
|
||||
checkboxes[ContextSettingsOrder::ALBUMS_BY_ARTIST] = ui_->context_item4_enable;
|
||||
checkboxes[ContextSettingsOrder::SONG_LYRICS] = ui_->context_item5_enable;
|
||||
|
||||
// Create and populate the helper menus
|
||||
QMenu *menu = new QMenu(this);
|
||||
menu->addAction(ui_->action_albumartist);
|
||||
menu->addAction(ui_->action_artist);
|
||||
menu->addAction(ui_->action_album);
|
||||
menu->addAction(ui_->action_title);
|
||||
menu->addAction(ui_->action_albumartist);
|
||||
menu->addAction(ui_->action_year);
|
||||
menu->addAction(ui_->action_composer);
|
||||
menu->addAction(ui_->action_performer);
|
||||
@@ -81,8 +84,6 @@ ContextSettingsPage::ContextSettingsPage(SettingsDialog* dialog)
|
||||
menu->addAction(ui_->action_playcount);
|
||||
menu->addAction(ui_->action_skipcount);
|
||||
menu->addAction(ui_->action_filename);
|
||||
menu->addAction(ui_->action_rating);
|
||||
menu->addAction(ui_->action_score);
|
||||
menu->addSeparator();
|
||||
menu->addAction(ui_->action_newline);
|
||||
ui_->context_exp_chooser1->setMenu(menu);
|
||||
@@ -101,10 +102,7 @@ ContextSettingsPage::ContextSettingsPage(SettingsDialog* dialog)
|
||||
|
||||
}
|
||||
|
||||
ContextSettingsPage::~ContextSettingsPage()
|
||||
{
|
||||
delete ui_;
|
||||
}
|
||||
ContextSettingsPage::~ContextSettingsPage() { delete ui_; }
|
||||
|
||||
void ContextSettingsPage::Load() {
|
||||
|
||||
@@ -113,7 +111,7 @@ void ContextSettingsPage::Load() {
|
||||
s.beginGroup(ContextSettingsPage::kSettingsGroup);
|
||||
ui_->context_custom_text1->setText(s.value(kSettingsTitleFmt, "%title% - %artist%").toString());
|
||||
ui_->context_custom_text2->setText(s.value(kSettingsSummaryFmt, "%album%").toString());
|
||||
for (int i = 0; i < ContextSettingsOrder::NELEMS; ++i) {
|
||||
for (int i = 0 ; i < ContextSettingsOrder::NELEMS ; ++i) {
|
||||
checkboxes[i]->setChecked(s.value(kSettingsGroupEnable[i], i != ContextSettingsOrder::ALBUMS_BY_ARTIST).toBool());
|
||||
}
|
||||
s.endGroup();
|
||||
|
||||
@@ -35,8 +35,7 @@ class QCheckBox;
|
||||
class SettingsDialog;
|
||||
class Ui_ContextSettingsPage;
|
||||
|
||||
class ContextSettingsPage : public SettingsPage
|
||||
{
|
||||
class ContextSettingsPage : public SettingsPage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -48,7 +47,8 @@ public:
|
||||
ENGINE_AND_DEVICE,
|
||||
ALBUMS_BY_ARTIST,
|
||||
SONG_LYRICS,
|
||||
NELEMS,
|
||||
ALBUM,
|
||||
NELEMS
|
||||
};
|
||||
|
||||
static const char *kSettingsGroup;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>526</width>
|
||||
<height>733</height>
|
||||
<width>500</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -147,64 +147,53 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
<widget class="QCheckBox" name="context_item1_enable">
|
||||
<property name="text">
|
||||
<string>Album</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="context_item2_enable">
|
||||
<property name="text">
|
||||
<string>Technical Data</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="context_item3_enable">
|
||||
<property name="text">
|
||||
<string>Engine and Device</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="context_item4_enable">
|
||||
<property name="text">
|
||||
<string>Albums by Artist</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="context_item5_enable">
|
||||
<property name="text">
|
||||
<string>Song Lyrics</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout2">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="context_item1_enable">
|
||||
<property name="text">
|
||||
<string>Technical Data</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="context_item2_enable">
|
||||
<property name="text">
|
||||
<string>Engine and Device</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="context_item3_enable">
|
||||
<property name="text">
|
||||
<string>Albums by Artist</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="context_item4_enable">
|
||||
<property name="text">
|
||||
<string>Song Lyrics</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -336,22 +325,6 @@
|
||||
<string>Add song skip count</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_rating">
|
||||
<property name="text">
|
||||
<string notr="true">%rating%</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add song rating</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_score">
|
||||
<property name="text">
|
||||
<string notr="true">%score%</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add song auto score</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_newline">
|
||||
<property name="text">
|
||||
<string notr="true">%newline%</string>
|
||||
|
||||
Reference in New Issue
Block a user