Files
LinkScope_Client/Core/Interface/ToolBarOne.py
AccentuSoft 7507990ca5 Push commits:
Move saved Resolutions parameters to global scope.

Move all Program settings to global scope.

Update & Refactor Settings Object.

Update Whats My Name - make detection more precise & add sites.

Update README.md

Update version number

Finalize importing tabs from TOR.

Change settings labels so they look better in menus. Add Tor browser path setting.

Fix bug with deselected entities when zooming out.

Transition to pyqtdarktheme for theme & styling.

Check if firefox snap exists if firefox package is not present.

Make sure that every file from the directories holding resolutions is present.

Refactor importing of tabs.
2023-02-07 18:04:19 +02:00

151 lines
6.9 KiB
Python

#!/usr/bin/env python3
from PySide6 import QtWidgets, QtGui
class ToolBarOne(QtWidgets.QToolBar):
def __init__(self, title, parent):
# Parent is (expected to be) mainWindow.
super().__init__(title, parent=parent)
self.setObjectName(title)
self.setToolButtonStyle(QtGui.Qt.ToolButtonStyle.ToolButtonTextUnderIcon)
newCanvas = QtGui.QAction("Add Canvas",
self,
statusTip="Create new Canvas or Open existing Canvas",
triggered=self.addCanvas,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('addCanvas')))
newCanvas.setShortcut('Ctrl+N')
self.addAction(newCanvas)
self.insertSeparator(newCanvas)
manualLink = QtGui.QAction('Create Manual &Link',
self,
statusTip="Link two entities together manually",
triggered=self.createManualLink,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('drawLink')))
self.addAction(manualLink)
self.insertSeparator(manualLink)
uploadSelected = QtGui.QAction('Upload Selected Files',
self,
statusTip="Upload the selected file entities to the server",
triggered=self.uploadSelectedFiles,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('uploading')))
self.addAction(uploadSelected)
self.insertSeparator(uploadSelected)
selectLeaves = QtGui.QAction('Select Leaf Nodes',
self,
statusTip="Select nodes with one or more incoming links and no outgoing links.",
triggered=self.selectLeafNodes,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('leafNodes')))
self.addAction(selectLeaves)
self.insertSeparator(selectLeaves)
selectRoots = QtGui.QAction('Select Root Nodes',
self,
statusTip="Select nodes with one or more outgoing links and no incoming links.",
triggered=self.selectRootNodes,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('rootNodes')))
self.addAction(selectRoots)
self.insertSeparator(selectRoots)
selectIsolated = QtGui.QAction('Select Isolated Nodes',
self,
statusTip="Select nodes with no incoming or outgoing links.",
triggered=self.selectIsolatedNodes,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('isolatedNodes')))
self.addAction(selectIsolated)
self.insertSeparator(selectIsolated)
selectNonIsolated = QtGui.QAction('Select Non Isolated Nodes',
self,
statusTip="Select nodes with at least one incoming or outgoing link.",
triggered=self.selectNonIsolatedNodes,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('nonIsolatedNodes')))
self.addAction(selectNonIsolated)
self.insertSeparator(selectNonIsolated)
shortestPath = QtGui.QAction('Find Shortest Path',
self,
statusTip="Find the shortest path (if any) between two selected entities.",
triggered=self.findShortestPath,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('shortestPath')))
self.addAction(shortestPath)
self.insertSeparator(shortestPath)
mergeEntities = QtGui.QAction('Merge Entities',
self,
statusTip="Merge the selected entities into one.",
triggered=self.mergeEntities,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('merge')))
self.addAction(mergeEntities)
self.insertSeparator(mergeEntities)
splitEntity = QtGui.QAction('Split Entity',
self,
statusTip="Split the selected entity into multiple different ones.",
triggered=self.splitEntity,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('split')))
self.addAction(splitEntity)
self.insertSeparator(splitEntity)
generateReportAction = QtGui.QAction('Generate Report',
self,
statusTip="Generate Report from the selected nodes.",
triggered=self.generateReport,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('generateReport')))
self.addAction(generateReportAction)
self.insertSeparator(generateReportAction)
rearrangeCanvas = QtGui.QAction('Rearrange Canvas',
self,
statusTip="Rearrange Canvas Nodes automatically.",
triggered=self.rearrangeGraph,
icon=QtGui.QIcon(self.parent().RESOURCEHANDLER.getIcon('rearrange')))
self.addAction(rearrangeCanvas)
self.insertSeparator(rearrangeCanvas)
self.linkItems = []
self.selectMode = False
def createManualLink(self):
self.parent().toggleLinkingMode()
def rearrangeGraph(self):
self.parent().centralWidget().tabbedPane.getCurrentScene().rearrangeGraph()
def addCanvas(self):
self.parent().addCanvas()
def selectLeafNodes(self):
self.parent().selectLeafNodes()
def selectRootNodes(self):
self.parent().selectRootNodes()
def selectIsolatedNodes(self):
self.parent().selectIsolatedNodes()
def selectNonIsolatedNodes(self):
self.parent().selectNonIsolatedNodes()
def findShortestPath(self):
self.parent().findShortestPath()
def uploadSelectedFiles(self):
self.parent().uploadFiles()
def downloadSelectedFiles(self):
self.parent().downloadFiles()
def mergeEntities(self):
self.parent().mergeEntities()
def splitEntity(self):
self.parent().splitEntity()
def generateReport(self):
self.parent().generateReport()