Commit 01f29963 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Don't rely on a label to retreive settings.

parent 29b97c37
......@@ -518,13 +518,13 @@ void
MainWindow::createGlobalPreferences()
{
m_globalPreferences = new Settings( SettingsManager::Vlmc, this );
m_globalPreferences->addCategory( QT_TRANSLATE_NOOP( "Settings", "General" ), SettingsManager::Vlmc,
m_globalPreferences->addCategory( "general", QT_TRANSLATE_NOOP( "Settings", "General" ), SettingsManager::Vlmc,
QIcon( ":/images/vlmc" ) );
m_globalPreferences->addCategory( QT_TRANSLATE_NOOP( "Settings", "Keyboard" ), SettingsManager::Vlmc,
m_globalPreferences->addCategory( "keyboard", QT_TRANSLATE_NOOP( "Settings", "Keyboard" ), SettingsManager::Vlmc,
QIcon( ":/images/keyboard" ) );
m_globalPreferences->addCategory( QT_TRANSLATE_NOOP( "Settings", "YouTube" ), SettingsManager::Vlmc,
m_globalPreferences->addCategory( "youtube", QT_TRANSLATE_NOOP( "Settings", "YouTube" ), SettingsManager::Vlmc,
QIcon( ":/images/youtube" ) );
m_globalPreferences->addCategory( QT_TRANSLATE_NOOP( "Settings", "Network" ), SettingsManager::Vlmc,
m_globalPreferences->addCategory( "network", QT_TRANSLATE_NOOP( "Settings", "Network" ), SettingsManager::Vlmc,
QIcon( ":/images/network" ) );
}
......@@ -551,11 +551,11 @@ void
MainWindow::createProjectPreferences()
{
m_projectPreferences = new Settings( SettingsManager::Project, this );
m_projectPreferences->addCategory( QT_TRANSLATE_NOOP( "Settings", "General" ), SettingsManager::Project,
m_projectPreferences->addCategory( "general", QT_TRANSLATE_NOOP( "Settings", "General" ), SettingsManager::Project,
QIcon( ":/images/vlmc" ) );
m_projectPreferences->addCategory( QT_TRANSLATE_NOOP( "Settings", "Video" ), SettingsManager::Project,
m_projectPreferences->addCategory( "video", QT_TRANSLATE_NOOP( "Settings", "Video" ), SettingsManager::Project,
QIcon( ":/images/video" ) );
m_projectPreferences->addCategory( QT_TRANSLATE_NOOP( "Settings", "Audio" ), SettingsManager::Project,
m_projectPreferences->addCategory( "audio", QT_TRANSLATE_NOOP( "Settings", "Audio" ), SettingsManager::Project,
QIcon( ":/images/audio" ) );
}
......
......@@ -42,14 +42,14 @@
#include <QHashIterator>
#include <QEvent>
PreferenceWidget::PreferenceWidget( const char *category, SettingsManager::Type type,
PreferenceWidget::PreferenceWidget( const QString &name, const char *label, SettingsManager::Type type,
QWidget *parent ) :
QScrollArea( parent ),
m_category( category )
m_category( label )
{
QWidget *container = new QWidget( this );
SettingsManager::SettingList settings =
SettingsManager::getInstance()->group( QString( category ), type );
SettingsManager::getInstance()->group( name, type );
QFormLayout *layout = new QFormLayout( container );
layout->setFieldGrowthPolicy( QFormLayout::AllNonFixedFieldsGrow );
......
......@@ -40,7 +40,7 @@ class PreferenceWidget : public QScrollArea
Q_OBJECT
public:
typedef QList<ISettingsCategoryWidget*> SettingsList;
PreferenceWidget( const char* category, SettingsManager::Type type,
PreferenceWidget( const QString &name, const char* category, SettingsManager::Type type,
QWidget* parent = 0 );
virtual ~PreferenceWidget() {}
......
......@@ -62,16 +62,16 @@ Settings::Settings( SettingsManager::Type type, QWidget *parent ) :
}
void
Settings::addCategory( const char *name,
Settings::addCategory( const QString &name, const char *label,
SettingsManager::Type type,
const QIcon &icon )
{
PreferenceWidget *pWidget = new PreferenceWidget( name, type, this );
PreferenceWidget *pWidget = new PreferenceWidget( name, label, type, this );
m_stackedLayout->addWidget( pWidget );
// Create a button linked to the widget using its index
m_panel->addButton( name, icon, m_stackedLayout->count() - 1 );
m_panel->addButton( label, icon, m_stackedLayout->count() - 1 );
switchWidget( 0 );
}
......
......@@ -47,7 +47,8 @@ class Settings : public QDialog
public:
Settings( SettingsManager::Type type, QWidget *parent = 0 );
void addCategory( const char *name,
void addCategory( const QString& categorieName,
const char *label,
SettingsManager::Type type,
const QIcon &icon );
......
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