Ejemplo n.º 1
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)
        self.tasklist = tasklist

        self.exporter = export.Exporter(tasklist.list_)

        self.ID_JSON = wx.NewId()
        self.ID_TSV = wx.NewId()
        self.ID_XML = wx.NewId()

        self.json = wx.MenuItem(self, self.ID_JSON,
                            "&JSON...", "Export to JSON format")
        self.tsv = wx.MenuItem(self, self.ID_TSV,
                            "&TSV...", "Export to tab-separated values format")
        self.xml = wx.MenuItem(self, self.ID_XML,
                            "&XML...", "Export to XML format")

        self.json.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.tsv.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.xml.SetBitmap(wxgui_api.get_menu_icon('@file'))

        self.AppendItem(self.json)
        self.AppendItem(self.tsv)
        self.AppendItem(self.xml)

        wxgui_api.bind_to_menu(self._export_to_json, self.json)
        wxgui_api.bind_to_menu(self._export_to_tsv, self.tsv)
        wxgui_api.bind_to_menu(self._export_to_xml, self.xml)
Ejemplo n.º 2
0
    def __init__(self, plugin):
        self.plugin = plugin

        self.ID_ALARMS = wx.NewId()
        self.ID_SELECT = wx.NewId()
        self.ID_FIND = wx.NewId()

        submenu = wx.Menu()

        config = coreaux_api.get_plugin_configuration('wxalarmslog')(
                                                            'GlobalShortcuts')

        self.alarms = wx.MenuItem(wxgui_api.get_menu_logs(), self.ID_ALARMS,
                            '&Alarms', 'Alarms log commands', subMenu=submenu)
        self.select = wx.MenuItem(submenu, self.ID_SELECT,
                "&Select\t{}".format(config['select']),
                "Select the alarms history log")
        self.find = wx.MenuItem(submenu, self.ID_FIND,
                "Find in &database\t{}".format(config['find']),
                "Select the database items associated to the selected entries")

        self.alarms.SetBitmap(wxgui_api.get_menu_icon('@alarmslog'))
        self.select.SetBitmap(wxgui_api.get_menu_icon('@jump'))
        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))

        wxgui_api.add_menu_logs_item(self.alarms)
        submenu.AppendItem(self.select)
        submenu.AppendItem(self.find)

        wxgui_api.bind_to_menu(self._select, self.select)
        wxgui_api.bind_to_menu(self._find_in_tree, self.find)

        wxgui_api.bind_to_menu_view_logs_update(self._update_items)
        wxgui_api.bind_to_menu_view_logs_disable(self._disable_items)
        wxgui_api.bind_to_reset_menu_items(self._reset_items)
Ejemplo n.º 3
0
    def __init__(self, tasklist, mainmenu):
        wx.Menu.__init__(self)
        self.tasklist = tasklist
        self.occview = tasklist.list_
        self.mainmenu = mainmenu

        self.snooze_selected_submenu = SnoozeSelectedConfigMenu(tasklist,
                                                mainmenu, accelerator=False)

        self.find = wx.MenuItem(self, self.mainmenu.ID_FIND,
                                                        "&Find in database")
        self.edit = wx.MenuItem(self, self.mainmenu.ID_EDIT, "&Edit selected")
        self.snooze = wx.MenuItem(self, self.mainmenu.ID_SNOOZE,
                                        "&Snooze selected",
                                        subMenu=self.snooze_selected_submenu)
        self.dismiss = wx.MenuItem(self, self.mainmenu.ID_DISMISS,
                                                           "&Dismiss selected")

        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))
        self.snooze.SetBitmap(wxgui_api.get_menu_icon('@snooze'))
        self.dismiss.SetBitmap(wxgui_api.get_menu_icon('@dismiss'))

        self.AppendItem(self.find)
        self.AppendItem(self.edit)
        self.AppendSeparator()
        self.AppendItem(self.snooze)
        self.AppendItem(self.dismiss)
Ejemplo n.º 4
0
    def __init__(self, plugin):
        self.plugin = plugin

        self.ID_UNDO = wx.NewId()
        self.ID_REDO = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtexthistory')(
                                                            'GlobalShortcuts')

        self.mundo = wx.MenuItem(wxgui_api.get_menu_editor(), self.ID_UNDO,
                                            '&Undo\t{}'.format(config['undo']),
                                            'Undo the previous text edit')
        self.mredo = wx.MenuItem(wxgui_api.get_menu_editor(), self.ID_REDO,
                                            '&Redo\t{}'.format(config['redo']),
                                            'Redo the next text edit')
        separator = wx.MenuItem(wxgui_api.get_menu_editor(),
                                                        kind=wx.ITEM_SEPARATOR)

        self.mundo.SetBitmap(wxgui_api.get_menu_icon('@undo'))
        self.mredo.SetBitmap(wxgui_api.get_menu_icon('@redo'))

        # Add in reverse order
        wxgui_api.add_menu_editor_item(separator)
        wxgui_api.add_menu_editor_item(self.mredo)
        wxgui_api.add_menu_editor_item(self.mundo)

        wxgui_api.bind_to_menu(self.plugin.undo_text, self.mundo)
        wxgui_api.bind_to_menu(self.plugin.redo_text, self.mredo)

        wxgui_api.bind_to_reset_menu_items(self._reset)
        wxgui_api.bind_to_menu_edit_update(self._update)
Ejemplo n.º 5
0
    def __init__(self, filename, mainmenu):
        self.cpaste_label_1 = '&Paste items'
        self.cpaste_label_2 = '&Paste as siblings'

        self.cut = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                               mainmenu.ID_CUT, 'Cu&t items')
        self.copy = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                mainmenu.ID_COPY, '&Copy items')
        self.paste = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                 mainmenu.ID_PASTE, self.cpaste_label_1)
        self.pastesub = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                    mainmenu.ID_PASTE_SUB,
                                    'P&aste as children')

        self.cut.SetBitmap(wxgui_api.get_menu_icon('@cut'))
        self.copy.SetBitmap(wxgui_api.get_menu_icon('@copy'))
        self.paste.SetBitmap(wxgui_api.get_menu_icon('@paste'))
        self.pastesub.SetBitmap(wxgui_api.get_menu_icon('@paste'))

        separator = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                kind=wx.ITEM_SEPARATOR)

        # Add in reverse order
        wxgui_api.add_tree_context_menu_item(filename, separator)
        wxgui_api.add_tree_context_menu_item(filename, self.pastesub)
        wxgui_api.add_tree_context_menu_item(filename, self.paste)
        wxgui_api.add_tree_context_menu_item(filename, self.copy)
        wxgui_api.add_tree_context_menu_item(filename, self.cut)

        wxgui_api.bind_to_reset_tree_context_menu(
            self._handle_reset_tree_context_menu)
        wxgui_api.bind_to_popup_tree_context_menu(
            self._handle_popup_tree_context_menu)
Ejemplo n.º 6
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)
        self.tasklist = tasklist

        self.exporter = export.Exporter(tasklist.list_)

        self.ID_JSON = wx.NewId()
        self.ID_TSV = wx.NewId()
        self.ID_XML = wx.NewId()

        self.json = wx.MenuItem(self, self.ID_JSON, "&JSON...",
                                "Export to JSON format")
        self.tsv = wx.MenuItem(self, self.ID_TSV, "&TSV...",
                               "Export to tab-separated values format")
        self.xml = wx.MenuItem(self, self.ID_XML, "&XML...",
                               "Export to XML format")

        self.json.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.tsv.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.xml.SetBitmap(wxgui_api.get_menu_icon('@file'))

        self.AppendItem(self.json)
        self.AppendItem(self.tsv)
        self.AppendItem(self.xml)

        wxgui_api.bind_to_menu(self._export_to_json, self.json)
        wxgui_api.bind_to_menu(self._export_to_tsv, self.tsv)
        wxgui_api.bind_to_menu(self._export_to_xml, self.xml)
Ejemplo n.º 7
0
    def __init__(self, tasklist, mainmenu):
        wx.Menu.__init__(self)
        self.tasklist = tasklist
        self.occview = tasklist.list_
        self.mainmenu = mainmenu

        self.snooze_selected_submenu = SnoozeSelectedConfigMenu(
            tasklist, mainmenu, accelerator=False)

        self.find = wx.MenuItem(self, self.mainmenu.ID_FIND,
                                "&Find in database")
        self.edit = wx.MenuItem(self, self.mainmenu.ID_EDIT, "&Edit selected")
        self.snooze = wx.MenuItem(self,
                                  self.mainmenu.ID_SNOOZE,
                                  "&Snooze selected",
                                  subMenu=self.snooze_selected_submenu)
        self.dismiss = wx.MenuItem(self, self.mainmenu.ID_DISMISS,
                                   "&Dismiss selected")

        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))
        self.snooze.SetBitmap(wxgui_api.get_menu_icon('@snooze'))
        self.dismiss.SetBitmap(wxgui_api.get_menu_icon('@dismiss'))

        self.AppendItem(self.find)
        self.AppendItem(self.edit)
        self.AppendSeparator()
        self.AppendItem(self.snooze)
        self.AppendItem(self.dismiss)
Ejemplo n.º 8
0
    def __init__(self, plugin):
        self.plugin = plugin

        self.ID_UNDO = wx.NewId()
        self.ID_REDO = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtexthistory')(
            'GlobalShortcuts')

        self.mundo = wx.MenuItem(wxgui_api.get_menu_editor(), self.ID_UNDO,
                                 '&Undo\t{}'.format(config['undo']),
                                 'Undo the previous text edit')
        self.mredo = wx.MenuItem(wxgui_api.get_menu_editor(), self.ID_REDO,
                                 '&Redo\t{}'.format(config['redo']),
                                 'Redo the next text edit')
        separator = wx.MenuItem(wxgui_api.get_menu_editor(),
                                kind=wx.ITEM_SEPARATOR)

        self.mundo.SetBitmap(wxgui_api.get_menu_icon('@undo'))
        self.mredo.SetBitmap(wxgui_api.get_menu_icon('@redo'))

        # Add in reverse order
        wxgui_api.add_menu_editor_item(separator)
        wxgui_api.add_menu_editor_item(self.mredo)
        wxgui_api.add_menu_editor_item(self.mundo)

        wxgui_api.bind_to_menu(self.plugin.undo_text, self.mundo)
        wxgui_api.bind_to_menu(self.plugin.redo_text, self.mredo)

        wxgui_api.bind_to_reset_menu_items(self._reset)
        wxgui_api.bind_to_menu_edit_update(self._update)
Ejemplo n.º 9
0
    def __init__(self, filename, mainmenu):
        self.cpaste_label_1 = '&Paste items'
        self.cpaste_label_2 = '&Paste as siblings'

        self.cut = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                                mainmenu.ID_CUT, 'Cu&t items')
        self.copy = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                            mainmenu.ID_COPY, '&Copy items')
        self.paste = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                        mainmenu.ID_PASTE, self.cpaste_label_1)
        self.pastesub = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                mainmenu.ID_PASTE_SUB, 'P&aste as children')

        self.cut.SetBitmap(wxgui_api.get_menu_icon('@cut'))
        self.copy.SetBitmap(wxgui_api.get_menu_icon('@copy'))
        self.paste.SetBitmap(wxgui_api.get_menu_icon('@paste'))
        self.pastesub.SetBitmap(wxgui_api.get_menu_icon('@paste'))

        separator = wx.MenuItem(wxgui_api.get_tree_context_menu(filename),
                                                        kind=wx.ITEM_SEPARATOR)

        # Add in reverse order
        wxgui_api.add_tree_context_menu_item(filename, separator)
        wxgui_api.add_tree_context_menu_item(filename, self.pastesub)
        wxgui_api.add_tree_context_menu_item(filename, self.paste)
        wxgui_api.add_tree_context_menu_item(filename, self.copy)
        wxgui_api.add_tree_context_menu_item(filename, self.cut)

        wxgui_api.bind_to_reset_tree_context_menu(
                                        self._handle_reset_tree_context_menu)
        wxgui_api.bind_to_popup_tree_context_menu(
                                        self._handle_popup_tree_context_menu)
Ejemplo n.º 10
0
    def __init__(self):
        wx.Menu.__init__(self)

        find = wx.MenuItem(self, mainmenu.ID_FIND, "&Find in database")
        edit = wx.MenuItem(self, mainmenu.ID_EDIT, "&Edit selected")

        find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))

        self.AppendItem(find)
        self.AppendItem(edit)
Ejemplo n.º 11
0
    def __init__(self):
        wx.Menu.__init__(self)

        find = wx.MenuItem(self, mainmenu.ID_FIND, "&Find in database")
        edit = wx.MenuItem(self, mainmenu.ID_EDIT, "&Edit selected")

        find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))

        self.AppendItem(find)
        self.AppendItem(edit)
Ejemplo n.º 12
0
    def __init__(self, dbs):
        self.dbs = dbs

        self.ID_CUT = wx.NewId()
        self.ID_COPY = wx.NewId()
        self.ID_PASTE = wx.NewId()
        self.ID_PASTE_SUB = wx.NewId()

        config = coreaux_api.get_plugin_configuration("wxcopypaste")("GlobalShortcuts")

        self.mpaste_label_1 = "&Paste items\t{}".format(config["paste"])
        self.mpaste_help_1 = "Paste items as root items"
        self.mpaste_label_2 = "&Paste as siblings\t{}".format(config["paste"])
        self.mpaste_help_2 = "Paste items as siblings below the selected item"

        self.mcut = wx.MenuItem(
            wxgui_api.get_menu_database(), self.ID_CUT, "Cu&t items\t{}".format(config["cut"]), "Cut the selected items"
        )
        self.mcopy = wx.MenuItem(
            wxgui_api.get_menu_database(),
            self.ID_COPY,
            "&Copy items\t{}".format(config["copy"]),
            "Copy the selected items",
        )
        self.mpaste = wx.MenuItem(wxgui_api.get_menu_database(), self.ID_PASTE, self.mpaste_label_1, self.mpaste_help_1)
        self.mpastesub = wx.MenuItem(
            wxgui_api.get_menu_database(),
            self.ID_PASTE_SUB,
            "P&aste as children\t{}".format(config["paste_children"]),
            "Paste items as children of the selected item",
        )

        self.mcut.SetBitmap(wxgui_api.get_menu_icon("@cut"))
        self.mcopy.SetBitmap(wxgui_api.get_menu_icon("@copy"))
        self.mpaste.SetBitmap(wxgui_api.get_menu_icon("@paste"))
        self.mpastesub.SetBitmap(wxgui_api.get_menu_icon("@paste"))

        separator = wx.MenuItem(wxgui_api.get_menu_database(), kind=wx.ITEM_SEPARATOR)

        # Add in reverse order
        wxgui_api.add_menu_database_item(separator)
        wxgui_api.add_menu_database_item(self.mpastesub)
        wxgui_api.add_menu_database_item(self.mpaste)
        wxgui_api.add_menu_database_item(self.mcopy)
        wxgui_api.add_menu_database_item(self.mcut)

        wxgui_api.bind_to_menu(self.cut_items, self.mcut)
        wxgui_api.bind_to_menu(self.copy_items, self.mcopy)
        wxgui_api.bind_to_menu(self.paste_items_as_siblings, self.mpaste)
        wxgui_api.bind_to_menu(self.paste_items_as_children, self.mpastesub)

        wxgui_api.bind_to_reset_menu_items(self._handle_reset_menu_items)
        wxgui_api.bind_to_menu_database_update(self._handle_enable_tree_menus)
Ejemplo n.º 13
0
    def __init__(self):
        wx.Menu.__init__(self)

        refresh = wx.MenuItem(self, mainmenu.ID_REFRESH_SEARCH,
                              "&Start search", "Start the selected search")
        close_ = wx.MenuItem(self, wxgui_api.get_menu_view_close_tab_id(),
                             "Cl&ose", "Close the selected search")

        refresh.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        close_.SetBitmap(wxgui_api.get_menu_icon('@close'))

        self.AppendItem(refresh)
        self.AppendItem(close_)
Ejemplo n.º 14
0
    def __init__(self):
        wx.Menu.__init__(self)

        self.ID_NEW_SEARCH = wx.NewId()
        self.ID_REFRESH_SEARCH = wx.NewId()
        self.ID_FIND = wx.NewId()
        self.ID_EDIT = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxdbsearch')(
            'GlobalShortcuts')

        self.search = wx.MenuItem(
            self, self.ID_NEW_SEARCH,
            "&New search...\t{}".format(config['new_search']),
            "Open a new text search in the databases")
        self.refresh = wx.MenuItem(
            self, self.ID_REFRESH_SEARCH,
            "&Start search\t{}".format(config['start_search']),
            "Start the selected search")
        self.find = wx.MenuItem(
            self, self.ID_FIND,
            "&Find in database\t{}".format(config['find_item']),
            "Select the database items associated to the selected results")
        self.edit = wx.MenuItem(
            self, self.ID_EDIT,
            "&Edit selected\t{}".format(config['edit_item']),
            "Open in the editor the database items associated "
            "to the selected results")

        self.search.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.refresh.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))

        self.AppendItem(self.search)
        self.AppendItem(self.refresh)
        self.AppendSeparator()
        self.AppendItem(self.find)
        self.AppendItem(self.edit)

        wxgui_api.bind_to_menu(self.new_search, self.search)
        wxgui_api.bind_to_menu(self.refresh_search, self.refresh)
        wxgui_api.bind_to_menu(self.find_in_tree, self.find)
        wxgui_api.bind_to_menu(self.edit_items, self.edit)

        wxgui_api.bind_to_update_menu_items(self.update_items)
        wxgui_api.bind_to_reset_menu_items(self.reset_items)

        wxgui_api.insert_menu_main_item('&Search',
                                        wxgui_api.get_menu_view_position(),
                                        self)
Ejemplo n.º 15
0
    def __init__(self, dbs):
        self.dbs = dbs

        self.ID_CUT = wx.NewId()
        self.ID_COPY = wx.NewId()
        self.ID_PASTE = wx.NewId()
        self.ID_PASTE_SUB = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxcopypaste')(
                                                            'GlobalShortcuts')

        self.mpaste_label_1 = '&Paste items\t{}'.format(config['paste'])
        self.mpaste_help_1 = 'Paste items as root items'
        self.mpaste_label_2 = '&Paste as siblings\t{}'.format(config['paste'])
        self.mpaste_help_2 = 'Paste items as siblings below the selected item'

        self.mcut = wx.MenuItem(wxgui_api.get_menu_database(), self.ID_CUT,
                                        'Cu&t items\t{}'.format(config['cut']),
                                        'Cut the selected items')
        self.mcopy = wx.MenuItem(wxgui_api.get_menu_database(), self.ID_COPY,
                                    '&Copy items\t{}'.format(config['copy']),
                                    'Copy the selected items')
        self.mpaste = wx.MenuItem(wxgui_api.get_menu_database(), self.ID_PASTE,
                                    self.mpaste_label_1, self.mpaste_help_1)
        self.mpastesub = wx.MenuItem(wxgui_api.get_menu_database(),
                                                            self.ID_PASTE_SUB,
                    'P&aste as children\t{}'.format(config['paste_children']),
                    'Paste items as children of the selected item')

        self.mcut.SetBitmap(wxgui_api.get_menu_icon('@cut'))
        self.mcopy.SetBitmap(wxgui_api.get_menu_icon('@copy'))
        self.mpaste.SetBitmap(wxgui_api.get_menu_icon('@paste'))
        self.mpastesub.SetBitmap(wxgui_api.get_menu_icon('@paste'))

        separator = wx.MenuItem(wxgui_api.get_menu_database(),
                                                        kind=wx.ITEM_SEPARATOR)

        # Add in reverse order
        wxgui_api.add_menu_database_item(separator)
        wxgui_api.add_menu_database_item(self.mpastesub)
        wxgui_api.add_menu_database_item(self.mpaste)
        wxgui_api.add_menu_database_item(self.mcopy)
        wxgui_api.add_menu_database_item(self.mcut)

        wxgui_api.bind_to_menu(self.cut_items, self.mcut)
        wxgui_api.bind_to_menu(self.copy_items, self.mcopy)
        wxgui_api.bind_to_menu(self.paste_items_as_siblings, self.mpaste)
        wxgui_api.bind_to_menu(self.paste_items_as_children, self.mpastesub)

        wxgui_api.bind_to_reset_menu_items(self._handle_reset_menu_items)
        wxgui_api.bind_to_menu_database_update(self._handle_enable_tree_menus)
Ejemplo n.º 16
0
    def __init__(self, dbs):
        self.dbs = dbs

        self.ID_CUT = wx.NewId()
        self.ID_COPY = wx.NewId()
        self.ID_PASTE = wx.NewId()
        self.ID_PASTE_SUB = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxcopypaste')(
            'GlobalShortcuts')

        self.mpaste_label_1 = '&Paste items\t{}'.format(config['paste'])
        self.mpaste_help_1 = 'Paste items as root items'
        self.mpaste_label_2 = '&Paste as siblings\t{}'.format(config['paste'])
        self.mpaste_help_2 = 'Paste items as siblings below the selected item'

        self.mcut = wx.MenuItem(wxgui_api.get_menu_database(), self.ID_CUT,
                                'Cu&t items\t{}'.format(config['cut']),
                                'Cut the selected items')
        self.mcopy = wx.MenuItem(wxgui_api.get_menu_database(), self.ID_COPY,
                                 '&Copy items\t{}'.format(config['copy']),
                                 'Copy the selected items')
        self.mpaste = wx.MenuItem(wxgui_api.get_menu_database(), self.ID_PASTE,
                                  self.mpaste_label_1, self.mpaste_help_1)
        self.mpastesub = wx.MenuItem(
            wxgui_api.get_menu_database(), self.ID_PASTE_SUB,
            'P&aste as children\t{}'.format(config['paste_children']),
            'Paste items as children of the selected item')

        self.mcut.SetBitmap(wxgui_api.get_menu_icon('@cut'))
        self.mcopy.SetBitmap(wxgui_api.get_menu_icon('@copy'))
        self.mpaste.SetBitmap(wxgui_api.get_menu_icon('@paste'))
        self.mpastesub.SetBitmap(wxgui_api.get_menu_icon('@paste'))

        separator = wx.MenuItem(wxgui_api.get_menu_database(),
                                kind=wx.ITEM_SEPARATOR)

        # Add in reverse order
        wxgui_api.add_menu_database_item(separator)
        wxgui_api.add_menu_database_item(self.mpastesub)
        wxgui_api.add_menu_database_item(self.mpaste)
        wxgui_api.add_menu_database_item(self.mcopy)
        wxgui_api.add_menu_database_item(self.mcut)

        wxgui_api.bind_to_menu(self.cut_items, self.mcut)
        wxgui_api.bind_to_menu(self.copy_items, self.mcopy)
        wxgui_api.bind_to_menu(self.paste_items_as_siblings, self.mpaste)
        wxgui_api.bind_to_menu(self.paste_items_as_children, self.mpastesub)

        wxgui_api.bind_to_reset_menu_items(self._handle_reset_menu_items)
        wxgui_api.bind_to_menu_database_update(self._handle_enable_tree_menus)
Ejemplo n.º 17
0
    def __init__(self):
        wx.Menu.__init__(self)

        refresh = wx.MenuItem(self, mainmenu.ID_REFRESH_SEARCH,
                                                "&Start search",
                                                "Start the selected search")
        close_ = wx.MenuItem(self,
                                wxgui_api.get_menu_view_close_tab_id(),
                                "Cl&ose", "Close the selected search")

        refresh.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        close_.SetBitmap(wxgui_api.get_menu_icon('@close'))

        self.AppendItem(refresh)
        self.AppendItem(close_)
Ejemplo n.º 18
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)
        self.tasklist = tasklist

        self.ID_PREVIOUS = wx.NewId()
        self.ID_NEXT = wx.NewId()
        self.ID_APPLY = wx.NewId()
        self.ID_SET = wx.NewId()
        self.ID_RESET = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtasklist')(
            'GlobalShortcuts')('Navigator')

        self.previous = wx.MenuItem(
            self, self.ID_PREVIOUS,
            "&Previous page\t{}".format(config['previous']),
            "View the previous page of events")
        self.next = wx.MenuItem(self, self.ID_NEXT,
                                "&Next page\t{}".format(config['next']),
                                "View the next page of events")
        self.apply = wx.MenuItem(self, self.ID_APPLY,
                                 "&Apply filters\t{}".format(config['apply']),
                                 "Apply the configured filters")
        self.set = wx.MenuItem(self, self.ID_SET,
                               "Se&t filters\t{}".format(config['set']),
                               "Apply and save the configured filters")
        self.reset = wx.MenuItem(self, self.ID_RESET,
                                 "&Reset filters\t{}".format(config['reset']),
                                 "Reset the filters to the saved ones")

        self.previous.SetBitmap(wxgui_api.get_menu_icon('@left'))
        self.next.SetBitmap(wxgui_api.get_menu_icon('@right'))
        self.apply.SetBitmap(wxgui_api.get_menu_icon('@apply'))
        self.set.SetBitmap(wxgui_api.get_menu_icon('@save'))
        self.reset.SetBitmap(wxgui_api.get_menu_icon('@undo'))

        self.AppendSeparator()
        self.AppendItem(self.previous)
        self.AppendItem(self.next)
        self.AppendItem(self.apply)
        self.AppendItem(self.set)
        self.AppendItem(self.reset)

        wxgui_api.bind_to_menu(self._go_to_previous_page, self.previous)
        wxgui_api.bind_to_menu(self._go_to_next_page, self.next)
        wxgui_api.bind_to_menu(self._apply_filters, self.apply)
        wxgui_api.bind_to_menu(self._set_filters, self.set)
        wxgui_api.bind_to_menu(self._reset_filters, self.reset)
Ejemplo n.º 19
0
    def __init__(self):
        wx.TaskBarIcon.__init__(self)
        self.ID_MINIMIZE = wx.NewId()
        # Let self.restore have a different ID from menumin in the main menu,
        # in fact this is a check item, while the other is a normal item
        self.ID_RESTORE = wx.NewId()
        # Don't use wx.ID_EXIT because it assigns a Ctrl+q accelerator
        # automatically
        self.ID_EXIT = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtrayicon')(
                                                            'GlobalShortcuts')

        wxgui_api.install_bundled_icon("wxtrayicon", '@tray',
                                                    ("Tango", "tray16.png"))
        wxgui_api.install_bundled_icon("wxtrayicon", '@traywarning',
                                                        ("warning24.png", ))

        self.icon = BlinkingIcon(self)

        menumin = wx.MenuItem(wxgui_api.get_menu_file(), self.ID_MINIMIZE,
                            '&Minimize to tray\t{}'.format(config['minimize']),
                            'Minimize the main window to tray icon')

        menumin.SetBitmap(wxgui_api.get_menu_icon('@tray'))

        wxgui_api.add_menu_file_item(menumin)

        self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self._handle_left_click)
        self.Bind(wx.EVT_TASKBAR_RIGHT_DOWN, self._handle_right_click)
        wxgui_api.bind_to_close_window(self.hide_main_window)
        wxgui_api.bind_to_menu(self.hide_main_window, menumin)
        core_api.bind_to_exit_app_2(self.remove)
Ejemplo n.º 20
0
    def __init__(self):
        wx.TaskBarIcon.__init__(self)
        self.ID_MINIMIZE = wx.NewId()
        # Let self.restore have a different ID from menumin in the main menu,
        # in fact this is a check item, while the other is a normal item
        self.ID_RESTORE = wx.NewId()
        # Don't use wx.ID_EXIT because it assigns a Ctrl+q accelerator
        # automatically
        self.ID_EXIT = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtrayicon')(
            'GlobalShortcuts')

        wxgui_api.install_bundled_icon("wxtrayicon", '@tray',
                                       ("Tango", "tray16.png"))
        wxgui_api.install_bundled_icon("wxtrayicon", '@traywarning',
                                       ("warning24.png", ))

        self.icon = BlinkingIcon(self)

        menumin = wx.MenuItem(
            wxgui_api.get_menu_file(), self.ID_MINIMIZE,
            '&Minimize to tray\t{}'.format(config['minimize']),
            'Minimize the main window to tray icon')

        menumin.SetBitmap(wxgui_api.get_menu_icon('@tray'))

        wxgui_api.add_menu_file_item(menumin)

        self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self._handle_left_click)
        self.Bind(wx.EVT_TASKBAR_RIGHT_DOWN, self._handle_right_click)
        wxgui_api.bind_to_close_window(self.hide_main_window)
        wxgui_api.bind_to_menu(self.hide_main_window, menumin)
        core_api.bind_to_exit_app_2(self.remove)
Ejemplo n.º 21
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)
        self.tasklist = tasklist

        self.ID_PREVIOUS = wx.NewId()
        self.ID_NEXT = wx.NewId()
        self.ID_APPLY = wx.NewId()
        self.ID_SET = wx.NewId()
        self.ID_RESET = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtasklist')(
                                                'GlobalShortcuts')('Navigator')

        self.previous = wx.MenuItem(self, self.ID_PREVIOUS,
                            "&Previous page\t{}".format(config['previous']),
                            "View the previous page of events")
        self.next = wx.MenuItem(self, self.ID_NEXT,
                                    "&Next page\t{}".format(config['next']),
                                    "View the next page of events")
        self.apply = wx.MenuItem(self, self.ID_APPLY,
                                "&Apply filters\t{}".format(config['apply']),
                                "Apply the configured filters")
        self.set = wx.MenuItem(self, self.ID_SET,
                                    "Se&t filters\t{}".format(config['set']),
                                    "Apply and save the configured filters")
        self.reset = wx.MenuItem(self, self.ID_RESET,
                                "&Reset filters\t{}".format(config['reset']),
                                "Reset the filters to the saved ones")

        self.previous.SetBitmap(wxgui_api.get_menu_icon('@left'))
        self.next.SetBitmap(wxgui_api.get_menu_icon('@right'))
        self.apply.SetBitmap(wxgui_api.get_menu_icon('@apply'))
        self.set.SetBitmap(wxgui_api.get_menu_icon('@save'))
        self.reset.SetBitmap(wxgui_api.get_menu_icon('@undo'))

        self.AppendSeparator()
        self.AppendItem(self.previous)
        self.AppendItem(self.next)
        self.AppendItem(self.apply)
        self.AppendItem(self.set)
        self.AppendItem(self.reset)

        wxgui_api.bind_to_menu(self._go_to_previous_page, self.previous)
        wxgui_api.bind_to_menu(self._go_to_next_page, self.next)
        wxgui_api.bind_to_menu(self._apply_filters, self.apply)
        wxgui_api.bind_to_menu(self._set_filters, self.set)
        wxgui_api.bind_to_menu(self._reset_filters, self.reset)
Ejemplo n.º 22
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)

        self.json = wx.MenuItem(self, tasklist.mainmenu.export_submenu.ID_JSON,
                                                                    "&JSON...")
        self.tsv = wx.MenuItem(self, tasklist.mainmenu.export_submenu.ID_TSV,
                                                                    "&TSV...")
        self.xml = wx.MenuItem(self, tasklist.mainmenu.export_submenu.ID_XML,
                                                                    "&XML...")

        self.json.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.tsv.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.xml.SetBitmap(wxgui_api.get_menu_icon('@file'))

        self.AppendItem(self.json)
        self.AppendItem(self.tsv)
        self.AppendItem(self.xml)
Ejemplo n.º 23
0
    def __init__(self):
        wx.Menu.__init__(self)

        self.ID_NEW_SEARCH = wx.NewId()
        self.ID_REFRESH_SEARCH = wx.NewId()
        self.ID_FIND = wx.NewId()
        self.ID_EDIT = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxdbsearch')(
                                                            'GlobalShortcuts')

        self.search = wx.MenuItem(self, self.ID_NEW_SEARCH,
                            "&New search...\t{}".format(config['new_search']),
                            "Open a new text search in the databases")
        self.refresh = wx.MenuItem(self, self.ID_REFRESH_SEARCH,
                            "&Start search\t{}".format(config['start_search']),
                            "Start the selected search")
        self.find = wx.MenuItem(self, self.ID_FIND,
                "&Find in database\t{}".format(config['find_item']),
                "Select the database items associated to the selected results")
        self.edit = wx.MenuItem(self, self.ID_EDIT,
                            "&Edit selected\t{}".format(config['edit_item']),
                            "Open in the editor the database items associated "
                            "to the selected results")

        self.search.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.refresh.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))

        self.AppendItem(self.search)
        self.AppendItem(self.refresh)
        self.AppendSeparator()
        self.AppendItem(self.find)
        self.AppendItem(self.edit)

        wxgui_api.bind_to_menu(self.new_search, self.search)
        wxgui_api.bind_to_menu(self.refresh_search, self.refresh)
        wxgui_api.bind_to_menu(self.find_in_tree, self.find)
        wxgui_api.bind_to_menu(self.edit_items, self.edit)

        wxgui_api.bind_to_update_menu_items(self.update_items)
        wxgui_api.bind_to_reset_menu_items(self.reset_items)

        wxgui_api.insert_menu_main_item('&Search',
                                    wxgui_api.get_menu_view_position(), self)
Ejemplo n.º 24
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)

        self.json = wx.MenuItem(self, tasklist.mainmenu.export_submenu.ID_JSON,
                                "&JSON...")
        self.tsv = wx.MenuItem(self, tasklist.mainmenu.export_submenu.ID_TSV,
                               "&TSV...")
        self.xml = wx.MenuItem(self, tasklist.mainmenu.export_submenu.ID_XML,
                               "&XML...")

        self.json.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.tsv.SetBitmap(wxgui_api.get_menu_icon('@file'))
        self.xml.SetBitmap(wxgui_api.get_menu_icon('@file'))

        self.AppendItem(self.json)
        self.AppendItem(self.tsv)
        self.AppendItem(self.xml)
Ejemplo n.º 25
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)
        self.tasklist = tasklist

        self.navigator_submenu = TabContextNavigatorMenu(tasklist)
        self.alarms_submenu = TabContextAlarmsMenu(tasklist)
        self.snooze_all_submenu = SnoozeAllConfigMenu(tasklist,
                                                            tasklist.mainmenu)
        self.export_submenu = TabContextExportMenu(tasklist)

        self.show = wx.MenuItem(self, self.tasklist.viewmenu.ID_SHOW,
                                                                "Hide &panel")
        self.navigator = wx.MenuItem(self, self.tasklist.mainmenu.ID_NAVIGATOR,
                                'Na&vigator', subMenu=self.navigator_submenu)
        self.alarms = wx.MenuItem(self, self.tasklist.viewmenu.ID_ALARMS,
                                '&Active alarms', subMenu=self.alarms_submenu)
        self.gaps = wx.MenuItem(self, self.tasklist.viewmenu.ID_GAPS,
                                            "Show &gaps", kind=wx.ITEM_CHECK)
        self.overlaps = wx.MenuItem(self,
                    self.tasklist.viewmenu.ID_OVERLAPS, "Show &overlappings",
                    kind=wx.ITEM_CHECK)
        self.scroll = wx.MenuItem(self,
                    self.tasklist.mainmenu.ID_SCROLL, "Scro&ll to ongoing")
        self.autoscroll = wx.MenuItem(self,
                                        self.tasklist.viewmenu.ID_AUTOSCROLL,
                                        "Enable a&uto-scroll",
                                        kind=wx.ITEM_CHECK)
        self.snooze_all = wx.MenuItem(self,
                                self.tasklist.mainmenu.ID_SNOOZE_ALL,
                                "S&nooze all", subMenu=self.snooze_all_submenu)
        self.dismiss_all = wx.MenuItem(self,
                        self.tasklist.mainmenu.ID_DISMISS_ALL, "Dis&miss all")
        self.export = wx.MenuItem(self, self.tasklist.mainmenu.ID_EXPORT,
                                'E&xport view', subMenu=self.export_submenu)

        self.show.SetBitmap(wxgui_api.get_menu_icon('@close'))
        self.navigator.SetBitmap(wxgui_api.get_menu_icon('@navigator'))
        self.alarms.SetBitmap(wxgui_api.get_menu_icon('@activealarms'))
        self.scroll.SetBitmap(wxgui_api.get_menu_icon('@scroll'))
        self.snooze_all.SetBitmap(wxgui_api.get_menu_icon('@snooze'))
        self.dismiss_all.SetBitmap(wxgui_api.get_menu_icon('@dismiss'))
        self.export.SetBitmap(wxgui_api.get_menu_icon('@saveas'))

        self.AppendItem(self.show)
        self.AppendSeparator()
        self.AppendItem(self.navigator)
        self.AppendItem(self.alarms)
        self.AppendItem(self.gaps)
        self.AppendItem(self.overlaps)
        self.AppendSeparator()
        self.AppendItem(self.scroll)
        self.AppendItem(self.autoscroll)
        self.AppendSeparator()
        self.AppendItem(self.snooze_all)
        self.AppendItem(self.dismiss_all)
        self.AppendSeparator()
        self.AppendItem(self.export)
Ejemplo n.º 26
0
    def __init__(self, plugin):
        self.plugin = plugin

        self.ID_MAIN = wx.NewId()
        self.ID_FOCUS = wx.NewId()
        self.ID_TOGGLE = wx.NewId()

        wxgui_api.install_bundled_icon("wxscheduler", '@scheduler',
                                       ("Tango", "scheduler16.png"))

        submenu = wx.Menu()

        config = coreaux_api.get_plugin_configuration('wxscheduler')(
            'GlobalShortcuts')

        self.main = wx.MenuItem(wxgui_api.get_menu_view_editors(),
                                self.ID_MAIN,
                                '&Scheduler',
                                'Scheduler navigation actions',
                                subMenu=submenu)
        self.focus = wx.MenuItem(submenu, self.ID_FOCUS,
                                 "&Focus\t{}".format(config['focus']),
                                 "Focus scheduler panel")
        self.toggle = wx.MenuItem(submenu, self.ID_TOGGLE,
                                  "&Toggle\t{}".format(config['toggle']),
                                  "Toggle scheduler panel")

        self.main.SetBitmap(wxgui_api.get_menu_icon('@scheduler'))
        self.focus.SetBitmap(wxgui_api.get_menu_icon('@jump'))
        self.toggle.SetBitmap(wxgui_api.get_menu_icon('@toggle'))

        wxgui_api.add_menu_editor_plugin(self.main)
        submenu.AppendItem(self.focus)
        submenu.AppendItem(self.toggle)

        wxgui_api.bind_to_menu(self._focus, self.focus)
        wxgui_api.bind_to_menu(self._toggle, self.toggle)

        wxgui_api.bind_to_menu_view_editors_disable(self._disable_items)
        wxgui_api.bind_to_reset_menu_items(self._reset_items)
Ejemplo n.º 27
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)
        self.tasklist = tasklist

        self.navigator = wx.MenuItem(
            self,
            self.tasklist.viewmenu.ID_TOGGLE_NAVIGATOR,
            "&Show",
            "Show or hide the navigator bar",
            kind=wx.ITEM_CHECK)
        self.previous = wx.MenuItem(
            self, self.tasklist.mainmenu.navigator_submenu.ID_PREVIOUS,
            "&Previous page")
        self.next = wx.MenuItem(
            self, self.tasklist.mainmenu.navigator_submenu.ID_NEXT,
            "&Next page")
        self.apply = wx.MenuItem(
            self, self.tasklist.mainmenu.navigator_submenu.ID_APPLY,
            "&Apply filters")
        self.set = wx.MenuItem(self,
                               self.tasklist.mainmenu.navigator_submenu.ID_SET,
                               "Se&t filters")
        self.reset = wx.MenuItem(
            self, self.tasklist.mainmenu.navigator_submenu.ID_RESET,
            "&Reset filters")

        self.previous.SetBitmap(wxgui_api.get_menu_icon('@left'))
        self.next.SetBitmap(wxgui_api.get_menu_icon('@right'))
        self.apply.SetBitmap(wxgui_api.get_menu_icon('@apply'))
        self.set.SetBitmap(wxgui_api.get_menu_icon('@save'))
        self.reset.SetBitmap(wxgui_api.get_menu_icon('@undo'))

        self.AppendItem(self.navigator)
        self.AppendSeparator()
        self.AppendItem(self.previous)
        self.AppendItem(self.next)
        self.AppendItem(self.apply)
        self.AppendItem(self.set)
        self.AppendItem(self.reset)
Ejemplo n.º 28
0
    def __init__(self, plugin):
        self.plugin = plugin

        self.ID_MAIN = wx.NewId()
        self.ID_FOCUS = wx.NewId()
        self.ID_TOGGLE = wx.NewId()

        wxgui_api.install_bundled_icon("wxscheduler", '@scheduler',
                                                ("Tango", "scheduler16.png"))

        submenu = wx.Menu()

        config = coreaux_api.get_plugin_configuration('wxscheduler')(
                                                            'GlobalShortcuts')

        self.main = wx.MenuItem(wxgui_api.get_menu_view_editors(),
                                self.ID_MAIN,
                                '&Scheduler', 'Scheduler navigation actions',
                                subMenu=submenu)
        self.focus = wx.MenuItem(submenu, self.ID_FOCUS,
                                        "&Focus\t{}".format(config['focus']),
                                        "Focus scheduler panel")
        self.toggle = wx.MenuItem(submenu, self.ID_TOGGLE,
                                        "&Toggle\t{}".format(config['toggle']),
                                        "Toggle scheduler panel")

        self.main.SetBitmap(wxgui_api.get_menu_icon('@scheduler'))
        self.focus.SetBitmap(wxgui_api.get_menu_icon('@jump'))
        self.toggle.SetBitmap(wxgui_api.get_menu_icon('@toggle'))

        wxgui_api.add_menu_editor_plugin(self.main)
        submenu.AppendItem(self.focus)
        submenu.AppendItem(self.toggle)

        wxgui_api.bind_to_menu(self._focus, self.focus)
        wxgui_api.bind_to_menu(self._toggle, self.toggle)

        wxgui_api.bind_to_menu_view_editors_disable(self._disable_items)
        wxgui_api.bind_to_reset_menu_items(self._reset_items)
Ejemplo n.º 29
0
    def __init__(self, plugin):
        self.plugin = plugin

        self.ID_ALARMS = wx.NewId()
        self.ID_SELECT = wx.NewId()
        self.ID_FIND = wx.NewId()

        submenu = wx.Menu()

        config = coreaux_api.get_plugin_configuration('wxalarmslog')(
            'GlobalShortcuts')

        self.alarms = wx.MenuItem(wxgui_api.get_menu_logs(),
                                  self.ID_ALARMS,
                                  '&Alarms',
                                  'Alarms log commands',
                                  subMenu=submenu)
        self.select = wx.MenuItem(submenu, self.ID_SELECT,
                                  "&Select\t{}".format(config['select']),
                                  "Select the alarms history log")
        self.find = wx.MenuItem(
            submenu, self.ID_FIND,
            "Find in &database\t{}".format(config['find']),
            "Select the database items associated to the selected entries")

        self.alarms.SetBitmap(wxgui_api.get_menu_icon('@alarmslog'))
        self.select.SetBitmap(wxgui_api.get_menu_icon('@jump'))
        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))

        wxgui_api.add_menu_logs_item(self.alarms)
        submenu.AppendItem(self.select)
        submenu.AppendItem(self.find)

        wxgui_api.bind_to_menu(self._select, self.select)
        wxgui_api.bind_to_menu(self._find_in_tree, self.find)

        wxgui_api.bind_to_menu_view_logs_update(self._update_items)
        wxgui_api.bind_to_menu_view_logs_disable(self._disable_items)
        wxgui_api.bind_to_reset_menu_items(self._reset_items)
Ejemplo n.º 30
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)
        self.tasklist = tasklist

        self.navigator = wx.MenuItem(self,
                self.tasklist.viewmenu.ID_TOGGLE_NAVIGATOR,
                "&Show", "Show or hide the navigator bar", kind=wx.ITEM_CHECK)
        self.previous = wx.MenuItem(self,
                        self.tasklist.mainmenu.navigator_submenu.ID_PREVIOUS,
                        "&Previous page")
        self.next = wx.MenuItem(self,
                            self.tasklist.mainmenu.navigator_submenu.ID_NEXT,
                            "&Next page")
        self.apply = wx.MenuItem(self,
                            self.tasklist.mainmenu.navigator_submenu.ID_APPLY,
                            "&Apply filters")
        self.set = wx.MenuItem(self,
                            self.tasklist.mainmenu.navigator_submenu.ID_SET,
                            "Se&t filters")
        self.reset = wx.MenuItem(self,
                            self.tasklist.mainmenu.navigator_submenu.ID_RESET,
                            "&Reset filters")

        self.previous.SetBitmap(wxgui_api.get_menu_icon('@left'))
        self.next.SetBitmap(wxgui_api.get_menu_icon('@right'))
        self.apply.SetBitmap(wxgui_api.get_menu_icon('@apply'))
        self.set.SetBitmap(wxgui_api.get_menu_icon('@save'))
        self.reset.SetBitmap(wxgui_api.get_menu_icon('@undo'))

        self.AppendItem(self.navigator)
        self.AppendSeparator()
        self.AppendItem(self.previous)
        self.AppendItem(self.next)
        self.AppendItem(self.apply)
        self.AppendItem(self.set)
        self.AppendItem(self.reset)
Ejemplo n.º 31
0
    def __init__(self, parent, ID_RESTORE, ID_EXIT):
        wx.Menu.__init__(self)

        self.restore = wx.MenuItem(self, ID_RESTORE, "&Show Outspline",
                                                            kind=wx.ITEM_CHECK)
        self.exit_ = wx.MenuItem(self, ID_EXIT, "E&xit")

        self.exit_.SetBitmap(wxgui_api.get_menu_icon('@exit'))

        self.AppendItem(self.restore)
        self.AppendSeparator()
        self.AppendItem(self.exit_)

        parent.Bind(wx.EVT_MENU, self.toggle_main_window, self.restore)
        parent.Bind(wx.EVT_MENU, self.exit_application, self.exit_)
Ejemplo n.º 32
0
    def __init__(self, parent, ID_RESTORE, ID_EXIT):
        wx.Menu.__init__(self)

        self.restore = wx.MenuItem(self,
                                   ID_RESTORE,
                                   "&Show Outspline",
                                   kind=wx.ITEM_CHECK)
        self.exit_ = wx.MenuItem(self, ID_EXIT, "E&xit")

        self.exit_.SetBitmap(wxgui_api.get_menu_icon('@exit'))

        self.AppendItem(self.restore)
        self.AppendSeparator()
        self.AppendItem(self.exit_)

        parent.Bind(wx.EVT_MENU, self.toggle_main_window, self.restore)
        parent.Bind(wx.EVT_MENU, self.exit_application, self.exit_)
Ejemplo n.º 33
0
    def __init__(self, mainmenu, log):
        self.log = log

        self.find_paramaters = (mainmenu.ID_FIND, "&Find in database",
                                wxgui_api.get_menu_icon('@dbfind'))
Ejemplo n.º 34
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)

        self.tasklist = tasklist
        self.occview = tasklist.list_

        self.ID_NAVIGATOR = wx.NewId()
        self.ID_SCROLL = wx.NewId()
        self.ID_FIND = wx.NewId()
        self.ID_EDIT = wx.NewId()
        self.ID_SNOOZE = wx.NewId()
        self.ID_SNOOZE_ALL = wx.NewId()
        self.ID_SNOOZE_FOR_SEL = wx.NewId()
        self.ID_SNOOZE_FOR_ALL = wx.NewId()
        self.ID_DISMISS = wx.NewId()
        self.ID_DISMISS_ALL = wx.NewId()
        self.ID_EXPORT = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtasklist')

        # Using a set here to remove any duplicates would lose the order of the
        # times
        snooze_times = config['snooze_times'].split(' ')
        self.snoozetimesconf = []

        for stime in snooze_times:
            ID_SNOOZE_FOR_N_SEL = wx.NewId()
            ID_SNOOZE_FOR_N_ALL = wx.NewId()
            time = int(stime) * 60
            number, unit = TimeSpanCtrl.compute_widget_values(time)
            # Duplicate time values are not supported, just make sure they
            # don't crash the application
            self.snoozetimesconf.append(((ID_SNOOZE_FOR_N_SEL,
                                    ID_SNOOZE_FOR_N_ALL), time, number, unit))

        self.navigator_submenu = NavigatorMenu(tasklist)
        self.snooze_selected_submenu = SnoozeSelectedConfigMenu(tasklist, self)
        self.snooze_all_submenu = SnoozeAllConfigMenu(tasklist, self)
        self.export_submenu = ExportMenu(tasklist)

        shconf = config("GlobalShortcuts")

        self.navigator = wx.MenuItem(self, self.ID_NAVIGATOR, 'Na&vigator',
                        'Navigator actions', subMenu=self.navigator_submenu)
        self.scroll = wx.MenuItem(self, self.ID_SCROLL,
                "Scro&ll to ongoing\t{}".format(shconf['scroll_to_ongoing']),
                "Order the list by State and scroll "
                "to the first ongoing event")
        self.find = wx.MenuItem(self, self.ID_FIND,
            "&Find in database\t{}".format(shconf('Items')['find_selected']),
            "Select the database items associated to the selected events")
        self.edit = wx.MenuItem(self, self.ID_EDIT,
                "&Edit selected\t{}".format(shconf('Items')['edit_selected']),
                "Open in the editor the database items associated "
                "to the selected events")

        self.snooze = wx.MenuItem(self, self.ID_SNOOZE, "&Snooze selected",
                                        "Snooze the selected alarms",
                                        subMenu=self.snooze_selected_submenu)
        self.snooze_all = wx.MenuItem(self, self.ID_SNOOZE_ALL,
                                "S&nooze all", "Snooze all the active alarms",
                                subMenu=self.snooze_all_submenu)

        self.dismiss = wx.MenuItem(self, self.ID_DISMISS,
                                        "&Dismiss selected\t{}".format(
                                        shconf('Items')['dismiss_selected']),
                                        "Dismiss the selected alarms")
        self.dismiss_all = wx.MenuItem(self, self.ID_DISMISS_ALL,
                    "Dis&miss all\t{}".format(shconf('Items')['dismiss_all']),
                    "Dismiss all the active alarms")
        self.export = wx.MenuItem(self, self.ID_EXPORT, 'E&xport view',
                                        'Export the current view to a file',
                                        subMenu=self.export_submenu)

        self.navigator.SetBitmap(wxgui_api.get_menu_icon('@navigator'))
        self.scroll.SetBitmap(wxgui_api.get_menu_icon('@scroll'))
        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))
        self.snooze.SetBitmap(wxgui_api.get_menu_icon('@snooze'))
        self.snooze_all.SetBitmap(wxgui_api.get_menu_icon('@snooze'))
        self.dismiss.SetBitmap(wxgui_api.get_menu_icon('@dismiss'))
        self.dismiss_all.SetBitmap(wxgui_api.get_menu_icon('@dismiss'))
        self.export.SetBitmap(wxgui_api.get_menu_icon('@saveas'))

        self.AppendItem(self.navigator)
        self.AppendItem(self.scroll)
        self.AppendSeparator()
        self.AppendItem(self.find)
        self.AppendItem(self.edit)
        self.AppendSeparator()
        self.AppendItem(self.snooze)
        self.AppendItem(self.snooze_all)
        self.AppendItem(self.dismiss)
        self.AppendItem(self.dismiss_all)
        self.AppendSeparator()
        self.AppendItem(self.export)

        wxgui_api.bind_to_menu(self._scroll_to_ongoing, self.scroll)
        wxgui_api.bind_to_menu(self._find_in_tree, self.find)
        wxgui_api.bind_to_menu(self._edit_items, self.edit)
        wxgui_api.bind_to_menu(self._dismiss_selected_alarms, self.dismiss)
        wxgui_api.bind_to_menu(self._dismiss_all_alarms, self.dismiss_all)

        wxgui_api.bind_to_update_menu_items(self._update_items)
        wxgui_api.bind_to_reset_menu_items(self._reset_items)


        wxgui_api.insert_menu_main_item('S&chedule',
                                    wxgui_api.get_menu_view_position(), self)
Ejemplo n.º 35
0
    def __init__(self, tasklist):
        self.tasklist = tasklist
        self.occview = tasklist.list_

        self.ID_EVENTS = wx.NewId()
        self.ID_SHOW = wx.NewId()
        self.ID_FOCUS = wx.NewId()
        self.ID_ALARMS = wx.NewId()
        self.ID_TOGGLE_NAVIGATOR = wx.NewId()
        self.ID_GAPS = wx.NewId()
        self.ID_OVERLAPS = wx.NewId()
        self.ID_AUTOSCROLL = wx.NewId()

        submenu = wx.Menu()
        self.alarms_submenu = AlarmsMenu(tasklist)

        config = coreaux_api.get_plugin_configuration('wxtasklist')(
                                                    'GlobalShortcuts')('View')


        self.events = wx.MenuItem(wxgui_api.get_menu_view(), self.ID_EVENTS,
                        '&Schedule', 'Schedule navigation actions',
                        subMenu=submenu)
        self.show = wx.MenuItem(submenu, self.ID_SHOW,
                                "Show &panel\t{}".format(config['show']),
                                "Show the schedule panel", kind=wx.ITEM_CHECK)
        self.focus = wx.MenuItem(submenu, self.ID_FOCUS,
                        "&Focus\t{}".format(config['focus']),
                        "Set focus on the schedule tab")
        self.alarms = wx.MenuItem(submenu, self.ID_ALARMS, '&Active alarms',
                                        'Set the visibility of active alarms',
                                        subMenu=self.alarms_submenu)
        self.navigator = wx.MenuItem(submenu, self.ID_TOGGLE_NAVIGATOR,
                        "Show &navigator\t{}".format(config['show_navigator']),
                        "Show or hide the navigator bar", kind=wx.ITEM_CHECK)
        self.gaps = wx.MenuItem(submenu, self.ID_GAPS,
                            "Show &gaps\t{}".format(config['toggle_gaps']),
                            "Show any unallocated time in the shown interval",
                            kind=wx.ITEM_CHECK)
        self.overlaps = wx.MenuItem(submenu, self.ID_OVERLAPS,
                "Show &overlappings\t{}".format(config['toggle_overlappings']),
                "Show time intervals used by more than one event",
                kind=wx.ITEM_CHECK)
        self.autoscroll = wx.MenuItem(submenu, self.ID_AUTOSCROLL,
                                            "Enable a&uto-scroll",
                                            "Auto-scroll to the first ongoing "
                                            "event when refreshing",
                                            kind=wx.ITEM_CHECK)

        self.events.SetBitmap(wxgui_api.get_menu_icon('@tasklist'))
        self.focus.SetBitmap(wxgui_api.get_menu_icon('@jump'))
        self.alarms.SetBitmap(wxgui_api.get_menu_icon('@activealarms'))

        wxgui_api.insert_menu_right_tab_group(self.events)
        submenu.AppendItem(self.show)
        submenu.AppendItem(self.focus)
        submenu.AppendSeparator()
        submenu.AppendItem(self.alarms)
        submenu.AppendItem(self.navigator)
        submenu.AppendItem(self.gaps)
        submenu.AppendItem(self.overlaps)
        submenu.AppendItem(self.autoscroll)

        wxgui_api.bind_to_menu(self.tasklist.toggle_shown, self.show)
        wxgui_api.bind_to_menu(self._focus, self.focus)
        wxgui_api.bind_to_menu(self._toggle_navigator, self.navigator)
        wxgui_api.bind_to_menu(self._show_gaps, self.gaps)
        wxgui_api.bind_to_menu(self._show_overlappings, self.overlaps)
        wxgui_api.bind_to_menu(self._enable_autoscroll, self.autoscroll)

        wxgui_api.bind_to_reset_menu_items(self._reset_items)
        wxgui_api.bind_to_menu_view_update(self._update_items)
Ejemplo n.º 36
0
    def __init__(self, tasklist):
        wx.Menu.__init__(self)

        self.tasklist = tasklist
        self.occview = tasklist.list_

        self.ID_NAVIGATOR = wx.NewId()
        self.ID_SCROLL = wx.NewId()
        self.ID_FIND = wx.NewId()
        self.ID_EDIT = wx.NewId()
        self.ID_SNOOZE = wx.NewId()
        self.ID_SNOOZE_ALL = wx.NewId()
        self.ID_SNOOZE_FOR_SEL = wx.NewId()
        self.ID_SNOOZE_FOR_ALL = wx.NewId()
        self.ID_DISMISS = wx.NewId()
        self.ID_DISMISS_ALL = wx.NewId()
        self.ID_EXPORT = wx.NewId()

        config = coreaux_api.get_plugin_configuration('wxtasklist')

        # Using a set here to remove any duplicates would lose the order of the
        # times
        snooze_times = config['snooze_times'].split(' ')
        self.snoozetimesconf = []

        for stime in snooze_times:
            ID_SNOOZE_FOR_N_SEL = wx.NewId()
            ID_SNOOZE_FOR_N_ALL = wx.NewId()
            time = int(stime) * 60
            number, unit = TimeSpanCtrl.compute_widget_values(time)
            # Duplicate time values are not supported, just make sure they
            # don't crash the application
            self.snoozetimesconf.append(
                ((ID_SNOOZE_FOR_N_SEL, ID_SNOOZE_FOR_N_ALL), time, number,
                 unit))

        self.navigator_submenu = NavigatorMenu(tasklist)
        self.snooze_selected_submenu = SnoozeSelectedConfigMenu(tasklist, self)
        self.snooze_all_submenu = SnoozeAllConfigMenu(tasklist, self)
        self.export_submenu = ExportMenu(tasklist)

        shconf = config("GlobalShortcuts")

        self.navigator = wx.MenuItem(self,
                                     self.ID_NAVIGATOR,
                                     'Na&vigator',
                                     'Navigator actions',
                                     subMenu=self.navigator_submenu)
        self.scroll = wx.MenuItem(
            self, self.ID_SCROLL,
            "Scro&ll to ongoing\t{}".format(shconf['scroll_to_ongoing']),
            "Order the list by State and scroll "
            "to the first ongoing event")
        self.find = wx.MenuItem(
            self, self.ID_FIND,
            "&Find in database\t{}".format(shconf('Items')['find_selected']),
            "Select the database items associated to the selected events")
        self.edit = wx.MenuItem(
            self, self.ID_EDIT,
            "&Edit selected\t{}".format(shconf('Items')['edit_selected']),
            "Open in the editor the database items associated "
            "to the selected events")

        self.snooze = wx.MenuItem(self,
                                  self.ID_SNOOZE,
                                  "&Snooze selected",
                                  "Snooze the selected alarms",
                                  subMenu=self.snooze_selected_submenu)
        self.snooze_all = wx.MenuItem(self,
                                      self.ID_SNOOZE_ALL,
                                      "S&nooze all",
                                      "Snooze all the active alarms",
                                      subMenu=self.snooze_all_submenu)

        self.dismiss = wx.MenuItem(
            self, self.ID_DISMISS, "&Dismiss selected\t{}".format(
                shconf('Items')['dismiss_selected']),
            "Dismiss the selected alarms")
        self.dismiss_all = wx.MenuItem(
            self, self.ID_DISMISS_ALL,
            "Dis&miss all\t{}".format(shconf('Items')['dismiss_all']),
            "Dismiss all the active alarms")
        self.export = wx.MenuItem(self,
                                  self.ID_EXPORT,
                                  'E&xport view',
                                  'Export the current view to a file',
                                  subMenu=self.export_submenu)

        self.navigator.SetBitmap(wxgui_api.get_menu_icon('@navigator'))
        self.scroll.SetBitmap(wxgui_api.get_menu_icon('@scroll'))
        self.find.SetBitmap(wxgui_api.get_menu_icon('@dbfind'))
        self.edit.SetBitmap(wxgui_api.get_menu_icon('@edit'))
        self.snooze.SetBitmap(wxgui_api.get_menu_icon('@snooze'))
        self.snooze_all.SetBitmap(wxgui_api.get_menu_icon('@snooze'))
        self.dismiss.SetBitmap(wxgui_api.get_menu_icon('@dismiss'))
        self.dismiss_all.SetBitmap(wxgui_api.get_menu_icon('@dismiss'))
        self.export.SetBitmap(wxgui_api.get_menu_icon('@saveas'))

        self.AppendItem(self.navigator)
        self.AppendItem(self.scroll)
        self.AppendSeparator()
        self.AppendItem(self.find)
        self.AppendItem(self.edit)
        self.AppendSeparator()
        self.AppendItem(self.snooze)
        self.AppendItem(self.snooze_all)
        self.AppendItem(self.dismiss)
        self.AppendItem(self.dismiss_all)
        self.AppendSeparator()
        self.AppendItem(self.export)

        wxgui_api.bind_to_menu(self._scroll_to_ongoing, self.scroll)
        wxgui_api.bind_to_menu(self._find_in_tree, self.find)
        wxgui_api.bind_to_menu(self._edit_items, self.edit)
        wxgui_api.bind_to_menu(self._dismiss_selected_alarms, self.dismiss)
        wxgui_api.bind_to_menu(self._dismiss_all_alarms, self.dismiss_all)

        wxgui_api.bind_to_update_menu_items(self._update_items)
        wxgui_api.bind_to_reset_menu_items(self._reset_items)

        wxgui_api.insert_menu_main_item('S&chedule',
                                        wxgui_api.get_menu_view_position(),
                                        self)
Ejemplo n.º 37
0
    def __init__(self, tasklist):
        self.tasklist = tasklist
        self.occview = tasklist.list_

        self.ID_EVENTS = wx.NewId()
        self.ID_SHOW = wx.NewId()
        self.ID_FOCUS = wx.NewId()
        self.ID_ALARMS = wx.NewId()
        self.ID_TOGGLE_NAVIGATOR = wx.NewId()
        self.ID_GAPS = wx.NewId()
        self.ID_OVERLAPS = wx.NewId()
        self.ID_AUTOSCROLL = wx.NewId()

        submenu = wx.Menu()
        self.alarms_submenu = AlarmsMenu(tasklist)

        config = coreaux_api.get_plugin_configuration('wxtasklist')(
            'GlobalShortcuts')('View')

        self.events = wx.MenuItem(wxgui_api.get_menu_view(),
                                  self.ID_EVENTS,
                                  '&Schedule',
                                  'Schedule navigation actions',
                                  subMenu=submenu)
        self.show = wx.MenuItem(submenu,
                                self.ID_SHOW,
                                "Show &panel\t{}".format(config['show']),
                                "Show the schedule panel",
                                kind=wx.ITEM_CHECK)
        self.focus = wx.MenuItem(submenu, self.ID_FOCUS,
                                 "&Focus\t{}".format(config['focus']),
                                 "Set focus on the schedule tab")
        self.alarms = wx.MenuItem(submenu,
                                  self.ID_ALARMS,
                                  '&Active alarms',
                                  'Set the visibility of active alarms',
                                  subMenu=self.alarms_submenu)
        self.navigator = wx.MenuItem(submenu,
                                     self.ID_TOGGLE_NAVIGATOR,
                                     "Show &navigator\t{}".format(
                                         config['show_navigator']),
                                     "Show or hide the navigator bar",
                                     kind=wx.ITEM_CHECK)
        self.gaps = wx.MenuItem(
            submenu,
            self.ID_GAPS,
            "Show &gaps\t{}".format(config['toggle_gaps']),
            "Show any unallocated time in the shown interval",
            kind=wx.ITEM_CHECK)
        self.overlaps = wx.MenuItem(
            submenu,
            self.ID_OVERLAPS,
            "Show &overlappings\t{}".format(config['toggle_overlappings']),
            "Show time intervals used by more than one event",
            kind=wx.ITEM_CHECK)
        self.autoscroll = wx.MenuItem(submenu,
                                      self.ID_AUTOSCROLL,
                                      "Enable a&uto-scroll",
                                      "Auto-scroll to the first ongoing "
                                      "event when refreshing",
                                      kind=wx.ITEM_CHECK)

        self.events.SetBitmap(wxgui_api.get_menu_icon('@tasklist'))
        self.focus.SetBitmap(wxgui_api.get_menu_icon('@jump'))
        self.alarms.SetBitmap(wxgui_api.get_menu_icon('@activealarms'))

        wxgui_api.insert_menu_right_tab_group(self.events)
        submenu.AppendItem(self.show)
        submenu.AppendItem(self.focus)
        submenu.AppendSeparator()
        submenu.AppendItem(self.alarms)
        submenu.AppendItem(self.navigator)
        submenu.AppendItem(self.gaps)
        submenu.AppendItem(self.overlaps)
        submenu.AppendItem(self.autoscroll)

        wxgui_api.bind_to_menu(self.tasklist.toggle_shown, self.show)
        wxgui_api.bind_to_menu(self._focus, self.focus)
        wxgui_api.bind_to_menu(self._toggle_navigator, self.navigator)
        wxgui_api.bind_to_menu(self._show_gaps, self.gaps)
        wxgui_api.bind_to_menu(self._show_overlappings, self.overlaps)
        wxgui_api.bind_to_menu(self._enable_autoscroll, self.autoscroll)

        wxgui_api.bind_to_reset_menu_items(self._reset_items)
        wxgui_api.bind_to_menu_view_update(self._update_items)
Ejemplo n.º 38
0
    def __init__(self, mainmenu, log):
        self.log = log

        self.find_paramaters = (mainmenu.ID_FIND, "&Find in database",
                                wxgui_api.get_menu_icon('@dbfind'))