2 This file is part of Akonadi.
4 Copyright (c) 2006 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 <kaboutdata.h>
23 #include <kapplication.h>
24 #include <kcmdlineargs.h>
27 #include "mainwindow.h"
31 int main( int argc
, char **argv
)
33 KAboutData
aboutData( "akonadiconsole", 0,
34 ki18n( "Akonadi Console" ),
36 ki18n( "The Management and Debugging Console for Akonadi" ),
37 KAboutData::License_GPL
,
38 ki18n( "(c) 2006-2008 the Akonadi developer" ),
40 "http://pim.kde.org/akonadi/" );
41 aboutData
.setProgramIconName( "akonadi" );
42 aboutData
.addAuthor( ki18n( "Tobias König" ), ki18n( "Author" ), "tokoe@kde.org" );
43 aboutData
.addAuthor( ki18n( "Volker Krause" ), ki18n( "Author" ), "vkrause@kde.org" );
45 KCmdLineArgs::init( argc
, argv
, &aboutData
);
46 KCmdLineOptions options
;
47 options
.add( "remote <server>", ki18n("Connect to an Akonadi remote debugging server"));
48 KCmdLineArgs::addCmdLineOptions( options
);
50 KCmdLineArgs
*args
= KCmdLineArgs::parsedArgs();
51 if ( args
->isSet( "remote" ) ) {
52 const QString akonadiAddr
= QString::fromLatin1( "tcp:host=%1,port=31415" ).arg( args
->getOption( "remote" ) );
53 const QString dbusAddr
= QString::fromLatin1( "tcp:host=%1,port=31416" ).arg( args
->getOption( "remote" ) );
54 setenv( "AKONADI_SERVER_ADDRESS", akonadiAddr
.toLatin1(), 1 );
55 setenv( "DBUS_SESSION_BUS_ADDRESS", dbusAddr
.toLatin1(), 1 );
60 MainWindow
*window
= new MainWindow
;
61 if ( args
->isSet( "remote" ) )
62 window
->setWindowTitle( i18n( "Remote Akonadi Console (%1)", args
->getOption( "remote" ) ) );