diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-10-13 11:56:14 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-10-29 21:58:42 +0900 |
commit | 2879ff70be9271550477982a1a6371714db38562 (patch) | |
tree | c2054149dba923ab080fe7093432c7663a990111 /src/main.cpp | |
parent | 3eb38d2556f676d1027746f20bf12a1dd74451ef (diff) | |
download | krecipes-2879ff70.tar.gz krecipes-2879ff70.zip |
Rearrange folders structure to remove unnecessary 'krecipes' second level subfolder
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 0c8ed6c9a4000af8f48581a81c4b5c2f5b9fd502)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..de93bf2 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,81 @@ + +/*************************************************************************** +* Copyright (C) 2003-2005 by * +* Unai Garro (ugarro@users.sourceforge.net) * +* Jason Kivlighn (jkivlighn@gmail.com) * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "krecipes.h" + +#include <iostream> + +#include <kuniqueapplication.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdelocale.h> + +#include "convert_sqlite3.h" + +static const char *description = + I18N_NOOP( "The TDE Cookbook" ); + +static const char *version = "1.0-beta1"; + +static TDECmdLineOptions options[] = + { + { "convert-sqlite3", I18N_NOOP("Convert the current SQLite 2.x database to SQLite 3 and exit") , 0 }, + { 0, 0, 0 } + }; + +int main( int argc, char **argv ) +{ + TDEAboutData about( "krecipes", I18N_NOOP( "Krecipes" ), version, description, + TDEAboutData::License_GPL, I18N_NOOP( "(C) 2003 Unai Garro\n(C) 2004-2006 Jason Kivlighn\n\n___________\n\n\nThis product is RecipeML compatible.\n You can get more information about this file format in:\n http://www.formatdata.com/recipeml" ), 0, 0, "jkivlighn@gmail.com" ); + about.addAuthor( "Unai Garro", 0, "ugarro@users.sourceforge.net" ); + about.addAuthor( "Jason Kivlighn", 0, "jkivlighn@gmail.com" ); + about.addAuthor( "Cyril Bosselut", 0, "bosselut@b1project.com" ); + + about.addCredit( "Colleen Beamer", I18N_NOOP("Testing, bug reports, suggestions"), "colleen.beamer@gmail.com" ); + + about.setTranslator( I18N_NOOP( "INSERT YOUR NAME HERE" ), I18N_NOOP( "INSERT YOUR EMAIL ADDRESS" ) ); + TDECmdLineArgs::init( argc, argv, &about ); + TDECmdLineArgs::addCmdLineOptions( options ); + KUniqueApplication::addCmdLineOptions(); + + if ( !KUniqueApplication::start() ) { + std::cout << "Krecipes is already running!" << std::endl; + return 0; + } + + KUniqueApplication app; + + // see if we are starting with session management + if ( app.isRestored() ) { + RESTORE( Krecipes ); + } + else { + // no session.. just start up normally + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + TQApplication::flushX(); + + if ( args->isSet("convert-sqlite3") ) { + ConvertSQLite3(); + return 0; + } + + Krecipes * widget = new Krecipes; + app.setMainWidget( widget ); + widget->show(); + + args->clear(); + } + + return app.exec(); +} + |