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.

Methods

Constants

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.

Public Instance methods

Sets default class mappings to refer to GnomeSSHMenu item classes.

[Source]

# 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.

[Source]

# 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.

[Source]

# File lib/gnome-sshmenu.rb, line 206
    def menus_open_tabs=(val)
      set('menus_open_tabs', val ? 1 : 0)
    end

Returns true if the ‘Open all as tabs’ global option is enabled.

[Source]

# File lib/gnome-sshmenu.rb, line 198
    def menus_open_tabs?
      if opt = get('menus_open_tabs')
        return opt != 0
      end
      return false
    end

[Validate]