pygui most dialogs are modal, default dialogs to modal
This commit is contained in:
parent
ea4271d7cb
commit
9d1f5cfcc6
31 changed files with 37 additions and 45 deletions
|
@ -36,7 +36,7 @@ THE POSSIBILITY OF SUCH DAMAGE.\
|
|||
|
||||
class AboutDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "About CORE", modal=True)
|
||||
super().__init__(master, app, "About CORE")
|
||||
self.draw()
|
||||
|
||||
def draw(self):
|
||||
|
|
|
@ -16,7 +16,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class AlertsDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Alerts", modal=True)
|
||||
super().__init__(master, app, "Alerts")
|
||||
self.app = app
|
||||
self.tree = None
|
||||
self.codetext = None
|
||||
|
@ -125,7 +125,7 @@ class AlertsDialog(Dialog):
|
|||
|
||||
class DaemonLog(Dialog):
|
||||
def __init__(self, master: tk.Widget, app: "Application"):
|
||||
super().__init__(master, app, "core-daemon log", modal=True)
|
||||
super().__init__(master, app, "core-daemon log")
|
||||
self.columnconfigure(0, weight=1)
|
||||
self.path = tk.StringVar(value="/var/log/core-daemon.log")
|
||||
self.draw()
|
||||
|
|
|
@ -19,7 +19,7 @@ class SizeAndScaleDialog(Dialog):
|
|||
"""
|
||||
create an instance for size and scale object
|
||||
"""
|
||||
super().__init__(master, app, "Canvas Size and Scale", modal=True)
|
||||
super().__init__(master, app, "Canvas Size and Scale")
|
||||
self.canvas = self.app.canvas
|
||||
self.validation = app.validation
|
||||
self.section_font = font.Font(weight="bold")
|
||||
|
|
|
@ -21,7 +21,7 @@ class CanvasWallpaperDialog(Dialog):
|
|||
"""
|
||||
create an instance of CanvasWallpaper object
|
||||
"""
|
||||
super().__init__(master, app, "Canvas Background", modal=True)
|
||||
super().__init__(master, app, "Canvas Background")
|
||||
self.canvas = self.app.canvas
|
||||
self.scale_option = tk.IntVar(value=self.canvas.scale_option.get())
|
||||
self.adjust_to_dim = tk.BooleanVar(value=self.canvas.adjust_to_dim.get())
|
||||
|
|
|
@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class ColorPickerDialog(Dialog):
|
||||
def __init__(self, master: Any, app: "Application", initcolor: str = "#000000"):
|
||||
super().__init__(master, app, "color picker", modal=True)
|
||||
super().__init__(master, app, "color picker")
|
||||
self.red_entry = None
|
||||
self.blue_entry = None
|
||||
self.green_entry = None
|
||||
|
|
|
@ -29,7 +29,7 @@ class ConfigServiceConfigDialog(Dialog):
|
|||
node_id: int,
|
||||
):
|
||||
title = f"{service_name} Config Service"
|
||||
super().__init__(master, app, title, modal=True)
|
||||
super().__init__(master, app, title)
|
||||
self.master = master
|
||||
self.app = app
|
||||
self.core = app.core
|
||||
|
|
|
@ -16,7 +16,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class CopyServiceConfigDialog(Dialog):
|
||||
def __init__(self, master: Any, app: "Application", node_id: int):
|
||||
super().__init__(master, app, f"Copy services to node {node_id}", modal=True)
|
||||
super().__init__(master, app, f"Copy services to node {node_id}")
|
||||
self.parent = master
|
||||
self.app = app
|
||||
self.node_id = node_id
|
||||
|
@ -177,7 +177,7 @@ class ViewConfigDialog(Dialog):
|
|||
data: str,
|
||||
filename: str = None,
|
||||
):
|
||||
super().__init__(master, app, f"n{node_id} config data", modal=True)
|
||||
super().__init__(master, app, f"n{node_id} config data")
|
||||
self.data = data
|
||||
self.service_data = None
|
||||
self.filepath = tk.StringVar(value=f"/tmp/services.tmp-n{node_id}-{filename}")
|
||||
|
|
|
@ -18,7 +18,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class ServicesSelectDialog(Dialog):
|
||||
def __init__(self, master: Any, app: "Application", current_services: Set[str]):
|
||||
super().__init__(master, app, "Node Services", modal=True)
|
||||
super().__init__(master, app, "Node Services")
|
||||
self.groups = None
|
||||
self.services = None
|
||||
self.current = None
|
||||
|
@ -101,7 +101,7 @@ class ServicesSelectDialog(Dialog):
|
|||
|
||||
class CustomNodesDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Custom Nodes", modal=True)
|
||||
super().__init__(master, app, "Custom Nodes")
|
||||
self.edit_button = None
|
||||
self.delete_button = None
|
||||
self.nodes_list = None
|
||||
|
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class Dialog(tk.Toplevel):
|
||||
def __init__(
|
||||
self, master: tk.Widget, app: "Application", title: str, modal: bool = False
|
||||
self, master: tk.Widget, app: "Application", title: str, modal: bool = True
|
||||
):
|
||||
super().__init__(master)
|
||||
self.withdraw()
|
||||
|
|
|
@ -21,7 +21,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class GlobalEmaneDialog(Dialog):
|
||||
def __init__(self, master: Any, app: "Application"):
|
||||
super().__init__(master, app, "EMANE Configuration", modal=True)
|
||||
super().__init__(master, app, "EMANE Configuration")
|
||||
self.config_frame = None
|
||||
self.draw()
|
||||
|
||||
|
@ -60,10 +60,7 @@ class EmaneModelDialog(Dialog):
|
|||
interface: int = None,
|
||||
):
|
||||
super().__init__(
|
||||
master,
|
||||
app,
|
||||
f"{canvas_node.core_node.name} {model} Configuration",
|
||||
modal=True,
|
||||
master, app, f"{canvas_node.core_node.name} {model} Configuration"
|
||||
)
|
||||
self.canvas_node = canvas_node
|
||||
self.node = canvas_node.core_node
|
||||
|
@ -117,7 +114,7 @@ class EmaneConfigDialog(Dialog):
|
|||
self, master: "Application", app: "Application", canvas_node: "CanvasNode"
|
||||
):
|
||||
super().__init__(
|
||||
master, app, f"{canvas_node.core_node.name} EMANE Configuration", modal=True
|
||||
master, app, f"{canvas_node.core_node.name} EMANE Configuration"
|
||||
)
|
||||
self.app = app
|
||||
self.canvas_node = canvas_node
|
||||
|
|
|
@ -9,7 +9,7 @@ from core.gui.themes import FRAME_PAD, PADX
|
|||
|
||||
class ExecutePythonDialog(Dialog):
|
||||
def __init__(self, master, app):
|
||||
super().__init__(master, app, "Execute Python Script", modal=True)
|
||||
super().__init__(master, app, "Execute Python Script")
|
||||
self.app = app
|
||||
self.with_options = tk.IntVar(value=0)
|
||||
self.options = tk.StringVar(value="")
|
||||
|
|
|
@ -8,7 +8,7 @@ from core.gui.themes import FRAME_PAD, PADX, PADY
|
|||
|
||||
class FindDialog(Dialog):
|
||||
def __init__(self, master, app) -> None:
|
||||
super().__init__(master, app, "Find", modal=True)
|
||||
super().__init__(master, app, "Find", modal=False)
|
||||
|
||||
self.find_text = tk.StringVar(value="")
|
||||
self.tree = None
|
||||
|
|
|
@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class HookDialog(Dialog):
|
||||
def __init__(self, master: Any, app: "Application"):
|
||||
super().__init__(master, app, "Hook", modal=True)
|
||||
super().__init__(master, app, "Hook")
|
||||
self.name = tk.StringVar()
|
||||
self.codetext = None
|
||||
self.hook = core_pb2.Hook()
|
||||
|
@ -89,7 +89,7 @@ class HookDialog(Dialog):
|
|||
|
||||
class HooksDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Hooks", modal=True)
|
||||
super().__init__(master, app, "Hooks")
|
||||
self.listbox = None
|
||||
self.edit_button = None
|
||||
self.delete_button = None
|
||||
|
|
|
@ -15,7 +15,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class IpConfigDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application") -> None:
|
||||
super().__init__(master, app, "IP Configuration", modal=True)
|
||||
super().__init__(master, app, "IP Configuration")
|
||||
ip_config = self.app.guiconfig.setdefault("ips")
|
||||
self.ip4 = ip_config.setdefault("ip4", appconfig.DEFAULT_IP4)
|
||||
self.ip6 = ip_config.setdefault("ip6", appconfig.DEFAULT_IP6)
|
||||
|
|
|
@ -33,7 +33,7 @@ def get_float(var: tk.StringVar) -> Union[float, None]:
|
|||
|
||||
class LinkConfigurationDialog(Dialog):
|
||||
def __init__(self, master: "CanvasGraph", app: "Application", edge: "CanvasEdge"):
|
||||
super().__init__(master, app, "Link Configuration", modal=True)
|
||||
super().__init__(master, app, "Link Configuration")
|
||||
self.app = app
|
||||
self.edge = edge
|
||||
self.is_symmetric = edge.link.options.unidirectional is False
|
||||
|
|
|
@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class MacConfigDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application") -> None:
|
||||
super().__init__(master, app, "MAC Configuration", modal=True)
|
||||
super().__init__(master, app, "MAC Configuration")
|
||||
mac = self.app.guiconfig.get("mac", appconfig.DEFAULT_MAC)
|
||||
self.mac_var = tk.StringVar(value=mac)
|
||||
self.draw()
|
||||
|
|
|
@ -21,10 +21,7 @@ class MobilityConfigDialog(Dialog):
|
|||
self, master: "Application", app: "Application", canvas_node: "CanvasNode"
|
||||
):
|
||||
super().__init__(
|
||||
master,
|
||||
app,
|
||||
f"{canvas_node.core_node.name} Mobility Configuration",
|
||||
modal=True,
|
||||
master, app, f"{canvas_node.core_node.name} Mobility Configuration"
|
||||
)
|
||||
self.canvas_node = canvas_node
|
||||
self.node = canvas_node.core_node
|
||||
|
|
|
@ -100,9 +100,7 @@ class NodeConfigDialog(Dialog):
|
|||
"""
|
||||
create an instance of node configuration
|
||||
"""
|
||||
super().__init__(
|
||||
master, app, f"{canvas_node.core_node.name} Configuration", modal=True
|
||||
)
|
||||
super().__init__(master, app, f"{canvas_node.core_node.name} Configuration")
|
||||
self.canvas_node = canvas_node
|
||||
self.node = canvas_node.core_node
|
||||
self.image = canvas_node.image
|
||||
|
|
|
@ -25,7 +25,7 @@ class NodeConfigServiceDialog(Dialog):
|
|||
services: Set[str] = None,
|
||||
):
|
||||
title = f"{canvas_node.core_node.name} Config Services"
|
||||
super().__init__(master, app, title, modal=True)
|
||||
super().__init__(master, app, title)
|
||||
self.app = app
|
||||
self.canvas_node = canvas_node
|
||||
self.node_id = canvas_node.core_node.id
|
||||
|
|
|
@ -18,7 +18,7 @@ if TYPE_CHECKING:
|
|||
class NodeServiceDialog(Dialog):
|
||||
def __init__(self, master: Any, app: "Application", canvas_node: "CanvasNode"):
|
||||
title = f"{canvas_node.core_node.name} Services"
|
||||
super().__init__(master, app, title, modal=True)
|
||||
super().__init__(master, app, title)
|
||||
self.app = app
|
||||
self.canvas_node = canvas_node
|
||||
self.node_id = canvas_node.core_node.id
|
||||
|
|
|
@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class ObserverDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Observer Widgets", modal=True)
|
||||
super().__init__(master, app, "Observer Widgets")
|
||||
self.observers = None
|
||||
self.save_button = None
|
||||
self.delete_button = None
|
||||
|
|
|
@ -17,7 +17,7 @@ SCALE_INTERVAL = 0.01
|
|||
|
||||
class PreferencesDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Preferences", modal=True)
|
||||
super().__init__(master, app, "Preferences")
|
||||
self.gui_scale = tk.DoubleVar(value=self.app.app_scale)
|
||||
preferences = self.app.guiconfig["preferences"]
|
||||
self.editor = tk.StringVar(value=preferences["editor"])
|
||||
|
|
|
@ -9,7 +9,7 @@ from core.gui.widgets import CodeText, ListboxScroll
|
|||
|
||||
class RunToolDialog(Dialog):
|
||||
def __init__(self, master, app) -> None:
|
||||
super().__init__(master, app, "Run Tool", modal=True)
|
||||
super().__init__(master, app, "Run Tool")
|
||||
self.cmd = tk.StringVar(value="ps ax")
|
||||
self.app = app
|
||||
self.result = None
|
||||
|
|
|
@ -17,7 +17,7 @@ DEFAULT_PORT = 50051
|
|||
|
||||
class ServersDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "CORE Servers", modal=True)
|
||||
super().__init__(master, app, "CORE Servers")
|
||||
self.name = tk.StringVar(value=DEFAULT_NAME)
|
||||
self.address = tk.StringVar(value=DEFAULT_ADDRESS)
|
||||
self.port = tk.IntVar(value=DEFAULT_PORT)
|
||||
|
|
|
@ -29,7 +29,7 @@ class ServiceConfigDialog(Dialog):
|
|||
node_id: int,
|
||||
):
|
||||
title = f"{service_name} Service"
|
||||
super().__init__(master, app, title, modal=True)
|
||||
super().__init__(master, app, title)
|
||||
self.master = master
|
||||
self.app = app
|
||||
self.core = app.core
|
||||
|
|
|
@ -15,7 +15,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class SessionOptionsDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Session Options", modal=True)
|
||||
super().__init__(master, app, "Session Options")
|
||||
self.config_frame = None
|
||||
self.has_error = False
|
||||
self.config = self.get_config()
|
||||
|
|
|
@ -20,7 +20,7 @@ class SessionsDialog(Dialog):
|
|||
def __init__(
|
||||
self, master: "Application", app: "Application", is_start_app: bool = False
|
||||
) -> None:
|
||||
super().__init__(master, app, "Sessions", modal=True)
|
||||
super().__init__(master, app, "Sessions")
|
||||
self.is_start_app = is_start_app
|
||||
self.selected_session = None
|
||||
self.selected_id = None
|
||||
|
|
|
@ -25,7 +25,7 @@ class ShapeDialog(Dialog):
|
|||
title = "Add Shape"
|
||||
else:
|
||||
title = "Add Text"
|
||||
super().__init__(master, app, title, modal=True)
|
||||
super().__init__(master, app, title)
|
||||
self.canvas = app.canvas
|
||||
self.fill = None
|
||||
self.border = None
|
||||
|
|
|
@ -15,7 +15,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class ThroughputDialog(Dialog):
|
||||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Throughput Config", modal=False)
|
||||
super().__init__(master, app, "Throughput Config")
|
||||
self.app = app
|
||||
self.canvas = app.canvas
|
||||
self.show_throughput = tk.IntVar(value=1)
|
||||
|
|
|
@ -21,7 +21,7 @@ class WlanConfigDialog(Dialog):
|
|||
self, master: "Application", app: "Application", canvas_node: "CanvasNode"
|
||||
):
|
||||
super().__init__(
|
||||
master, app, f"{canvas_node.core_node.name} Wlan Configuration", modal=True
|
||||
master, app, f"{canvas_node.core_node.name} Wlan Configuration"
|
||||
)
|
||||
self.canvas_node = canvas_node
|
||||
self.node = canvas_node.core_node
|
||||
|
|
|
@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class ErrorDialog(Dialog):
|
||||
def __init__(self, master, app: "Application", title: str, details: str) -> None:
|
||||
super().__init__(master, app, "CORE Exception", modal=True)
|
||||
super().__init__(master, app, "CORE Exception")
|
||||
self.title = title
|
||||
self.details = details
|
||||
self.error_message = None
|
||||
|
|
Loading…
Reference in a new issue