Commit e698ba98 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Preferences: String preferences are now autogenerated

parent a5a9953e
...@@ -49,6 +49,7 @@ SET(VLMC_SRCS ...@@ -49,6 +49,7 @@ SET(VLMC_SRCS
Gui/settings/Panel.cpp Gui/settings/Panel.cpp
Gui/settings/PreferenceWidget.cpp Gui/settings/PreferenceWidget.cpp
Gui/settings/Settings.cpp Gui/settings/Settings.cpp
Gui/settings/StringWidget.cpp
Gui/timeline/AbstractGraphicsMediaItem.cpp Gui/timeline/AbstractGraphicsMediaItem.cpp
Gui/timeline/GraphicsAudioItem.cpp Gui/timeline/GraphicsAudioItem.cpp
Gui/timeline/GraphicsCursorItem.cpp Gui/timeline/GraphicsCursorItem.cpp
...@@ -133,6 +134,7 @@ SET (VLMC_HDRS ...@@ -133,6 +134,7 @@ SET (VLMC_HDRS
Gui/settings/Panel.h Gui/settings/Panel.h
Gui/settings/PreferenceWidget.h Gui/settings/PreferenceWidget.h
Gui/settings/Settings.h Gui/settings/Settings.h
Gui/settings/StringWidget.h
Gui/TagWidget.h Gui/TagWidget.h
Gui/timeline/AbstractGraphicsMediaItem.h Gui/timeline/AbstractGraphicsMediaItem.h
Gui/timeline/GraphicsAudioItem.h Gui/timeline/GraphicsAudioItem.h
......
...@@ -348,18 +348,15 @@ void MainWindow::createGlobalPreferences() ...@@ -348,18 +348,15 @@ void MainWindow::createGlobalPreferences()
void MainWindow::createProjectPreferences() void MainWindow::createProjectPreferences()
{ {
m_projectPreferences = new Settings( this ); m_projectPreferences = new Settings( this );
// m_projectPreferences->addWidget( tr( "Project" ), m_projectPreferences->addCategorie( "general", SettingsManager::Project,
// new ProjectPreferences, QIcon( ":/images/images/vlmc.png" ),
// QIcon( ":/images/images/vlmc.png" ), tr ( "Project settings" ) );
// tr ( "Project settings" ) ); m_projectPreferences->addCategorie( "video", SettingsManager::Project,
// m_projectPreferences->addWidget( tr ( "Video" ), QIcon( ":/images/images/video.png" ),
// new VideoProjectPreferences, tr ( "Video settings" ) );
// QIcon( ":/images/images/video.png" ), m_projectPreferences->addCategorie( "audio", SettingsManager::Project,
// tr ( "Video settings" ) ); QIcon( ":/images/images/audio.png" ),
// m_projectPreferences->addWidget( tr ( "Audio" ), tr ( "Audio settings" ) );
// new AudioProjectPreferences,
// QIcon( ":/images/images/audio.png" ),
// tr ( "Audio settings" ) );
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <stddef.h> #include <stddef.h>
class SettingValue; class SettingValue;
class QComboBox; class QComboBox;
class QTranslator; class QTranslator;
......
...@@ -25,8 +25,10 @@ ...@@ -25,8 +25,10 @@
#include "ISettingsCategorieWidget.h" #include "ISettingsCategorieWidget.h"
#include "PreferenceWidget.h" #include "PreferenceWidget.h"
#include "SettingsManager.h" #include "SettingsManager.h"
#include "KeyboardShortcut.h" #include "KeyboardShortcut.h"
#include "LanguageWidget.h" #include "LanguageWidget.h"
#include "StringWidget.h"
#include <QFormLayout> #include <QFormLayout>
#include <QtDebug> #include <QtDebug>
...@@ -65,6 +67,8 @@ PreferenceWidget::widgetFactory( SettingValue *s ) ...@@ -65,6 +67,8 @@ PreferenceWidget::widgetFactory( SettingValue *s )
return new KeyboardShortcut( s, this ); return new KeyboardShortcut( s, this );
case SettingValue::Language: case SettingValue::Language:
return new LanguageWidget( s, this ); return new LanguageWidget( s, this );
case SettingValue::String:
return new StringWidget( s, this );
default: default:
return NULL; return NULL;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Copyright (C) 2008-2010 VideoLAN * Copyright (C) 2008-2010 VideoLAN
* *
* Authors: Clement CHAVANCE <kinder@vlmc.org> * Authors: Clement CHAVANCE <kinder@vlmc.org>
* Hugo Beauzée-Luyssen <hugo@vlmc.org>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
/*****************************************************************************
* StringWidget: Handle text settings.
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@vlmc.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "StringWidget.h"
#include "SettingValue.h"
#include <QLineEdit>
StringWidget::StringWidget( SettingValue *s, QWidget *parent /*= NULL*/ ) :
m_setting( s )
{
m_lineEdit = new QLineEdit( parent );
m_lineEdit->setText( s->get().toString() );
}
QWidget*
StringWidget::widget()
{
return m_lineEdit;
}
void
StringWidget::save()
{
m_setting->set( m_lineEdit->text() );
}
/*****************************************************************************
* StringWidget: Handle text settings.
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@vlmc.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef STRINGWIDGET_H
#define STRINGWIDGET_H
#include "ISettingsCategorieWidget.h"
#include <stddef.h>
class SettingValue;
class QLineEdit;
class StringWidget : public ISettingsCategorieWidget
{
public:
StringWidget( SettingValue *s, QWidget *parent = NULL );
QWidget* widget();
void save();
private:
SettingValue *m_setting;
QLineEdit *m_lineEdit;
};
#endif // STRINGWIDGET_H
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