]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/podcast_configuration.cpp
Forgotten tooltips.
[vlc] / modules / gui / qt4 / dialogs / podcast_configuration.cpp
index 343cd88271a96c21f9edebb6ab6f0ccccf7ad4f1..b49ef97997d8347ac4e77f8f0c5630e9455fcde9 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "podcast_configuration.hpp"
 
-PodcastConfigurationDialog::PodcastConfigurationDialog( intf_thread_t *_p_intf )
-    :p_intf( _p_intf )
+PodcastConfigDialog *PodcastConfigDialog::instance = NULL;
+
+PodcastConfigDialog::PodcastConfigDialog( QWidget *parent, intf_thread_t *_p_intf)
+                    : QVLCDialog( parent, _p_intf )
+
 {
     ui.setupUi( this );
+
+    ui.podcastDelete->setToolTip( qtr( "Delete the selected item" ) );
+    QPushButton *okButton = new QPushButton( qtr( "&Close" ), this );
+    QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ), this );
+    ui.okCancel->addButton( okButton, QDialogButtonBox::AcceptRole );
+    ui.okCancel->addButton( cancelButton, QDialogButtonBox::RejectRole );
+
     CONNECT( ui.podcastAdd, clicked(), this, add() );
     CONNECT( ui.podcastDelete, clicked(), this, remove() );
 
@@ -46,7 +59,11 @@ PodcastConfigurationDialog::PodcastConfigurationDialog( intf_thread_t *_p_intf )
     }
 }
 
-void PodcastConfigurationDialog::accept()
+PodcastConfigDialog::~PodcastConfigDialog()
+{
+}
+
+void PodcastConfigDialog::accept()
 {
     QString urls = "";
     for( int i = 0; i < ui.podcastList->count(); i++ )
@@ -56,14 +73,22 @@ void PodcastConfigurationDialog::accept()
     }
     const char *psz_urls = qtu( urls );
     config_PutPsz( p_intf, "podcast-urls", psz_urls );
+    vlc_object_t *p_obj = (vlc_object_t*)
+                          vlc_object_find_name( p_intf->p_libvlc,
+                                                "podcast", FIND_CHILD );
+    if( p_obj )
+    {
+        var_SetString( p_obj, "podcast-urls", psz_urls );
+        vlc_object_release( p_obj );
+    }
+
     if( playlist_IsServicesDiscoveryLoaded( THEPL, "podcast" ) )
     {
-        msg_Info( p_intf, "You will need to reload the podcast module for changes to be used (FIXME)" );
+        msg_Dbg( p_intf, "You will need to reload the podcast module to take into account deleted podcast urls" );
     }
-    QDialog::accept();
 }
 
-void PodcastConfigurationDialog::add()
+void PodcastConfigDialog::add()
 {
     if( ui.podcastURL->text() != QString( "" ) )
     {
@@ -72,7 +97,7 @@ void PodcastConfigurationDialog::add()
     }
 }
 
-void PodcastConfigurationDialog::remove()
+void PodcastConfigDialog::remove()
 {
     delete ui.podcastList->currentItem();
 }