#include "DisplaySettings.h"
#include "ConnectionSettings.h"
#include "StartupSettings.h"
+#include <QScrollArea>
#include <QtDebug>
+#define QT_DELETE(X) \
+ if ( X != 0 ) \
+ { \
+ qDebug() << "delete " << X; \
+ delete X; \
+ X = 0; \
+ }
+
SettingsView::SettingsView( QWidget *aParent ) :
ViewBase( ViewBase::NormalView, aParent )
{
SettingsView::~SettingsView()
{
- if ( iTabWidget != 0 )
- {
- delete iTabWidget;
- iTabWidget = 0;
- }
- if ( iOkButton != 0 )
- {
- delete iOkButton;
- iOkButton = 0;
- }
- if ( iCancelButton != 0 )
- {
- delete iCancelButton;
- iCancelButton = 0;
- }
- if ( iSettingsTab != 0 )
- {
- delete iSettingsTab;
- iSettingsTab = 0;
- }
- if ( iWeekViewTab != 0 )
- {
- delete iWeekViewTab;
- iWeekViewTab = 0;
- }
- if ( iResourcesTab != 0 )
- {
- delete iResourcesTab;
- iResourcesTab = 0;
- }
- if ( iKioskModeTab != 0 )
- {
- delete iKioskModeTab;
- iKioskModeTab = 0;
- }
- if ( iUserName != 0 )
- {
- delete iUserName;
- iUserName = 0;
- }
- if ( iPassword != 0 )
- {
- delete iPassword;
- iPassword = 0;
- }
- if ( iServerAddress != 0 )
- {
- delete iServerAddress;
- iServerAddress = 0;
- }
- if ( iDayStartTime != 0 )
- {
- delete iDayStartTime;
- iDayStartTime = 0;
- }
- if ( iDayEndTime != 0 )
- {
- delete iDayEndTime;
- iDayEndTime = 0;
- }
- if ( iFiveDays != 0 )
- {
- delete iFiveDays;
- iFiveDays = 0;
- }
- if ( iSevenDays != 0 )
- {
- delete iSevenDays;
- iSevenDays = 0;
- }
- if ( iRefreshInterval != 0 )
- {
- delete iRefreshInterval;
- iRefreshInterval = 0;
- }
- if ( iPowerSaveEnabled != 0 )
- {
- delete iPowerSaveEnabled;
- iPowerSaveEnabled = 0;
- }
- if ( iPowerSaveStartTime != 0 )
- {
- delete iPowerSaveStartTime;
- iPowerSaveStartTime = 0;
- }
- if ( iPowerSaveEndTime != 0 )
- {
- delete iPowerSaveEndTime;
- iPowerSaveEndTime = 0;
- }
+ qDebug() << "[SettingsView::~SettingsView]";
+ /*QT_DELETE(iOkButton);
+ QT_DELETE(iCancelButton);
+ QT_DELETE(iUserName);
+ QT_DELETE(iPassword);
+ QT_DELETE(iServerAddress);
+ QT_DELETE(iDayStartTime);
+ QT_DELETE(iDayEndTime);
+ QT_DELETE(iFiveDays);
+ QT_DELETE(iSevenDays);
+ QT_DELETE(iRefreshInterval);
+ QT_DELETE(iPowerSaveEnabled);
+ QT_DELETE(iPowerSaveStartTime);
+ QT_DELETE(iPowerSaveEndTime);
+ QT_DELETE(iShowConfidentialMeetingDetails);
+ QT_DELETE(iSettingsTab);
+ QT_DELETE(iWeekViewTab);
+ QT_DELETE(iResourcesTab);
+ QT_DELETE(iKioskModeTab);
+ QT_DELETE(iTabWidget);*/
}
QWidget *SettingsView::initSettingsTab()
// Create the group boxes
QGroupBox *userInformationGroup = new QGroupBox( tr( "User Information" ) );
QGroupBox *serverInformationGroup = new QGroupBox( tr( "Server Information" ) );
+ QGroupBox *privacySettingsGroup = new QGroupBox( tr( "Privacy Settings" ) );
// Prepare the user infromation group box
QGridLayout *ugl = new QGridLayout;
serverInformationGroup->setLayout( sgl );
+ // Prepare meeting info setting box
+ QGridLayout *pgl = new QGridLayout;
+ iShowConfidentialMeetingDetails = new QCheckBox( tr( "Show confidential meeting details" ) );
+
+ pgl->addWidget( iShowConfidentialMeetingDetails, 0, 0 );
+
+ privacySettingsGroup->setLayout( pgl );
+
// Prepare and set the main layout
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget( userInformationGroup );
mainLayout->addWidget( serverInformationGroup );
+ mainLayout->addWidget( privacySettingsGroup );
widget->setLayout( mainLayout );
- return widget;
+ QScrollArea *scroll = new QScrollArea;
+ scroll->setWidget(widget);
+ return scroll;
}
QWidget *SettingsView::initWeekViewTab()
widget->setLayout( mainLayout );
- return widget;
+ QScrollArea *scroll = new QScrollArea;
+ scroll->setWidget(widget);
+ return scroll;
}
QWidget *SettingsView::initResourcesTab()
widget->setLayout( mainLayout );
- return widget;
+ QScrollArea *scroll = new QScrollArea;
+ scroll->setWidget(widget);
+ return scroll;
}
QWidget *SettingsView::initKioskModeTab()
}
iPowerSaveStartTime->setTime( Configuration::instance()->startupSettings()->turnOnAt() );
iPowerSaveEndTime->setTime( Configuration::instance()->startupSettings()->turnOffAt() );
-
+
// Prepare the admin password box
QGroupBox *adminPasswordGroup = new QGroupBox( tr( "Admin Password" ) );
QLabel *oldPwdLabel = new QLabel( tr( "Old password:" ) );
widget->setLayout( mainLayout );
- return widget;
+ QScrollArea *scroll = new QScrollArea;
+ scroll->setWidget(widget);
+ return scroll;
}
void SettingsView::handleOkClicked()
bool sevenDays = iSevenDays->isChecked();
bool powerSaveEnabled = iPowerSaveEnabled->isChecked();
+ bool showConfidentialMeetingDetails = iShowConfidentialMeetingDetails->isChecked();
+
// set values to Configuration
// set user information
- Configuration::instance()->connectionSettings()->setUsername( userName );
- Configuration::instance()->connectionSettings()->setPassword( password );
+ Configuration::instance()->setUsername(userName);//connectionSettings()->setUsername( userName );
+ Configuration::instance()->setPassword(password);//connectionSettings()->setPassword( password );
// set server information
- Configuration::instance()->connectionSettings()->setServerUrl( serverAddress );
+ Configuration::instance()->setServerUrl(serverAddress);//connectionSettings()->setServerUrl( serverAddress );
if ( ok )
{
- Configuration::instance()->connectionSettings()->setRefreshInterval( refreshInterval );
+ Configuration::instance()->setRefreshinterval(refreshInterval);//connectionSettings()->setRefreshInterval( refreshInterval );
}
// set weekly view settings
Configuration::instance()->startupSettings()->setTurnOnAt( powerSaveStart );
Configuration::instance()->startupSettings()->setTurnOffAt( powerSaveEnd );
+ // set privacy settings
+ Configuration::instance()->setShowConfidentialMeetingDetails( showConfidentialMeetingDetails );
+
+ qDebug() << "[SettingsView::okClicked] save()";
+
// save configuration
Configuration::instance()->save();
+
+ qDebug() << "[SettingsView::okClicked] setValues()";
// Emit the signal to notify that ok is pressed and data is saved.
setValues();
void SettingsView::setValues()
{
// set user information
- iUserName->setText( Configuration::instance()->connectionSettings()->username() );
- iPassword->setText( Configuration::instance()->connectionSettings()->password() );
+ iUserName->setText( Configuration::instance()->getUsername() );
+ iPassword->setText( Configuration::instance()->getPassword());//connectionSettings()->password() );
// set server information
- iServerAddress->setText( Configuration::instance()->connectionSettings()->serverUrl().toString() );
+ iServerAddress->setText( Configuration::instance()->getServerUrl().toString());//connectionSettings()->serverUrl().toString() );
QString refreshIntervalStr;
- refreshIntervalStr.setNum( Configuration::instance()->connectionSettings()->refreshInterval() );
+ refreshIntervalStr.setNum( Configuration::instance()->getRefreshinterval());//connectionSettings()->refreshInterval() );
iRefreshInterval->setText( refreshIntervalStr );
// set weekly view display settings
if ( Configuration::instance()->displaySettings()->daysInSchedule() == DisplaySettings::WeekdaysInSchedule )
}
iPowerSaveStartTime->setTime( Configuration::instance()->startupSettings()->turnOnAt() );
iPowerSaveEndTime->setTime( Configuration::instance()->startupSettings()->turnOffAt() );
+
+ // set privacy settings
+ iShowConfidentialMeetingDetails->setChecked( Configuration::instance()->showConfidentialMeetingDetails() );
}