AlbumShaper  1.0a3
Public Member Functions | Static Public Member Functions | Private Attributes
AlertsWidget Class Reference

Alerts Settings. More...

#include <alertsWidget.h>

Inheritance diagram for AlertsWidget:
Inheritance graph
[legend]
Collaboration diagram for AlertsWidget:
Collaboration graph
[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, config, grid, horizontalLine, showDestructiveAlerts, showSoftwareUpdateAlerts, and WIDGET_SPACING.

                                               : QWidget( parent, name)
{
  this->config = config;

  categoryLabel = new QLabel( tr("Alerts:"), this);
  QFont labelFont = categoryLabel->font();
  labelFont.setWeight(QFont::Bold);
  categoryLabel->setFont( labelFont );

  horizontalLine = new QFrame(this);
  horizontalLine->setLineWidth(2);
  horizontalLine->setMidLineWidth(1);
  horizontalLine->setFrameStyle( QFrame::HLine | QFrame::Raised );

  behavior = new QVGroupBox( tr("Behavior"), this);
  showDestructiveAlerts = new QCheckBox( tr("Alert me to destructive actions"), behavior);
  showSoftwareUpdateAlerts = new QCheckBox( tr("Alert me to software updates"), behavior);

  grid = new QGridLayout( this, 4, 1, 0);
  grid->setSpacing( WIDGET_SPACING );

  grid->addWidget( categoryLabel,  0, 0, Qt::AlignLeft );
  grid->addWidget( horizontalLine,  1, 0 );
  grid->addWidget( behavior,  2, 0 );
  grid->setRowStretch( 3, 1 );
}

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().

{
  showDestructiveAlerts->setChecked( config->getBool( "alerts", "showDestructiveAlerts" ));
  showSoftwareUpdateAlerts->setChecked( config->getBool( "alerts", "showSoftwareUpdateAlerts" ));
}
void AlertsWidget::saveSettings ( )

Definition at line 69 of file alertsWidget.cpp.

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

Referenced by ConfigurationWidget::saveSettings().

{
  config->setBool( "alerts", "showDestructiveAlerts", showDestructiveAlerts->isChecked() );
  config->setBool( "alerts", "showSoftwareUpdateAlerts", showSoftwareUpdateAlerts->isChecked() );

  //either check for and show or remove updates availble icon
  if(showSoftwareUpdateAlerts->isChecked())
    ((Window*)qApp->mainWidget())->getStatus()->checkForUpdates();
  else
    ((Window*)qApp->mainWidget())->getStatus()->removeUpdatesIcon();
}
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().

{
  config->setBool( "alerts", "showDestructiveAlerts", true );
  config->setBool( "alerts", "showSoftwareUpdateAlerts", true );
  config->setString( "alerts", "loadSaveDir", QString(ALBUMSHAPER_VERSION) );
}

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 AlertsWidget(), 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: