- setWindowTitle( qtr( "Update" ) );
- resize( 230, 180 );
-
- QGridLayout *layout = new QGridLayout( this );
-
- QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
- updateButton = new QPushButton( qtr( "&Update List" ) );
- updateButton->setDefault( true );
- QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Horizontal);
- buttonBox->addButton( updateButton, QDialogButtonBox::ActionRole );
- buttonBox->addButton( closeButton, QDialogButtonBox::AcceptRole );
-
- QGroupBox *checkGroup = new QGroupBox( qtr( "Select Package" ) );
- QGridLayout *checkLayout = new QGridLayout( checkGroup );
- checkInfo = new QCheckBox( qtr( "Information" ) );
- checkSource = new QCheckBox( qtr( "Sources" ) );
- checkBinary = new QCheckBox( qtr( "Binary" ) );
- checkPlugin = new QCheckBox( qtr( "Plugin" ) );
-
- checkInfo->setDisabled( true );
- checkSource->setDisabled( true );
- checkBinary->setDisabled( true );
- checkPlugin->setDisabled( true );
-
- checkLayout->addWidget( checkInfo, 0, 0 );
- checkLayout->addWidget( checkSource, 1, 0 );
- checkLayout->addWidget( checkBinary, 2, 0 );
- checkLayout->addWidget( checkPlugin, 3, 0 );
-
- layout->addWidget( checkGroup, 0, 0 );
- layout->addWidget( buttonBox, 1, 0 );
-
- BUTTONACT( updateButton, updateOrUpload() );
- BUTTONACT( closeButton, close() );
-
- p_update = update_New( _p_intf );
- b_updated = false;
+ /* build Ui */
+ ui.setupUi( this );
+ ui.updateDialogButtonBox->addButton( new QPushButton( qtr("&Close"), this ),
+ QDialogButtonBox::RejectRole );
+ QPushButton *recheckButton = new QPushButton( qtr("&Recheck version"), this );
+ ui.updateDialogButtonBox->addButton( recheckButton, QDialogButtonBox::ActionRole );
+
+ ui.updateNotifyButtonBox->addButton( new QPushButton( qtr("&Yes"), this ),
+ QDialogButtonBox::AcceptRole );
+ ui.updateNotifyButtonBox->addButton( new QPushButton( qtr("&No"), this ),
+ QDialogButtonBox::RejectRole );
+
+ setWindowTitle( qtr( "VLC media player updates" ) );
+ setWindowRole( "vlc-update" );
+
+ BUTTONACT( recheckButton, UpdateOrDownload() );
+ CONNECT( ui.updateDialogButtonBox, rejected(), this, close() );
+
+ CONNECT( ui.updateNotifyButtonBox, accepted(), this, UpdateOrDownload() );
+ CONNECT( ui.updateNotifyButtonBox, rejected(), this, close() );
+
+ /* Create the update structure */
+ p_update = update_New( p_intf );
+ b_checked = false;
+
+ setMinimumSize( 300, 300 );
+ setMaximumSize( 400, 300 );
+
+ readSettings( "Update", QSize( 300, 250 ) );
+
+ /* Check for updates */
+ UpdateOrDownload();