[vlc-devel] commit: QT4: enable fontdialog for choosing freetype-font family ( Ilkka Ollakka )

git version control git at videolan.org
Mon Aug 3 12:21:03 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Aug  3 10:53:20 2009 +0300| [c6f40f60027b035eb62b2b07a7439a54ced15064] | committer: Ilkka Ollakka 

QT4: enable fontdialog for choosing freetype-font family

At the moment it doesn't handle those size/bold/* stuff, only takes font
from it. But IMO still better than old file-choosing way.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c6f40f60027b035eb62b2b07a7439a54ced15064
---

 modules/gui/qt4/components/preferences_widgets.cpp |   14 +++++---------
 modules/gui/qt4/components/preferences_widgets.hpp |    6 ++----
 modules/gui/qt4/components/simple_preferences.cpp  |    2 +-
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 6c74223..24968a4 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -136,12 +136,10 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
         p_control = new DirectoryConfigControl( p_this, p_item, parent, l,
                                                 line );
         break;
-#if 0
     case CONFIG_ITEM_FONT:
         p_control = new FontConfigControl( p_this, p_item, parent, l,
-                                           line, false );
+                                           line);
         break;
-#endif
     case CONFIG_ITEM_KEY:
         p_control = new KeySelectorControl( p_this, p_item, parent, l, line );
         break;
@@ -370,20 +368,19 @@ void DirectoryConfigControl::updateField()
     text->setText( toNativeSepNoSlash( dir ) );
 }
 
-#if 0
 #include <QFontDialog>
 
 /********* String / Font **********/
 FontConfigControl::FontConfigControl( vlc_object_t *_p_this,
                         module_config_t *_p_item, QWidget *_p_widget,
-                        QGridLayout *_p_layout, int& _int, bool _pwd ) :
-     FileConfigControl( _p_this, _p_item, _p_widget, _p_layout, _int, _pwd)
+                        QGridLayout *_p_layout, int& _int) :
+     FileConfigControl( _p_this, _p_item, _p_widget, _p_layout, _int)
 {}
 
 FontConfigControl::FontConfigControl( vlc_object_t *_p_this,
                         module_config_t *_p_item, QLabel *_p_label,
-                        QLineEdit *_p_line, QPushButton *_p_button, bool _pwd ):
-     FileConfigControl( _p_this, _p_item, _p_label, _p_line, _p_button, _pwd)
+                        QLineEdit *_p_line, QPushButton *_p_button):
+     FileConfigControl( _p_this, _p_item, _p_label, _p_line, _p_button)
 {}
 
 void FontConfigControl::updateField()
@@ -393,7 +390,6 @@ void FontConfigControl::updateField()
     if( !ok ) return;
     text->setText( font.family() );
 }
-#endif
 
 /********* String / choice list **********/
 StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp
index 94f68ad..f6e4ba0 100644
--- a/modules/gui/qt4/components/preferences_widgets.hpp
+++ b/modules/gui/qt4/components/preferences_widgets.hpp
@@ -329,20 +329,18 @@ public slots:
     virtual void updateField();
 };
 
-#if 0
 class FontConfigControl : public FileConfigControl
 {
     Q_OBJECT;
 public:
     FontConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                       QGridLayout *, int&, bool pwd );
+                       QGridLayout *, int&);
     FontConfigControl( vlc_object_t *, module_config_t *, QLabel *,
-                       QLineEdit *, QPushButton *, bool pwd );
+                       QLineEdit *, QPushButton *);
     virtual ~FontConfigControl() {};
 public slots:
     virtual void updateField();
 };
-#endif
 
 class ModuleConfigControl : public VStringConfigControl
 {
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 7b51f97..52d1e26 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -576,7 +576,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                             encoding );
             CONFIG_GENERIC( "sub-language", String, ui.subLangLabel,
                             preferredLanguage );
-            CONFIG_GENERIC_FILE( "freetype-font", File, ui.fontLabel, ui.font,
+            CONFIG_GENERIC_FILE( "freetype-font", Font, ui.fontLabel, ui.font,
                             ui.fontBrowse );
             CONFIG_GENERIC( "freetype-color", IntegerList, ui.fontColorLabel,
                             fontColor );




More information about the vlc-devel mailing list