Example #1
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)
Example #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)
Example #3
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)
Example #4
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)
Example #5
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)
Example #6
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)
Example #7
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)
Example #8
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)
Example #9
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)
Example #10
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)
Example #11
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)
Example #12
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)
Example #13
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)
Example #14
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)
Example #15
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)