AlbumShaper 1.0a3
AlertsWidget Class Reference

Alerts Settings. More...

#include <alertsWidget.h>

Inheritance diagram for AlertsWidget:
Collaboration diagram for AlertsWidget:

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

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 * showDestructiveAlerts
QCheckBox * showSoftwareUpdateAlerts
Q3VGroupBox * behavior
Q3GridLayout * grid
QLabel * categoryLabel
Configuration * config
Backend config object pointer.
Q3Frame * horizontalLine
#define WIDGET_SPACING
Definition config.h:31

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

Member Function Documentation

◆ loadSettings()

void AlertsWidget::loadSettings ( )

Definition at line 65 of file alertsWidget.cpp.

66{
67 showDestructiveAlerts->setChecked( config->getBool( "alerts", "showDestructiveAlerts" ));
68 showSoftwareUpdateAlerts->setChecked( config->getBool( "alerts", "showSoftwareUpdateAlerts" ));
69}
bool getBool(QString group, QString key)
Fetch bool setting.

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

Referenced by ConfigurationWidget::ConfigurationWidget().

◆ saveSettings()

void AlertsWidget::saveSettings ( )

Definition at line 71 of file alertsWidget.cpp.

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}
void setBool(QString group, QString key, bool val)
Set bool setting.
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget.
Definition window.h:40

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

Referenced by ConfigurationWidget::saveSettings().

◆ setDefaults()

void AlertsWidget::setDefaults ( Configuration * config)
static

Definition at line 58 of file alertsWidget.cpp.

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...
#define ALBUMSHAPER_VERSION
Definition config.h:21

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

Referenced by Window::Window().

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(), saveSettings(), and setDefaults().

◆ 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: