Commit d0f00ee6 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: podcast configuration, don't use a modal window, don't use a Qdailog but a QVLCFrame.

parent f913159d
...@@ -23,8 +23,11 @@ ...@@ -23,8 +23,11 @@
#include "podcast_configuration.hpp" #include "podcast_configuration.hpp"
PodcastConfigurationDialog::PodcastConfigurationDialog( intf_thread_t *_p_intf ) PodcastConfigDialog *PodcastConfigDialog::instance = NULL;
:p_intf( _p_intf )
PodcastConfigDialog::PodcastConfigDialog( intf_thread_t *_p_intf)
: QVLCFrame( _p_intf )
{ {
ui.setupUi( this ); ui.setupUi( this );
...@@ -51,7 +54,11 @@ PodcastConfigurationDialog::PodcastConfigurationDialog( intf_thread_t *_p_intf ) ...@@ -51,7 +54,11 @@ PodcastConfigurationDialog::PodcastConfigurationDialog( intf_thread_t *_p_intf )
} }
} }
void PodcastConfigurationDialog::accept() PodcastConfigDialog::~PodcastConfigDialog()
{
}
void PodcastConfigDialog::accept()
{ {
QString urls = ""; QString urls = "";
for( int i = 0; i < ui.podcastList->count(); i++ ) for( int i = 0; i < ui.podcastList->count(); i++ )
...@@ -74,11 +81,9 @@ void PodcastConfigurationDialog::accept() ...@@ -74,11 +81,9 @@ void PodcastConfigurationDialog::accept()
{ {
msg_Dbg( p_intf, "You will need to reload the podcast module to take into account deleted podcast urls" ); 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( "" ) ) if( ui.podcastURL->text() != QString( "" ) )
{ {
...@@ -87,7 +92,7 @@ void PodcastConfigurationDialog::add() ...@@ -87,7 +92,7 @@ void PodcastConfigurationDialog::add()
} }
} }
void PodcastConfigurationDialog::remove() void PodcastConfigDialog::remove()
{ {
delete ui.podcastList->currentItem(); delete ui.podcastList->currentItem();
} }
...@@ -24,21 +24,26 @@ ...@@ -24,21 +24,26 @@
#ifndef _PODCAST_CONFIGURATION_DIALOG_H_ #ifndef _PODCAST_CONFIGURATION_DIALOG_H_
#define _PODCAST_CONFIGURATION_DIALOG_H_ #define _PODCAST_CONFIGURATION_DIALOG_H_
#include "qt4.hpp" #include "util/qvlcframe.hpp"
#include "ui/podcast_configuration.h" #include "ui/podcast_configuration.h"
class PodcastConfigurationDialog : public QDialog class PodcastConfigDialog : public QVLCFrame
{ {
Q_OBJECT; Q_OBJECT;
public: public:
PodcastConfigurationDialog( intf_thread_t *p_intf ); static PodcastConfigDialog * getInstance( intf_thread_t *p_intf )
{
if( !instance)
instance = new PodcastConfigDialog( p_intf );
return instance;
}
virtual ~PodcastConfigDialog();
private: private:
PodcastConfigDialog( intf_thread_t *);
static PodcastConfigDialog *instance;
Ui::PodcastConfiguration ui; Ui::PodcastConfiguration ui;
intf_thread_t *p_intf; public slots:
private slots:
void accept(); void accept();
void add(); void add();
void remove(); void remove();
......
...@@ -110,7 +110,10 @@ void DialogsProvider::customEvent( QEvent *event ) ...@@ -110,7 +110,10 @@ void DialogsProvider::customEvent( QEvent *event )
bookmarksDialog(); break; bookmarksDialog(); break;
case INTF_DIALOG_EXTENDED: case INTF_DIALOG_EXTENDED:
extendedDialog(); break; extendedDialog(); break;
/* We might want to make it better with custom functions */ case INTF_DIALOG_VLM:
vlmDialog(); break;
case INTF_DIALOG_INTERACTION:
doInteraction( de->p_arg ); break;
case INTF_DIALOG_POPUPMENU: case INTF_DIALOG_POPUPMENU:
QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0) ); break; QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0) ); break;
case INTF_DIALOG_AUDIOPOPUPMENU: case INTF_DIALOG_AUDIOPOPUPMENU:
...@@ -119,10 +122,6 @@ void DialogsProvider::customEvent( QEvent *event ) ...@@ -119,10 +122,6 @@ void DialogsProvider::customEvent( QEvent *event )
QVLCMenu::VideoPopupMenu( p_intf ); break; QVLCMenu::VideoPopupMenu( p_intf ); break;
case INTF_DIALOG_MISCPOPUPMENU: case INTF_DIALOG_MISCPOPUPMENU:
QVLCMenu::MiscPopupMenu( p_intf ); break; QVLCMenu::MiscPopupMenu( p_intf ); break;
case INTF_DIALOG_INTERACTION:
doInteraction( de->p_arg ); break;
case INTF_DIALOG_VLM:
vlmDialog(); break;
case INTF_DIALOG_WIZARD: case INTF_DIALOG_WIZARD:
case INTF_DIALOG_STREAMWIZARD: case INTF_DIALOG_STREAMWIZARD:
case INTF_DIALOG_UPDATEVLC: case INTF_DIALOG_UPDATEVLC:
...@@ -191,6 +190,12 @@ void DialogsProvider::bookmarksDialog() ...@@ -191,6 +190,12 @@ void DialogsProvider::bookmarksDialog()
/* BookmarkDialog::getInstance( p_intf )->toggleVisible(); */ /* BookmarkDialog::getInstance( p_intf )->toggleVisible(); */
} }
void DialogsProvider::podcastConfigureDialog()
{
PodcastConfigDialog::getInstance( p_intf )->toggleVisible();
}
/**************************************************************************** /****************************************************************************
* All the open/add stuff * All the open/add stuff
* Open Dialog first - Simple Open then * Open Dialog first - Simple Open then
...@@ -503,12 +508,6 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg ) ...@@ -503,12 +508,6 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
} }
} }
void DialogsProvider::podcastConfigureDialog()
{
PodcastConfigurationDialog c( p_intf );
c.exec();
}
void DialogsProvider::switchToSkins() void DialogsProvider::switchToSkins()
{ {
var_SetString( p_intf, "intf-switch", "skins2" ); var_SetString( p_intf, "intf-switch", "skins2" );
......
<ui version="4.0" > <ui version="4.0" >
<class>PodcastConfiguration</class> <class>PodcastConfiguration</class>
<widget class="QDialog" name="PodcastConfiguration" > <widget class="QWidget" name="PodcastConfiguration" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
......
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