summaryrefslogtreecommitdiffstats
path: root/tdeprint/management/kaddprinterwizard.cpp
blob: b60be8510eba4b84c33f4e5a93d7f3cd805f6840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "kmmanager.h"
#include <kcmdlineargs.h>
#include <kapplication.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <kglobal.h>

static KCmdLineOptions options[] =
{
	{ "tdeconfig", I18N_NOOP("Configure TDE Print"), 0 },
	{ "serverconfig", I18N_NOOP("Configure print server"), 0 },
	KCmdLineLastOption
};

extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
{
	TDECmdLineArgs::init(argc, argv, "kaddprinterwizard",
			I18N_NOOP("Start the add printer wizard"),
			"0.1");
	TDECmdLineArgs::addCmdLineOptions(options);
	
	TDEGlobal::locale()->setMainCatalogue("tdelibs");

	TDEApplication app;
	TDECmdLineArgs	*args = TDECmdLineArgs::parsedArgs();
	bool	doConfig = args->isSet("tdeconfig");
	bool	doSrvConfig = args->isSet("serverconfig");

	if (doConfig)
		KMManager::self()->invokeOptionsDialog();
	else if (doSrvConfig)
		KMManager::self()->configureServer();
	else if (KMManager::self()->addPrinterWizard() == -1)
	{
		KMessageBox::error(0, KMManager::self()->errorMsg().prepend("<qt>").append("</qt>"));
	}
	
	return 0;
}