You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.4 KiB
60 lines
1.4 KiB
14 years ago
|
#include <tqwidget.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdeaboutdata.h>
|
||
|
#include <tdeapplication.h>
|
||
15 years ago
|
#include <kdebug.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
12 years ago
|
#include <tdecmdlineargs.h>
|
||
15 years ago
|
|
||
|
#include "stdaddressbook.h"
|
||
|
|
||
|
#include "distributionlisteditor.h"
|
||
|
#include "distributionlist.h"
|
||
|
|
||
|
using namespace KABC;
|
||
|
|
||
12 years ago
|
static const TDECmdLineOptions options[] =
|
||
15 years ago
|
{
|
||
|
{"list <listname>", I18N_NOOP("Show distribution list with name <listname>"), 0},
|
||
12 years ago
|
TDECmdLineLastOption
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
|
int main(int argc,char **argv)
|
||
|
{
|
||
12 years ago
|
TDEAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1");
|
||
12 years ago
|
TDECmdLineArgs::init(argc,argv,&aboutData);
|
||
|
TDECmdLineArgs::addCmdLineOptions( options );
|
||
15 years ago
|
|
||
12 years ago
|
TDEApplication app;
|
||
15 years ago
|
|
||
12 years ago
|
TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
|
||
15 years ago
|
if (args->isSet("list")) {
|
||
14 years ago
|
TQString name = args->getOption("list");
|
||
15 years ago
|
|
||
|
DistributionListManager *manager =
|
||
|
new DistributionListManager( StdAddressBook::self() );
|
||
|
manager->load();
|
||
|
DistributionList *list = manager->list( name );
|
||
|
if ( !list ) {
|
||
|
kdDebug() << "No list with name '" << name << "'" << endl;
|
||
|
return 1;
|
||
|
} else {
|
||
|
kdDebug() << "RESULT: " << list->emails().join(", ") << endl;
|
||
|
return 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
DistributionListEditor *editor =
|
||
|
new DistributionListEditor( StdAddressBook::self(), 0 );
|
||
|
|
||
|
editor->show();
|
||
|
app.setMainWidget(editor);
|
||
|
|
||
14 years ago
|
TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) );
|
||
15 years ago
|
|
||
|
app.exec();
|
||
|
|
||
|
delete editor;
|
||
|
}
|