AlertsWidget Class Reference

Alerts Settings. More...

#include <alertsWidget.h>

Inheritance diagram for AlertsWidget:
[legend]
Collaboration diagram for AlertsWidget:
[legend]

List of all members.

Public Member Functions

 AlertsWidget (Configuration *config, QWidget *parent=0, const char *name=0)
void loadSettings ()
void saveSettings ()

Static Public Member Functions

static void setDefaults (Configuration *config)

Private Attributes

Configurationconfig
 Backend config object pointer.
QGridLayout * grid
QLabelcategoryLabel
QFramehorizontalLine
QVGroupBox * behavior
QCheckBox * showDestructiveAlerts
QCheckBox * showSoftwareUpdateAlerts


Detailed Description

Alerts Settings.

Definition at line 30 of file alertsWidget.h.


Constructor & Destructor Documentation

AlertsWidget::AlertsWidget ( Configuration config,
QWidget parent = 0,
const char *  name = 0 
)

Definition at line 28 of file alertsWidget.cpp.

References behavior, categoryLabel, grid, horizontalLine, showDestructiveAlerts, showSoftwareUpdateAlerts, and WIDGET_SPACING.

00029                                                : QWidget( parent, name)
00030 {
00031   this->config = config;
00032 
00033   categoryLabel = new QLabel( tr("Alerts:"), this);
00034   QFont labelFont = categoryLabel->font();
00035   labelFont.setWeight(QFont::Bold);
00036   categoryLabel->setFont( labelFont );
00037 
00038   horizontalLine = new QFrame(this);
00039   horizontalLine->setLineWidth(2);
00040   horizontalLine->setMidLineWidth(1);
00041   horizontalLine->setFrameStyle( QFrame::HLine | QFrame::Raised );
00042 
00043   behavior = new QVGroupBox( tr("Behavior"), this);
00044   showDestructiveAlerts = new QCheckBox( tr("Alert me to destructive actions"), behavior);
00045   showSoftwareUpdateAlerts = new QCheckBox( tr("Alert me to software updates"), behavior);
00046 
00047   grid = new QGridLayout( this, 4, 1, 0);
00048   grid->setSpacing( WIDGET_SPACING );
00049 
00050   grid->addWidget( categoryLabel,  0, 0, Qt::AlignLeft );
00051   grid->addWidget( horizontalLine,  1, 0 );
00052   grid->addWidget( behavior,  2, 0 );
00053   grid->setRowStretch( 3, 1 );
00054 }


Member Function Documentation

void AlertsWidget::loadSettings (  ) 

Definition at line 63 of file alertsWidget.cpp.

References config, Configuration::getBool(), showDestructiveAlerts, and showSoftwareUpdateAlerts.

Referenced by ConfigurationWidget::ConfigurationWidget().

00064 {
00065   showDestructiveAlerts->setChecked( config->getBool( "alerts", "showDestructiveAlerts" ));
00066   showSoftwareUpdateAlerts->setChecked( config->getBool( "alerts", "showSoftwareUpdateAlerts" ));
00067 }

void AlertsWidget::saveSettings (  ) 

Definition at line 69 of file alertsWidget.cpp.

References config, Configuration::setBool(), showDestructiveAlerts, and showSoftwareUpdateAlerts.

Referenced by ConfigurationWidget::saveSettings().

00070 {
00071   config->setBool( "alerts", "showDestructiveAlerts", showDestructiveAlerts->isChecked() );
00072   config->setBool( "alerts", "showSoftwareUpdateAlerts", showSoftwareUpdateAlerts->isChecked() );
00073 
00074   //either check for and show or remove updates availble icon
00075   if(showSoftwareUpdateAlerts->isChecked())
00076     ((Window*)qApp->mainWidget())->getStatus()->checkForUpdates();
00077   else
00078     ((Window*)qApp->mainWidget())->getStatus()->removeUpdatesIcon();
00079 }

void AlertsWidget::setDefaults ( Configuration config  )  [static]

Definition at line 56 of file alertsWidget.cpp.

References ALBUMSHAPER_VERSION, Configuration::setBool(), and Configuration::setString().

Referenced by Window::Window().

00057 {
00058   config->setBool( "alerts", "showDestructiveAlerts", true );
00059   config->setBool( "alerts", "showSoftwareUpdateAlerts", true );
00060   config->setString( "alerts", "loadSaveDir", QString(ALBUMSHAPER_VERSION) );
00061 }


Member Data Documentation

QVGroupBox* AlertsWidget::behavior [private]

Definition at line 49 of file alertsWidget.h.

Referenced by AlertsWidget().

Definition at line 46 of file alertsWidget.h.

Referenced by AlertsWidget().

Backend config object pointer.

Definition at line 42 of file alertsWidget.h.

Referenced by loadSettings(), and saveSettings().

QGridLayout* AlertsWidget::grid [private]

Definition at line 44 of file alertsWidget.h.

Referenced by AlertsWidget().

Definition at line 47 of file alertsWidget.h.

Referenced by AlertsWidget().

Definition at line 50 of file alertsWidget.h.

Referenced by AlertsWidget(), loadSettings(), and saveSettings().

Definition at line 51 of file alertsWidget.h.

Referenced by AlertsWidget(), loadSettings(), and saveSettings().


The documentation for this class was generated from the following files:

Generated on Sun Aug 23 02:34:34 2009 for AlbumShaper by  doxygen 1.5.9