]> git.sesse.net Git - vlc/commitdiff
Qt4 - Preferences : Reset preferences.
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 13 Mar 2007 21:08:04 +0000 (21:08 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 13 Mar 2007 21:08:04 +0000 (21:08 +0000)
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/dialogs/prefs_dialog.cpp
modules/gui/qt4/dialogs/prefs_dialog.hpp

index a311709da78136cbc5c5c06e38112e3bff4e70a2..59f5211edb00d6f57ba4ae5515b22a84690171c4 100644 (file)
@@ -142,8 +142,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     // Title Label
     QLabel *panel_label = new QLabel;
     QFont labelFont = QApplication::font( static_cast<QWidget*>(0) );
-    labelFont.setPointSize( labelFont.pointSize() + 4 );
-    labelFont.setBold( true );
+    labelFont.setPointSize( labelFont.pointSize() + 6 );
+    labelFont.setFamily( "Verdana" );
     panel_label->setFont( labelFont );
 
     // Title <hr>
index f0a663f2d3c67456089a96063fb61ceb65e1f72d..57008874f9d32202912e10c4872198abd08d0f09 100644 (file)
@@ -36,6 +36,8 @@
 #include <QPushButton>
 #include <QCheckBox>
 #include <QScrollArea>
+#include <QMessageBox>
+
 
 PrefsDialog *PrefsDialog::instance = NULL;
 
@@ -43,9 +45,9 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 {
      QGridLayout *main_layout = new QGridLayout( this );
      setWindowTitle( qtr( "Preferences" ) );
-     resize( 800, 650 );
+     resize( 700, 650 );
      setMaximumHeight( 650 );
-     setMaximumWidth( 800 );
+     setMaximumWidth( 700 );
 
      tree_panel = new QWidget( 0 );
      tree_panel_l = new QHBoxLayout;
@@ -82,17 +84,18 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 
      setSmall();
 
-     QPushButton *save, *cancel;
+     QPushButton *save, *cancel, *reset;
      QHBoxLayout *buttonsLayout = QVLCFrame::doButtons( this, NULL,
-                                                        &save, _("Save"),
-                                                        &cancel, _("Cancel"),
-                                                        NULL, NULL );
+                                      &save, _("Save"),
+                                      &cancel, _("Cancel"),
+                                      &reset, _( "Reset Preferences" ) );
      main_layout->addLayout( buttonsLayout, 4, 0, 1 ,3 );
      setLayout( main_layout );
 
 
      BUTTONACT( save, save() );
      BUTTONACT( cancel, cancel() );
+     BUTTONACT( reset, reset() );
      BUTTONACT( small, setSmall() );
      BUTTONACT( all, setAll() );
 
@@ -250,3 +253,18 @@ void PrefsDialog::cancel()
     }
     hide();
 }
+
+void PrefsDialog::reset()
+{
+    int ret = QMessageBox::question(this, qtr("Reset Preferences"),
+                 qtr("This will reset your VLC media player preferences.\n"
+                         "Are you sure you want to continue?"),
+                  QMessageBox::Ok | QMessageBox::Cancel,
+                                                         QMessageBox::Ok);
+    if ( ret == QMessageBox::Ok )
+    {
+        config_ResetAll( p_intf );
+        // TODO reset changes ?
+         config_SaveConfigFile( p_intf, NULL );
+    }
+}
index 35a234f03c4567abfab74c9c574a6302d727b8f5..17722e76c835dd28cdc244c9a89eff67894257cb 100644 (file)
@@ -85,6 +85,7 @@ private slots:
      void setSmall();
      void save();
      void cancel();
+     void reset();
 };
 
 #endif