forked from ctrl_packages/epics_launcher
+3
-3
@@ -269,7 +269,7 @@ class LauncherMenu(QtGui.QMenu):
|
||||
"""
|
||||
|
||||
self.action = LauncherMenuWidgetAction(widget, self)
|
||||
if self.actions()[index]:
|
||||
if (len(self.actions()) > index):
|
||||
self.insertAction(self.actions()[index], self.action)
|
||||
else:
|
||||
self.addAction(self.action)
|
||||
@@ -1230,7 +1230,7 @@ def main():
|
||||
|
||||
if default:
|
||||
cfg = defaultCfg
|
||||
logMsg += "Launcher will be loaded with default configuration."
|
||||
logMsg += "Launcher will be loaded with default mapping."
|
||||
logging.warning(logMsg)
|
||||
|
||||
# Create Launcher Window and load default style and theme
|
||||
@@ -1270,7 +1270,7 @@ def main():
|
||||
position[1] = screenGeometry.height()-geometry.height()+position[1]
|
||||
|
||||
# Update x/y coordinates of window
|
||||
launcherWindow.setGeometry(position[0], position[1], 0, 0)
|
||||
launcherWindow.move(position[0], position[1])
|
||||
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
@@ -181,6 +181,13 @@ class launcher_menu_model(object):
|
||||
logging.error(err_msg)
|
||||
sys.exit()
|
||||
|
||||
def __repr__(self):
|
||||
s = "{} (nelm: {})\n".format(self.main_title, len(self.menu_items))
|
||||
tabs = "\t" *self.level
|
||||
strings = map(repr,self.menu_items)
|
||||
strings = [tabs + str for str in strings]
|
||||
s += "\n".join(strings)
|
||||
return s
|
||||
|
||||
class launcher_menu_model_item(object):
|
||||
|
||||
@@ -211,6 +218,8 @@ class launcher_menu_model_item(object):
|
||||
else:
|
||||
self.trace = list()
|
||||
|
||||
def __repr__(self):
|
||||
return "{}: {}".format(self.__class__.__name__, self.text)
|
||||
|
||||
class launcher_main_title_item(launcher_menu_model_item):
|
||||
|
||||
@@ -272,6 +281,9 @@ class launcher_sub_menu_item(launcher_menu_model_item):
|
||||
self.sub_menu = launcher_menu_model(self, file_path,
|
||||
parent.level+1, launcher_cfg)
|
||||
|
||||
def __repr__(self):
|
||||
return repr(launcher_menu_model_item.__repr__(self))+" : "+repr(self.sub_menu)
|
||||
|
||||
|
||||
class launcher_file_choice_item(launcher_menu_model_item):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user