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,11 +23,14 @@
#include "podcast_configuration.hpp"
PodcastConfigurationDialog::PodcastConfigurationDialog( intf_thread_t *_p_intf )
:p_intf( _p_intf )
PodcastConfigDialog *PodcastConfigDialog::instance = NULL;
PodcastConfigDialog::PodcastConfigDialog( intf_thread_t *_p_intf)
: QVLCFrame( _p_intf )
{
ui.setupUi( this );
QPushButton *okButton = new QPushButton( qtr( "OK" ), this );
QPushButton *cancelButton = new QPushButton( qtr( "Cancel" ), this );
ui.okCancel->addButton( okButton, QDialogButtonBox::AcceptRole );
......@@ -51,7 +54,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++ )
......@@ -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" );
}
QDialog::accept();
}
void PodcastConfigurationDialog::add()
void PodcastConfigDialog::add()
{
if( ui.podcastURL->text() != QString( "" ) )
{
......@@ -87,7 +92,7 @@ void PodcastConfigurationDialog::add()
}
}
void PodcastConfigurationDialog::remove()
void PodcastConfigDialog::remove()
{
delete ui.podcastList->currentItem();
}
......@@ -24,21 +24,26 @@
#ifndef _PODCAST_CONFIGURATION_DIALOG_H_
#define _PODCAST_CONFIGURATION_DIALOG_H_
#include "qt4.hpp"
#include "util/qvlcframe.hpp"
#include "ui/podcast_configuration.h"
class PodcastConfigurationDialog : public QDialog
class PodcastConfigDialog : public QVLCFrame
{
Q_OBJECT;
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:
PodcastConfigDialog( intf_thread_t *);
static PodcastConfigDialog *instance;
Ui::PodcastConfiguration ui;
intf_thread_t *p_intf;
private slots:
public slots:
void accept();
void add();
void remove();
......
......@@ -110,7 +110,10 @@ void DialogsProvider::customEvent( QEvent *event )
bookmarksDialog(); break;
case INTF_DIALOG_EXTENDED:
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:
QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0) ); break;
case INTF_DIALOG_AUDIOPOPUPMENU:
......@@ -119,10 +122,6 @@ void DialogsProvider::customEvent( QEvent *event )
QVLCMenu::VideoPopupMenu( p_intf ); break;
case INTF_DIALOG_MISCPOPUPMENU:
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_STREAMWIZARD:
case INTF_DIALOG_UPDATEVLC:
......@@ -191,6 +190,12 @@ void DialogsProvider::bookmarksDialog()
/* BookmarkDialog::getInstance( p_intf )->toggleVisible(); */
}
void DialogsProvider::podcastConfigureDialog()
{
PodcastConfigDialog::getInstance( p_intf )->toggleVisible();
}
/****************************************************************************
* All the open/add stuff
* Open Dialog first - Simple Open then
......@@ -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()
{
var_SetString( p_intf, "intf-switch", "skins2" );
......
<ui version="4.0" >
<class>PodcastConfiguration</class>
<widget class="QDialog" name="PodcastConfiguration" >
<widget class="QWidget" name="PodcastConfiguration" >
<property name="geometry" >
<rect>
<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