File indexing completed on 2024-04-14 14:47:09

0001 /********************************************************************************
0002  * Copyright (C) 2011-2015 by Stephen Allewell                                  *
0003  * steve.allewell@gmail.com                                                     *
0004  *                                                                              *
0005  * This program is free software; you can redistribute it and/or modify         *
0006  * it under the terms of the GNU General Public License as published by         *
0007  * the Free Software Foundation; either version 2 of the License, or            *
0008  * (at your option) any later version.                                          *
0009  ********************************************************************************/
0010 
0011 
0012 /**
0013  * @file
0014  * Implement the main function that is the first function to be called when the application starts.
0015  * Initialises the application and creates the MainWindow. Calls exec on the KApplication to begin
0016  * the event loop.
0017  */
0018 
0019 
0020 /**
0021  * @mainpage SymbolEditor Documentation
0022  *
0023  * @section intro_section Introduction
0024  * The symbol editor is used to create cross stitch symbols for the KXStitch application.  Originally KXStitch
0025  * relied on standard character fonts to supply these symbols, but differences in user languages and the quality
0026  * of the fonts available along with the alignment of the characters and the limited number available has driven
0027  * the need to create a dedicated symbol set.
0028  *
0029  * The symbol set will be stored in a file and several files can be created depending on the users needs, for
0030  * example having a halloween symbol set for halloween themed patterns.
0031  *
0032  * Each of the files will contain a series of symbols which will be displayed in the symbol library tab. Editing
0033  * of existing symbols can be done by double clicking the entry in the library which will populate the editor
0034  * with this symbol. Alternatively new symbols can be created and added to the library.
0035  *
0036  * @section user_interface The User Interface
0037  *
0038  * - @ref main_window
0039  *  - @ref file_menu
0040  *  - @ref edit_menu
0041  *   - @ref file_edit_toolbar
0042  *  - @ref rendering_menu
0043  *  - @ref tools_menu
0044  *   - @ref tools_toolbar
0045  * - @ref editor_window
0046  *  - @ref editor_tools
0047  *  - @ref path_rendering
0048  *  - @ref points
0049  *  - @ref editing_symbols
0050  * - @ref symbol_library
0051  *
0052  * @section license_section License
0053  * SymbolEditor is provided as free software; you can redistribute it and/or modify it under the terms of the
0054  * GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or
0055  * (at your option) any later version.
0056  */
0057 
0058 
0059 #include <QApplication>
0060 #include <QCommandLineParser>
0061 #include <QUrl>
0062 
0063 #include <KAboutData>
0064 #include <KLocalizedString>
0065 
0066 #include "MainWindow.h"
0067 
0068 
0069 /**
0070  * The main function creates an instance of a KAboutData object and populates it with any information necessary
0071  * for the application.
0072  *
0073  * A QCommandLineParser object is created to manage any arguments passed on the command line. At this time these are not
0074  * used.
0075  *
0076  * A QApplication object is created to manage the application and a new MainWindow is created and shown on the desktop.
0077  *
0078  * The QApplication instance is then executed which begins the event loop allowing user interaction.
0079  */
0080 int main(int argc, char *argv[])
0081 {
0082     QApplication app(argc, argv);
0083 
0084     KLocalizedString::setApplicationDomain("SymbolEditor");
0085 
0086     KAboutData aboutData(QStringLiteral("SymbolEditor"),                    // component name
0087                          QString(i18n("SymbolEditor")),                     // display name
0088                          QStringLiteral("2.0.0"),                          // version
0089                          i18n("A cross stitch symbol editor."),             // short description
0090                          KAboutLicense::GPL_V2,                             // license
0091                          i18n("(c)2011-2015 Stephen Allewell"),             // copyright
0092                          QStringLiteral(),                                  // other text
0093                          QString("http://userbase.kde.org/SymbolEditor")    // home page
0094                          // bug address defaults to submit@bugs.kde.org
0095                );
0096 
0097     aboutData.addAuthor(QStringLiteral("Stephen Allewell"), i18n("Project Lead"), QStringLiteral("steve.allewell@gmail.com"));
0098     aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails"));
0099 
0100     KAboutData::setApplicationData(aboutData);
0101 
0102     app.setApplicationName(aboutData.componentName());
0103     app.setApplicationDisplayName(aboutData.displayName());
0104     app.setWindowIcon(QIcon::fromTheme("SymbolEditor"));
0105     app.setOrganizationDomain(aboutData.organizationDomain());
0106     app.setApplicationVersion(aboutData.version());
0107 
0108     QCommandLineParser parser;
0109     aboutData.setupCommandLine(&parser);
0110     parser.setApplicationDescription(aboutData.shortDescription());
0111     parser.addHelpOption();
0112     parser.addVersionOption();
0113 
0114     parser.process(app);
0115 
0116     MainWindow *mainWindow = new MainWindow();
0117     mainWindow->show();
0118 
0119     return app.exec();
0120 }