22 #include <tqbuttongroup.h>
24 #include <tqradiobutton.h>
25 #include <tqspinbox.h>
29 #include <tdelocale.h>
32 #include "resourcecached.h"
34 #include "resourcecachedconfig.h"
38 ResourceCachedReloadConfig::ResourceCachedReloadConfig( TQWidget *parent,
40 : TQWidget( parent, name )
42 TQBoxLayout *topLayout =
new TQVBoxLayout(
this );
44 mGroup =
new TQButtonGroup( 1, TQt::Horizontal, i18n(
"Automatic Reload"),
this );
45 topLayout->addWidget( mGroup );
46 new TQRadioButton( i18n(
"Never"), mGroup );
47 new TQRadioButton( i18n(
"On startup"), mGroup );
49 TQRadioButton *intervalRadio =
new TQRadioButton( i18n(
"Regular interval"),
51 connect( intervalRadio, TQ_SIGNAL( stateChanged(
int ) ),
52 TQ_SLOT( slotIntervalStateChanged(
int ) ) );
53 TQHBox *intervalBox =
new TQHBox( mGroup );
54 new TQLabel( i18n(
"Interval in minutes"), intervalBox );
55 mIntervalSpin =
new TQSpinBox( 1,900, 1,intervalBox );
56 mIntervalSpin->setEnabled(
false );
59 void ResourceCachedReloadConfig::loadSettings(
ResourceCached *resource )
65 void ResourceCachedReloadConfig::saveSettings(
ResourceCached *resource )
71 void ResourceCachedReloadConfig::slotIntervalStateChanged(
int state )
73 if ( state == TQButton::On ) mIntervalSpin->setEnabled(
true );
74 else mIntervalSpin->setEnabled(
false );
78 ResourceCachedSaveConfig::ResourceCachedSaveConfig( TQWidget *parent,
80 : TQWidget( parent, name )
82 TQBoxLayout *topLayout =
new TQVBoxLayout(
this );
84 mGroup =
new TQButtonGroup( 1, TQt::Horizontal, i18n(
"Automatic Save"),
this );
85 topLayout->addWidget( mGroup );
86 new TQRadioButton( i18n(
"Never"), mGroup );
87 new TQRadioButton( i18n(
"On exit"), mGroup );
89 TQRadioButton *intervalRadio =
new TQRadioButton( i18n(
"Regular interval"),
91 connect( intervalRadio, TQ_SIGNAL( stateChanged(
int ) ),
92 TQ_SLOT( slotIntervalStateChanged(
int ) ) );
93 TQHBox *intervalBox =
new TQHBox( mGroup );
94 new TQLabel( i18n(
"Interval in minutes"), intervalBox );
95 mIntervalSpin =
new TQSpinBox( 1,900, 1,intervalBox );
96 mIntervalSpin->setEnabled(
false );
98 new TQRadioButton( i18n(
"Delayed after changes"), mGroup );
99 new TQRadioButton( i18n(
"On every change"), mGroup );
102 void ResourceCachedSaveConfig::loadSettings(
ResourceCached *resource )
108 void ResourceCachedSaveConfig::saveSettings(
ResourceCached *resource )
114 void ResourceCachedSaveConfig::slotIntervalStateChanged(
int state )
116 if ( state == TQButton::On ) mIntervalSpin->setEnabled(
true );
117 else mIntervalSpin->setEnabled(
false );
120 #include "resourcecachedconfig.moc"
This class provides a calendar resource using a local CalendarLocal object to cache the calendar data...
void setSavePolicy(int policy)
Set save policy.
int reloadInterval() const
Return reload interval in minutes.
int reloadPolicy() const
Return reload policy.
void setSaveInterval(int minutes)
Set save interval in minutes which is used when save policy is SaveInterval.
int savePolicy() const
Return save policy.
void setReloadInterval(int minutes)
Set reload interval in minutes which is used when reload policy is ReloadInterval.
void setReloadPolicy(int policy)
Set reload policy.
int saveInterval() const
Return save interval in minutes.
Namespace KCal is for global classes, objects and/or functions in libkcal.