Empty branches are always unscrolled after import, relinking to scrolled branch doesn't open branch
6 #include "branchpropwindow.h"
8 #include "findwindow.h"
9 #include "historywindow.h"
10 #include "mapeditor.h"
11 #include "simplescripteditor.h"
12 #include "texteditor.h"
15 class Main : public QMainWindow
20 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
22 ModModeNone, //!< Unused
23 ModModeColor, //!< Pick color from object
24 ModModeCopy, //!< Copy object
25 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
28 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
31 void statusMessage (const QString &);
38 void closeEvent( QCloseEvent* );
41 void setupFileActions();
42 void setupEditActions();
43 void setupFormatActions();
44 void setupViewActions();
45 void setupModeActions();
46 void setupWindowActions();
47 void setupFlag(FlagObj *fo, QToolBar *tb, bool aw, const QString &name, const QString &tooltip);
48 void setupFlagActions();
49 void setupNetworkActions();
50 void setupSettingsActions();
51 void setupTestActions();
52 void setupHelpActions();
53 void setupContextMenus();
54 void setupRecentMapsMenu();
56 void hideEvent (QHideEvent * );
57 void showEvent (QShowEvent * );
58 MapEditor* currentMapEditor() const;
61 void editorChanged(QWidget*);
63 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
64 void fileLoad(const LoadMode &);
66 void fileLoadRecent();
67 void addRecentMap (const QString &);
68 void fileSave(MapEditor*, const SaveMode & );
71 void fileSave(MapEditor *); // autosave from MapEditor
73 void fileSaveAs(const SaveMode &);
75 void fileImportKDE3Bookmarks();
76 void fileImportKDE4Bookmarks();
77 void fileImportFirefoxBookmarks();
78 void fileImportFreemind();
82 void fileExportXHTML();
83 void fileExportImage();
84 void fileExportASCII();
86 void fileExportLaTeX();
87 void fileExportKDE3Bookmarks();
88 void fileExportKDE4Bookmarks();
89 void fileExportTaskjuggler();
90 void fileExportOOPresentation();
98 void gotoHistoryStep (int);
103 void editOpenFindWindow();
104 void editFind(QString);
105 void editFindChanged();
107 void openTabs(QStringList);
110 void editOpenURLTab();
112 void editOpenMultipleURLTabs();
115 void editHeading2URL();
116 void editBugzilla2URL();
118 void openVymLinks(const QStringList &);
120 void editOpenMultipleVymLinks();
121 void editHeadingFinished();
122 void editAttributeFinished();
125 void editAttribute();
126 void editOpenVymLink();
128 void editDeleteVymLink();
129 void editToggleHideExport();
133 void editSortChildren();
134 void editToggleScroll();
135 void editUnscrollChilds();
136 void editAddMapCenter();
137 void editNewBranch();
138 void editNewBranchBefore();
139 void editNewBranchAbove();
140 void editNewBranchBelow();
141 void editImportAdd();
142 void editImportReplace();
143 void editSaveBranch();
144 void editDeleteKeepChilds();
145 void editDeleteChilds();
146 void editDeleteSelection();
147 void editUpperBranch();
148 void editLowerBranch();
149 void editLeftBranch();
150 void editRightBranch();
151 void editFirstBranch();
152 void editLastBranch();
153 void editLoadImage();
154 void editSaveImage();
155 void editFollowXLink (QAction *);
156 void editEditXLink (QAction *);
158 void formatSelectColor();
159 void formatPickColor();
160 void colorChanged(QColor);
161 void formatColorBranch();
162 void formatColorSubtree();
163 void formatLinkStyleLine();
164 void formatLinkStyleParabel();
165 void formatLinkStylePolyLine();
166 void formatLinkStylePolyParabel();
167 void formatSelectBackColor();
168 void formatSelectBackImage();
169 void formatSelectLinkColor();
170 void formatSelectSelectionColor();
171 void formatToggleLinkColorHint();
172 void formatHideLinkUnselected();
174 void viewZoomReset();
180 void networkStartServer();
181 void networkConnect();
184 void settingsMacroDir();
185 void settingsToggleDelKey();
186 void settingsUndoLevels();
187 void settingsAutosaveToggle();
188 void settingsAutosaveTime();
189 void settingsWriteBackupFileToggle();
190 void settingsToggleAnimation();
192 void windowToggleNoteEditor();
193 void windowToggleHistory();
194 void windowToggleProperty();
195 void updateHistory(SimpleSettings &);
196 void windowToggleAntiAlias();
197 void windowToggleSmoothPixmap();
198 void updateNoteFlag();
199 void updateSatellites(MapEditor *);
200 void updateActions();
201 ModMode getModMode();
202 bool autoEditNewBranch();
203 bool autoSelectNewBranch();
204 bool useFlagGroups();
205 void setScript(const QString &);
206 void runScript(const QString &);
207 void runScriptEverywhere (const QString &);
210 void windowNextEditor();
211 void windowPreviousEditor();
212 void windowShowNoteEditor();
213 void windowHideNoteEditor();
215 void standardFlagChanged();
217 void testFunction1();
218 void testFunction2();
229 QTabWidget *tabWidget;
230 FindWindow *findWindow;
231 QProcess *procBrowser;
233 QStringList imageTypes;
235 QLineEdit *lineedit; // to enter headings of branches
236 QString prevSelection;
238 HistoryWindow *historyWindow;
240 BranchPropertyWindow *branchPropertyWindow;
241 SimpleScriptEditor *scriptEditor;
243 QList <QAction*> actionListBranches;
249 QMenu *recentFilesMenu;
250 enum { MaxRecentFiles = 9 };
251 QAction *recentFileActions[MaxRecentFiles];
253 QAction *macroActions[12];
256 QAction* actionFileNewCopy;
257 QAction* actionFileSave;
258 QAction* actionFilePrint;
259 QAction* actionEditUndo;
260 QAction* actionEditRedo;
261 QAction *actionEditCopy;
262 QAction *actionEditCut;
263 QAction *actionEditPaste;
264 QAction *actionEditMoveUp;
265 QAction *actionEditMoveDown;
266 QAction *actionEditSortChildren;
267 QAction *actionEditToggleScroll;
268 QAction* actionEditOpenURL;
269 QAction* actionEditOpenURLTab;
270 QAction* actionEditOpenMultipleURLTabs;
271 QAction* actionEditURL;
272 QAction* actionEditLocalURL;
273 QAction* actionEditHeading2URL;
274 QAction* actionEditBugzilla2URL;
275 QAction* actionEditFATE2URL;
276 QAction *actionEditOpenVymLink;
277 QAction *actionEditOpenMultipleVymLinks;
278 QAction *actionEditVymLink;
279 QAction *actionEditDeleteVymLink;
280 QAction *actionEditToggleHideExport;
281 QAction *actionEditMapInfo;
282 QAction *actionEditHeading;
283 QAction *actionEditDelete;
284 QAction *actionEditAddMapCenter;
285 QAction *actionEditAddBranch;
286 QAction *actionEditAddBranchBefore;
287 QAction *actionEditAddBranchAbove;
288 QAction *actionEditAddBranchBelow;
289 QAction *actionEditDeleteKeepChilds;
290 QAction *actionEditDeleteChilds;
291 QAction *actionEditImportAdd;
292 QAction *actionEditImportReplace;
293 QAction *actionEditSaveBranch;
294 QAction *actionEditSelectFirst;
295 QAction *actionEditSelectLast;
296 QAction *actionEditLoadImage;
298 QAction* actionFormatColor;
299 QAction* actionFormatPickColor;
300 QAction* actionFormatColorBranch;
301 QAction* actionFormatColorSubtree;
302 QAction* actionFormatLinkColorHint;
303 QAction* actionFormatBackColor;
304 QAction* actionFormatBackImage;
305 QAction* actionFormatLinkColor;
306 QAction* actionFormatSelectionColor;
308 QActionGroup* actionGroupModModes;
309 QAction* actionModModeColor;
310 QAction* actionModModeXLink;
311 QAction* actionModModeCopy;
313 QActionGroup *actionGroupFormatFrameTypes;
316 QActionGroup *actionGroupFormatLinkStyles;
317 QAction *actionFormatLinkStyleLine;
318 QAction *actionFormatLinkStyleParabel;
319 QAction *actionFormatLinkStylePolyLine;
320 QAction *actionFormatLinkStylePolyParabel;
321 QAction *actionFormatHideLinkUnselected;
323 QAction *actionViewToggleNoteEditor;
324 QAction *actionViewToggleHistoryWindow;
325 QAction *actionViewTogglePropertyWindow;
326 QAction *actionViewToggleAntiAlias;
327 QAction *actionViewToggleSmoothPixmapTransform;
328 QAction* actionViewCenter;
330 QAction* actionSettingsAutoEditNewBranch;
331 QAction* actionSettingsAutoSelectNewBranch;
332 QAction* actionSettingsAutoSelectText;
333 QAction* actionSettingsUseDelKey;
334 QAction* actionSettingsUseFlagGroups;
335 QAction* actionSettingsUseHideExport;
336 QAction* actionSettingsAutosaveToggle;
337 QAction* actionSettingsAutosaveTime;
338 QAction* actionSettingsWriteBackupFile;
339 QAction* actionSettingsUseAnimation;