]> git.sesse.net Git - vlc/commitdiff
Show Save Metadata button when editing comments.
authorTimothy B. Terriberry <tterribe@xiph.org>
Mon, 2 Sep 2013 16:48:12 +0000 (09:48 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 2 Sep 2013 18:44:55 +0000 (20:44 +0200)
QTextEdit doesn't have a textEdited() signal, but textChanged()
works well enough if we disable it while we're changing the text
ourselves.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/info_panels.cpp

index 41f018e6e03cc6d5dc7207d69ac664ff6d9e0ef3..ddfe30892bbbc7ebde8424cfb71fc0d5eeaf8058 100644 (file)
@@ -166,7 +166,7 @@ MetaPanel::MetaPanel( QWidget *parent,
     description_text = new QTextEdit;
     description_text->setAcceptRichText( false );
     metaLayout->addWidget( description_text, line, 0, 1, 7 );
-    // CONNECT( description_text, textChanged(), this, enterEditMode() ); //FIXME
+    CONNECT( description_text, textChanged(), this, enterEditMode() );
     line++;
 
     /* VLC_META_SETTING: Useless */
@@ -238,7 +238,10 @@ void MetaPanel::update( input_item_t *p_item )
     UPDATE_META( Genre, genre_text );
     UPDATE_META( Copyright, copyright_text );
     UPDATE_META( Album, collection_text );
+    disconnect( description_text, SIGNAL(textChanged()), this,
+                SLOT(enterEditMode()) );
     UPDATE_META( Description, description_text );
+    CONNECT( description_text, textChanged(), this, enterEditMode() );
     UPDATE_META( Language, language_text );
     UPDATE_META( NowPlaying, nowplaying_text );
     UPDATE_META( Publisher, publisher_text );
@@ -341,7 +344,10 @@ void MetaPanel::clear()
     collection_text->clear();
     seqnum_text->clear();
     seqtot_text->clear();
+    disconnect( description_text, SIGNAL(textChanged()), this,
+                SLOT(enterEditMode()) );
     description_text->clear();
+    CONNECT( description_text, textChanged(), this, enterEditMode() );
     date_text->clear();
     language_text->clear();
     nowplaying_text->clear();