Class | GnomeSSHMenu::Config |
In: |
lib/gnome-sshmenu.rb
(Git)
|
Parent: | SSHMenu::Config |
The GnomeSSHMenu::Config class builds on SSHMenu::Config to add support for gnome-terminal with configurable profiles and tabbed windows.
GnomeTermProfiles | = | '/apps/gnome-terminal/global/profile_list' | GConf key for retrieving a list of terminal profiles. | |
GnomeTermProfName | = | '/apps/gnome-terminal/profiles/%s/visible_name' | GConf key template to get visible name for a profile. |
Sets default class mappings to refer to GnomeSSHMenu item classes.
# File lib/gnome-sshmenu.rb, line 173 def inject_defaults mapper.inject( 'app.model.item' => GnomeSSHMenu::Item, 'app.model.hostitem' => GnomeSSHMenu::HostItem, 'app.model.menuitem' => GnomeSSHMenu::MenuItem ) super end
Retrieves a list of gnome-terminal profile names from the GConf registry.
# File lib/gnome-sshmenu.rb, line 184 def list_profiles profiles = [] client = GConf::Client.default names = client[GnomeTermProfiles] or return profiles names.each { |prof_name| title = client[sprintf(GnomeTermProfName, prof_name)] profiles.push(title) unless title.nil? } profiles.sort! { |a,b| a.upcase <=> b.upcase } return profiles end
Used to set the ‘Open all as tabs’ global option.
# File lib/gnome-sshmenu.rb, line 206 def menus_open_tabs=(val) set('menus_open_tabs', val ? 1 : 0) end