mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 19:45:31 +01:00
Improve track selection dialog: allow expanding, use linedit for filename and minor other modifications. Fixes issue 1392
This commit is contained in:
parent
e4d9d54414
commit
b52f3b6082
@ -39,7 +39,7 @@ void TrackSelectionDialog::Init(const QString& filename, const SongList& songs)
|
|||||||
current_songs_ = songs;
|
current_songs_ = songs;
|
||||||
|
|
||||||
// Set filename
|
// Set filename
|
||||||
ui_->filenameLabel->setText(current_filename_); //TODO: use basefilename, it's nicer
|
ui_->filenameLineEdit->setText(current_filename_); //TODO: use basefilename, it's nicer
|
||||||
|
|
||||||
// Clear tree widget
|
// Clear tree widget
|
||||||
ui_->resultsTreeWidget->clear();
|
ui_->resultsTreeWidget->clear();
|
||||||
@ -48,10 +48,10 @@ void TrackSelectionDialog::Init(const QString& filename, const SongList& songs)
|
|||||||
int song_index = 0;
|
int song_index = 0;
|
||||||
foreach(const Song& song, songs) {
|
foreach(const Song& song, songs) {
|
||||||
QStringList valuesStringList;
|
QStringList valuesStringList;
|
||||||
valuesStringList << song.title() << song.artist() << song.album();
|
|
||||||
if (song.track() > 0) {
|
if (song.track() > 0) {
|
||||||
valuesStringList << QString::number(song.track());
|
valuesStringList << QString::number(song.track());
|
||||||
}
|
}
|
||||||
|
valuesStringList << song.title() << song.artist() << song.album();
|
||||||
QTreeWidgetItem* item = new QTreeWidgetItem(
|
QTreeWidgetItem* item = new QTreeWidgetItem(
|
||||||
ui_->resultsTreeWidget, valuesStringList);
|
ui_->resultsTreeWidget, valuesStringList);
|
||||||
if(song_index==0) { // if it's the first item, set focus on it
|
if(song_index==0) { // if it's the first item, set focus on it
|
||||||
@ -61,10 +61,10 @@ void TrackSelectionDialog::Init(const QString& filename, const SongList& songs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Resize columns
|
// Resize columns
|
||||||
ui_->resultsTreeWidget->setColumnWidth(0, 175); // Title column
|
ui_->resultsTreeWidget->setColumnWidth(0, 50); // Track column
|
||||||
ui_->resultsTreeWidget->setColumnWidth(1, 175); // Artist column
|
ui_->resultsTreeWidget->setColumnWidth(1, 175); // Title column
|
||||||
ui_->resultsTreeWidget->setColumnWidth(2, 175); // Album column
|
ui_->resultsTreeWidget->setColumnWidth(2, 175); // Artist column
|
||||||
ui_->resultsTreeWidget->setColumnWidth(3, 50); // Track column
|
ui_->resultsTreeWidget->setColumnWidth(3, 175); // Album column
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackSelectionDialog::accept() {
|
void TrackSelectionDialog::accept() {
|
||||||
|
@ -17,106 +17,182 @@
|
|||||||
<iconset resource="../../data/data.qrc">
|
<iconset resource="../../data/data.qrc">
|
||||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QGroupBox" name="fileNameGroupBox">
|
||||||
<x>260</x>
|
<property name="title">
|
||||||
<y>330</y>
|
<string>File name</string>
|
||||||
<width>341</width>
|
|
||||||
<height>32</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QGroupBox" name="fileNameGroupBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>571</width>
|
|
||||||
<height>41</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>File name</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QLabel" name="filenameLabel">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>551</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QGroupBox" name="resultsGroupBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>591</width>
|
|
||||||
<height>271</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Select best possible match</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QTreeWidget" name="resultsTreeWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>591</width>
|
|
||||||
<height>241</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="editTriggers">
|
|
||||||
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
|
||||||
</property>
|
|
||||||
<attribute name="headerDefaultSectionSize">
|
|
||||||
<number>150</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="headerMinimumSectionSize">
|
|
||||||
<number>50</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="headerDefaultSectionSize">
|
|
||||||
<number>150</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="headerMinimumSectionSize">
|
|
||||||
<number>50</number>
|
|
||||||
</attribute>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Title</string>
|
|
||||||
</property>
|
</property>
|
||||||
</column>
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<column>
|
<item>
|
||||||
<property name="text">
|
<widget class="QLineEdit" name="filenameLineEdit">
|
||||||
<string>Artist</string>
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="Button">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Base">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Window">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="Button">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Base">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Window">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="Button">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Base">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Window">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="0">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="frame">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="resultsGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Select best possible match</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<column>
|
<item>
|
||||||
<property name="text">
|
<widget class="QTreeWidget" name="resultsTreeWidget">
|
||||||
<string>Album</string>
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||||
|
</property>
|
||||||
|
<attribute name="headerDefaultSectionSize">
|
||||||
|
<number>150</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="headerMinimumSectionSize">
|
||||||
|
<number>50</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="headerDefaultSectionSize">
|
||||||
|
<number>150</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="headerMinimumSectionSize">
|
||||||
|
<number>50</number>
|
||||||
|
</attribute>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Track</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Title</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Artist</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Album</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
<property name="orientation">
|
||||||
<column>
|
<enum>Qt::Horizontal</enum>
|
||||||
<property name="text">
|
|
||||||
<string>Track</string>
|
|
||||||
</property>
|
</property>
|
||||||
</column>
|
<property name="standardButtons">
|
||||||
</widget>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</widget>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../data/data.qrc"/>
|
<include location="../../data/data.qrc"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user