AlbumShaper  1.0a3
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
AlertsWidget Class Reference

Alerts Settings. More...

#include <alertsWidget.h>

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

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. More...
 
Q3GridLayout * grid
 
QLabelcategoryLabel
 
Q3FramehorizontalLine
 
Q3VGroupBox * behavior
 
QCheckBox * showDestructiveAlerts
 
QCheckBox * showSoftwareUpdateAlerts
 

Detailed Description

Alerts Settings.

Definition at line 34 of file alertsWidget.h.

Constructor & Destructor Documentation

§ AlertsWidget()

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

Definition at line 30 of file alertsWidget.cpp.

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

31  : QWidget( parent, name)
32 {
33  this->config = config;
34 
35  categoryLabel = new QLabel( tr("Alerts:"), this);
36  QFont labelFont = categoryLabel->font();
37  labelFont.setWeight(QFont::Bold);
38  categoryLabel->setFont( labelFont );
39 
40  horizontalLine = new Q3Frame(this);
41  horizontalLine->setLineWidth(2);
42  horizontalLine->setMidLineWidth(1);
43  horizontalLine->setFrameStyle( Q3Frame::HLine | Q3Frame::Raised );
44 
45  behavior = new Q3VGroupBox( tr("Behavior"), this);
46  showDestructiveAlerts = new QCheckBox( tr("Alert me to destructive actions"), behavior);
47  showSoftwareUpdateAlerts = new QCheckBox( tr("Alert me to software updates"), behavior);
48 
49  grid = new Q3GridLayout( this, 4, 1, 0);
50  grid->setSpacing( WIDGET_SPACING );
51 
52  grid->addWidget( categoryLabel, 0, 0, Qt::AlignLeft );
53  grid->addWidget( horizontalLine, 1, 0 );
54  grid->addWidget( behavior, 2, 0 );
55  grid->setRowStretch( 3, 1 );
56 }
QCheckBox * showSoftwareUpdateAlerts
Definition: alertsWidget.h:55
Configuration * config
Backend config object pointer.
Definition: alertsWidget.h:46
Q3VGroupBox * behavior
Definition: alertsWidget.h:53
QCheckBox * showDestructiveAlerts
Definition: alertsWidget.h:54
#define WIDGET_SPACING
Definition: config.h:31
QLabel * categoryLabel
Definition: alertsWidget.h:50
Q3Frame * horizontalLine
Definition: alertsWidget.h:51
Q3GridLayout * grid
Definition: alertsWidget.h:48

Member Function Documentation

§ loadSettings()

void AlertsWidget::loadSettings ( )

Definition at line 65 of file alertsWidget.cpp.

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

Referenced by ConfigurationWidget::ConfigurationWidget().

66 {
67  showDestructiveAlerts->setChecked( config->getBool( "alerts", "showDestructiveAlerts" ));
68  showSoftwareUpdateAlerts->setChecked( config->getBool( "alerts", "showSoftwareUpdateAlerts" ));
69 }
QCheckBox * showSoftwareUpdateAlerts
Definition: alertsWidget.h:55
Configuration * config
Backend config object pointer.
Definition: alertsWidget.h:46
bool getBool(QString group, QString key)
Fetch bool setting.
QCheckBox * showDestructiveAlerts
Definition: alertsWidget.h:54

§ saveSettings()

void AlertsWidget::saveSettings ( )

Definition at line 71 of file alertsWidget.cpp.

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

Referenced by ConfigurationWidget::saveSettings().

72 {
73  config->setBool( "alerts", "showDestructiveAlerts", showDestructiveAlerts->isChecked() );
74  config->setBool( "alerts", "showSoftwareUpdateAlerts", showSoftwareUpdateAlerts->isChecked() );
75 
76  //either check for and show or remove updates availble icon
77  if(showSoftwareUpdateAlerts->isChecked())
78  ((Window*)qApp->mainWidget())->getStatus()->checkForUpdates();
79  else
80  ((Window*)qApp->mainWidget())->getStatus()->removeUpdatesIcon();
81 }
QCheckBox * showSoftwareUpdateAlerts
Definition: alertsWidget.h:55
Configuration * config
Backend config object pointer.
Definition: alertsWidget.h:46
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget...
Definition: window.h:39
void setBool(QString group, QString key, bool val)
Set bool setting.
QCheckBox * showDestructiveAlerts
Definition: alertsWidget.h:54

§ setDefaults()

void AlertsWidget::setDefaults ( Configuration config)
static

Definition at line 58 of file alertsWidget.cpp.

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

Referenced by Window::Window().

59 {
60  config->setBool( "alerts", "showDestructiveAlerts", true );
61  config->setBool( "alerts", "showSoftwareUpdateAlerts", true );
62  config->setString( "alerts", "loadSaveDir", QString(ALBUMSHAPER_VERSION) );
63 }
void setString(QString group, QString key, QString value)
Sets a setting value, if group does not exist it is created, if setting does not exist it is also cre...
void setBool(QString group, QString key, bool val)
Set bool setting.
#define ALBUMSHAPER_VERSION
Definition: config.h:21

Member Data Documentation

§ behavior

Q3VGroupBox* AlertsWidget::behavior
private

Definition at line 53 of file alertsWidget.h.

Referenced by AlertsWidget().

§ categoryLabel

QLabel* AlertsWidget::categoryLabel
private

Definition at line 50 of file alertsWidget.h.

Referenced by AlertsWidget().

§ config

Configuration* AlertsWidget::config
private

Backend config object pointer.

Definition at line 46 of file alertsWidget.h.

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

§ grid

Q3GridLayout* AlertsWidget::grid
private

Definition at line 48 of file alertsWidget.h.

Referenced by AlertsWidget().

§ horizontalLine

Q3Frame* AlertsWidget::horizontalLine
private

Definition at line 51 of file alertsWidget.h.

Referenced by AlertsWidget().

§ showDestructiveAlerts

QCheckBox* AlertsWidget::showDestructiveAlerts
private

Definition at line 54 of file alertsWidget.h.

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

§ showSoftwareUpdateAlerts

QCheckBox* AlertsWidget::showSoftwareUpdateAlerts
private

Definition at line 55 of file alertsWidget.h.

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


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