2
This file is part of Akonadi.
4
Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22
#include "kabceditor.h"
24
#include <QtGui/QGridLayout>
25
#include <QtGui/QLabel>
26
#include <QtGui/QLineEdit>
27
#include <QtGui/QPushButton>
29
#include <akonadi/item.h>
30
#include <kapplication.h>
31
#include <kcmdlineargs.h>
33
#include "kabc/kabcitemeditor.h"
35
Dialog::Dialog( QWidget *parent )
38
setCaption( "Contact Editor" );
41
showButtonSeparator( true );
43
QWidget *wdg = new QWidget( this );
44
QGridLayout *layout = new QGridLayout( wdg );
46
mEditor = new Akonadi::KABCItemEditor( Akonadi::KABCItemEditor::EditMode, wdg );
47
layout->addWidget( mEditor, 0, 0, 1, 3 );
49
QLabel *label = new QLabel( "Item Id:", wdg );
50
layout->addWidget( label, 1, 0 );
52
mId = new QLineEdit( wdg );
53
layout->addWidget( mId, 1, 1 );
55
QPushButton *button = new QPushButton( "Load", wdg );
56
layout->addWidget( button, 1, 2 );
58
connect( button, SIGNAL( clicked() ), SLOT( load() ) );
60
button = new QPushButton( "Save", wdg );
61
layout->addWidget( button, 2, 2 );
63
connect( button, SIGNAL( clicked() ), SLOT( save() ) );
74
mEditor->loadContact( Akonadi::Item( mId->text().toLongLong() ) );
79
mEditor->saveContact();
82
int main( int argc, char **argv )
84
KCmdLineArgs::init( argc, argv, "kabceditor", 0, ki18n("KABC Editor"), "1.0" , ki18n("A contact editor for Akonadi"));
93
#include "kabceditor.moc"