• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

akonadi/clients

mainwidget.cpp

Go to the documentation of this file.
00001 /*
00002     This file is part of Akonadi.
00003 
00004     Copyright (c) 2006 Tobias Koenig <tokoe@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00019     USA.
00020 */
00021 
00022 #include "mainwidget.h"
00023 
00024 #include "agentwidget.h"
00025 #include "browserwidget.h"
00026 #include "debugwidget.h"
00027 #include "searchdialog.h"
00028 
00029 #include <akonadi/agentinstancewidget.h>
00030 #include <akonadi/agentfilterproxymodel.h>
00031 #include <akonadi/searchcreatejob.h>
00032 
00033 #include <KAction>
00034 #include <KActionCollection>
00035 #include <KXmlGuiWindow>
00036 
00037 #include <QtGui/QTabWidget>
00038 #include <QtGui/QVBoxLayout>
00039 
00040 MainWidget::MainWidget( KXmlGuiWindow *parent )
00041   : QWidget( parent )
00042 {
00043   QVBoxLayout *layout = new QVBoxLayout( this );
00044 
00045   QTabWidget *tabWidget = new QTabWidget( this );
00046   tabWidget->setObjectName( "mainTab" );
00047   layout->addWidget( tabWidget );
00048 
00049   tabWidget->addTab( new AgentWidget( tabWidget ), "Agents" );
00050   AgentWidget *resView = new AgentWidget( tabWidget );
00051   resView->widget()->agentFilterProxyModel()->addCapabilityFilter( "Resource" );
00052   tabWidget->addTab( resView, "Resources" );
00053   BrowserWidget *browser = new BrowserWidget( parent, tabWidget );
00054   tabWidget->addTab( browser, "Browser" );
00055   tabWidget->addTab( new DebugWidget( tabWidget ), "Debugger" );
00056 
00057   KAction *action = parent->actionCollection()->addAction( "akonadiconsole_search" );
00058   action->setText( "Create Search" );
00059   connect( action, SIGNAL( triggered() ), this, SLOT( createSearch() ) );
00060 }
00061 
00062 void MainWidget::createSearch()
00063 {
00064   SearchDialog dlg;
00065   if ( !dlg.exec() )
00066     return;
00067 
00068   const QString query = dlg.searchQuery();
00069   if ( query.isEmpty() )
00070     return;
00071 
00072   QString name = dlg.searchName();
00073   if ( name.isEmpty() )
00074     name = "My Search";
00075 
00076   new Akonadi::SearchCreateJob( name, query );
00077 }
00078 
00079 #include "mainwidget.moc"

akonadi/clients

Skip menu "akonadi/clients"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal