27 #include <tqgroupbox.h>
28 #include <tqbuttongroup.h>
29 #include <tqlineedit.h>
33 #include <tqtextstream.h>
34 #include <tqcombobox.h>
37 #include <tqspinbox.h>
38 #include <tqdatetime.h>
40 #include <tdeapplication.h>
42 #include <tdelocale.h>
43 #include <tdeglobal.h>
44 #include <tdefontdialog.h>
45 #include <kstandarddirs.h>
46 #include <tdemessagebox.h>
47 #include <kcolordialog.h>
48 #include <kiconloader.h>
49 #include <kiconeffect.h>
51 #include "kandyprefs.h"
53 #include "kandyprefsdialog.h"
54 #include "kandyprefsdialog.moc"
58 KPrefsDialog(KandyPrefs::self(),parent,name,modal)
61 setupAddressbookTab();
66 KandyPrefsDialog::~KandyPrefsDialog()
71 delete startupTerminal;
75 void KandyPrefsDialog::setupSerialTab()
77 TQFrame *topFrame = addPage(i18n(
"Serial Interface"),0,
78 DesktopIcon(
"connect_no",TDEIcon::SizeMedium));
80 TQGridLayout *topLayout =
new TQGridLayout(topFrame,6,2);
81 topLayout->setSpacing(spacingHint());
82 topLayout->setMargin(marginHint());
85 serialDevice = addWidString( KandyPrefs::self()->serialDeviceItem(),
87 topLayout->addWidget(serialDevice->label(),0,0);
88 topLayout->addWidget(serialDevice->lineEdit(),0,1);
91 baudRate = addWidString( KandyPrefs::self()->baudRateItem(), topFrame );
92 topLayout->addWidget( baudRate->label(), 1, 0 );
93 topLayout->addWidget( baudRate->lineEdit(), 1, 1 );
96 lockDir = addWidString( KandyPrefs::self()->lockDirectoryItem(),
98 topLayout->addWidget(lockDir->label(),2,0);
99 topLayout->addWidget(lockDir->lineEdit(),2,1);
102 openOnStartup = addWidBool( KandyPrefs::self()->startupModemItem(),
104 topLayout->addWidget(openOnStartup->checkBox(),3,0);
107 autoSetClock = addWidBool( KandyPrefs::self()->autoSetClockItem(),
109 topLayout->addWidget(autoSetClock->checkBox(),4,0);
111 topLayout->setRowStretch(5,1);
114 void KandyPrefsDialog::setupAddressbookTab()
116 TQFrame *topFrame = addPage(i18n(
"Address Book"), 0,
117 DesktopIcon(
"kaddressbook", TDEIcon::SizeMedium));
119 TQGridLayout *topLayout =
new TQGridLayout(topFrame, 13, 4);
120 topLayout->setSpacing(spacingHint());
121 topLayout->setMargin(marginHint());
123 excHome = addWidBool ( KandyPrefs::self()->excludeHomeItem(), topFrame );
124 topLayout->addWidget(excHome->checkBox(), 0, 0);
126 excWork = addWidBool ( KandyPrefs::self()->excludeWorkItem(), topFrame );
127 topLayout->addWidget(excWork->checkBox(), 1, 0);
129 excMsg = addWidBool ( KandyPrefs::self()->excludeMessagingItem(), topFrame );
130 topLayout->addWidget(excMsg->checkBox(), 2, 0);
132 excFax = addWidBool ( KandyPrefs::self()->excludeFaxItem(), topFrame );
133 topLayout->addWidget(excFax->checkBox(), 3, 0);
135 excCell = addWidBool ( KandyPrefs::self()->excludeCellItem(), topFrame );
136 topLayout->addWidget(excCell->checkBox(), 4, 0);
138 excVideo = addWidBool ( KandyPrefs::self()->excludeVideoItem(), topFrame );
139 topLayout->addWidget(excVideo->checkBox(), 5, 0);
141 excBbs = addWidBool ( KandyPrefs::self()->excludeMailboxItem(), topFrame );
142 topLayout->addWidget(excBbs->checkBox(), 6, 0);
144 excModem = addWidBool ( KandyPrefs::self()->excludeModemItem(), topFrame );
145 topLayout->addWidget(excModem->checkBox(), 7, 0);
147 excCar = addWidBool ( KandyPrefs::self()->excludeCarItem(), topFrame );
148 topLayout->addWidget(excCar->checkBox(), 8, 0);
150 excISDN = addWidBool ( KandyPrefs::self()->excludeISDNItem(), topFrame );
151 topLayout->addWidget(excISDN->checkBox(), 9, 0);
153 excPager = addWidBool ( KandyPrefs::self()->excludePagerItem(), topFrame );
154 topLayout->addWidget(excPager->checkBox(), 10, 0);
157 useHomeSuff = addWidBool ( KandyPrefs::self()->useHomeSuffItem(), topFrame );
158 topLayout->addWidget(useHomeSuff->checkBox(), 0, 1);
160 useWorkSuff = addWidBool ( KandyPrefs::self()->useWorkSuffItem(), topFrame );
161 topLayout->addWidget(useWorkSuff->checkBox(), 1, 1);
163 useMessagingSuff = addWidBool ( KandyPrefs::self()->useMessagingSuffItem(), topFrame );
164 topLayout->addWidget(useMessagingSuff->checkBox(), 2, 1);
166 useFaxSuff = addWidBool ( KandyPrefs::self()->useFaxSuffItem(), topFrame );
167 topLayout->addWidget(useFaxSuff->checkBox(), 3, 1);
169 useCellSuff = addWidBool ( KandyPrefs::self()->useCellSuffItem(), topFrame );
170 topLayout->addWidget(useCellSuff->checkBox(), 4, 1);
172 useVideoSuff = addWidBool ( KandyPrefs::self()->useVideoSuffItem(), topFrame );
173 topLayout->addWidget(useVideoSuff->checkBox(), 5, 1);
175 useMailboxSuff = addWidBool ( KandyPrefs::self()->useMailboxSuffItem(), topFrame );
176 topLayout->addWidget(useMailboxSuff->checkBox(), 6, 1);
178 useModemSuff = addWidBool ( KandyPrefs::self()->useModemSuffItem(), topFrame );
179 topLayout->addWidget(useModemSuff->checkBox(), 7, 1);
181 useCarSuff = addWidBool ( KandyPrefs::self()->useCarSuffItem(), topFrame );
182 topLayout->addWidget(useCarSuff->checkBox(), 8, 1);
184 useISDNSuff = addWidBool ( KandyPrefs::self()->useISDNSuffItem(), topFrame );
185 topLayout->addWidget(useISDNSuff->checkBox(), 9, 1);
187 usePagerSuff = addWidBool ( KandyPrefs::self()->usePagerSuffItem(), topFrame );
188 topLayout->addWidget(usePagerSuff->checkBox(), 10, 1);
191 HomeSuff = addWidString( KandyPrefs::self()->homeSuffItem(), topFrame );
192 topLayout->addWidget(HomeSuff->label(), 0, 2);
193 topLayout->addWidget(HomeSuff->lineEdit(), 0, 3);
195 WorkSuff = addWidString( KandyPrefs::self()->workSuffItem(), topFrame );
196 topLayout->addWidget(WorkSuff->label(), 1, 2);
197 topLayout->addWidget(WorkSuff->lineEdit(), 1, 3);
199 MessagingSuff = addWidString( KandyPrefs::self()->messagingSuffItem(), topFrame );
200 topLayout->addWidget(MessagingSuff->label(), 2, 2);
201 topLayout->addWidget(MessagingSuff->lineEdit(), 2, 3);
203 FaxSuff = addWidString( KandyPrefs::self()->faxSuffItem(), topFrame );
204 topLayout->addWidget(FaxSuff->label(), 3, 2);
205 topLayout->addWidget(FaxSuff->lineEdit(), 3, 3);
207 CellSuff = addWidString( KandyPrefs::self()->cellSuffItem(), topFrame );
208 topLayout->addWidget(CellSuff->label(), 4, 2);
209 topLayout->addWidget(CellSuff->lineEdit(), 4, 3);
211 VideoSuff = addWidString( KandyPrefs::self()->videoSuffItem(), topFrame );
212 topLayout->addWidget(VideoSuff->label(), 5, 2);
213 topLayout->addWidget(VideoSuff->lineEdit(), 5, 3);
215 MailboxSuff = addWidString( KandyPrefs::self()->mailboxSuffItem(), topFrame );
216 topLayout->addWidget(MailboxSuff->label(), 6, 2);
217 topLayout->addWidget(MailboxSuff->lineEdit(), 6, 3);
219 ModemSuff = addWidString( KandyPrefs::self()->modemSuffItem(), topFrame );
220 topLayout->addWidget(ModemSuff->label(), 7, 2);
221 topLayout->addWidget(ModemSuff->lineEdit(), 7, 3);
223 CarSuff = addWidString( KandyPrefs::self()->carSuffItem(), topFrame );
224 topLayout->addWidget(CarSuff->label(), 8, 2);
225 topLayout->addWidget(CarSuff->lineEdit(), 8, 3);
227 ISDNSuff = addWidString( KandyPrefs::self()->iSDNSuffItem(), topFrame );
228 topLayout->addWidget(ISDNSuff->label(), 9, 2);
229 topLayout->addWidget(ISDNSuff->lineEdit(), 9, 3);
231 PagerSuff = addWidString( KandyPrefs::self()->pagerSuffItem(), topFrame );
232 topLayout->addWidget(PagerSuff->label(), 10, 2);
233 topLayout->addWidget(PagerSuff->lineEdit(), 10, 3);
236 topLayout->setRowStretch(11, 1);
238 if ( !KandyPrefs::self()->useHomeSuff() )
240 HomeSuff->lineEdit()->setEnabled(
false );
241 HomeSuff->label()->setEnabled(
false );
243 if ( !KandyPrefs::self()->useWorkSuff() )
245 WorkSuff->lineEdit()->setEnabled(
false );
246 WorkSuff->label()->setEnabled(
false );
248 if ( !KandyPrefs::self()->useMessagingSuff() )
250 MessagingSuff->lineEdit()->setEnabled(
false );
251 MessagingSuff->label()->setEnabled(
false );
253 if ( !KandyPrefs::self()->useFaxSuff() )
255 FaxSuff->lineEdit()->setEnabled(
false );
256 FaxSuff->label()->setEnabled(
false );
258 if ( !KandyPrefs::self()->useCellSuff() )
260 CellSuff->lineEdit()->setEnabled(
false );
261 CellSuff->label()->setEnabled(
false );
263 if ( !KandyPrefs::self()->useVideoSuff() )
265 VideoSuff->lineEdit()->setEnabled(
false );
266 VideoSuff->label()->setEnabled(
false );
268 if ( !KandyPrefs::self()->useMailboxSuff() )
270 MailboxSuff->lineEdit()->setEnabled(
false );
271 MailboxSuff->label()->setEnabled(
false );
273 if ( !KandyPrefs::self()->useModemSuff() )
275 ModemSuff->lineEdit()->setEnabled(
false );
276 ModemSuff->label()->setEnabled(
false );
278 if ( !KandyPrefs::self()->useCarSuff() )
280 CarSuff->lineEdit()->setEnabled(
false );
281 CarSuff->label()->setEnabled(
false );
283 if ( !KandyPrefs::self()->useISDNSuff() )
285 ISDNSuff->lineEdit()->setEnabled(
false );
286 ISDNSuff->label()->setEnabled(
false );
288 if ( !KandyPrefs::self()->usePagerSuff() )
290 PagerSuff->lineEdit()->setEnabled(
false );
291 PagerSuff->label()->setEnabled(
false );
295 connect( useHomeSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
296 HomeSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
297 connect( useHomeSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
298 HomeSuff->label(), TQ_SLOT(setEnabled(
bool)) );
300 connect( useWorkSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
301 WorkSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
302 connect( useWorkSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
303 WorkSuff->label(), TQ_SLOT(setEnabled(
bool)) );
305 connect( useMessagingSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
306 MessagingSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
307 connect( useMessagingSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
308 MessagingSuff->label(), TQ_SLOT(setEnabled(
bool)) );
310 connect( useFaxSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
311 FaxSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
312 connect( useFaxSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
313 FaxSuff->label(), TQ_SLOT(setEnabled(
bool)) );
315 connect( useCellSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
316 CellSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
317 connect( useCellSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
318 CellSuff->label(), TQ_SLOT(setEnabled(
bool)) );
320 connect( useVideoSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
321 VideoSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
322 connect( useVideoSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
323 VideoSuff->label(), TQ_SLOT(setEnabled(
bool)) );
325 connect( useMailboxSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
326 MailboxSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
327 connect( useMailboxSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
328 MailboxSuff->label(), TQ_SLOT(setEnabled(
bool)) );
330 connect( useModemSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
331 ModemSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
332 connect( useModemSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
333 ModemSuff->label(), TQ_SLOT(setEnabled(
bool)) );
335 connect( useCarSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
336 CarSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
337 connect( useCarSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
338 CarSuff->label(), TQ_SLOT(setEnabled(
bool)) );
340 connect( useISDNSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
341 ISDNSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
342 connect( useISDNSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
343 ISDNSuff->label(), TQ_SLOT(setEnabled(
bool)) );
345 connect( usePagerSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
346 PagerSuff->lineEdit(), TQ_SLOT(setEnabled(
bool)) );
347 connect( usePagerSuff->checkBox(), TQ_SIGNAL(toggled(
bool)),
348 PagerSuff->label(), TQ_SLOT(setEnabled(
bool)) );
351 void KandyPrefsDialog::setupWindowsTab()
353 TQFrame *topFrame = addPage(i18n(
"Windows"),0,
354 DesktopIcon(
"window_duplicate",TDEIcon::SizeMedium));
356 TQGridLayout *topLayout =
new TQGridLayout(topFrame,6,2);
357 topLayout->setSpacing(spacingHint());
358 topLayout->setMargin(marginHint());
360 startupTerminal = addWidBool( KandyPrefs::self()->startupTerminalWinItem(),
362 topLayout->addWidget(startupTerminal->checkBox(),0,0);
364 startupMobile = addWidBool( KandyPrefs::self()->startupMobileWinItem(),
366 topLayout->addWidget(startupMobile->checkBox(),1,0);
368 topLayout->setRowStretch(2, 1);
KandyPrefsDialog(TQWidget *parent=0, char *name=0, bool modal=false)
Initialize dialog and pages.