Bug 177400 - tag dialog allows editing of metadata for streams if opened via a service (e.g. Cool Streams)
Summary: tag dialog allows editing of metadata for streams if opened via a service (e....
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Metadata Editing and Reading (show other bugs)
Version: 2.3-GIT
Platform: unspecified Linux
: LO minor
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-10 17:57 UTC by andreaswuest
Modified: 2011-01-11 20:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4.1


Attachments
screenshot from context menu when opened via context menu in the playlist (48.10 KB, image/png)
2008-12-10 18:01 UTC, andreaswuest
Details
screenshot from context menu when opened via context menu in the radio germany internet tab (139.54 KB, image/png)
2008-12-10 18:03 UTC, andreaswuest
Details
new screenshot (56.48 KB, image/png)
2009-12-18 21:09 UTC, andreaswuest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andreaswuest 2008-12-10 17:57:50 UTC
Version:           2.0 (using 4.1.3 (KDE 4.1.3), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.27-9-generic

hi,

the edit metadata menu looks different depending on the location of the stream when you open it via the context menu. attached the screenshot of two different context menus.
Comment 1 andreaswuest 2008-12-10 18:01:51 UTC
Created attachment 29213 [details]
screenshot from context menu when opened via context menu in the playlist
Comment 2 andreaswuest 2008-12-10 18:03:58 UTC
Created attachment 29214 [details]
screenshot from context menu when opened via context menu in the radio germany internet tab

btw. the title of the context menu is definitely wrong. i only selected the swr3 stream as the screenshot show. however the metadata editor seem to affect all the streams in the radio germany list (83 stations) !
Comment 3 andreaswuest 2008-12-10 18:04:52 UTC
by looking different i mean the enabled/disabled input fields !
Comment 4 Daniel Hahler 2009-05-24 18:28:24 UTC
I can confirm both issues in 2.0.96:

1. The meta data fields, in the "Edit Track Details" dialog (opened from the "Internet" tab) should get handled in the same way, as when being opened from the playlist. And this probably means, that they should be disabled as well, because entering values therein won't save them anyway.

2. The "Edit Track Details" dialog in the "Internet" tab defaults to select all streams, multiplied by the number of actual streams being selected, i.e. if you have 25 tracks in "Cool streams", selecting two of them and going to edit them results in 50 tracks being edited ("Information for 50 Tracks" in the title)
Comment 5 Myriam Schweingruber 2009-12-17 16:12:37 UTC
Is this still valid for Amarok 2.2.1 or 2.2.2 beta?
Comment 6 andreaswuest 2009-12-18 21:09:04 UTC
Created attachment 39164 [details]
new screenshot

the issue is still valid. i have attached a new screenshot. those are the context menues for the same stream. the first from the internet tab, the second from the playlist. the track details from the internet tab is still empty and shows a wrong title.
Comment 7 andreaswuest 2009-12-18 21:10:20 UTC
btw. i am currently using version 2.2.1
Comment 8 Myriam Schweingruber 2009-12-25 19:02:32 UTC
Thank you for the feedback.
Comment 9 Sergey Ivanov 2011-01-11 20:45:45 UTC
commit 0ad260c3a05fc8b5bca6a0f92b0e09c2ecaf09be
branch master
Author: Sergey Ivanov <123kash@gmail.com>
Date:   Tue Jan 11 22:45:00 2011 +0300

    Fixed issue with TagDialog that make metadata fields stay editable if multiple
    streams opened.
    BUG: 177400

diff --git a/ChangeLog b/ChangeLog
index 64e9d61..07627d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@ Amarok ChangeLog
 ================
 (C) 2002-2010 the Amarok authors.
 
+VERISON 2.4.1
+  BUGFIXES:
+    * Fixed issue with TagDialog that make metadata fields stay editable if multiple
+      streams opened. (BR 177400)
+    * Fixed missing equel-sign ('=') in filter string of bookmarks. (BR 245759)
 
 VERSION 2.4.0
   CHANGES:
@@ -11,7 +16,6 @@ VERSION 2.4.0
     * Fixed some broken radio stream URLs.
 
   BUGFIXES:
-    * Fixed missing equel-sign ('=') in filter string of bookmarks. (BR 245759)
     * Fix crash on copying tracks between collection. (BR 261364)
     * Fix fetching of script data. BBC, Free Music Charts and others should work again.
       (BR 261839)
diff --git a/src/dialogs/TagDialog.cpp b/src/dialogs/TagDialog.cpp
index 6b3d436..70360ff 100644
--- a/src/dialogs/TagDialog.cpp
+++ b/src/dialogs/TagDialog.cpp
@@ -987,8 +987,6 @@ void TagDialog::readTags()
 {
     DEBUG_BLOCK
 
-    const bool local = m_currentTrack->playableUrl().isLocalFile();
-
     setWindowTitle( KDialog::makeStandardCaption( i18n("Track Details: %1 by %2",
                     m_currentTrack->name(),  m_currentTrack->artist() ? m_currentTrack->artist()->name() : QString() ) ) );
 
@@ -1118,50 +1116,7 @@ void TagDialog::readTags()
 
     loadCover();
 
-    // enable only for editable files
-#define enableOrDisable( X ) \
-    ui->X->setEnabled( editable ); \
-    qobject_cast<KLineEdit*>(ui->X->lineEdit())->setClearButtonShown( editable )
-
-    const bool editable = m_currentTrack->hasCapabilityInterface( Capabilities::Capability::Editable );
-    ui->kLineEdit_title->setEnabled( editable );
-    ui->kLineEdit_title->setClearButtonShown( editable );
-
-    enableOrDisable( kComboBox_artist );
-    enableOrDisable( kComboBox_albumArtist );
-    enableOrDisable( kComboBox_composer );
-    enableOrDisable( kComboBox_album );
-    enableOrDisable( kComboBox_genre );
-
-    ui->kLineEdit_Bpm->setEnabled( editable );
-    ui->kLineEdit_Bpm->setClearButtonShown( editable );
-
-#undef enableOrDisable
-    ui->qSpinBox_track->setEnabled( editable );
-    ui->qSpinBox_discNumber->setEnabled( editable );
-    ui->qSpinBox_year->setEnabled( editable );
-    ui->qPlainTextEdit_comment->setEnabled( editable );
-    ui->ratingWidget->setEnabled( true );
-    ui->qSpinBox_score->setEnabled( true );
-    ui->pushButton_guessTags->setEnabled( editable );
-    ui->pushButton_musicbrainz->setEnabled( editable );
-
-    if( local )
-    {
-        ui->pushButton_guessTags->show();
-        ui->pushButton_musicbrainz->show();
-    }
-    else
-    {
-       ui->pushButton_guessTags->hide();
-       ui->pushButton_musicbrainz->hide();
-    }
-
-    // If it's a local file, write the directory to m_path, else disable the "open in konqui" button
-    if ( local )
-        m_path = m_currentTrack->playableUrl().directory();
-    else
-        ui->pushButton_open->setEnabled( false );
+    setControlsAccessability();
 
     ui->pushButton_ok->setEnabled( m_storedTags.count() > 0 || m_storedScores.count() > 0
                               || m_storedLyrics.count() > 0 || m_storedRatings.count() > 0
@@ -1385,10 +1340,62 @@ TagDialog::readMultipleTracks()
 
     ui->statisticsLabel->setText( statisticsText );
 
+    setControlsAccessability();
     // This will reset a wrongly enabled Ok button
     checkModified();
 }
 
+void
+TagDialog::setControlsAccessability()
+{
+    // enable only for editable files
+    const bool local = m_currentTrack->playableUrl().isLocalFile();
+    const bool editable = m_currentTrack->hasCapabilityInterface( Capabilities::Capability::Editable );
+
+#define enableOrDisable( X ) \
+    ui->X->setEnabled( editable ); \
+    qobject_cast<KLineEdit*>(ui->X->lineEdit())->setClearButtonShown( editable )
+
+    ui->kLineEdit_title->setEnabled( editable );
+    ui->kLineEdit_title->setClearButtonShown( editable );
+
+    enableOrDisable( kComboBox_artist );
+    enableOrDisable( kComboBox_albumArtist );
+    enableOrDisable( kComboBox_composer );
+    enableOrDisable( kComboBox_album );
+    enableOrDisable( kComboBox_genre );
+
+    ui->kLineEdit_Bpm->setEnabled( editable );
+    ui->kLineEdit_Bpm->setClearButtonShown( editable );
+
+#undef enableOrDisable
+    ui->qSpinBox_track->setEnabled( editable );
+    ui->qSpinBox_discNumber->setEnabled( editable );
+    ui->qSpinBox_year->setEnabled( editable );
+    ui->qPlainTextEdit_comment->setEnabled( editable );
+    ui->ratingWidget->setEnabled( true );
+    ui->qSpinBox_score->setEnabled( true );
+    ui->pushButton_guessTags->setEnabled( editable );
+    ui->pushButton_musicbrainz->setEnabled( editable );
+
+    if( local )
+    {
+        ui->pushButton_guessTags->show();
+        ui->pushButton_musicbrainz->show();
+    }
+    else
+    {
+       ui->pushButton_guessTags->hide();
+       ui->pushButton_musicbrainz->hide();
+    }
+
+    // If it's a local file, write the directory to m_path, else disable the "open in konqui" button
+    if ( local )
+        m_path = m_currentTrack->playableUrl().directory();
+    else
+        ui->pushButton_open->setEnabled( false );
+}
+
 inline bool
 equalString( const QString &a, const QString &b )
 {
diff --git a/src/dialogs/TagDialog.h b/src/dialogs/TagDialog.h
index c130505..887eeaf 100644
--- a/src/dialogs/TagDialog.h
+++ b/src/dialogs/TagDialog.h
@@ -156,6 +156,7 @@ class AMAROK_EXPORT TagDialog : public KDialog, public Meta::Observer
         void setMultipleTracksMode();
         void setSingleTrackMode();
         void enableItems();
+        void setControlsAccessability();
         bool hasChanged();
         int changes();
         void storeTags();