27 #include <tdeapplication.h>
28 #include <tdeconfig.h>
30 #include <tdeglobal.h>
31 #include <kiconloader.h>
32 #include <tdelocale.h>
34 #include "viewconfigurefieldspage.h"
35 #include "viewconfigurefilterpage.h"
36 #include "viewmanager.h"
38 #include "viewconfigurewidget.h"
40 ViewConfigureWidget::ViewConfigureWidget( TDEABC::AddressBook *ab, TQWidget *parent,
42 : KAB::ConfigureWidget( ab, parent, name )
44 TQVBoxLayout *topLayout =
new TQVBoxLayout(
this );
46 mMainWidget =
new KJanusWidget(
this,
"JanusWidget", KJanusWidget::IconList );
47 topLayout->addWidget( mMainWidget );
50 TQVBox *page = addPage( i18n(
"Fields" ), TQString(),
51 TDEGlobal::iconLoader()->loadIcon(
"view_detailed",
55 mFieldsPage =
new ViewConfigureFieldsPage( addressBook(), page );
58 page = addPage( i18n(
"Default Filter" ), TQString(),
59 TDEGlobal::iconLoader()->loadIcon(
"filter",
62 mFilterPage =
new ViewConfigureFilterPage( page );
65 ViewConfigureWidget::~ViewConfigureWidget()
71 mFieldsPage->restoreSettings( config );
72 mFilterPage->restoreSettings( config );
77 mFieldsPage->saveSettings( config );
78 mFilterPage->saveSettings( config );
82 const TQPixmap &pixmap )
84 return mMainWidget->addVBoxPage( item, header, pixmap );
87 ViewConfigureDialog::ViewConfigureDialog(
ViewConfigureWidget *wdg,
const TQString &viewName,
88 TQWidget *parent,
const char *name )
89 : KDialogBase( Swallow, i18n(
"Modify View: " ) + viewName, Help | Ok | Cancel,
90 Ok, parent, name, true, true ), mConfigWidget( wdg )
92 setMainWidget( mConfigWidget );
97 ViewConfigureDialog::~ViewConfigureDialog()
101 void ViewConfigureDialog::restoreSettings( TDEConfig *config )
103 mConfigWidget->restoreSettings( config );
106 void ViewConfigureDialog::saveSettings( TDEConfig *config )
108 mConfigWidget->saveSettings( config );
111 void ViewConfigureDialog::slotHelp()
113 kapp->invokeHelp(
"using-views" );
116 #include "viewconfigurewidget.moc"