summaryrefslogtreecommitdiffstats
path: root/kdeprint/management/kaddprinterwizard.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch)
tree5ac38a06f3dde268dc7927dc155896926aaf7012 /kdeprint/management/kaddprinterwizard.cpp
downloadtdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz
tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeprint/management/kaddprinterwizard.cpp')
-rw-r--r--kdeprint/management/kaddprinterwizard.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/kdeprint/management/kaddprinterwizard.cpp b/kdeprint/management/kaddprinterwizard.cpp
new file mode 100644
index 000000000..65d355a8f
--- /dev/null
+++ b/kdeprint/management/kaddprinterwizard.cpp
@@ -0,0 +1,39 @@
+#include "kmmanager.h"
+#include <kcmdlineargs.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kglobal.h>
+
+static KCmdLineOptions options[] =
+{
+ { "kdeconfig", I18N_NOOP("Configure KDE Print"), 0 },
+ { "serverconfig", I18N_NOOP("Configure print server"), 0 },
+ KCmdLineLastOption
+};
+
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
+{
+ KCmdLineArgs::init(argc, argv, "kaddprinterwizard",
+ I18N_NOOP("Start the add printer wizard"),
+ "0.1");
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KGlobal::locale()->setMainCatalogue("kdelibs");
+
+ KApplication app;
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ bool doConfig = args->isSet("kdeconfig");
+ 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;
+}