Commit a68bf164 authored by Michael Pyne's avatar Michael Pyne

Simplify change detection signaling in tag editor.

parent 3d153778
...@@ -493,19 +493,6 @@ void TagEditor::setupLayout() ...@@ -493,19 +493,6 @@ void TagEditor::setupLayout()
{ {
setupUi(this); setupUi(this);
for(auto input : findChildren<QWidget *>()) {
if(input->inherits("QLineEdit"))
connect(input, SIGNAL(textChanged(QString)), this, SLOT(slotDataChanged()));
if(input->inherits("QComboBox")) {
connect(input, SIGNAL(activated(int)), this, SLOT(slotDataChanged()));
connect(input, SIGNAL(currentTextChanged(QString)), this, SLOT(slotDataChanged()));
}
if(input->inherits("QSpinBox"))
connect(input, SIGNAL(valueChanged(int)), this, SLOT(slotDataChanged()));
if(input->inherits("QTextEdit"))
connect(input, SIGNAL(textChanged()), this, SLOT(slotDataChanged()));
}
// Do some meta-programming to find the matching enable boxes // Do some meta-programming to find the matching enable boxes
for(auto enable : findChildren<QCheckBox *>(QRegExp("Enable$"))) { for(auto enable : findChildren<QCheckBox *>(QRegExp("Enable$"))) {
...@@ -645,9 +632,9 @@ void TagEditor::showEvent(QShowEvent *e) ...@@ -645,9 +632,9 @@ void TagEditor::showEvent(QShowEvent *e)
// private slots // private slots
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void TagEditor::slotDataChanged(bool c) void TagEditor::slotDataChanged()
{ {
m_dataChanged = c; m_dataChanged = true;
} }
void TagEditor::slotItemRemoved(PlaylistItem *item) void TagEditor::slotItemRemoved(PlaylistItem *item)
......
...@@ -72,7 +72,7 @@ private: ...@@ -72,7 +72,7 @@ private:
virtual void showEvent(QShowEvent *e); virtual void showEvent(QShowEvent *e);
private slots: private slots:
void slotDataChanged(bool c = true); void slotDataChanged();
void slotItemRemoved(PlaylistItem *item); void slotItemRemoved(PlaylistItem *item);
void slotPlaylistRemoved() { m_currentPlaylist = 0; } void slotPlaylistRemoved() { m_currentPlaylist = 0; }
......
...@@ -289,6 +289,25 @@ ...@@ -289,6 +289,25 @@
<header>klineedit.h</header> <header>klineedit.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops>
<tabstop>artistNameEnable</tabstop>
<tabstop>artistNameBox</tabstop>
<tabstop>trackNameEnable</tabstop>
<tabstop>trackNameBox</tabstop>
<tabstop>albumNameEnable</tabstop>
<tabstop>albumNameBox</tabstop>
<tabstop>genreEnable</tabstop>
<tabstop>genreBox</tabstop>
<tabstop>fileNameBox</tabstop>
<tabstop>trackEnable</tabstop>
<tabstop>trackSpin</tabstop>
<tabstop>lengthBox</tabstop>
<tabstop>yearEnable</tabstop>
<tabstop>yearSpin</tabstop>
<tabstop>bitrateBox</tabstop>
<tabstop>commentEnable</tabstop>
<tabstop>commentBox</tabstop>
</tabstops>
<resources/> <resources/>
<connections> <connections>
<connection> <connection>
...@@ -298,12 +317,12 @@ ...@@ -298,12 +317,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>141</x> <x>268</x>
<y>21</y> <y>28</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>138</x> <x>145</x>
<y>43</y> <y>94</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -314,12 +333,12 @@ ...@@ -314,12 +333,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>102</x> <x>266</x>
<y>71</y> <y>147</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>104</x> <x>111</x>
<y>90</y> <y>206</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -330,12 +349,12 @@ ...@@ -330,12 +349,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>126</x> <x>268</x>
<y>122</y> <y>250</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>125</x> <x>132</x>
<y>151</y> <y>304</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -346,12 +365,12 @@ ...@@ -346,12 +365,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>147</x> <x>268</x>
<y>170</y> <y>348</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>147</x> <x>154</x>
<y>198</y> <y>402</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -362,12 +381,12 @@ ...@@ -362,12 +381,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>330</x> <x>567</x>
<y>66</y> <y>147</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>303</x> <x>456</x>
<y>68</y> <y>152</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -378,12 +397,12 @@ ...@@ -378,12 +397,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>337</x> <x>800</x>
<y>121</y> <y>250</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>344</x> <x>628</x>
<y>156</y> <y>408</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -394,14 +413,129 @@ ...@@ -394,14 +413,129 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>558</x> <x>877</x>
<y>66</y> <y>147</y>
</hint>
<hint type="destinationlabel">
<x>766</x>
<y>152</y>
</hint>
</hints>
</connection>
<connection>
<sender>artistNameBox</sender>
<signal>editTextChanged(QString)</signal>
<receiver>TagEditor</receiver>
<slot>slotDataChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>66</x>
<y>71</y>
</hint>
<hint type="destinationlabel">
<x>131</x>
<y>-7</y>
</hint>
</hints>
</connection>
<connection>
<sender>trackNameBox</sender>
<signal>textChanged(QString)</signal>
<receiver>TagEditor</receiver>
<slot>slotDataChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>28</x>
<y>194</y>
</hint>
<hint type="destinationlabel">
<x>433</x>
<y>0</y>
</hint>
</hints>
</connection>
<connection>
<sender>albumNameBox</sender>
<signal>editTextChanged(QString)</signal>
<receiver>TagEditor</receiver>
<slot>slotDataChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>231</x>
<y>288</y>
</hint>
<hint type="destinationlabel">
<x>408</x>
<y>5</y>
</hint>
</hints>
</connection>
<connection>
<sender>genreBox</sender>
<signal>editTextChanged(QString)</signal>
<receiver>TagEditor</receiver>
<slot>slotDataChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>188</x>
<y>389</y>
</hint>
<hint type="destinationlabel">
<x>714</x>
<y>3</y>
</hint>
</hints>
</connection>
<connection>
<sender>commentBox</sender>
<signal>textChanged()</signal>
<receiver>TagEditor</receiver>
<slot>slotDataChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>540</x>
<y>351</y>
</hint>
<hint type="destinationlabel">
<x>111</x>
<y>5</y>
</hint>
</hints>
</connection>
<connection>
<sender>trackSpin</sender>
<signal>valueChanged(int)</signal>
<receiver>TagEditor</receiver>
<slot>slotDataChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>414</x>
<y>121</y>
</hint>
<hint type="destinationlabel">
<x>394</x>
<y>-12</y>
</hint>
</hints>
</connection>
<connection>
<sender>yearSpin</sender>
<signal>valueChanged(int)</signal>
<receiver>TagEditor</receiver>
<slot>slotDataChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>704</x>
<y>117</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>510</x> <x>685</x>
<y>69</y> <y>-6</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
</connections> </connections>
<slots>
<slot>slotDataChanged()</slot>
</slots>
</ui> </ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment