Exemplo n.º 1
0
 def _enabled_item_menu(self):
     return [
         MenuActionTypes.OpenFile(),
         MenuActionTypes.Edit(),
         MenuActionTypes.Trace(), None,
         MenuActionTypes.Delete()
     ]
Exemplo n.º 2
0
 def _get_menu_items(self):
     return [
         MenuActionTypes.Edit(),
         MenuActionTypes.View(),
         MenuActionTypes.Delete(), None,
         MenuActionTypes.AddTestprogram()
     ]
Exemplo n.º 3
0
 def _enabled_item_menu(self):
     return [
         MenuActionTypes.Edit(),
         MenuActionTypes.View(),
         MenuActionTypes.Trace(), None,
         self._dependant_menu_type()
     ]
Exemplo n.º 4
0
 def _get_menu_items(self):
     return [
         MenuActionTypes.Edit(),
         MenuActionTypes.View(),
         MenuActionTypes.MoveUp(),
         MenuActionTypes.MoveDown(), None,
         MenuActionTypes.Delete()
     ]
Exemplo n.º 5
0
    def _enabled_item_menu(self):
        menu = [MenuActionTypes.OpenFile()]
        if self._is_default:
            menu.append(MenuActionTypes.UseCustomImplementation())
        else:
            menu.append(MenuActionTypes.UseDefaultImplementation())

        return menu
Exemplo n.º 6
0
    def _enabled_item_menu(self):
        menu = [MenuActionTypes.OpenFile(),
                MenuActionTypes.Edit(),
                MenuActionTypes.Trace()]

        delete_menu_option = [None,
                              MenuActionTypes.Delete()]

        if not self.dependency_list:
            menu += delete_menu_option

        return menu
Exemplo n.º 7
0
    def _generate_new_menu_actions(self, parent):
        new_menu = QtWidgets.QMenu('New', parent)
        import qtawesome as qta
        new_menu.setIcon(qta.icon('mdi.plus', color='orange'))

        new_file = QtWidgets.QAction(ACTIONS[MenuActionTypes.AddFile()][1], new_menu)
        new_file.setIcon(ACTIONS[MenuActionTypes.AddFile()][0])
        new_file.triggered.connect(self.add_file__item)

        new_folder = QtWidgets.QAction(ACTIONS[MenuActionTypes.AddFolder()][1], new_menu)
        new_folder.setIcon(ACTIONS[MenuActionTypes.AddFolder()][0])
        new_folder.triggered.connect(self.add_folder_item)

        new_menu.addAction(new_file)
        new_menu.addAction(new_folder)

        return new_menu
Exemplo n.º 8
0
    def _generate_import_menu_actions(self, parent):
        menu_action = QtWidgets.QMenu('Import', parent)
        import qtawesome as qta
        menu_action.setIcon(qta.icon('mdi.application-import', color='orange'))

        import_file = QtWidgets.QAction(ACTIONS[MenuActionTypes.AddFile()][1], parent)
        import_file.setIcon(ACTIONS[MenuActionTypes.ImportFile()][0])
        import_file.triggered.connect(self.import_file_item)

        import_folder = QtWidgets.QAction(ACTIONS[MenuActionTypes.AddFolder()][1], parent)
        import_folder.setIcon(ACTIONS[MenuActionTypes.ImportFolder()][0])
        import_folder.triggered.connect(self.import_folder_item)

        menu_action.addAction(import_file)
        menu_action.addAction(import_folder)

        return menu_action
Exemplo n.º 9
0
    def _get_menu_items(self):
        menu = [
            MenuActionTypes.Edit(),
            MenuActionTypes.View(),
            MenuActionTypes.CopyPath(), None,
            MenuActionTypes.Delete()
        ]

        if not self.is_single:
            menu.insert(2, MenuActionTypes.MoveDown())
            menu.insert(2, MenuActionTypes.MoveUp())

        return menu
Exemplo n.º 10
0
 def is_valid_functionality(functionality):
     return functionality not in (MenuActionTypes.Add(),
                                  MenuActionTypes.CloneFrom())
Exemplo n.º 11
0
 def _get_menu_items():
     return [MenuActionTypes.Add(), MenuActionTypes.CloneFrom()]
Exemplo n.º 12
0
 def _get_menu_items(self):
     return [MenuActionTypes.Add()]
Exemplo n.º 13
0
    def is_valid_functionality(self, functionality):
        if functionality in (MenuActionTypes.AddStandardTest(), MenuActionTypes.Import()):
            return False

        return True
Exemplo n.º 14
0
 def _get_menu_items():
     return [MenuActionTypes.Add(),
             MenuActionTypes.AddStandardTest(),
             MenuActionTypes.Import()]
Exemplo n.º 15
0
 def _disabled_item_menu(self):
     return [MenuActionTypes.Select()]
Exemplo n.º 16
0
 def _enabled_item_menu(self):
     menu = super()._enabled_item_menu()
     menu.insert(0, MenuActionTypes.Activate())
     return menu
Exemplo n.º 17
0
 def is_valid_functionality(functionality):
     return not functionality == MenuActionTypes.CloneFrom()
Exemplo n.º 18
0
 def _disabled_item_menu(self):
     return [MenuActionTypes.Enable()]
Exemplo n.º 19
0
import qtawesome as qta

from ATE.spyder.widgets.actions_on.model.Constants import MenuActionTypes

ACTIONS = {
    MenuActionTypes.Edit(): (qta.icon('mdi.lead-pencil',
                                      color='orange'), "Edit"),
    MenuActionTypes.Add(): (qta.icon('mdi.plus', color='orange'), "New"),
    MenuActionTypes.AddFile(): (qta.icon('mdi.file-plus',
                                         color='orange'), "File"),
    MenuActionTypes.AddFolder(): (qta.icon('mdi.folder-plus',
                                           color='orange'), "Folder"),
    MenuActionTypes.View(): (qta.icon('mdi.eye-outline',
                                      color='orange'), "View"),
    MenuActionTypes.Delete(): (qta.icon('mdi.minus',
                                        color='orange'), "Delete"),
    MenuActionTypes.Import(): (qta.icon('mdi.application-import',
                                        color='orange'), "Import"),
    MenuActionTypes.ImportFile(): (qta.icon('mdi.file-import',
                                            color='orange'), "File"),
    MenuActionTypes.ImportFolder(): (qta.icon('mdi.folder-download',
                                              color='orange'), "Folder"),
    MenuActionTypes.Activate(): (qta.icon('mdi.check',
                                          color='orange'), "Select Hardware"),
    MenuActionTypes.CloneTo(): (qta.icon('mdi.application-export',
                                         color='orange'), "Clone to ..."),
    MenuActionTypes.CloneFrom(): (qta.icon('mdi.application-import',
                                           color='orange'), "Clone from ..."),
    MenuActionTypes.Trace(): (qta.icon('mdi.share-variant',
                                       color='orange'), "Trace usage"),
    MenuActionTypes.AddStandardTest():
Exemplo n.º 20
0
import qtawesome as qta

from ATE.spyder.widgets.actions_on.model.Constants import MenuActionTypes


ACTIONS = {MenuActionTypes.Edit(): (qta.icon('mdi.lead-pencil', color='orange'), "Edit"),
           MenuActionTypes.Add(): (qta.icon('mdi.plus', color='orange'), "New"),
           MenuActionTypes.AddFile(): (qta.icon('mdi.file-plus', color='orange'), "File"),
           MenuActionTypes.AddFolder(): (qta.icon('mdi.folder-plus', color='orange'), "Folder"),
           MenuActionTypes.View(): (qta.icon('mdi.eye-outline', color='orange'), "View"),
           MenuActionTypes.Delete(): (qta.icon('mdi.minus', color='orange'), "Delete"),
           MenuActionTypes.Import(): (qta.icon('mdi.application-import', color='orange'), "Import"),
           MenuActionTypes.ImportFile(): (qta.icon('mdi.file-import', color='orange'), "File"),
           MenuActionTypes.ImportFolder(): (qta.icon('mdi.folder-download', color='orange'), "Folder"),
           MenuActionTypes.Activate(): (qta.icon('mdi.check', color='orange'), "Select Hardware"),
           MenuActionTypes.CloneTo(): (qta.icon('mdi.application-export', color='orange'), "Clone to ..."),
           MenuActionTypes.CloneFrom(): (qta.icon('mdi.application-import', color='orange'), "Clone from ..."),
           MenuActionTypes.Trace(): (qta.icon('mdi.share-variant', color='orange'), "Trace usage"),
           MenuActionTypes.AddStandardTest(): (qta.icon('mdi.plus-box-outline', color='orange'), "Add Standard Test"),
           MenuActionTypes.Rename(): (qta.icon('mdi.file-edit', color='orange'), "Rename"),
           MenuActionTypes.Move(): (qta.icon('mdi.file-move', color='orange'), "Move"),
           MenuActionTypes.DeleteFile(): (qta.icon('mdi.file-remove', color='orange'), "Remove"),
           MenuActionTypes.Obsolete(): (qta.icon('mdi.block-helper', color='orange'), "Obsolete"),
           MenuActionTypes.Enable(): (qta.icon('mdi.check', color='orange'), "Activate"),
           MenuActionTypes.MoveUp(): (qta.icon('mdi.arrow-up-bold-box', color='orange'), "Move Up"),
           MenuActionTypes.MoveDown(): (qta.icon('mdi.arrow-down-bold-box', color='orange'), "Move Down"),
           MenuActionTypes.OpenFile(): (qta.icon('mdi.book-open', color='orange'), "Open"),
           MenuActionTypes.AddTestprogram(): (qta.icon('mdi.plus', color='orange'), "New Testprogram"),
           MenuActionTypes.UseCustomImplementation(): (qta.icon('mdi.file-move', color='orange'), "Use Custom Implementation"),
           MenuActionTypes.UseDefaultImplementation(): (qta.icon('mdi.file-replace', color='orange'), "Use Default Implementation"),
           MenuActionTypes.Select(): (qta.icon('mdi.check', color='orange'), "Select Target")}
Exemplo n.º 21
0
 def _get_menu_items():
     return [MenuActionTypes.DeleteFile()]
Exemplo n.º 22
0
 def _get_menu_items():
     return [MenuActionTypes.ImportFile(),
             MenuActionTypes.CloneFrom()]
Exemplo n.º 23
0
 def _dependant_menu_type(self):
     if not len(self.dependency_list):
         return MenuActionTypes.Delete()
     else:
         return MenuActionTypes.Obsolete()
Exemplo n.º 24
0
 def _get_menu_items(self):
     return [MenuActionTypes.AddTestprogram()]
Exemplo n.º 25
0
 def _get_menu_items(self):
     return [MenuActionTypes.Rename(),
             MenuActionTypes.Move(),
             None,
             MenuActionTypes.DeleteFile()]
Exemplo n.º 26
0
 def _get_menu_items():
     return [MenuActionTypes.ImportFile()]