diff -r 9eb7767c2dfa -r 608f976aa7bb main.cpp --- a/main.cpp Sun Jan 30 12:58:47 2005 +0000 +++ b/main.cpp Tue Jun 06 14:58:11 2006 +0000 @@ -1,14 +1,19 @@ #include #include #include +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include #include "settings.h" #include "options.h" #include "mainwindow.h" -#include "icons/vym-48x48.xpm" -#include "icons/vym-editor.xpm" - #include "flagrowobj.h" // Global variables @@ -16,14 +21,24 @@ // initialized in mainwindow Main *mainWindow; // used in BranchObj::select() -MapEditor *clipboardME; +QString tmpVymDir; // All temp files go there, created in mainwindow +QString clipboardDir; // Clipboard used in all mapEditors +QDir vymBaseDir; // Containing all styles, scripts, images, ... +QString iconPath; // Pointing to icons used for toolbars +QString flagsPath; // Pointing to flags +bool clipboardEmpty; FlagRowObj *systemFlagsDefault; // used to copy from in LinkableMapObj FlagRowObj *standardFlagsDefault; +// Lists of actions +// (QActionGroup could not be "enabled") +Q3PtrList actionListBranches; + // Actions which change sometimes QAction *actionFileSave; QAction *actionFilePrint; QAction *actionEditUndo; +QAction *actionEditRedo; QAction *actionEditCopy; QAction *actionEditCut; QAction *actionEditPaste; @@ -31,25 +46,30 @@ QAction *actionEditMoveDown; QAction *actionEditToggleScroll; QAction *actionEditOpenURL; +QAction *actionEditOpenURLTab; QAction *actionEditURL; QAction *actionEditHeading2URL; QAction *actionEditBugzilla2URL; +QAction *actionEditFATE2URL; QAction *actionEditOpenVymLink; QAction *actionEditVymLink; +QAction *actionEditToggleHideExport; QAction *actionEditDeleteVymLink; QAction *actionEditMapInfo; QAction *actionEditHeading; QAction *actionEditDelete; QAction *actionEditAddBranch; +QAction *actionEditAddBranchHere; QAction *actionEditAddBranchAbove; QAction *actionEditAddBranchBelow; +QAction *actionEditRemoveBranchKeepChilds; +QAction *actionEditRemoveChilds; QAction *actionEditImportAdd; QAction *actionEditImportReplace; QAction *actionEditSaveBranch; QAction *actionEditSelectFirst; QAction *actionEditSelectLast; QAction *actionEditLoadImage; -QAction *actionEditToggleFloatExport; QAction *actionFormatColor; QAction *actionFormatPickColor; @@ -59,31 +79,47 @@ QAction *actionFormatLinkColorHint; QAction *actionFormatLinkColor; -QActionGroup *actionGroupFormatFrameTypes; +Q3ActionGroup *actionGroupModModes; +QAction *actionModModeColor; +QAction *actionModModeLink; +QAction *actionModModeCopy; + +Q3ActionGroup *actionGroupFormatFrameTypes; QAction *actionFormatFrameNone; QAction *actionFormatFrameRectangle; -QActionGroup *actionGroupFormatLinkStyles; +Q3ActionGroup *actionGroupFormatLinkStyles; +QAction *actionFormatIncludeImagesVer; +QAction *actionFormatIncludeImagesHor; +QAction *actionFormatHideLinkUnselected; QAction *actionFormatLinkStyleLine; QAction *actionFormatLinkStyleParabel; QAction *actionFormatLinkStylePolyLine; QAction *actionFormatLinkStylePolyParabel; QAction *actionViewToggleNoteEditor; +QAction *actionViewToggleHistoryWindow; QAction *actionSettingsAutoselectHeading; QAction *actionSettingsAutoselectText; QAction *actionSettingsPasteNewHeading; QAction *actionSettingsAutoedit; QAction *actionSettingsUseDelKey; +QAction *actionSettingsUseFlagGroups; +QAction *actionSettingsUseHideExport; -QPopupMenu *branchContextMenu; -QPopupMenu *floatimageContextMenu; -QPopupMenu *saveImageFormatMenu; -QPopupMenu *canvasContextMenu; -QPopupMenu *lastMapsMenu; -QPopupMenu *exportMenu; -QPopupMenu *exportImageFormatMenu; +Q3PopupMenu *branchContextMenu; +Q3PopupMenu *branchAddContextMenu; +Q3PopupMenu *branchRemoveContextMenu; +Q3PopupMenu *branchLinksContextMenu; +Q3PopupMenu *branchLinksContextMenuDup; +Q3PopupMenu *floatimageContextMenu; +Q3PopupMenu *saveImageFormatMenu; +Q3PopupMenu *canvasContextMenu; +Q3PopupMenu *lastMapsMenu; +Q3PopupMenu *importMenu; +Q3PopupMenu *exportMenu; +Q3PopupMenu *exportImageFormatMenu; Settings settings; @@ -96,19 +132,9 @@ QApplication app(argc,argv); - // Initialize translations - QTranslator translator (0); - translator.load( "vym_de", "." ); - app.installTranslator( &translator ); - - // Initializing the row of system flags - // is done in first call to MapEditor(), - // because we need at least one canvas first - systemFlagsDefault=NULL; - standardFlagsDefault=NULL; - // Reading and initializing options commandline options options.add ("version", SwitchOption, "v","version"); + options.add ("local", SwitchOption, "l", "local"); options.add ("help", SwitchOption, "h", "help"); options.add ("quit", SwitchOption, "q", "quit"); options.add ("test", StringOption, "t", "test"); @@ -121,45 +147,82 @@ "http://www.InSilmaril.de/vym\n"); if (options.parse()) { - cout << endl << options.getHelpText()<setPixmap("vym-128x128", QPixmap(iconPath+"vym-128x128.png")); + q3InitNetworkProtocols(); + + + // Initialize translations + QTranslator translator (0); + translator.load( QString("vym_")+QTextCodec::locale(), vymBaseDir.path() + "/lang"); + app.installTranslator( &translator ); + + // Initializing the row of system flags + // is done in first call to MapEditor(), + // because we need at least one canvas first + systemFlagsDefault=NULL; + standardFlagsDefault=NULL; + // Initialize window of TextEditor textEditor = new TextEditor(); - textEditor->setIcon (QPixmap (vym_editor_xpm)); + textEditor->setIcon (QPixmap (iconPath+"vym-editor.png")); if (textEditor->showWithMain()) textEditor->show(); - clipboardME = new MapEditor(); - clipboardME->resize (800,600); - clipboardME->setCaption("VYM - clipboard"); - clipboardME->hide(); - - // Initialize mainwindow after Mapeditors (because of Flags) + // Initialize mainwindow Main m; //m.resize(m.sizeHint()); - m.setIcon (QPixmap (vym_logo_xpm)); + m.setIcon (QPixmap (iconPath+"vym-48x48.png")); m.show(); m.fileNew(); m.loadCmdLine();