Empty branches are always unscrolled after import, relinking to scrolled branch doesn't open branch, starting DBUS implementation
9 #include "branchpropwindow.h"
10 #include "extrainfodialog.h"
13 #include "findwindow.h"
14 #include "historywindow.h"
15 #include "mapeditor.h"
16 #include "simplescripteditor.h"
17 #include "texteditor.h"
20 class Main : public QMainWindow
25 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
27 ModModeNone, //!< Unused
28 ModModeColor, //!< Pick color from object
29 ModModeCopy, //!< Copy object
30 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
33 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
38 QProgressBar *progressBar;
42 void statusMessage (const QString &);
43 void setProgressMinimum (int min);
44 void setProgressMaximum (int max);
45 void setProgressValue (int v);
46 void removeProgressBar();
53 void closeEvent( QCloseEvent* );
56 void setupFileActions();
57 void setupEditActions();
58 void setupFormatActions();
59 void setupViewActions();
60 void setupModeActions();
61 void setupWindowActions();
62 void setupFlag(Flag *flag, QToolBar *tb, const QString &name, const QString &tooltip);
63 void setupFlagActions();
64 void setupNetworkActions();
65 void setupSettingsActions();
66 void setupTestActions();
67 void setupHelpActions();
68 void setupContextMenus();
69 void setupRecentMapsMenu();
71 void hideEvent (QHideEvent * );
72 void showEvent (QShowEvent * );
73 MapEditor* currentMapEditor() const;
74 VymModel* currentModel() const;
77 void editorChanged(QWidget*);
79 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
80 void fileLoad(const LoadMode &);
82 void fileLoadRecent();
83 void addRecentMap (const QString &);
84 void fileSave(VymModel*, const SaveMode & );
87 void fileSave(VymModel*); // autosave from MapEditor
89 void fileSaveAs(const SaveMode &);
91 void fileImportKDE3Bookmarks();
92 void fileImportKDE4Bookmarks();
93 void fileImportFirefoxBookmarks();
94 void fileImportFreemind();
98 void fileExportXHTML();
99 void fileExportImage();
100 void fileExportASCII();
101 void fileExportCSV();
102 void fileExportLaTeX();
103 void fileExportKDE3Bookmarks();
104 void fileExportKDE4Bookmarks();
105 void fileExportTaskjuggler();
106 void fileExportOOPresentation();
114 void gotoHistoryStep (int);
119 void editOpenFindWindow();
120 void editFind(QString);
121 void editFindChanged();
123 void openTabs(QStringList);
126 void editOpenURLTab();
128 void editOpenMultipleURLTabs();
131 void editHeading2URL();
132 void editBugzilla2URL();
134 void openVymLinks(const QStringList &);
136 void editOpenMultipleVymLinks();
138 void editHeadingFinished(VymModel *m);
139 // void editHeading();
140 void editOpenVymLink();
142 void editDeleteVymLink();
143 void editToggleHideExport();
147 void editSortChildren();
148 void editToggleScroll();
149 void editExpandAll();
150 void editUnscrollChildren();
151 void editAddMapCenter();
152 void editNewBranch();
153 void editNewBranchBefore();
154 void editNewBranchAbove();
155 void editNewBranchBelow();
156 void editImportAdd();
157 void editImportReplace();
158 void editSaveBranch();
159 void editDeleteKeepChildren();
160 void editDeleteChildren();
161 void editDeleteSelection();
162 void editLoadImage();
163 void editSaveImage();
164 void editFollowXLink (QAction *);
165 void editEditXLink (QAction *);
167 void formatSelectColor();
168 void formatPickColor();
169 void colorChanged(QColor);
170 void formatColorBranch();
171 void formatColorSubtree();
172 void formatLinkStyleLine();
173 void formatLinkStyleParabel();
174 void formatLinkStylePolyLine();
175 void formatLinkStylePolyParabel();
176 void formatSelectBackColor();
177 void formatSelectBackImage();
178 void formatSelectLinkColor();
179 void formatSelectSelectionColor();
180 void formatToggleLinkColorHint();
181 void formatHideLinkUnselected();
183 void viewZoomReset();
189 void networkStartServer();
190 void networkConnect();
193 void settingsMacroDir();
194 void settingsToggleDelKey();
195 void settingsUndoLevels();
196 void settingsAutosaveToggle();
197 void settingsAutosaveTime();
198 void settingsWriteBackupFileToggle();
199 void settingsToggleAnimation();
201 void windowToggleNoteEditor();
202 void windowToggleHistory();
203 void windowToggleProperty();
204 void updateHistory(SimpleSettings &);
205 void windowToggleAntiAlias();
208 bool hasSmoothPixmapTransform();
210 void windowToggleSmoothPixmap();
211 void updateNoteFlag();
212 void updateNoteEditor (QModelIndex index);
213 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
215 void updateActions();
216 ModMode getModMode();
217 bool autoEditNewBranch();
218 bool autoSelectNewBranch();
219 void setScript(const QString &);
220 void runScript(const QString &);
221 void runScriptEverywhere (const QString &);
224 void windowNextEditor();
225 void windowPreviousEditor();
226 void windowShowNoteEditor();
227 void windowHideNoteEditor();
229 void standardFlagChanged();
231 void testFunction1();
232 void testFunction2();
243 QTabWidget *tabWidget;
244 FindWindow *findWindow;
245 QProcess *procBrowser;
247 QStringList imageTypes;
249 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
250 QString prevSelection;
252 HistoryWindow *historyWindow;
254 BranchPropertyWindow *branchPropertyWindow;
255 SimpleScriptEditor *scriptEditor;
257 QList <QAction*> actionListBranches;
263 QMenu *recentFilesMenu;
264 enum { MaxRecentFiles = 9 };
265 QAction *recentFileActions[MaxRecentFiles];
267 QAction *macroActions[12];
270 QAction* actionFileNewCopy;
271 QAction* actionFileSave;
272 QAction* actionFilePrint;
277 QAction *actionPaste;
278 QAction *actionMoveUp;
279 QAction *actionMoveDown;
280 QAction *actionSortChildren;
281 QAction *actionToggleScroll;
282 QAction *actionExpandAll;
283 QAction* actionOpenURL;
284 QAction* actionOpenURLTab;
285 QAction* actionOpenMultipleURLTabs;
287 QAction* actionLocalURL;
288 QAction* actionHeading2URL;
289 QAction* actionBugzilla2URL;
290 QAction* actionFATE2URL;
291 QAction *actionOpenVymLink;
292 QAction *actionOpenMultipleVymLinks;
293 QAction *actionVymLink;
294 QAction *actionDeleteVymLink;
295 QAction *actionToggleHideExport;
296 QAction *actionMapInfo;
297 QAction *actionHeading;
298 QAction *actionDelete;
301 QAction *actionAddMapCenter;
304 QAction *actionAddBranch;
305 QAction *actionAddBranchBefore;
306 QAction *actionAddBranchAbove;
307 QAction *actionAddBranchBelow;
308 QAction *actionDeleteKeepChildren;
309 QAction *actionDeleteChildren;
310 QAction *actionImportAdd;
311 QAction *actionImportReplace;
312 QAction *actionSaveBranch;
313 QAction *actionLoadImage;
315 QAction* actionFormatColor;
316 QAction* actionFormatPickColor;
317 QAction* actionFormatColorBranch;
318 QAction* actionFormatColorSubtree;
319 QAction* actionFormatLinkColorHint;
320 QAction* actionFormatBackColor;
321 QAction* actionFormatBackImage;
322 QAction* actionFormatLinkColor;
323 QAction* actionFormatSelectionColor;
325 QActionGroup* actionGroupModModes;
326 QAction* actionModModeColor;
327 QAction* actionModModeXLink;
328 QAction* actionModModeCopy;
330 QActionGroup *actionGroupFormatFrameTypes;
333 QActionGroup *actionGroupFormatLinkStyles;
334 QAction *actionFormatLinkStyleLine;
335 QAction *actionFormatLinkStyleParabel;
336 QAction *actionFormatLinkStylePolyLine;
337 QAction *actionFormatLinkStylePolyParabel;
338 QAction *actionFormatHideLinkUnselected;
340 QAction *actionViewToggleNoteEditor;
341 QAction *actionViewToggleHistoryWindow;
342 QAction *actionViewTogglePropertyWindow;
343 QAction *actionViewToggleAntiAlias;
344 QAction *actionViewToggleSmoothPixmapTransform;
345 QAction* actionViewCenter;
347 QAction* actionSettingsAutoEditNewBranch;
348 QAction* actionSettingsAutoSelectNewBranch;
349 QAction* actionSettingsAutoSelectText;
350 QAction* actionSettingsUseDelKey;
351 QAction* actionSettingsUseFlagGroups;
352 QAction* actionSettingsUseHideExport;
353 QAction* actionSettingsAutosaveToggle;
354 QAction* actionSettingsAutosaveTime;
355 QAction* actionSettingsWriteBackupFile;
356 QAction* actionSettingsUseAnimation;