Method: Ruber::StatusBar#view=
- Defined in:
- lib/ruber/main_window/status_bar.rb
#view=(v) ⇒ Object
Associates an editor view with the status bar. This means that the status bar will display information about that view.
v can be the view to associate with the status bar or nil. If it’s nil, the status bar won’t show anything
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/ruber/main_window/status_bar.rb', line 61 def view= v return if @view == v if @view disconnect @view, nil, self, nil disconnect @view.document, nil, self, nil end @view = v if v connect @view, SIGNAL('information_message(QString, QWidget*)'), self, SLOT('display_information(const QString &)') connect @view, SIGNAL('cursor_position_changed(KTextEditor::Cursor, QWidget*)'), self, SLOT('update_cursor_position(KTextEditor::Cursor)') connect @view, SIGNAL('view_mode_changed(QString, QWidget*)'), self, SLOT('update_view_mode(const QString &)') connect @view, SIGNAL('selection_mode_changed(bool, QWidget*)'), self, SLOT('update_selection_mode(bool)') connect @view.document, SIGNAL('modified_changed(bool, QObject*)'), self, SLOT('update_state()') connect @view.document, SIGNAL('modified_on_disk(QObject*, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)'), self, SLOT('update_state()') update end end |