summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /kaddressbook/viewmanager.cpp
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp685
1 files changed, 685 insertions, 0 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
new file mode 100644
index 0000000..e8c5b45
--- a/dev/null
+++ b/kaddressbook/viewmanager.cpp
@@ -0,0 +1,685 @@
1/*
2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution.
22*/
23
24/*
25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk
27
28$Id$
29*/
30
31
32#ifndef KAB_EMBEDDED
33#include <libkdepim/kvcarddrag.h>
34#include <kabc/vcardconverter.h>
35#include <kconfig.h>
36#include <kdeversion.h>
37#include <kiconloader.h>
38#include <klocale.h>
39#include <kmessagebox.h>
40#include <kmultipledrag.h>
41#include <ktrader.h>
42#include <kurldrag.h>
43
44#include "addresseeutil.h"
45#else //KAB_EMBEDDED
46#include "views/kaddressbookiconview.h"
47#include "views/kaddressbooktableview.h"
48#include "views/kaddressbookcardview.h"
49#include "kaddressbookview.h"
50
51#include <qaction.h>
52#include <qmessagebox.h>
53#include <qpopupmenu.h>
54#include <kconfigbase.h>
55
56#endif //KAB_EMBEDDED
57
58
59#include <kdebug.h>
60#include <kactionclasses.h>
61
62#include <qlayout.h>
63#include <qwidgetstack.h>
64
65#include <kabc/addressbook.h>
66#include "filtereditdialog.h"
67#include "addviewdialog.h"
68#include "kabcore.h"
69#include "kabprefs.h"
70#include "viewmanager.h"
71
72ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name )
73 : QWidget( parent, name ), mCore( core ), mActiveView( 0 )
74{
75 initGUI();
76 initActions();
77
78 mViewDict.setAutoDelete( true );
79
80 createViewFactories();
81}
82
83ViewManager::~ViewManager()
84{
85 unloadViews();
86 mViewFactoryDict.clear();
87}
88
89void ViewManager::restoreSettings()
90{
91 mViewNameList = KABPrefs::instance()->mViewNames;
92 QString activeViewName = KABPrefs::instance()->mCurrentView;
93
94 mActionSelectView->setItems( mViewNameList );
95
96 // Filter
97 mFilterList = Filter::restore( mCore->config(), "Filter" );
98 mActionSelectFilter->setItems( filterNames() );
99 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
100
101 // Tell the views to reread their config, since they may have
102 // been modified by global settings
103 QString _oldgroup = mCore->config()->group();
104
105 QDictIterator<KAddressBookView> it( mViewDict );
106 for ( it.toFirst(); it.current(); ++it ) {
107 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
108 it.current()->readConfig( mCore->config() );
109 }
110 setActiveView( activeViewName );
111
112 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
113}
114
115void ViewManager::saveSettings()
116{
117 QString _oldgroup = mCore->config()->group();
118
119 QDictIterator<KAddressBookView> it( mViewDict );
120 for ( it.toFirst(); it.current(); ++it ) {
121 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
122#ifdef DESKTOP_VERSION
123 (*it)->writeConfig( mCore->config() );
124#else
125 (*it).writeConfig( mCore->config() );
126#endif
127 }
128
129 Filter::save( mCore->config(), "Filter", mFilterList );
130 KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem();
131
132 // write the view name list
133 KABPrefs::instance()->mViewNames = mViewNameList;
134 KABPrefs::instance()->mCurrentView = mActiveView->caption();
135
136}
137
138QStringList ViewManager::selectedUids() const
139{
140 if ( mActiveView )
141 return mActiveView->selectedUids();
142 else
143 return QStringList();
144}
145
146QStringList ViewManager::selectedEmails() const
147{
148 if ( mActiveView )
149 return mActiveView->selectedEmails();
150 else
151 return QStringList();
152}
153
154KABC::Addressee::List ViewManager::selectedAddressees() const
155{
156 KABC::Addressee::List list;
157 if ( mActiveView ) {
158 QStringList uids = mActiveView->selectedUids();
159 QStringList::Iterator it;
160 for ( it = uids.begin(); it != uids.end(); ++it ) {
161 KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
162 if ( !addr.isEmpty() )
163 list.append( addr );
164 }
165 }
166
167 return list;
168}
169//US added another method with no parameter, since my moc compiler does not support default parameters.
170void ViewManager::setSelected()
171{
172 setSelected( QString::null, true );
173}
174
175void ViewManager::setSelected( const QString &uid, bool selected )
176{
177 if ( mActiveView )
178 mActiveView->setSelected( uid, selected );
179}
180
181void ViewManager::unloadViews()
182{
183 mViewDict.clear();
184 mActiveView = 0;
185}
186
187void ViewManager::setActiveView( const QString &name )
188{
189 KAddressBookView *view = 0;
190
191 // Check that this isn't the same as the current active view
192 if ( mActiveView && ( mActiveView->caption() == name ) )
193 return;
194
195 // At this point we know the view that should be active is not
196 // currently active. We will try to find the new on in the list. If
197 // we can't find it, it means it hasn't been instantiated, so we will
198 // create it on demand.
199
200 view = mViewDict.find( name );
201
202 // Check if we found the view. If we didn't, then we need to create it
203 if ( view == 0 ) {
204 KConfig *config = mCore->config();
205
206 KConfigGroupSaver saver( config, name );
207
208 QString type = config->readEntry( "Type", "Table" );
209
210 kdDebug(5720) << "ViewManager::setActiveView: creating view - " << name << endl;
211
212 ViewFactory *factory = mViewFactoryDict.find( type );
213 if ( factory )
214 view = factory->view( mCore->addressBook(), mViewWidgetStack );
215
216 if ( view ) {
217 view->setCaption( name );
218 mViewDict.insert( name, view );
219//US my version needs an int as second parameter to addWidget
220 mViewWidgetStack->addWidget( view, -1 );
221 view->readConfig( config );
222
223 // The manager just relays the signals
224 connect( view, SIGNAL( selected( const QString& ) ),
225 SIGNAL( selected( const QString & ) ) );
226 connect( view, SIGNAL( executed( const QString& ) ),
227 SIGNAL( executed( const QString& ) ) );
228
229 connect( view, SIGNAL( deleteRequest( ) ),
230 SIGNAL( deleteRequest( ) ) );
231
232 connect( view, SIGNAL( modified() ), SIGNAL( modified() ) );
233 connect( view, SIGNAL( dropped( QDropEvent* ) ),
234 SLOT( dropped( QDropEvent* ) ) );
235 connect( view, SIGNAL( startDrag() ), SLOT( startDrag() ) );
236 }
237 }
238
239 // If we found or created the view, raise it and refresh it
240 if ( view ) {
241 mActiveView = view;
242 mViewWidgetStack->raiseWidget( view );
243 // Set the proper filter in the view. By setting the combo
244 // box, the activated slot will be called, which will push
245 // the filter to the view and refresh it.
246
247 if ( view->defaultFilterType() == KAddressBookView::None ) {
248
249 mActionSelectFilter->setCurrentItem( 0 );
250 setActiveFilter( 0 );
251 } else if ( view->defaultFilterType() == KAddressBookView::Active ) {
252 setActiveFilter( mActionSelectFilter->currentItem() );
253 } else {
254 uint pos = filterPosition( view->defaultFilterName() );
255 mActionSelectFilter->setCurrentItem( pos );
256 setActiveFilter( pos );
257 }
258//US qDebug("ViewManager::setActiveView 6" );
259
260 // Update the inc search widget to show the fields in the new active
261 // view.
262 mCore->setSearchFields( mActiveView->fields() );
263
264 mActiveView->refresh();
265
266 }
267 else
268 {
269 qDebug("ViewManager::setActiveView: unable to find view" );
270 kdDebug(5720) << "ViewManager::setActiveView: unable to find view\n";
271 }
272}
273
274//US added another method with no parameter, since my moc compiler does not support default parameters.
275void ViewManager::refreshView()
276{
277 refreshView( QString::null );
278}
279
280void ViewManager::refreshView( const QString &uid )
281{
282 if ( mActiveView )
283 mActiveView->refresh( uid );
284}
285
286void ViewManager::editView()
287{
288 if ( !mActiveView )
289 return;
290
291 ViewFactory *factory = mViewFactoryDict.find( mActiveView->type() );
292 ViewConfigureWidget *wdg = 0;
293 ViewConfigureDialog* dlg = 0;
294 if ( factory ) {
295 // Save the filters so the dialog has the latest set
296 Filter::save( mCore->config(), "Filter", mFilterList );
297 dlg = new ViewConfigureDialog( 0, mActiveView->caption(), this, "conf_dlg" );
298 wdg = factory->configureWidget( mCore->addressBook(), dlg,"conf_wid" );
299 } else {
300 qDebug("ViewManager::editView()::cannot find viewfactory ");
301 return;
302 }
303 if ( wdg ) {
304 dlg->setWidget( wdg );
305
306#ifndef DESKTOP_VERSION
307 //dlg.setMaximumSize( 640, 480 );
308 //dlg->setGeometry( 40,40, 400, 300);
309 dlg->showMaximized();
310#endif
311
312 KConfigGroupSaver saver( mCore->config(), mActiveView->caption() );
313
314 dlg->restoreSettings( mCore->config() );
315
316 if ( dlg->exec() ) {
317 dlg->saveSettings( mCore->config() );
318 mActiveView->readConfig( mCore->config() );
319
320 // Set the proper filter in the view. By setting the combo
321 // box, the activated slot will be called, which will push
322 // the filter to the view and refresh it.
323 if ( mActiveView->defaultFilterType() == KAddressBookView::None ) {
324 mActionSelectFilter->setCurrentItem( 0 );
325 setActiveFilter( 0 );
326 } else if ( mActiveView->defaultFilterType() == KAddressBookView::Active ) {
327 setActiveFilter( mActionSelectFilter->currentItem() );
328 } else {
329 uint pos = filterPosition( mActiveView->defaultFilterName() );
330 mActionSelectFilter->setCurrentItem( pos );
331 setActiveFilter( pos );
332 }
333 mCore->setSearchFields( mActiveView->fields() );
334 mActiveView->refresh();
335 }
336
337 }
338 delete dlg;
339}
340
341void ViewManager::deleteView()
342{
343 QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" )
344 .arg( mActiveView->caption() );
345 QString caption = i18n( "Confirm Delete" );
346
347
348 if (QMessageBox::information( this, caption,
349 text,
350 i18n("Yes!"), i18n("No"), 0, 0 ) == 0)
351 {
352 mViewNameList.remove( mActiveView->caption() );
353
354 // remove the view from the config file
355 KConfig *config = mCore->config();
356 config->deleteGroup( mActiveView->caption() );
357
358 mViewDict.remove( mActiveView->caption() );
359 mActiveView = 0;
360
361 // we are in an invalid state now, but that should be fixed after
362 // we emit the signal
363 mActionSelectView->setItems( mViewNameList );
364 if ( mViewNameList.count() > 0 ) {
365 mActionSelectView->setCurrentItem( 0 );
366 setActiveView( mViewNameList[ 0 ] );
367 }
368 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
369 }
370}
371
372void ViewManager::addView()
373{
374 AddViewDialog dialog( &mViewFactoryDict, this );
375
376 if ( dialog.exec() ) {
377 QString newName = dialog.viewName();
378 QString type = dialog.viewType();
379
380 // Check for name conflicts
381 bool firstConflict = true;
382 int numTries = 1;
383 while ( mViewNameList.contains( newName ) > 0 ) {
384 if ( !firstConflict ) {
385 newName = newName.left( newName.length() - 4 );
386 firstConflict = false;
387 }
388
389 newName = QString( "%1 <%2>" ).arg( newName ).arg( numTries );
390 numTries++;
391 }
392
393 // Add the new one to the list
394 mViewNameList.append( newName );
395
396 // write the view to the config file,
397 KConfig *config = mCore->config();
398
399 config->deleteGroup( newName );
400
401 KConfigGroupSaver saver( config, newName );
402
403 config->writeEntry( "Type", type );
404
405 // try to set the active view
406 mActionSelectView->setItems( mViewNameList );
407 mActionSelectView->setCurrentItem( mViewNameList.findIndex( newName ) );
408 setActiveView( newName );
409
410 editView();
411
412 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
413 }
414}
415
416void ViewManager::createViewFactories()
417{
418#ifndef KAB_EMBEDDED
419 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/View" );
420 KTrader::OfferList::ConstIterator it;
421 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
422 if ( !(*it)->hasServiceType( "KAddressBook/View" ) )
423 continue;
424
425 KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() );
426
427 if ( !factory ) {
428 kdDebug(5720) << "ViewManager::createViewFactories(): Factory creation failed" << endl;
429 continue;
430 }
431
432 ViewFactory *viewFactory = static_cast<ViewFactory*>( factory );
433
434 if ( !viewFactory ) {
435 kdDebug(5720) << "ViewManager::createViewFactories(): Cast failed" << endl;
436 continue;
437 }
438
439 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
440 }
441
442#else //KAB_EMBEDDED
443 ViewFactory* viewFactory = new IconViewFactory();
444 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
445// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1());
446
447 viewFactory = new TableViewFactory();
448 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
449// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1());
450
451 viewFactory = new CardViewFactory();
452 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
453// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1());
454
455#endif //KAB_EMBEDDED
456
457}
458
459void ViewManager::dropped( QDropEvent *e )
460{
461 kdDebug(5720) << "ViewManager::dropped: got a drop event" << endl;
462
463#ifndef KAB_EMBEDDED
464
465 QString clipText, vcards;
466 KURL::List urls;
467
468 if ( KURLDrag::decode( e, urls) ) {
469 KURL::List::Iterator it = urls.begin();
470 int c = urls.count();
471 if ( c > 1 ) {
472 QString questionString = i18n( "Import one contact into your addressbook?", "Import %n contacts into your addressbook?", c );
473 if ( KMessageBox::questionYesNo( this, questionString, i18n( "Import Contacts?" ) ) == KMessageBox::Yes ) {
474 for ( ; it != urls.end(); ++it )
475 emit urlDropped( *it );
476 }
477 } else if ( c == 1 )
478 emit urlDropped( *it );
479 } else if ( KVCardDrag::decode( e, vcards ) ) {
480 KABC::Addressee addr;
481 KABC::VCardConverter converter;
482 QStringList list = QStringList::split( "\r\n\r\n", vcards );
483 QStringList::Iterator it;
484 for ( it = list.begin(); it != list.end(); ++it ) {
485 if ( converter.vCardToAddressee( (*it).stripWhiteSpace(), addr ) ) {
486 KABC::Addressee a = mCore->addressBook()->findByUid( addr.uid() );
487 if ( a.isEmpty() ) {
488 mCore->addressBook()->insertAddressee( addr );
489 emit modified();
490 }
491 }
492 }
493
494 mActiveView->refresh();
495 }
496#else //KAB_EMBEDDED
497qDebug("ViewManager::dropped() has to be changed!!" );
498#endif //KAB_EMBEDDED
499
500}
501
502void ViewManager::startDrag()
503{
504 kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl;
505
506#ifndef KAB_EMBEDDED
507
508 // Get the list of all the selected addressees
509 KABC::Addressee::List addrList;
510 QStringList uidList = selectedUids();
511 QStringList::Iterator iter;
512 for ( iter = uidList.begin(); iter != uidList.end(); ++iter )
513 addrList.append( mCore->addressBook()->findByUid( *iter ) );
514
515 KMultipleDrag *drag = new KMultipleDrag( this );
516 drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) );
517 KABC::Addressee::List::Iterator it;
518 QStringList vcards;
519 for ( it = addrList.begin(); it != addrList.end(); ++it ) {
520 QString vcard = QString::null;
521 KABC::VCardConverter converter;
522 if ( converter.addresseeToVCard( *it, vcard ) )
523 vcards.append( vcard );
524 }
525 drag->addDragObject( new KVCardDrag( vcards.join( "\r\n" ), this ) );
526
527 drag->setPixmap( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop ) );
528 drag->dragCopy();
529
530#else //KAB_EMBEDDED
531qDebug("ViewManager::startDrag() has to be changed!!" );
532#endif //KAB_EMBEDDED
533
534}
535
536void ViewManager::setActiveFilter( int index )
537{
538 Filter currentFilter;
539
540 if ( ( index - 1 ) < 0 )
541 currentFilter = Filter();
542 else
543 currentFilter = mFilterList[ index - 1 ];
544
545 // Check if we have a view. Since the filter combo is created before
546 // the view, this slot could be called before there is a valid view.
547 if ( mActiveView ) {
548 mActiveView->setFilter( currentFilter );
549 mActiveView->refresh();
550 emit selected( QString::null );
551 }
552}
553
554void ViewManager::configureFilters()
555{
556 FilterDialog dlg( this );
557
558 dlg.setFilters( mFilterList );
559
560 if ( dlg.exec() )
561 mFilterList = dlg.filters();
562
563 uint pos = mActionSelectFilter->currentItem();
564 mActionSelectFilter->setItems( filterNames() );
565 mActionSelectFilter->setCurrentItem( pos );
566 setActiveFilter( pos );
567}
568
569QStringList ViewManager::filterNames() const
570{
571 QStringList names( i18n( "No Filter" ) );
572
573 Filter::List::ConstIterator it;
574 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
575 names.append( (*it).name() );
576
577 return names;
578}
579
580int ViewManager::filterPosition( const QString &name ) const
581{
582 int pos = 0;
583
584 Filter::List::ConstIterator it;
585 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos )
586 if ( name == (*it).name() )
587 return pos + 1;
588
589 return 0;
590}
591
592void ViewManager::initActions()
593{
594//US <ActionList name="view_loadedviews"/>
595//US <Separator/>
596
597#ifdef KAB_EMBEDDED
598 QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu();
599 QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu();
600 QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu();
601#endif //KAB_EMBEDDED
602
603 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" );
604#if KDE_VERSION >= 309
605 mActionSelectView->setMenuAccelsEnabled( false );
606#endif
607 connect( mActionSelectView, SIGNAL( activated( const QString& ) ),
608 SLOT( setActiveView( const QString& ) ) );
609
610
611#ifdef KAB_EMBEDDED
612 mActionSelectView->plug(viewmenu);
613 viewmenu->insertSeparator();
614#endif //KAB_EMBEDDED
615
616 KAction *action;
617
618 action = new KAction( i18n( "Modify View..." ), "configure", 0, this,
619 SLOT( editView() ), mCore->actionCollection(), "view_modify" );
620#ifndef KAB_EMBEDDED
621 action->setWhatsThis( i18n( "By pressing this button a dialog opens that allows you to modify the view of the addressbook. There you can add or remove fields that you want to be shown or hidden in the addressbook like the name for example." ) );
622#else //KAB_EMBEDDED
623 action->plug(viewmenu);
624#endif //KAB_EMBEDDED
625
626 action = new KAction( i18n( "Add View..." ), "window_new", 0, this,
627 SLOT( addView() ), mCore->actionCollection(), "view_add" );
628#ifndef KAB_EMBEDDED
629 action->setWhatsThis( i18n( "You can add a new view by choosing one of the dialog that appears after pressing the button. You have to give the view a name, so that you can distinguish between the different views." ) );
630#else //KAB_EMBEDDED
631 action->plug(viewmenu);
632#endif //KAB_EMBEDDED
633
634 mActionDeleteView = new KAction( i18n( "Delete View" ), "view_remove", 0,
635 this, SLOT( deleteView() ),
636 mCore->actionCollection(), "view_delete" );
637#ifndef KAB_EMBEDDED
638 mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) );
639#else //KAB_EMBEDDED
640 mActionDeleteView->plug(viewmenu);
641 viewmenu->insertSeparator();
642#endif //KAB_EMBEDDED
643
644#ifndef KAB_EMBEDDED
645 action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
646 SLOT( refreshView(const QString &) ), mCore->actionCollection(),
647 "view_refresh" );
648 action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) );
649#else //KAB_EMBEDDED
650 action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
651 SLOT( refreshView()), mCore->actionCollection(),
652 "view_refresh" );
653 action->plug(viewmenu);
654 viewmenu->insertSeparator();
655#endif //KAB_EMBEDDED
656
657 action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this,
658 SLOT( configureFilters() ), mCore->actionCollection(),
659 "options_edit_filters" );
660
661 mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" );
662
663#if KDE_VERSION >= 309
664 mActionSelectFilter->setMenuAccelsEnabled( false );
665#endif
666 connect( mActionSelectFilter, SIGNAL( activated( int ) ),
667 SLOT( setActiveFilter( int ) ) );
668
669#ifdef KAB_EMBEDDED
670 action->plug(settingsmenu);
671 mActionSelectFilter->plug(viewmenu);
672#endif //KAB_EMBEDDED
673
674}
675
676void ViewManager::initGUI()
677{
678 QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 );
679 mViewWidgetStack = new QWidgetStack( this );
680 layout->addWidget( mViewWidgetStack );
681}
682
683#ifndef KAB_EMBEDDED
684#include "viewmanager.moc"
685#endif //KAB_EMBEDDED