]> git.sesse.net Git - vlc/commitdiff
QT4: enable fontdialog for choosing freetype-font family
authorIlkka Ollakka <ileoo@videolan.org>
Mon, 3 Aug 2009 07:53:20 +0000 (10:53 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Mon, 3 Aug 2009 07:53:20 +0000 (10:53 +0300)
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.

modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/simple_preferences.cpp

index 6c7422349f99af883cf116a1d5b7ced34f34177a..24968a4c7bb7e4ce7e66b3126cdeb73e916fc26d 100644 (file)
@@ -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,
index 94f68ad2679517d7d812712b9aa6fdf13fac7160..f6e4ba0b32519e824cc54cb87f3e7e9e4f0092bb 100644 (file)
@@ -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
 {
index 7b51f97509d01288b36399550e43f262b8a40609..52d1e261eebc977a0b2c37c0bcceeabd0bc2121d 100644 (file)
@@ -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 );