#include <alertsWidget.h>
Inheritance diagram for AlertsWidget:
Definition at line 30 of file alertsWidget.h.
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 | |
Configuration * | config |
Backend config object pointer. | |
QGridLayout * | grid |
QLabel * | categoryLabel |
QFrame * | horizontalLine |
QVGroupBox * | behavior |
QCheckBox * | showDestructiveAlerts |
QCheckBox * | showSoftwareUpdateAlerts |
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.
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 }
void AlertsWidget::setDefaults | ( | Configuration * | config | ) | [static] |
Definition at line 56 of file alertsWidget.cpp.
References ALBUMSHAPER_VERSION, config, 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 }
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 }
Configuration* AlertsWidget::config [private] |
Backend config object pointer.
Definition at line 42 of file alertsWidget.h.
Referenced by AlertsWidget(), loadSettings(), saveSettings(), and setDefaults().
QGridLayout* AlertsWidget::grid [private] |
QLabel* AlertsWidget::categoryLabel [private] |
QFrame* AlertsWidget::horizontalLine [private] |
QVGroupBox* AlertsWidget::behavior [private] |
QCheckBox* AlertsWidget::showDestructiveAlerts [private] |
Definition at line 50 of file alertsWidget.h.
Referenced by AlertsWidget(), loadSettings(), and saveSettings().
QCheckBox* AlertsWidget::showSoftwareUpdateAlerts [private] |
Definition at line 51 of file alertsWidget.h.
Referenced by AlertsWidget(), loadSettings(), and saveSettings().