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: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 15799211
......@@ -594,6 +594,12 @@ NetOpenPanel::~NetOpenPanel()
void NetOpenPanel::clear()
{}
void NetOpenPanel::onFocus()
{
ui.urlComboBox->setFocus();
ui.urlComboBox->lineEdit()->selectAll();
}
static int strcmp_void( const void *k, const void *e )
{
return strcmp( (const char *)k, (const char *)e );
......
......@@ -74,6 +74,7 @@ public:
}
virtual ~OpenPanel() {};
virtual void clear() = 0;
virtual void onFocus() {}
protected:
intf_thread_t *p_intf;
public slots:
......@@ -140,6 +141,7 @@ public:
NetOpenPanel( QWidget *, intf_thread_t * );
virtual ~NetOpenPanel();
virtual void clear() ;
void onFocus();
private:
Ui::OpenNetwork ui;
QStringListModel *mrlList;
......
......@@ -240,15 +240,25 @@ void OpenDialog::showTab( int i_tab )
if( i_tab == OPEN_CAPTURE_TAB ) captureOpenPanel->initialize();
ui.Tab->setCurrentIndex( i_tab );
show();
if( ui.Tab->currentWidget() != NULL )
{
OpenPanel *panel = dynamic_cast<OpenPanel *>( ui.Tab->currentWidget() );
assert( panel );
panel->onFocus();
}
}
/* Function called on signal currentChanged triggered */
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();
{
OpenPanel *panel = dynamic_cast<OpenPanel *>( ui.Tab->currentWidget() );
assert( panel );
panel->onFocus();
panel->updateMRL();
}
}
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