Commit df805945 authored by Daniel Marth's avatar Daniel Marth Committed by Jean-Baptiste Kempf

URL box is now focussed when "Open Network Stream" dialog box opens.

The URL box in the "Open Network Stream" dialog has now always focus
when opened and its content is automatically selected.
The patch is for ticket #4361 and was created as a part of a GCI-task
(http://www.google-melange.com/gci/task/show/google/gci2010/videolan/t129200306101).
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 15799211
...@@ -594,6 +594,12 @@ NetOpenPanel::~NetOpenPanel() ...@@ -594,6 +594,12 @@ NetOpenPanel::~NetOpenPanel()
void NetOpenPanel::clear() void NetOpenPanel::clear()
{} {}
void NetOpenPanel::onFocus()
{
ui.urlComboBox->setFocus();
ui.urlComboBox->lineEdit()->selectAll();
}
static int strcmp_void( const void *k, const void *e ) static int strcmp_void( const void *k, const void *e )
{ {
return strcmp( (const char *)k, (const char *)e ); return strcmp( (const char *)k, (const char *)e );
......
...@@ -74,6 +74,7 @@ public: ...@@ -74,6 +74,7 @@ public:
} }
virtual ~OpenPanel() {}; virtual ~OpenPanel() {};
virtual void clear() = 0; virtual void clear() = 0;
virtual void onFocus() {}
protected: protected:
intf_thread_t *p_intf; intf_thread_t *p_intf;
public slots: public slots:
...@@ -140,6 +141,7 @@ public: ...@@ -140,6 +141,7 @@ public:
NetOpenPanel( QWidget *, intf_thread_t * ); NetOpenPanel( QWidget *, intf_thread_t * );
virtual ~NetOpenPanel(); virtual ~NetOpenPanel();
virtual void clear() ; virtual void clear() ;
void onFocus();
private: private:
Ui::OpenNetwork ui; Ui::OpenNetwork ui;
QStringListModel *mrlList; QStringListModel *mrlList;
......
...@@ -240,15 +240,25 @@ void OpenDialog::showTab( int i_tab ) ...@@ -240,15 +240,25 @@ void OpenDialog::showTab( int i_tab )
if( i_tab == OPEN_CAPTURE_TAB ) captureOpenPanel->initialize(); if( i_tab == OPEN_CAPTURE_TAB ) captureOpenPanel->initialize();
ui.Tab->setCurrentIndex( i_tab ); ui.Tab->setCurrentIndex( i_tab );
show(); show();
if( ui.Tab->currentWidget() != NULL )
{
OpenPanel *panel = dynamic_cast<OpenPanel *>( ui.Tab->currentWidget() );
assert( panel );
panel->onFocus();
}
} }
/* Function called on signal currentChanged triggered */ /* Function called on signal currentChanged triggered */
void OpenDialog::signalCurrent( int i_tab ) void OpenDialog::signalCurrent( int i_tab )
{ {
if( i_tab == OPEN_CAPTURE_TAB ) captureOpenPanel->initialize(); if( i_tab == OPEN_CAPTURE_TAB ) captureOpenPanel->initialize();
if( ui.Tab->currentWidget() != NULL ) if( ui.Tab->currentWidget() != NULL )
( dynamic_cast<OpenPanel *>( ui.Tab->currentWidget() ) )->updateMRL(); {
OpenPanel *panel = dynamic_cast<OpenPanel *>( ui.Tab->currentWidget() );
assert( panel );
panel->onFocus();
panel->updateMRL();
}
} }
void OpenDialog::toggleAdvancedPanel() void OpenDialog::toggleAdvancedPanel()
......
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