argument with minus instead of underscore; "Tabbed" -> "tabs" in enum; some new lines
This commit is contained in:
@ -26,7 +26,7 @@ def handle_clargs():
|
||||
|
||||
parser.add_argument("-e", "--examples", dest="add_examples", action="store_true", help="Add example data")
|
||||
|
||||
parser.add_argument("-w", "--window_mode", default="multi", type=str, help="Set the window mode to either 'single', 'multi' or 'tabs'.")
|
||||
parser.add_argument("-w", "--window-mode", default="multi", help='Set the window mode to either "single", "multi" or "tabs"')
|
||||
|
||||
return parser.parse_args().__dict__
|
||||
|
||||
|
@ -80,6 +80,7 @@ class MainWindow(QMainWindow):
|
||||
def ping(self):
|
||||
return "pong"
|
||||
|
||||
|
||||
# Signal callbacks
|
||||
|
||||
def on_make_new_plot(self, *args, **kwargs):
|
||||
|
@ -6,10 +6,12 @@ from .. import assets
|
||||
from ..theme import MDI_BKG
|
||||
from ..menus import BarMenu
|
||||
|
||||
|
||||
class MDIWindowMode(str, enum.Enum):
|
||||
SINGLE = "single"
|
||||
MULTI = "multi"
|
||||
TABS = "Tabbed"
|
||||
TABS = "tabs"
|
||||
|
||||
|
||||
class MDIArea(QMdiArea):
|
||||
|
||||
@ -34,6 +36,7 @@ class MDIArea(QMdiArea):
|
||||
menu.addAction("Close all", self.closeAllSubWindows)
|
||||
menu.addAction("Close inactive", self.closeInactiveSubWindows)
|
||||
|
||||
|
||||
def _window_mode_to_menu(self, mode:MDIWindowMode) -> str:
|
||||
if mode == MDIWindowMode.SINGLE:
|
||||
return "Single window"
|
||||
@ -46,6 +49,7 @@ class MDIArea(QMdiArea):
|
||||
checkbox = self._window_mode_to_menu(mode)
|
||||
self.menu.checkboxes[checkbox].setChecked(True)
|
||||
|
||||
|
||||
def on_cascade(self):
|
||||
self.menu.checkboxes["Multiple windows"].setChecked(True)
|
||||
self.enable_subwindow_view()
|
||||
|
Reference in New Issue
Block a user