Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

KdeUniqueCelestia Class Reference

#include <kdeuniquecelestia.h>

Collaboration diagram for KdeUniqueCelestia:

Collaboration graph
List of all members.

Public Member Functions

 KdeUniqueCelestia ()
int newInstance ()

Private Attributes

KdeAppapp

Constructor & Destructor Documentation

KdeUniqueCelestia::KdeUniqueCelestia  ) 
 

Definition at line 25 of file kdeuniquecelestia.cpp.

References app, and KdeApp::setStartURL().

00025                                      {
00026 
00027     bindtextdomain(PACKAGE, LOCALEDIR);
00028     bind_textdomain_codeset(PACKAGE, "UTF-8");
00029     textdomain(PACKAGE);
00030 
00031     KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00032     std::vector<std::string> validDirs;
00033     std::string config, dir;
00034     bool fullscreen = false;
00035 
00036     if (args->isSet("conf")) {
00037         if (QFile::exists(args->getOption("conf")))
00038             config = std::string((const char*)args->getOption("conf"));
00039         else
00040             std::cerr << i18n("File %1 does not exist, using default configuration file %2/celestia.cfg")
00041                     .arg(args->getOption("conf"))
00042                     .arg(CONFIG_DATA_DIR) << std::endl;
00043     }
00044 
00045     if (args->isSet("dir")) {
00046         QDir d(args->getOption("dir"));
00047         if (d.exists())
00048             dir = std::string((const char*)args->getOption("dir"));
00049         else 
00050             std::cerr << i18n("Directory %1 does not exist, using default %2")
00051                     .arg(args->getOption("dir"))
00052                     .arg(CONFIG_DATA_DIR)  << std::endl;
00053     }
00054 
00055     if (args->isSet("extrasdir")) {
00056         QCStringList dirs = args->getOptionList("extrasdir");
00057         for (QCStringList::Iterator i = dirs.begin(); i != dirs.end(); ++i) {
00058             QDir d(*i);
00059             if (d.exists()) 
00060                 validDirs.push_back(std::string((const char*)*i));
00061             else 
00062                 std::cerr << i18n("Extras directory %1 does not exist").arg(*i) << std::endl;
00063         }
00064     }
00065 
00066     if (args->isSet("fullscreen")) fullscreen = true;
00067 
00068     app = new KdeApp(config, dir, validDirs, fullscreen, !args->isSet("s"));
00069 
00070     if (args->count() != 0) {
00071         app->setStartURL(args->url(0));
00072     }
00073 
00074     setMainWidget(app);
00075     app->show();
00076     
00077 }


Member Function Documentation

int KdeUniqueCelestia::newInstance  ) 
 

Definition at line 79 of file kdeuniquecelestia.cpp.

References app, and KdeApp::goToURL().

00079                                    {
00080     KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00081     if (args->count() != 0) {
00082         app->goToURL(args->url(0));
00083         app->showNormal();
00084         app->setActiveWindow();
00085         app->raise();
00086     }
00087     return 0;
00088 }


Member Data Documentation

KdeApp* KdeUniqueCelestia::app [private]
 

Definition at line 29 of file kdeuniquecelestia.h.

Referenced by KdeUniqueCelestia(), and newInstance().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:25 2006 for Celestia by  doxygen 1.4.1