GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
main_window.h
1 
8 #ifndef GUI_MAIN_WINDOW_H_
9 #define GUI_MAIN_WINDOW_H_
10 
11 // Qt-imports
12 #include <QMessageBox>
13 #include <QAction>
14 #include <QVBoxLayout>
15 #include <QHBoxLayout>
16 #include <QFileDialog>
17 #include <QWheelEvent>
18 #include <QLabel>
19 #include <QDebug>
20 #include <QDesktopServices>
21 #include <QUrl>
22 #include <QPrintDialog>
23 #include <QPrinter>
24 #include <QMainWindow>
25 #include <QWidget>
26 #include <QAction>
27 #include <QMenu>
28 #include <QTreeView>
29 #include <QSortFilterProxyModel>
30 #include <QPoint>
31 #include <QShortcut>
32 #include <QWhatsThis>
33 #include <QDockWidget>
34 #include <QSettings>
35 
36 // General imports
37 #include <cstdlib>
38 #include <ctime>
39 #include <string>
40 #include <algorithm> //min
41 #include <iterator>
42 #include <stdlib.h>
43 #include <sstream>
44 #include <string>
45 #include <vector>
46 
47 // Local includes
48 #include "main_controller.h"
49 #include "graph_model.h"
50 #include "graph_scene.h"
51 #include "node_widget.h"
52 #include "edge_widget.h"
53 #include "graph_view.h"
54 #include "graph_model_item.h"
55 #include "graph_view.h"
56 #include "search_box.h"
57 #include "filter_menu.h"
58 #include "grapher.h"
59 #include "main_controller.h"
60 #include "treeview.h"
61 #include "swu_graph_model.h"
62 
63 // The UI-component itself
64 #include "ui_mainwindow.h"
65 
66 
67 class GraphToolMainWindow : public QMainWindow, private Ui::MainWindow {
68  Q_OBJECT
69 
70  public:
75  GraphToolMainWindow(QWidget* parent = 0);
76 
80  virtual ~GraphToolMainWindow();
81 
82 
83  protected:
84  void closeEvent(QCloseEvent *event);
85 
86  private:
87  void write_settings();
88 
89  void read_settings();
90 
92  void read_tree_settings();
94  void read_dock_settings();
95 
99  void load_tree();
100 
107  double update_zoom(uint num_of_nodes);
108 
112  void clear_treeview_selections();
113 
115  SearchBox* search_area_;
116 
118  GraphView* graph_view_;
119 
121  QDockWidget* tree_dock_;
122 
124  TreeView* dep_tree_;
125 
127  QWidget* graph_area_;
128 
130  QDockWidget* pre_filter_dock_;
131 
133  QDockWidget* post_filter_dock_;
134 
136  FilterMenu* post_filter_menu_;
137 
139  FilterMenu* pre_filter_menu_;
140 
142  MainController main_controller_;
143 
145  std::vector<std::string> treeview_selections_;
146 
148  bool first_;
149 
150  public slots:
155 
160 
165 
170 
175 
180 
185 
191 
197 
202 
207 
212 
217 
222 
227 
232 
237 
242 
247 
252 
257 
262 
266  void on_menuFilter_triggered(QAction*);
267 
273  void create_right_click_menu(const QPoint &point, std::string item_name);
274 
280  void right_click_menu_action(QAction* action);
281 
287  void select_item_in_graph(std::string item_name, bool first, bool multiple);
288 
294  void select_item_in_treeview(std::string item_name, bool first);
295 
298 
301 
303  void excludeSelection();
304 
306  void tree_visibility_changed(bool visibility);
307 
309  void filter_visibility_changed(bool visibility);
310 
312  void conditional_formatting_visibility_changed(bool visibility);
313 
314  private slots:
318  void search_type_changed(std::string);
319 
326  void recreate_scene(std::string focus_item = "", bool reset_zoom = false);
327 
331  void update_statusbar();
332 
336  void itemsSelected();
337 
342  void listItemSelected(std::string item_name);
343 
348  void itemDoubleClicked(QGraphicsItem* item);
349 
354  void removeItem(QGraphicsItem* item);
355 
359  void error_emptyGraph();
360 
365  void error_unknownItem(std::string item_name);
366 
371  void error_duplicateFilterName(std::string item_name);
372 
373 
374 };
375 
376 #endif
void on_actionImportCondFormattings_triggered()
Definition: main_window.cc:704
void on_actionDependents_triggered()
Definition: main_window.cc:547
void on_actionDependencies_triggered()
Definition: main_window.cc:543
void on_actionImportFilters_triggered()
Definition: main_window.cc:649
void select_item_in_graph(std::string item_name, bool first, bool multiple)
Definition: main_window.cc:921
void on_actionExportGraph_triggered()
Definition: main_window.cc:968
void conditional_formatting_visibility_changed(bool visibility)
Slot for updating the menu bar when the movable docks change.
Definition: main_window.cc:1028
Definition: search_box.h:18
void on_actionOpenManual_triggered()
Definition: main_window.cc:759
Definition: filter_menu.h:43
void on_actionAntiAliasing_triggered()
Definition: main_window.cc:506
void on_actionFilter_triggered()
Definition: main_window.cc:524
void on_actionColorEdgesMemType_triggered()
Definition: main_window.cc:551
Definition: ui_mainwindow.h:369
void on_actionGraphView_triggered()
Definition: main_window.cc:464
void on_actionQuit_triggered()
Definition: main_window.cc:574
virtual ~GraphToolMainWindow()
Definition: main_window.cc:304
void select_item_in_treeview(std::string item_name, bool first)
Definition: main_window.cc:941
void on_actionOpen_XML_show_difference_triggered()
Definition: main_window.cc:617
void pre_filter_model_changed()
Slot for notification if the Main Controller changes the pre filter model.
Definition: main_window.cc:1011
void on_menuFilter_triggered(QAction *)
Definition: main_window.cc:1002
Definition: graph_view.h:30
void on_actionTreeView_triggered()
Definition: main_window.cc:472
Definition: treeview.h:26
void on_actionForce_triggered()
Definition: main_window.cc:488
void post_filter_model_changed()
Slot for notification if the Main Controller changes the post filter model.
Definition: main_window.cc:1007
void filter_visibility_changed(bool visibility)
Slot for updating the menu bar when the movable docks change.
Definition: main_window.cc:1024
GraphToolMainWindow(QWidget *parent=0)
Definition: main_window.cc:3
void create_right_click_menu(const QPoint &point, std::string item_name)
Definition: main_window.cc:764
void on_actionBubble_triggered()
Definition: main_window.cc:480
void on_actionOpenXML_triggered()
Definition: main_window.cc:582
void on_actionExportCondFormattings_triggered()
Definition: main_window.cc:737
void on_actionPrint_triggered()
Definition: main_window.cc:993
Definition: main_controller.h:54
void excludeSelection()
Excludes (hides) all currently selected nodes. This fuction is called on keyboard shortcut press...
Definition: main_window.cc:433
void on_actionHierarchy_triggered()
Definition: main_window.cc:497
void on_actionConditionalFormatting_triggered()
Definition: main_window.cc:532
void on_actionExportFilters_triggered()
Definition: main_window.cc:683
void on_actionSearch_triggered()
Definition: main_window.cc:514
Definition: main_window.h:67
void tree_visibility_changed(bool visibility)
Slot for updating the menu bar when the movable docks change.
Definition: main_window.cc:1033
void right_click_menu_action(QAction *action)
Definition: main_window.cc:866