Commit c92304f6 authored by Scott Wheeler's avatar Scott Wheeler

Some temporary cleaning up of the GUI look. This of course will all be

reevaluated when a real redesign happens...

svn path=/trunk/kdemultimedia/juk/; revision=216312
parent 81742fa0
......@@ -140,6 +140,7 @@ void JuK::setupActions()
// tagger menu
new KAction(i18n("Save"), "filesave", "CTRL+t", m_splitter, SLOT(slotSaveTag()), actionCollection(), "saveItem");
new KAction(i18n("Delete"), "editdelete", 0, m_splitter, SLOT(slotDeleteSelectedItems()), actionCollection(), "removeItem");
new KAction(i18n("Guess Tag Information"), 0, m_splitter, SLOT(slotGuessTagInfo()), actionCollection(), "guessTag");
// settings menu
new KToggleAction(i18n("Show Menu Bar"), "CTRL+m", this, SLOT(slotToggleMenuBar()), actionCollection(), "toggleMenuBar");
......
......@@ -47,17 +47,17 @@
<Menu name="playlist"><text>Tagger</text>
<Action name="saveItem"/>
<Action name="removeItem"/>
<Action name="guessTag"/>
</Menu>
<Menu name="settings" noMerge="1"><text>&amp;Settings</text>
<Menu name="settings"><text>&amp;Settings</text>
<!-- <Action name="showGenreListEditor"/> -->
<Action name="restoreOnLoad"/>
<Action name="toggleSystemTray"/>
<Action name="dockOnClose"/>
<Action name="togglePopups"/>
<Action name="outputSelect"/>
<Separator/>
<Action name="options_configure_keybinding"/>
<Action name="tagGuesserConfig"/>
<Action name="outputSelect"/>
</Menu>
</MenuBar>
......@@ -87,8 +87,4 @@
<Action name="back"/>
<Action name="forward"/>
<Action name="trackPositionAction"/>
<Separator lineSeparator="false"/>
<Action name="loopPlaylist"/>
</kpartgui>
......@@ -171,6 +171,7 @@ public slots:
// Tagger slots
void slotSaveTag() { m_editor->save(); }
void slotGuessTagInfo() { m_editor->slotGuessTagInfo(); }
// Playlist slots
......
......@@ -240,6 +240,28 @@ void TagEditor::slotUpdateCollection()
}
}
void TagEditor::slotGuessTagInfo()
{
PlaylistItem *item = m_items.getFirst();
if(!item)
return;
Tag *tag = item->tag();
Q_ASSERT(tag);
TagGuesser guesser(tag->absFilePath());
if(!guesser.title().isNull())
m_trackNameBox->setText(guesser.title());
if(!guesser.artist().isNull())
m_artistNameBox->setEditText(guesser.artist());
if(!guesser.album().isNull())
m_albumNameBox->setEditText(guesser.album());
if(!guesser.track().isNull())
m_trackSpin->setValue(guesser.track().toInt());
if(!guesser.comment().isNull())
m_commentBox->setText(guesser.comment());
}
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
......@@ -367,9 +389,6 @@ void TagEditor::setupLayout()
m_commentBox = new KEdit(this, "commentBox");
m_commentBox->setTextFormat(Qt::PlainText);
addItem(i18n("Comment:"), m_commentBox, rightColumnLayout);
m_suggestButton = new KPushButton(i18n("S&uggest"), this, "suggestButton");
rightColumnLayout->addWidget(m_suggestButton, 0 /*no stretching */, Qt::AlignRight);
}
connect(m_artistNameBox, SIGNAL(textChanged(const QString&)), this, SLOT(slotDataChanged()));
......@@ -381,7 +400,6 @@ void TagEditor::setupLayout()
connect(m_yearSpin, SIGNAL(valueChanged(int)), this, SLOT(slotDataChanged()));
connect(m_trackSpin, SIGNAL(valueChanged(int)), this, SLOT(slotDataChanged()));
connect(m_commentBox, SIGNAL(textChanged()), this, SLOT(slotDataChanged()));
connect(m_suggestButton, SIGNAL(clicked()), this, SLOT(slotSuggestClicked()));
}
void TagEditor::save(const PlaylistItemList &list)
......@@ -541,26 +559,4 @@ void TagEditor::slotDataChanged(bool c)
m_dataChanged = c;
}
void TagEditor::slotSuggestClicked()
{
PlaylistItem *item = m_items.getFirst();
if(!item)
return;
Tag *tag = item->tag();
Q_ASSERT(tag);
TagGuesser guesser(tag->absFilePath());
if(!guesser.title().isNull())
m_trackNameBox->setText(guesser.title());
if(!guesser.artist().isNull())
m_artistNameBox->setEditText(guesser.artist());
if(!guesser.album().isNull())
m_albumNameBox->setEditText(guesser.album());
if(!guesser.track().isNull())
m_trackSpin->setValue(guesser.track().toInt());
if(!guesser.comment().isNull())
m_commentBox->setText(guesser.comment());
}
#include "tageditor.moc"
......@@ -48,7 +48,8 @@ public slots:
void slotRefresh();
void slotClear();
void slotUpdateCollection();
void slotGuessTagInfo();
private:
void setupLayout();
void readConfig();
......@@ -65,7 +66,6 @@ private:
private slots:
void slotDataChanged(bool c = true);
void slotSuggestClicked();
private:
typedef QMap<QWidget *, QCheckBox *> BoxMap;
......@@ -83,7 +83,6 @@ private:
KLineEdit *m_lengthBox;
KLineEdit *m_bitrateBox;
KEdit *m_commentBox;
KPushButton *m_suggestButton;
PlaylistItemList m_items;
......
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