Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
6e58f38a
Commit
6e58f38a
authored
Feb 21, 2010
by
Hugo Beauzee-Luyssen
Browse files
Preferences: Int settings widgets are now autogenerated
parent
e698ba98
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
6e58f38a
...
...
@@ -43,6 +43,7 @@ SET(VLMC_SRCS
Gui/library/MediaListViewController.cpp
Gui/library/StackViewController.cpp
Gui/library/StackViewNavController.cpp
Gui/settings/IntWidget.cpp
Gui/settings/KeyboardShortcut.cpp
Gui/settings/KeyboardShortcutInput.cpp
Gui/settings/LanguageWidget.cpp
...
...
@@ -127,6 +128,7 @@ SET (VLMC_HDRS
Gui/MainWindow.h
Gui/PreviewRuler.h
Gui/PreviewWidget.h
Gui/settings/IntWidget.h
Gui/settings/ISettingsCategorieWidget.h
Gui/settings/KeyboardShortcut.h
Gui/settings/KeyboardShortcutInput.h
...
...
src/Gui/settings/IntWidget.cpp
0 → 100644
View file @
6e58f38a
/*****************************************************************************
* IntWidget.cpp Handle integer 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
"IntWidget.h"
#include
"SettingValue.h"
#include
<QSpinBox>
IntWidget
::
IntWidget
(
SettingValue
*
s
,
QWidget
*
parent
/*= NULL*/
)
:
m_setting
(
s
)
{
m_lineEdit
=
new
QSpinBox
(
parent
);
m_lineEdit
->
setValue
(
s
->
get
().
toInt
()
);
}
QWidget
*
IntWidget
::
widget
()
{
return
m_lineEdit
;
}
void
IntWidget
::
save
()
{
m_setting
->
set
(
m_lineEdit
->
value
()
);
}
src/Gui/settings/IntWidget.h
0 → 100644
View file @
6e58f38a
/*****************************************************************************
* IntWidget.h Handle integer 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 INTWIDGET_H
#define INTWIDGET_H
#include
"ISettingsCategorieWidget.h"
#include
<stddef.h>
class
SettingValue
;
class
QSpinBox
;
class
IntWidget
:
public
ISettingsCategorieWidget
{
public:
IntWidget
(
SettingValue
*
s
,
QWidget
*
parent
=
NULL
);
QWidget
*
widget
();
void
save
();
private:
SettingValue
*
m_setting
;
QSpinBox
*
m_lineEdit
;
};
#endif // INTWIDGET_H
src/Gui/settings/PreferenceWidget.cpp
View file @
6e58f38a
...
...
@@ -29,6 +29,7 @@
#include
"KeyboardShortcut.h"
#include
"LanguageWidget.h"
#include
"StringWidget.h"
#include
"IntWidget.h"
#include
<QFormLayout>
#include
<QtDebug>
...
...
@@ -69,6 +70,8 @@ PreferenceWidget::widgetFactory( SettingValue *s )
return
new
LanguageWidget
(
s
,
this
);
case
SettingValue
::
String
:
return
new
StringWidget
(
s
,
this
);
case
SettingValue
::
Int
:
return
new
IntWidget
(
s
,
this
);
default:
return
NULL
;
}
...
...
src/Gui/settings/StringWidget.cpp
View file @
6e58f38a
/*****************************************************************************
* StringWidget: Handle text settings.
* StringWidget
.h
: Handle text settings.
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment