main.cpp
changeset 376 626fd85b1f69
parent 308 2827ca924b18
child 390 0e1aeb21cb78
     1.1 --- a/main.cpp	Mon Apr 24 11:31:15 2006 +0000
     1.2 +++ b/main.cpp	Tue Sep 05 15:05:18 2006 +0000
     1.3 @@ -1,16 +1,16 @@
     1.4 -#include <qapplication.h>
     1.5 -#include <qpixmap.h>
     1.6 -#include <qtranslator.h>
     1.7 -#include <qdir.h>
     1.8 -#include <qptrlist.h>
     1.9 -#include <qtextcodec.h>
    1.10 -#include <qnetwork.h>
    1.11 -#include <qmime.h>
    1.12 +#include <QApplication>
    1.13 +#include <QPixmap>
    1.14 +#include <QTranslator>
    1.15 +#include <QDir>
    1.16 +#include <q3ptrlist.h>
    1.17 +#include <QTextCodec>
    1.18 +#include <q3network.h>
    1.19 +#include <QMenu>
    1.20 +#include <QActionGroup>
    1.21  
    1.22  #include "settings.h"
    1.23  #include "options.h"
    1.24  #include "mainwindow.h"
    1.25 -
    1.26  #include "flagrowobj.h"
    1.27  
    1.28  // Global variables
    1.29 @@ -21,6 +21,8 @@
    1.30  QString tmpVymDir;				// All temp files go there, created in mainwindow
    1.31  QString clipboardDir;			// Clipboard used in all mapEditors
    1.32  QDir vymBaseDir;				// Containing all styles, scripts, images, ...
    1.33 +QDir lastImageDir;
    1.34 +QDir lastFileDir;
    1.35  QString iconPath;				// Pointing to icons used for toolbars
    1.36  QString flagsPath;				// Pointing to flags
    1.37  bool clipboardEmpty;			
    1.38 @@ -29,7 +31,7 @@
    1.39  
    1.40  // Lists of actions
    1.41  // (QActionGroup could not be "enabled")
    1.42 -QPtrList <QAction> actionListBranches;
    1.43 +Q3PtrList <QAction> actionListBranches;
    1.44  
    1.45  // Actions which change sometimes
    1.46  QAction *actionFileSave;
    1.47 @@ -44,11 +46,13 @@
    1.48  QAction *actionEditToggleScroll;
    1.49  QAction *actionEditOpenURL;
    1.50  QAction *actionEditOpenURLTab;
    1.51 +QAction *actionEditOpenMultipleURLTabs;
    1.52  QAction *actionEditURL;
    1.53  QAction *actionEditHeading2URL;
    1.54  QAction *actionEditBugzilla2URL;
    1.55  QAction *actionEditFATE2URL;
    1.56  QAction *actionEditOpenVymLink;
    1.57 +QAction *actionEditOpenMultipleVymLinks;
    1.58  QAction *actionEditVymLink;
    1.59  QAction *actionEditToggleHideExport;
    1.60  QAction *actionEditDeleteVymLink;
    1.61 @@ -99,33 +103,36 @@
    1.62  
    1.63  QAction *actionSettingsAutoselectHeading;
    1.64  QAction *actionSettingsAutoselectText;
    1.65 -QAction *actionSettingsPasteNewHeading;
    1.66  QAction *actionSettingsAutoedit;
    1.67  QAction *actionSettingsUseDelKey;
    1.68  QAction *actionSettingsUseFlagGroups;
    1.69  QAction *actionSettingsUseHideExport;
    1.70  
    1.71 -QPopupMenu *branchContextMenu;
    1.72 -QPopupMenu *branchAddContextMenu;
    1.73 -QPopupMenu *branchRemoveContextMenu;
    1.74 -QPopupMenu *branchLinksContextMenu;
    1.75 -QPopupMenu *branchLinksContextMenuDup;
    1.76 -QPopupMenu *floatimageContextMenu;
    1.77 -QPopupMenu *saveImageFormatMenu;
    1.78 -QPopupMenu *canvasContextMenu;
    1.79 -QPopupMenu *lastMapsMenu;
    1.80 -QPopupMenu *importMenu;
    1.81 -QPopupMenu *exportMenu;
    1.82 -QPopupMenu *exportImageFormatMenu;
    1.83  
    1.84 +QMenu* branchContextMenu;
    1.85 +QMenu* branchAddContextMenu;
    1.86 +QMenu* branchRemoveContextMenu;
    1.87 +QMenu* branchLinksContextMenu;
    1.88 +QMenu* branchXLinksContextMenuEdit;
    1.89 +QMenu* branchXLinksContextMenuFollow;
    1.90 +QMenu* floatimageContextMenu;
    1.91 +QMenu* canvasContextMenu;
    1.92 +QMenu* fileLastMapsMenu;
    1.93 +QMenu* fileImportMenu;
    1.94 +QMenu* fileExportMenu;
    1.95  
    1.96 -Settings settings;
    1.97 +
    1.98 +Settings settings ("InSilmaril","vym"); // Organization, Application name
    1.99 +
   1.100  Options options;
   1.101 +ImageIO imageIO;
   1.102  
   1.103  int statusbarTime=3500;
   1.104  
   1.105  int main(int argc, char** argv)
   1.106  {
   1.107 +//FIXME	Q_INIT_RESOURCE (application);
   1.108 +
   1.109      QApplication app(argc,argv);
   1.110  
   1.111  
   1.112 @@ -144,14 +151,14 @@
   1.113  		"http://www.InSilmaril.de/vym\n");
   1.114  	if (options.parse())
   1.115  	{
   1.116 -		cout << endl << options.getHelpText()<<endl;
   1.117 +		cout << endl << options.getHelpText().ascii()<<endl;
   1.118  		return 1;
   1.119  	}
   1.120  
   1.121  	if (options.isOn ("version"))
   1.122  	{
   1.123  		cout << "vym version "<<__VYM_VERSION
   1.124 -			<<"  (c) 2004 Uwe Drechsel - "
   1.125 +			<<"  (c) 2004-2006 Uwe Drechsel - "
   1.126  			<<__BUILD_DATE<<endl;
   1.127  			
   1.128  		return 0;	
   1.129 @@ -182,22 +189,17 @@
   1.130  	iconPath=vymBaseDir.path()+"/icons/";
   1.131  	flagsPath=vymBaseDir.path()+"/flags/";
   1.132  
   1.133 +	// Some directories
   1.134 +	lastImageDir=QDir().current();
   1.135 +	lastFileDir=QDir().current();
   1.136 +
   1.137  	if (options.isOn ("help"))
   1.138  	{
   1.139 -		cout << options.getHelpText()<<endl;
   1.140 +		cout << options.getHelpText().ascii()<<endl;
   1.141  		return 0;	
   1.142  	}	
   1.143  
   1.144 -	if (options.isOn ("test"))
   1.145 -	{
   1.146 -		// FIXME testing string option only
   1.147 -		cout << "Testing: "<<options.getArg("test")<< endl;
   1.148 -	}	
   1.149 -
   1.150 -
   1.151 -    QMimeSourceFactory *factory = QMimeSourceFactory::defaultFactory();
   1.152 -    factory->setPixmap("vym-128x128", QPixmap(iconPath+"vym-128x128.png"));
   1.153 -    qInitNetworkProtocols();
   1.154 +    q3InitNetworkProtocols();
   1.155  
   1.156  
   1.157  	// Initialize translations