27#include <tqradiobutton.h>
28#include <tqcheckbox.h>
30#include <tqbuttongroup.h>
35#include <kurlrequester.h>
36#include <kiconloader.h>
40#include "configuretableviewdialog.h"
42ConfigureTableViewWidget::ConfigureTableViewWidget( TDEABC::AddressBook *ab,
47 TQWidget *page = addPage( i18n(
"Look & Feel" ), TQString(),
48 TDEGlobal::iconLoader()->loadIcon(
"preferences-desktop",
54ConfigureTableViewWidget::~ConfigureTableViewWidget()
62 mPage->restoreSettings( config );
69 mPage->saveSettings( config );
74LookAndFeelPage::LookAndFeelPage(TQWidget *parent,
const char *name)
75 : TQWidget(parent, name)
80 enableBackgroundToggled(mBackgroundBox->isChecked());
83void LookAndFeelPage::restoreSettings( TDEConfig *config )
85 mAlternateButton->setChecked(config->readBoolEntry(
"ABackground",
true));
86 mLineButton->setChecked(config->readBoolEntry(
"SingleLine",
false));
87 mToolTipBox->setChecked(config->readBoolEntry(
"ToolTips",
true));
89 if (!mAlternateButton->isChecked() && !mLineButton->isChecked())
90 mNoneButton->setChecked(
true);
92 mBackgroundBox->setChecked(config->readBoolEntry(
"Background",
false));
93 mBackgroundName->lineEdit()->setText(config->readPathEntry(
"BackgroundName"));
94 mIMPresenceBox->setChecked( config->readBoolEntry(
"InstantMessagingPresence",
false ) );
97void LookAndFeelPage::saveSettings( TDEConfig *config )
99 config->writeEntry(
"ABackground", mAlternateButton->isChecked());
100 config->writeEntry(
"SingleLine", mLineButton->isChecked());
101 config->writeEntry(
"ToolTips", mToolTipBox->isChecked());
102 config->writeEntry(
"Background", mBackgroundBox->isChecked());
103 config->writePathEntry(
"BackgroundName", mBackgroundName->lineEdit()->text());
104 config->writeEntry(
"InstantMessagingPresence", mIMPresenceBox->isChecked() );
107void LookAndFeelPage::initGUI()
109 TQVBoxLayout *layout =
new TQVBoxLayout(
this, 0, KDialogBase::spacingHint());
111 TQButtonGroup *group =
new TQButtonGroup(1, TQt::Horizontal,
112 i18n(
"Row Separator"),
this);
113 layout->addWidget(group);
115 mAlternateButton =
new TQRadioButton(i18n(
"Alternating backgrounds"),
116 group,
"mAlternateButton");
117 mLineButton =
new TQRadioButton(i18n(
"Single line"), group,
"mLineButton");
118 mNoneButton =
new TQRadioButton(i18n(
"None"), group,
"mNoneButton");
121 TQHBoxLayout *backgroundLayout =
new TQHBoxLayout();
122 layout->addLayout(backgroundLayout);
124 mBackgroundBox =
new TQCheckBox(i18n(
"Enable background image:"),
this,
126 connect(mBackgroundBox, TQ_SIGNAL(toggled(
bool)),
127 TQ_SLOT(enableBackgroundToggled(
bool)));
128 backgroundLayout->addWidget(mBackgroundBox);
130 mBackgroundName =
new KURLRequester(
this,
"mBackgroundName");
131 mBackgroundName->setMode(KFile::File | KFile::ExistingOnly |
133 mBackgroundName->setFilter(KImageIO::pattern(KImageIO::Reading));
134 backgroundLayout->addWidget(mBackgroundName);
137 mToolTipBox =
new TQCheckBox(i18n(
"Enable contact tooltips"),
this,
139 layout->addWidget(mToolTipBox);
140 mIMPresenceBox =
new TQCheckBox( i18n(
"Show instant messaging presence" ),
this,
"mIMPresenceBox" );
141 layout->addWidget( mIMPresenceBox );
144void LookAndFeelPage::enableBackgroundToggled(
bool enabled)
146 mBackgroundName->setEnabled(enabled);
149#include "configuretableviewdialog.moc"