Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/controller/project_controller.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.QtWidgets import *
from PyQt5 import QtCore

from source.view.project.project_tool_bar import EditingFeatures
from source.view.project.project_window import ProjectWindow
from source.view.project.project_tool_bar import ProjectToolBar
from source.view.project.about_window import AboutWindow
Expand All @@ -27,6 +28,8 @@ def __init__(self):
self.visualize_graph_dock = VisualizeGraphDock()
self.tree_file_dock = TreeFileDock()

self.editing_features = EditingFeatures()

self.invariants_selected = {}
self.edited_graph = None

Expand Down Expand Up @@ -73,6 +76,8 @@ def connect_events(self):

self.visualize_graph_dock.any_signal.connect(self.update_graph_to_table)

self.project_tool_bar.features_info_button.triggered.connect(self.show_editing_features)

# self.project_window.print_action.triggered.connect(self.on_print)

def connect_tool_bar_events(self):
Expand Down Expand Up @@ -103,6 +108,9 @@ def on_print(self):
# pass
pass

def show_editing_features(self):
self.editing_features.show()

def on_visualize_tree(self):
self.tree_file_dock.setVisible(True)

Expand Down
57 changes: 57 additions & 0 deletions source/view/project/project_tool_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,60 @@ def fill_combo_graphs(self, graphs):
return None

return graphs[0]


class EditingFeatures(QDialog):

def __init__(self):
super().__init__()

self.setWindowFlag(QtCore.Qt.WindowContextHelpButtonHint, False)
self.setWindowTitle("Information")

self.tableWidget = QTableWidget()

self.set_content_attributes()
self.set_up_layout()

def set_content_attributes(self):
self.tableWidget.setRowCount(6)
self.tableWidget.setColumnCount(2)

self.tableWidget.verticalHeader().hide()

self.tableWidget.setHorizontalHeaderLabels(["Keymap", "Function"])

label_list = [" Insert or +", " Delete or -", " Control + Left-Click", " Left-Click", " Left-Click",
" Left-Click"]

for i, label_item in enumerate(label_list):
label = QLabel(label_item)
label.setStyleSheet("font-weight: bold")
self.tableWidget.setCellWidget(i, 0, label)

self.tableWidget.setCellWidget(0, 1, QLabel(" Insert a new node"))
self.tableWidget.setCellWidget(1, 1, QLabel(" Delete a node"))
self.tableWidget.setCellWidget(2, 1, QLabel(" Multiple nodes and or edges can "
"be selected by holding control while clicking"))
self.tableWidget.setCellWidget(3, 1, QLabel(" Double clicking on two nodes"
" successively will create an edge between them"))
self.tableWidget.setCellWidget(4, 1, QLabel(" Individual nodes and edges can"
" be selected using the left-click"))
self.tableWidget.setCellWidget(5, 1, QLabel(" Selected plot elements can be dragged"
" around by holding left-click on a selected artist"))

self.tableWidget.horizontalHeader().setDisabled(True)
self.tableWidget.horizontalHeader().setStyleSheet("color: black; background-color: gray")
self.tableWidget.setStyleSheet("background-color: #DCDCDC; color: black;")
self.tableWidget.horizontalHeader().setStretchLastSection(True)

self.tableWidget.setMaximumHeight((self.tableWidget.rowHeight(0) * 7) - 5)
self.tableWidget.setColumnWidth(0, 150)

def set_up_layout(self):
self.setMinimumSize(750, 250)

layout = QVBoxLayout()
layout.addWidget(self.tableWidget)

self.setLayout(layout)