Menu

[efa3d9]: / src / mainwindow.h  Maximize  Restore  History

Download this file

645 lines (571 with data), 18.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QItemSelection>
#include <QJSValue>
#include <QMainWindow>
#include <QProgressDialog>
#include <QTextStream>
#include "file.h"
#include "flag.h"
#include "settings.h"
class QPrinter;
class QJSEngine;
class HistoryWindow;
class MapEditor;
class TreeItem;
class VymText;
class VymModel;
class VymView;
class VymWrapper;
class Main : public QMainWindow {
Q_OBJECT
public:
/*! Modifier modes are used when SHIFT together with a mouse button is
* pressed */
enum ModMode {
ModModeUndefined, //!< Unused
ModModePoint, //!< Regular mode: Point and relink items
ModModeColor, //!< Pick color from object
ModModeXLink, //!< Create a XLink (XLinkObj) from selected object
ModModeMoveObject, //!< Move object without linking
ModModeMoveView //!< Move view without changing
};
Main(QWidget *parent = 0);
~Main();
void loadCmdLine();
private:
QProgressDialog progressDialog;
int progressMax;
int progressCounter;
int progressCounterTotal;
public:
void logInfo(const QString &comment, const QString &caller = "");
void statusMessage(const QString &, int timeout = 10000);
void setProgressMaximum(int max);
void addProgressValue(float v);
void initProgressCounter(uint n = 1);
void removeProgressCounter();
public slots:
void fileNew();
void fileNewCopy();
protected:
void closeEvent(QCloseEvent *);
public:
QPrinter *setupPrinter();
private:
void setupAPI();
/*! Helper method to clone actions later in MapEditor */
void cloneActionMapEditor(QAction *a, QKeySequence ks);
void setupFileActions();
void setupEditActions();
void setupSelectActions();
void setupFormatActions();
void setupViewActions();
void setupConnectActions();
void setupModeActions();
void setupWindowActions();
void setupFlagActions();
public slots:
void addUserFlag();
public:
Flag *setupFlag(const QString &path, Flag::FlagType type,
const QString &name, const QString &tooltip,
const QUuid &uid = QUuid(), const QKeySequence &ks = 0);
private:
void setupNetworkActions();
void setupSettingsActions();
void setupTestActions();
void setupHelpActions();
void setupContextMenus();
void setupRecentMapsMenu();
void setupMacros();
void setupToolbars();
VymView *currentView() const;
VymView *view(const int i);
public:
MapEditor *currentMapEditor() const;
VymModel *currentModel() const;
uint currentMapId() const;
int currentMapIndex() const;
VymModel *getModel(uint);
bool gotoModel(VymModel *m);
bool gotoModelWithId(uint id);
bool closeModelWithId(uint id);
int modelCount();
void updateTabName(VymModel *vm);
private slots:
void editorChanged();
public slots:
File::ErrorCode fileLoad(QString, const File::LoadMode &, const File::FileType &ftype);
void fileLoad(const File::LoadMode &);
private slots:
void fileLoad();
void fileSaveSession();
public slots:
void fileRestoreSession();
private slots:
void fileLoadRecent();
void fileClearRecent();
void addRecentMap(const QString &);
void fileSave(VymModel *, const File::SaveMode &);
void fileSave();
public slots:
void fileSave(VymModel *); // autosave from MapEditor
private slots:
void fileSaveAs();
void fileSaveAs(const File::SaveMode &);
void fileSaveAsDefault();
void fileImportFirefoxBookmarks();
void fileImportFreemind();
void fileImportIThoughts();
void fileImportMM();
void fileImportDir();
void fileExportAO();
void fileExportASCII();
void fileExportASCIITasks();
void fileExportCSV();
void fileExportConfluence();
void fileExportFirefoxBookmarks();
void fileExportHTML();
void fileExportImage();
void fileExportImpress();
void fileExportLaTeX();
void fileExportMarkdown();
void fileExportOrgMode();
void fileExportPDF();
void fileExportSVG();
void fileExportTaskJuggler();
void fileExportXML();
void fileExportLast();
bool fileCloseMap(int i = -1); // Optionally pass number of tab
void filePrint();
bool fileExitVYM();
public slots:
void editUndo();
void editRedo();
void gotoHistoryStep(int);
private slots:
void editCopy();
void editPaste();
void editCut();
public slots:
void updateQueries(VymModel *);
bool openURL(const QString &url);
void openTabs(QStringList);
void editOpenURL();
void editOpenURLTab();
private slots:
void editOpenMultipleVisURLTabs(bool ignoreScrolled = true);
void editOpenMultipleURLTabs();
void editNote2URLs();
void editURL();
void editLocalURL();
void editHeading2URL();
void setJiraQuery();
void getJiraDataSubtree();
void getConfluencePageDetails();
void getConfluencePageDetailsRecursively();
void getConfluenceUser();
void openVymLinks(const QStringList &, bool background = false);
void editVymLink();
void editOpenMultipleVymLinks();
public slots:
void editHeading();
void editHeadingFinished(VymModel *m);
void editOpenVymLink(bool background = false);
void editOpenVymLinkBackground();
private slots:
void editDeleteVymLink();
void editToggleHideExport();
void editToggleTask();
void editCycleTaskStatus();
void editTaskResetDeltaPrio();
void editTaskSleepN();
void editAddTimestamp();
void editMapProperties();
void editMoveUp();
void editMoveDown();
void editMoveUpDiagonally();
void editMoveDownDiagonally();
void editDetach();
void editSortChildren();
void editSortBackChildren();
void editToggleScroll();
void editExpandAll();
void editExpandOneLevel();
void editCollapseOneLevel();
void editCollapseUnselected();
void editUnscrollSubtree();
void editGrowSelectionSize();
void editShrinkSelectionSize();
void editResetSelectionSize();
void editAddMapCenter();
void editAddBranch();
void editAddBranchBefore();
void editAddBranchAbove();
void editAddBranchBelow();
void editImportAdd();
void editImportReplace();
void editSaveBranch();
void editDeleteKeepChildren();
void editDeleteChildren();
void editDeleteSelection();
void editLoadImage();
void editSaveImage();
void popupFollowXLink();
void editFollowXLink(QAction *);
void editEditXLink(QAction *);
private slots:
bool initLinkedMapsMenu(VymModel *model, QMenu *menu);
public slots:
void editGoToLinkedMap();
private slots:
void editToggleTarget();
bool initTargetsMenu(VymModel *model, QMenu *menu);
void editGoToTarget();
void editMoveToTarget();
void editSelectPrevious();
void editSelectNext();
void editSelectNothing();
void editOpenFindResultWidget();
void editFindNext(QString s, bool searchNotesFlag);
void editFindDuplicateURLs();
public slots:
void selectQuickColor(int n);
void setQuickColor(QColor col);
void quickColorPressed();
void formatPickColor();
QColor getCurrentColor();
int getCurrentColorIndex();
void setCurrentColor(QColor);
private slots:
void formatColorBranch();
void formatColorSubtree();
void formatLinkStyleLine();
void formatLinkStyleParabel();
void formatLinkStylePolyLine();
void formatLinkStylePolyParabel();
void formatBackground();
void formatSelectLinkColor();
void formatSelectSelectionColor();
void formatSelectFont();
void formatToggleLinkColorHint();
void formatHideLinkUnselected();
public slots:
void viewZoomReset();
void viewZoomIn();
void viewZoomOut();
void viewRotateCounterClockwise();
void viewRotateClockwise();
void viewCenter();
void viewCenterScaled();
void viewCenterRotated();
public slots:
void networkStartServer();
void networkConnect();
void downloadFinished();
void settingsPDF();
void settingsURL();
void settingsActionLog();
void settingsMacroPath();
void settingsUndoLevels();
void settingsDefaultMapPath();
public:
QString defaultMapPath(); // Default path, used with "auto" to define newMapPath
QString newMapPath(); // Depends on settings and dark theme
bool useAutosave();
void setAutosave(bool b);
public slots:
void settingsAutosaveTime();
void settingsDefaultMapAuthor();
void settingsDarkTheme();
void settingsShowParentsLevelTasks();
void settingsShowParentsLevelFindResults();
void settingsToggleAutoLayout();
void settingsToggleWriteBackupFile();
void settingsToggleAnimation();
void settingsToggleDownloads();
bool settingsConfluence();
bool settingsJIRA();
void windowToggleNoteEditor();
void windowToggleTreeEditor();
void windowToggleTaskEditor();
void windowToggleSlideEditor();
void windowToggleScriptEditor();
void windowToggleScriptOutput();
void windowToggleHistory();
void windowToggleProperty();
void windowShowHeadingEditor();
void windowToggleHeadingEditor();
void updateHistory(SimpleSettings &);
void windowToggleAntiAlias();
bool isAliased();
bool hasSmoothPixmapTransform();
void windowToggleSmoothPixmap();
void clearScriptOutput();
void updateHeading(const VymText &vt);
void updateNoteText(const VymText &vt);
void updateNoteEditor(TreeItem *ti);
void updateHeadingEditor(TreeItem *ti = nullptr);
void selectInNoteEditor(QString s, int i);
void setFocusMapEditor();
void changeSelection(VymModel *model, const QItemSelection &newSel,
const QItemSelection &delSel);
void updateDockWidgetTitles(VymModel *model);
void updateActions();
ModMode getModMode();
bool autoSelectNewBranch();
void scriptPrint(const QString &, const QString &color = "");
QVariant runScript(const QString &);
void abortScript(const QJSValue::ErrorType &err, const QString &msg);
void abortScript(const QString &msg);
QVariant setScriptResult(const QVariant &r);
private:
QJSEngine *scriptEngine;
QVariant scriptResult;
public slots:
QObject *getCurrentModelWrapper();
bool gotoWindow(const int &n);
private slots:
void windowNextEditor();
void windowPreviousEditor();
void nextSlide();
void previousSlide();
void flagChanged();
void testFunction1();
void testFunction2();
void toggleWinter();
void toggleHideExport();
void testCommand();
void helpDoc();
void helpDemo();
void helpShortcuts();
void helpMacros();
public:
QString scriptingCommands();
private slots:
void helpScriptingCommands();
void helpDebugInfo();
void helpAbout();
void helpAboutQT();
void callMacro();
void downloadReleaseNotesFinished();
private:
QUrl serverUrl(const QString &scriptName);
bool checkUpdatesAfterReleaseNotes;
public:
void checkReleaseNotesAndUpdates();
public slots:
void checkReleaseNotes();
bool downloadsEnabled(bool userTriggered = false);
void downloadUpdatesFinished(bool userTriggered = false);
void downloadUpdatesFinishedInt();
void downloadUpdates(bool userTriggered);
void checkUpdates();
void escapePressed();
void togglePresentationMode();
void toggleHideTmpMode();
private:
QString shortcutScope; //! For listing shortcuts
QTabWidget *tabWidget;
qint64 *browserPID;
QStringList imageTypes;
QUuid prevSelection;
HistoryWindow *historyWindow;
QDockWidget *headingEditorDW;
QDockWidget *noteEditorDW;
QDockWidget *scriptEditorDW;
QDockWidget *branchPropertyEditorDW;
public:
QList<QAction *>
mapEditorActions; //! allows mapEditor to clone actions and shortcuts
QList<QAction *>
taskEditorActions; //! allows taskEditor to clone actions and shortcuts
private:
QList<QAction *>
restrictedMapActions; //! Actions reqire map and write access
QList<QAction *>
unrestrictedMapActions; //! Actions require map, but work also in
//! readonly, e.g. print, copy
QList<QAction *> actionListFiles; //! File related actions, e.g. load, save,
//! restore session
QList<QAction *> actionListBranches;
QList<QAction *> actionListImages;
QList<QAction *> actionListItems;
int xLinkMenuWidth;
QMenu *recentFilesMenu;
enum { MaxRecentFiles = 20 };
QAction *recentFileActions[MaxRecentFiles];
QAction *actionRecentFilesClear;
QAction *macroActions[48];
QStringList macro;
QList <QColor> quickColors;
QMenu *toolbarsMenu;
QToolBar *fileToolbar;
QToolBar *clipboardToolbar;
QToolBar *editActionsToolbar;
QToolBar *selectionToolbar;
QToolBar *editorsToolbar;
QToolBar *colorsToolbar;
QToolBar *zoomToolbar;
QToolBar *modModesToolbar;
QToolBar *referencesToolbar;
QToolBar *standardFlagsToolbar;
QToolBar *userFlagsToolbar;
bool presentationMode;
QMap<QToolBar *, bool>
toolbarStates; // Save visibilty of toolbars during presentation mode
QAction *actionFileNew;
QAction *actionFileNewCopy;
QAction *actionFileOpen;
QAction *actionFileClose;
QAction *actionFileRestoreSession;
QAction *actionFileSave;
QAction *actionFilePrint;
QAction *actionFileExitVym;
QAction *actionClearRecent;
QAction *actionMapProperties;
QAction *actionFileExportLast;
QAction *actionFileExportConfluence;
QAction *actionUndo;
QAction *actionRedo;
QAction *actionCopy;
QAction *actionCut;
QAction *actionPaste;
QAction *actionMoveUp;
QAction *actionMoveDown;
QAction *actionMoveDownDiagonally;
QAction *actionMoveUpDiagonally;
QAction *actionDetach;
QAction *actionSortChildren;
QAction *actionSortBackChildren;
QAction *actionToggleScroll;
QAction *actionExpandAll;
QAction *actionExpandOneLevel;
QAction *actionCollapseOneLevel;
QAction *actionCollapseUnselected;
QAction *actionOpenURL;
QAction *actionOpenURLTab;
QAction *actionOpenMultipleVisURLTabs;
QAction *actionOpenMultipleURLTabs;
QAction *actionGetURLsFromNote;
QAction *actionURLNew;
QAction *actionLocalURL;
QAction *actionHeading2URL;
QAction *actionGetJiraDataSubtree;
QAction *actionGetConfluencePageDetails;
QAction *actionGetConfluencePageDetailsRecursively;
QAction *actionOpenVymLink;
QAction *actionOpenVymLinkBackground;
QAction *actionOpenMultipleVymLinks;
QAction *actionEditVymLink;
QAction *actionDeleteVymLink;
QAction *actionAddTimestamp;
QAction *actionToggleTask;
QAction *actionTogglePresentationMode;
QAction *actionToggleHideTmpMode;
QAction *actionCycleTaskStatus;
QAction *actionTaskResetDeltaPrio;
QAction *actionTaskSleep0;
QAction *actionTaskSleepN;
QAction *actionTaskSleep1;
QAction *actionTaskSleep2;
QAction *actionTaskSleep3;
QAction *actionTaskSleep4;
QAction *actionTaskSleep5;
QAction *actionTaskSleep7;
QAction *actionTaskSleep14;
QAction *actionTaskSleep28;
QAction *actionToggleHideExport;
QAction *actionMapInfo;
QAction *actionHeading;
QAction *actionDelete;
QAction *actionDeleteAlt;
public:
QAction *actionAddMapCenter;
private:
QAction *actionAddBranch;
QAction *actionAddBranchBefore;
QAction *actionAddBranchAbove;
QAction *actionAddBranchBelow;
QAction *actionDeleteKeepChildren;
QAction *actionDeleteChildren;
QAction *actionImportAdd;
QAction *actionImportReplace;
QAction *actionSaveBranch;
QAction *actionLoadImage;
QAction *actionGrowSelectionSize;
QAction *actionShrinkSelectionSize;
QAction *actionResetSelectionSize;
QAction *actionToggleTarget;
QAction *actionGoToTargetLinkedMap;
QAction *actionGoToTarget;
QAction *actionMoveToTarget;
QAction *actionSelectPrevious;
QAction *actionSelectNext;
QAction *actionSelectNothing;
QAction *actionFind;
QActionGroup *actionGroupQuickColors;
QAction *actionFormatQuickColor;
QAction *actionFormatPickColor;
QAction *actionFormatColorBranch;
QAction *actionFormatColorSubtree;
QAction *actionFormatLinkColorHint;
QAction *actionFormatBackground;
QAction *actionFormatLinkColor;
QAction *actionFormatSelectionColor;
QAction *actionFormatFont;
QAction *actionZoomIn;
QAction *actionZoomOut;
QAction *actionZoomReset;
QAction *actionRotateCounterClockwise;
QAction *actionRotateClockwise;
QAction *actionCenterOn;
QAction *actionCenterOnScaled;
QAction *actionCenterOnRotated;
QActionGroup *actionGroupModModes;
QAction *actionModModePoint;
QAction *actionModModeColor;
QAction *actionModModeCopy;
QAction *actionModModeXLink;
QAction *actionModModeMoveObject;
QAction *actionModModeMoveView;
QAction *actionToggleHideMode;
QAction *actionToggleWinter;
QActionGroup *actionGroupFormatFrameTypes;
QActionGroup *actionGroupFormatLinkStyles;
QAction *actionFormatLinkStyleLine;
QAction *actionFormatLinkStyleParabel;
QAction *actionFormatLinkStylePolyLine;
QAction *actionFormatLinkStylePolyParabel;
QAction *actionFormatHideLinkUnselected;
QAction *actionViewToggleNoteEditor;
QAction *actionViewToggleHeadingEditor;
QAction *actionViewToggleTreeEditor;
QAction *actionViewToggleTaskEditor;
QAction *actionViewToggleSlideEditor;
QAction *actionViewToggleScriptEditor;
QAction *actionViewToggleScriptOutput;
QAction *actionViewToggleHistoryWindow;
QAction *actionViewTogglePropertyEditor;
QAction *actionViewToggleAntiAlias;
QAction *actionViewToggleSmoothPixmapTransform;
QAction *actionViewCenter;
QAction *actionConnectGetConfluenceUser;
QAction *actionSettingsAutoSelectNewBranch;
QAction *actionSettingsAutoSelectText;
QAction *actionSettingsUseFlagGroups;
QAction *actionSettingsUseHideExport;
QAction *actionSettingsToggleAutosave;
QAction *actionSettingsAutosaveTime;
QAction *actionSettingsDarkTheme;
QAction *actionSettingsShowParentsLevelTasks;
QAction *actionSettingsShowParentsLevelFindResults;
QAction *actionSettingsToggleAutoLayout;
QAction *actionSettingsWriteBackupFile;
QAction *actionSettingsToggleDownloads;
QAction *actionSettingsUseAnimation;
QAction *actionSettingsJIRA;
QAction *actionSettingsConfluence;
};
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.