hide export for floatimages.
1 #include <qapplication.h>
3 #include <qtranslator.h>
6 #include <qtextcodec.h>
12 #include "mainwindow.h"
14 #include "icons/vym-48x48.xpm"
15 #include "icons/vym-128x128.xpm"
16 #include "icons/vym-editor.xpm"
18 #include "flagrowobj.h"
21 TextEditor *textEditor; // used in Constr. of LinkableMapObj
22 // initialized in mainwindow
24 Main *mainWindow; // used in BranchObj::select()
25 QString tmpVymDir; // All temp files go there, created in mainwindow
26 QString clipboardDir; // Clipboard used in all mapEditors
27 QDir vymBaseDir; // Containing all styles, scripts, images, ...
29 FlagRowObj *systemFlagsDefault; // used to copy from in LinkableMapObj
30 FlagRowObj *standardFlagsDefault;
33 // (QActionGroup could not be "enabled")
34 QPtrList <QAction> actionListBranches;
36 // Actions which change sometimes
37 QAction *actionFileSave;
38 QAction *actionFilePrint;
39 QAction *actionEditUndo;
40 QAction *actionEditRedo;
41 QAction *actionEditCopy;
42 QAction *actionEditCut;
43 QAction *actionEditPaste;
44 QAction *actionEditMoveUp;
45 QAction *actionEditMoveDown;
46 QAction *actionEditToggleScroll;
47 QAction *actionEditOpenURL;
48 QAction *actionEditURL;
49 QAction *actionEditHeading2URL;
50 QAction *actionEditBugzilla2URL;
51 QAction *actionEditFATE2URL;
52 QAction *actionEditOpenVymLink;
53 QAction *actionEditVymLink;
54 QAction *actionEditToggleHideExport;
55 QAction *actionEditDeleteVymLink;
56 QAction *actionEditMapInfo;
57 QAction *actionEditHeading;
58 QAction *actionEditDelete;
59 QAction *actionEditAddBranch;
60 QAction *actionEditAddBranchHere;
61 QAction *actionEditAddBranchAbove;
62 QAction *actionEditAddBranchBelow;
63 QAction *actionEditRemoveBranchHere;
64 QAction *actionEditRemoveChilds;
65 QAction *actionEditImportAdd;
66 QAction *actionEditImportReplace;
67 QAction *actionEditSaveBranch;
68 QAction *actionEditSelectFirst;
69 QAction *actionEditSelectLast;
70 QAction *actionEditLoadImage;
72 QAction *actionFormatColor;
73 QAction *actionFormatPickColor;
74 QAction *actionFormatColorBranch;
75 QAction *actionFormatColorSubtree;
76 QAction *actionFormatBackColor;
77 QAction *actionFormatLinkColorHint;
78 QAction *actionFormatLinkColor;
80 QActionGroup *actionGroupModModes;
81 QAction *actionModModeColor;
82 QAction *actionModModeLink;
83 QAction *actionModModeCopy;
85 QActionGroup *actionGroupFormatFrameTypes;
86 QAction *actionFormatFrameNone;
87 QAction *actionFormatFrameRectangle;
89 QActionGroup *actionGroupFormatLinkStyles;
90 QAction *actionFormatIncludeImagesVer;
91 QAction *actionFormatIncludeImagesHor;
92 QAction *actionFormatHideLinkUnselected;
93 QAction *actionFormatLinkStyleLine;
94 QAction *actionFormatLinkStyleParabel;
95 QAction *actionFormatLinkStylePolyLine;
96 QAction *actionFormatLinkStylePolyParabel;
98 QAction *actionViewToggleNoteEditor;
100 QAction *actionSettingsAutoselectHeading;
101 QAction *actionSettingsAutoselectText;
102 QAction *actionSettingsPasteNewHeading;
103 QAction *actionSettingsAutoedit;
104 QAction *actionSettingsUseDelKey;
105 QAction *actionSettingsUseFlagGroups;
107 QPopupMenu *branchContextMenu;
108 QPopupMenu *branchAddContextMenu;
109 QPopupMenu *branchRemoveContextMenu;
110 QPopupMenu *branchLinksContextMenu;
111 QPopupMenu *branchLinksContextMenuDup;
112 QPopupMenu *floatimageContextMenu;
113 QPopupMenu *saveImageFormatMenu;
114 QPopupMenu *canvasContextMenu;
115 QPopupMenu *lastMapsMenu;
116 QPopupMenu *importMenu;
117 QPopupMenu *exportMenu;
118 QPopupMenu *exportImageFormatMenu;
124 int statusbarTime=3500;
126 int main(int argc, char** argv)
128 QApplication app(argc,argv);
131 // Reading and initializing options commandline options
132 options.add ("version", SwitchOption, "v","version");
133 options.add ("local", SwitchOption, "l", "local");
134 options.add ("help", SwitchOption, "h", "help");
135 options.add ("quit", SwitchOption, "q", "quit");
136 options.add ("test", StringOption, "t", "test");
137 options.setHelpText (
138 "VYM - View Your Mind\n"
139 "--------------------\n\n"
140 "Information about vym can be found in vym.pdf,\n"
141 "which should be part of the vym package.\n"
142 "It is also available at the project homepage:\n\n"
143 "http://www.InSilmaril.de/vym\n");
146 cout << endl << options.getHelpText()<<endl;
150 if (options.isOn ("version"))
152 cout << "vym version "<<__VYM_VERSION
153 <<" (c) 2004 Uwe Drechsel - "
154 <<__BUILD_DATE<<endl;
159 // Use /usr/share/vym or /usr/local/share/vym or . ?
161 if (options.isOn ("local"))
163 vymBaseDir.setPath (vymBaseDir.currentDirPath());
166 vymBaseDir.setPath ("/usr/share/vym");
167 if (!vymBaseDir.exists())
168 vymBaseDir.setPath ("/usr/local/share/vym");
169 if (!vymBaseDir.exists())
170 vymBaseDir.setPath(vymBaseDir.currentDirPath() );
173 if (options.isOn ("help"))
175 cout << options.getHelpText()<<endl;
179 if (options.isOn ("test"))
181 // FIXME testing string option only
182 cout << "Testing: "<<options.getArg("test")<< endl;
186 QMimeSourceFactory *factory = QMimeSourceFactory::defaultFactory();
187 factory->setPixmap("vym_128x128", QPixmap(vym_128x128_xpm));
188 qInitNetworkProtocols();
191 // Initialize translations
192 QTranslator translator (0);
193 translator.load( QString("vym_")+QTextCodec::locale(), vymBaseDir.path() + "/lang");
194 app.installTranslator( &translator );
196 // Initializing the row of system flags
197 // is done in first call to MapEditor(),
198 // because we need at least one canvas first
199 systemFlagsDefault=NULL;
200 standardFlagsDefault=NULL;
202 // Initialize window of TextEditor
203 textEditor = new TextEditor();
204 textEditor->setIcon (QPixmap (vym_editor_xpm));
205 if (textEditor->showWithMain()) textEditor->show();
207 // Initialize mainwindow
209 //m.resize(m.sizeHint());
210 m.setIcon (QPixmap (vym_48x48_xpm));
215 // For benchmarking we may want to quit immediatly after drawing
216 if (options.isOn ("quit"))
221 QObject::connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );