Commit 0a48a346 authored by Clement CHAVANCE's avatar Clement CHAVANCE
Browse files

title of the preference window change when we switch between widgets

parent 45175e2a
......@@ -168,10 +168,10 @@ void MainWindow::createGlobalPreferences()
"images/vlmc.png",
"Language");
//For debugging purpose
m_globalPreferences->addWidget("language",
m_globalPreferences->addWidget("Test",
new QLabel("This is a test"),
"images/vlmc.png",
"Language");
"Test");
m_globalPreferences->build();
}
......
......@@ -69,7 +69,9 @@ void SimplePreferences::addWidget( const QString& name,
m_widgets.insert( idx, name );
m_panel->addButton( label, icon, idx );
if (m_currentWidget == 0)
{
m_currentWidget = widget;
}
}
void SimplePreferences::build()
......@@ -104,6 +106,8 @@ QVBoxLayout* SimplePreferences::buildRightHLayout()
QDialogButtonBox::Cancel |
QDialogButtonBox::Apply );
QString title( m_widgets.value( m_stackedWidgets->indexOf( m_currentWidget ) ) );
m_title->setText( title );
layout->addWidget( m_title );
layout->addWidget( titleLine );
layout->addWidget( m_stackedWidgets );
......@@ -118,6 +122,7 @@ void SimplePreferences::switchWidget( int widget )
if ( !m_widgets.contains( widget ) )
return ;
m_title->setText( m_widgets.value( widget ) );
emit widgetSwitched( widget );
}
Supports Markdown
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