main.cpp
changeset 243 fad762341d2d
parent 215 e211e2fc9d54
child 250 0e994bf2346b
     1.1 --- a/main.cpp	Tue Mar 14 14:27:04 2006 +0000
     1.2 +++ b/main.cpp	Tue Mar 14 14:27:08 2006 +0000
     1.3 @@ -51,6 +51,7 @@
     1.4  QAction *actionEditFATE2URL;
     1.5  QAction *actionEditOpenVymLink;
     1.6  QAction *actionEditVymLink;
     1.7 +QAction *actionEditToggleHideExport;
     1.8  QAction *actionEditDeleteVymLink;
     1.9  QAction *actionEditMapInfo;
    1.10  QAction *actionEditHeading;
    1.11 @@ -127,32 +128,10 @@
    1.12  {
    1.13      QApplication app(argc,argv);
    1.14  
    1.15 -    QMimeSourceFactory *factory = QMimeSourceFactory::defaultFactory();
    1.16 -    factory->setPixmap("vym_48x48", QPixmap(vym_48x48_xpm));
    1.17 -    factory->setPixmap("vym_128x128", QPixmap(vym_128x128_xpm));
    1.18 -    qInitNetworkProtocols();
    1.19 -
    1.20 -	// Use /usr/share/vym or /usr/local/share/vym or . ?
    1.21 -	QDir vymBaseDir;
    1.22 -	vymBaseDir.setPath ("/usr/share/vym");
    1.23 -	if (!vymBaseDir.exists())
    1.24 -        vymBaseDir.setPath ("/usr/local/share/vym");
    1.25 -	if (!vymBaseDir.exists())
    1.26 -        vymBaseDir.setPath(vymBaseDir.currentDirPath() );
    1.27 -
    1.28 -	// Initialize translations
    1.29 -	QTranslator translator (0);
    1.30 -	translator.load( QString("vym_")+QTextCodec::locale(), vymBaseDir.path() + "/lang");
    1.31 -    app.installTranslator( &translator );
    1.32 -
    1.33 -	// Initializing the row of system flags
    1.34 -	// is done in first call to MapEditor(),
    1.35 -	// because we need at least one canvas first
    1.36 -	systemFlagsDefault=NULL;
    1.37 -	standardFlagsDefault=NULL;
    1.38  
    1.39  	// Reading and initializing options commandline options
    1.40  	options.add ("version", SwitchOption, "v","version");
    1.41 +	options.add ("local", SwitchOption, "l", "local");
    1.42  	options.add ("help", SwitchOption, "h", "help");
    1.43  	options.add ("quit", SwitchOption, "q", "quit");
    1.44  	options.add ("test", StringOption, "t", "test");
    1.45 @@ -178,6 +157,20 @@
    1.46  		return 0;	
    1.47  	}		
    1.48  	
    1.49 +	// Use /usr/share/vym or /usr/local/share/vym or . ?
    1.50 +	QDir vymBaseDir;
    1.51 +	if (options.isOn ("local"))
    1.52 +	{
    1.53 +		vymBaseDir.setPath (vymBaseDir.currentDirPath());
    1.54 +	}else
    1.55 +	{
    1.56 +		vymBaseDir.setPath ("/usr/share/vym");
    1.57 +		if (!vymBaseDir.exists())
    1.58 +			vymBaseDir.setPath ("/usr/local/share/vym");
    1.59 +		if (!vymBaseDir.exists())
    1.60 +			vymBaseDir.setPath(vymBaseDir.currentDirPath() );
    1.61 +	}
    1.62 +
    1.63  	if (options.isOn ("help"))
    1.64  	{
    1.65  		cout << options.getHelpText()<<endl;
    1.66 @@ -190,6 +183,23 @@
    1.67  		cout << "Testing: "<<options.getArg("test")<< endl;
    1.68  	}	
    1.69  
    1.70 +
    1.71 +    QMimeSourceFactory *factory = QMimeSourceFactory::defaultFactory();
    1.72 +    factory->setPixmap("vym_128x128", QPixmap(vym_128x128_xpm));
    1.73 +    qInitNetworkProtocols();
    1.74 +
    1.75 +
    1.76 +	// Initialize translations
    1.77 +	QTranslator translator (0);
    1.78 +	translator.load( QString("vym_")+QTextCodec::locale(), vymBaseDir.path() + "/lang");
    1.79 +    app.installTranslator( &translator );
    1.80 +
    1.81 +	// Initializing the row of system flags
    1.82 +	// is done in first call to MapEditor(),
    1.83 +	// because we need at least one canvas first
    1.84 +	systemFlagsDefault=NULL;
    1.85 +	standardFlagsDefault=NULL;
    1.86 +
    1.87  	// Initialize window of TextEditor
    1.88  	textEditor = new TextEditor();
    1.89  	textEditor->setIcon (QPixmap (vym_editor_xpm));