Commit 354abbea authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Don't allocate and create the Capture Open Panel in open.

The Capture panel is sensibly slower than all the other ones and way less used by most people. Therefore, don't build it (especially for windows) unless you need it. Better for speed and memory.
parent 5ca01aec
......@@ -557,6 +557,16 @@ void NetOpenPanel::updateMRL() {
CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
OpenPanel( _parent, _p_intf )
{
isInitialized = false;
}
void CaptureOpenPanel::initialize()
{
if( isInitialized ) return;
msg_Dbg( p_intf, "Initialization of Capture device panel" );
isInitialized = true;
ui.setupUi( this );
BUTTONACT( ui.advancedButton, advancedDialog() );
......
......@@ -179,6 +179,8 @@ public:
virtual void clear() ;
private:
Ui::OpenCapture ui;
bool isInitialized;
QString advMRL;
QDialog *adv;
#ifdef WIN32
......@@ -203,6 +205,7 @@ private:
public slots:
virtual void updateMRL();
void initialize();
private slots:
void updateButtons();
void advancedDialog();
......
......@@ -128,7 +128,7 @@ OpenDialog::OpenDialog( QWidget *parent,
setMenuAction();
/* Force MRL update on tab change */
CONNECT( ui.Tab, currentChanged( int ), this, signalCurrent() );
CONNECT( ui.Tab, currentChanged( int ), this, signalCurrent( int ) );
CONNECT( fileOpenPanel, mrlUpdated( QString ), this, updateMRL( QString ) );
CONNECT( netOpenPanel, mrlUpdated( QString ), this, updateMRL( QString ) );
......@@ -208,13 +208,16 @@ void OpenDialog::setMenuAction()
void OpenDialog::showTab( int i_tab )
{
if( i_tab == OPEN_CAPTURE_TAB ) captureOpenPanel->initialize();
ui.Tab->setCurrentIndex( i_tab );
show();
}
/* Function called on signal currentChanged triggered */
void OpenDialog::signalCurrent()
void OpenDialog::signalCurrent( int i_tab )
{
if( i_tab == OPEN_CAPTURE_TAB ) captureOpenPanel->initialize();
if( ui.Tab->currentWidget() != NULL )
( dynamic_cast<OpenPanel *>( ui.Tab->currentWidget() ) )->updateMRL();
}
......
......@@ -114,7 +114,7 @@ private slots:
void updateMRL( QString );
void updateMRL();
void newCachingMethod( QString );
void signalCurrent();
void signalCurrent( int );
void browseInputSlave();
};
......
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