/* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2002-07-28 * Description : main program from digiKam * * Copyright (C) 2002-2006 by Renchi Raju * Copyright (C) 2002-2008 by Gilles Caulier * * 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, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifdef HAVE_CONFIG_H #include #endif // TQt includes. #include #include #include #include // KDE includes. #include #include #include #include #include #include #include #include #include // KIPI includes. #include #include // Local includes. #include "daboutdata.h" #include "albumdb.h" #include "digikamapp.h" #include "digikamfirstrun.h" static KCmdLineOptions options[] = { { "detect-camera", I18N_NOOP("Automatically detect and open camera"), 0 }, { "download-from ", I18N_NOOP("Open camera dialog at "), 0 }, KCmdLineLastOption }; int main(int argc, char *argv[]) { TQString libInfo = Digikam::libraryInfo(); TQString description = Digikam::digiKamDescription(); TDEAboutData aboutData( "digikam", I18N_NOOP("digiKam"), digikam_version, description.latin1(), TDEAboutData::License_GPL, Digikam::copyright(), 0, Digikam::webProjectUrl()); aboutData.setOtherText(libInfo.latin1()); Digikam::authorsRegistration(aboutData); TDECmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::addCmdLineOptions( options ); TDEApplication app; TDEConfig* config = TDEGlobal::config(); config->setGroup("General Settings"); TQString version = config->readEntry("Version"); config->setGroup("Album Settings"); TQString albumPath = config->readPathEntry("Album Path"); TQFileInfo dirInfo(albumPath); // version 0.6 was the version when the new Albums Library // storage was implemented if (version.startsWith("0.5") || !dirInfo.exists() || !dirInfo.isDir()) { // Run the first run Digikam::DigikamFirstRun *firstRun = new Digikam::DigikamFirstRun(config); app.setMainWidget(firstRun); firstRun->show(); return app.exec(); } Digikam::DigikamApp *digikam = new Digikam::DigikamApp(); app.setMainWidget(digikam); digikam->show(); TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); if (args && args->isSet("detect-camera")) digikam->autoDetect(); else if (args && args->isSet("download-from")) digikam->downloadFrom(args->getOption("download-from")); #if KDE_IS_VERSION(3,2,0) TQStringList tipsFiles; tipsFiles.append("digikam/tips"); tipsFiles.append("kipi/tips"); TDEGlobal::locale()->insertCatalogue("kipiplugins"); TDEGlobal::locale()->insertCatalogue("libkdcraw"); KTipDialog::showMultiTip(0, tipsFiles, false); #else KTipDialog::showTip(0, "digikam/tips", false); #endif return app.exec(); }