#include <QtDebug>
SettingsView::SettingsView( QWidget *aParent ) :
- ObservedWidget( aParent )
+ ViewBase( ViewBase::NormalView, aParent )
{
qDebug() << "SettingsView::ctor invoked";
// Prepare the tabbed view
QHBoxLayout *buttonLayout = new QHBoxLayout;
iOkButton = new QPushButton;
iOkButton->setText( tr( "OK" ) );
- iCancelButton = new QPushButton;
- iCancelButton->setText( tr( "Cancel" ) );
buttonLayout->addWidget( iOkButton );
- buttonLayout->addWidget( iCancelButton );
// Handle the main layout
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout( mainLayout );
// Handle component connections
- connect( iOkButton, SIGNAL( pressed() ), this, SLOT( okClicked() ) );
- connect( iCancelButton, SIGNAL( pressed() ), this, SLOT( cancelClicked() ) );
+ connect( iOkButton, SIGNAL( clicked() ), this, SLOT( handleOkClicked() ) );
}
SettingsView::~SettingsView()
delete iOkButton;
iOkButton = 0;
}
- if ( iCancelButton != 0 )
- {
- delete iCancelButton;
- iCancelButton = 0;
- }
if ( iSettingsTab != 0 )
{
delete iSettingsTab;
return widget;
}
-void SettingsView::okClicked()
+void SettingsView::handleOkClicked()
{
qDebug() << "[SettingsView::okClicked] <Invoked>";
bool powerSaveEnabled = iPowerSaveEnabled->isChecked();
// TODO : Set the values to configuration and save it
-
- close();
+
+ // Emit the signal to notify that ok is pressed and data is saved.
+ emit okClicked();
}
-void SettingsView::cancelClicked()
+void SettingsView::viewResized(const QSize &size)
{
- qDebug() << "[SettingsView::cancelClicked] <Invoked>";
- close();
-}
+ qDebug() << "[SettingsView::viewResized] <Invoked>";
+
+ qDebug() << "[SettingsView::viewResized] <Finished>";
+}
\ No newline at end of file