SVN_SILENT made messages (.desktop file)
[kdegraphics.git] / kcolorchooser / kcolorchooser.cpp
blob76b2fcc66b3479743ec6cdf292e22de24f5a4a11
1 /*
2 This file is part of KDE
4 Copyright (C) 1998-2000 Waldo Bastian (bastian@kde.org)
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 #include <iostream>
26 #include <kapplication.h>
27 #include <kcmdlineargs.h>
28 #include <kaboutdata.h>
29 #include <klocale.h>
31 #include "kcolordialog.h"
33 static const char description[] =
34 I18N_NOOP("KDE Color Chooser");
36 static const char version[] = "v1.0.1";
39 int main(int argc, char *argv[])
41 KAboutData aboutData( "kcolorchooser", "kdelibs4", ki18n("KColorChooser"),
42 version, ki18n(description), KAboutData::License_BSD,
43 ki18n("(c) 2000, Waldo Bastian"));
44 aboutData.addAuthor(ki18n("Waldo Bastian"),KLocalizedString(), "bastian@kde.org");
45 KCmdLineArgs::init( argc, argv, &aboutData );
47 KCmdLineOptions options;
48 options.add("print", ki18n("Print the selected color to stdout"));
49 KCmdLineArgs::addCmdLineOptions( options );
51 KApplication app;
53 KColorDialog dlg;
55 dlg.setColor(Qt::blue); // Just a color
57 app.connect(&dlg, SIGNAL(finished()), SLOT(quit()));
59 dlg.show();
60 app.exec();
62 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
63 const QColor c = dlg.color();
64 if ( args->isSet("print") && c.isValid() ) {
65 std::cout << c.name().toUtf8().constData() << std::endl;
67 args->clear();