def submenu(self): """ Submenu consisting of... Events... Snapshot... Clear Show / Hide Duplicates Filter (Submenu) """ filter_group = RadioGroup(self._filter.select, self._filter.selection()) duplicates_label, duplicates_arg = ( 'Hide Duplicates', False) if self._show_duplicates else ('Show Duplicates', True) return Submenu('Log', [ MenuItem('Events...', self._show_event_selection_prompt), MenuItem('Snapshot...', self._show_snapshot_prompt), MenuItem('Clear', self._clear), MenuItem(duplicates_label, functools.partial(setattr, self, '_show_duplicates'), duplicates_arg), Submenu('Filter', [ RadioMenuItem('None', filter_group, None), [ RadioMenuItem(opt, filter_group, opt) for opt in self._filter.latest_selections() ], MenuItem('New...', self._show_filter_prompt), ]), ])
def submenu(self): """ Submenu consisting of... Save Config... Sorting... Filter / Unfilter Options """ return Submenu('Configuration', [ MenuItem('Save Config...', self._show_write_dialog), MenuItem('Sorting...', self._show_sort_dialog), ])
def submenu(self): """ Submenu consisting of... Reload Show / Hide Comments Show / Hide Line Numbers """ comments_label, comments_arg = ('Hide Comments', False) if self._show_comments else ('Show Comments', True) line_number_label, line_number_arg = ('Hide Line Numbers', False) if self._show_line_numbers else ('Show Line Numbers', True) return Submenu('Torrc', [ MenuItem(comments_label, functools.partial(setattr, self, '_show_comments'), comments_arg), MenuItem(line_number_label, functools.partial(setattr, self, '_show_line_numbers'), line_number_arg), ])
def submenu(self): """ Submenu consisting of... Sorting... Resolver (Submenu) """ tracker = nyx.tracker.get_connection_tracker() resolver_group = RadioGroup(tracker.set_custom_resolver, tracker.get_custom_resolver()) return Submenu('Connections', [ MenuItem('Sorting...', self._show_sort_dialog), Submenu('Resolver', [ RadioMenuItem('auto', resolver_group, None), [RadioMenuItem(opt, resolver_group, opt) for opt in connection.Resolver], ]), ])
def submenu(self): """ Submenu consisting of... [X] <Stat 1> [ ] <Stat 2> [ ] <Stat 2> Resize... Interval (Submenu) Bounds (Submenu) """ stat_group = RadioGroup(functools.partial(setattr, self, '_displayed_stat'), self._displayed_stat) interval_group = RadioGroup(functools.partial(setattr, self, '_update_interval'), self._update_interval) bounds_group = RadioGroup(functools.partial(setattr, self, '_bounds_type'), self._bounds_type) return Submenu('Graph', [ RadioMenuItem('None', stat_group, None), [RadioMenuItem(str_tools._to_camel_case(opt, divider = ' '), stat_group, opt) for opt in sorted(self.stat_options())], MenuItem('Resize...', self._resize_graph), Submenu('Interval', [RadioMenuItem(opt, interval_group, opt) for opt in Interval]), Submenu('Bounds', [RadioMenuItem(opt, bounds_group, opt) for opt in Bounds]), ])