Commit c3ce1f59 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Preferences : Reset preferences.

parent d237ad88
...@@ -142,8 +142,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -142,8 +142,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
// Title Label // Title Label
QLabel *panel_label = new QLabel; QLabel *panel_label = new QLabel;
QFont labelFont = QApplication::font( static_cast<QWidget*>(0) ); QFont labelFont = QApplication::font( static_cast<QWidget*>(0) );
labelFont.setPointSize( labelFont.pointSize() + 4 ); labelFont.setPointSize( labelFont.pointSize() + 6 );
labelFont.setBold( true ); labelFont.setFamily( "Verdana" );
panel_label->setFont( labelFont ); panel_label->setFont( labelFont );
// Title <hr> // Title <hr>
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <QPushButton> #include <QPushButton>
#include <QCheckBox> #include <QCheckBox>
#include <QScrollArea> #include <QScrollArea>
#include <QMessageBox>
PrefsDialog *PrefsDialog::instance = NULL; PrefsDialog *PrefsDialog::instance = NULL;
...@@ -43,9 +45,9 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -43,9 +45,9 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{ {
QGridLayout *main_layout = new QGridLayout( this ); QGridLayout *main_layout = new QGridLayout( this );
setWindowTitle( qtr( "Preferences" ) ); setWindowTitle( qtr( "Preferences" ) );
resize( 800, 650 ); resize( 700, 650 );
setMaximumHeight( 650 ); setMaximumHeight( 650 );
setMaximumWidth( 800 ); setMaximumWidth( 700 );
tree_panel = new QWidget( 0 ); tree_panel = new QWidget( 0 );
tree_panel_l = new QHBoxLayout; tree_panel_l = new QHBoxLayout;
...@@ -82,17 +84,18 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) ...@@ -82,17 +84,18 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
setSmall(); setSmall();
QPushButton *save, *cancel; QPushButton *save, *cancel, *reset;
QHBoxLayout *buttonsLayout = QVLCFrame::doButtons( this, NULL, QHBoxLayout *buttonsLayout = QVLCFrame::doButtons( this, NULL,
&save, _("Save"), &save, _("Save"),
&cancel, _("Cancel"), &cancel, _("Cancel"),
NULL, NULL ); &reset, _( "Reset Preferences" ) );
main_layout->addLayout( buttonsLayout, 4, 0, 1 ,3 ); main_layout->addLayout( buttonsLayout, 4, 0, 1 ,3 );
setLayout( main_layout ); setLayout( main_layout );
BUTTONACT( save, save() ); BUTTONACT( save, save() );
BUTTONACT( cancel, cancel() ); BUTTONACT( cancel, cancel() );
BUTTONACT( reset, reset() );
BUTTONACT( small, setSmall() ); BUTTONACT( small, setSmall() );
BUTTONACT( all, setAll() ); BUTTONACT( all, setAll() );
...@@ -250,3 +253,18 @@ void PrefsDialog::cancel() ...@@ -250,3 +253,18 @@ void PrefsDialog::cancel()
} }
hide(); 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 );
}
}
...@@ -85,6 +85,7 @@ private slots: ...@@ -85,6 +85,7 @@ private slots:
void setSmall(); void setSmall();
void save(); void save();
void cancel(); void cancel();
void reset();
}; };
#endif #endif
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