# kdeprint Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kaddprinterwizard.cpp

    00001 #include "kmmanager.h"
    00002 #include <kcmdlineargs.h>
    00003 #include <kapplication.h>
    00004 #include <kmessagebox.h>
    00005 #include <klocale.h>
    00006 #include <kglobal.h>
    00007
    00008 static KCmdLineOptions options[] =
    00009 {
    00010     { "kdeconfig", I18N_NOOP("Configure KDE Print"), 0 },
    00011     { "serverconfig", I18N_NOOP("Configure print server"), 0 },
    00012     KCmdLineLastOption
    00013 };
    00014
    00015 extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
    00016 {
    00017     KCmdLineArgs::init(argc, argv, "kaddprinterwizard",
    00018             I18N_NOOP("Start the add printer wizard"),
    00019             "0.1");
    00020     KCmdLineArgs::addCmdLineOptions(options);
    00021
    00022     KGlobal::locale()->setMainCatalogue("kdelibs");
    00023
    00024     KApplication app;
    00025     KCmdLineArgs    *args = KCmdLineArgs::parsedArgs();
    00026     bool    doConfig = args->isSet("kdeconfig");
    00027     bool    doSrvConfig = args->isSet("serverconfig");
    00028
    00029     if (doConfig)
    00030         KMManager::self()->invokeOptionsDialog();
    00031     else if (doSrvConfig)
    00032         KMManager::self()->configureServer();
    00033     else if (KMManager::self()->addPrinterWizard() == -1)
    00034     {
    00035         KMessageBox::error(0, KMManager::self()->errorMsg().prepend("<qt>").append("</qt>"));
    00036     }
    00037
    00038     return 0;
    00039 }

This file is part of the documentation for kdeprint Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:31:01 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003