Class: Ruber::State::ProjectExtension

Inherits:
Qt::Object
  • Object
show all
Includes:
Extension, EnvironmentState
Defined in:
plugins/state/state.rb

Overview

Extension for projects needed by the State plugin

The scope of this extension is to save and restore the state of the tabs open when the project was last closed

Instance Attribute Summary

Attributes included from Extension

plugin

Instance Method Summary (collapse)

Methods included from EnvironmentState

#restore_environment, #restore_tab, #tab_to_tree, #tabs_state

Methods included from Extension

#query_close, #remove_from_project, #shutdown

Constructor Details

- (ProjectExtension) initialize(prj)

A new instance of ProjectExtension

Parameters:



481
482
483
484
485
486
# File 'plugins/state/state.rb', line 481

def initialize prj
  super
  @project = prj
#         connect @project, SIGNAL(:activated), self, SLOT(:auto_restore)
#         connect @project, SIGNAL(:deactivated), self, SLOT(:save_settings)
end

Instance Method Details

- (nil) save_settings

Saves Ruber’s state to the project

The saved information is: the configuration of open tabs, the position of the cursor in the views and the active view

Returns:

  • (nil)


496
497
498
499
500
501
502
# File 'plugins/state/state.rb', line 496

def save_settings
  state = tabs_state Ruber[:world].environment @project
  @project[:state, :tabs] = state[:tabs]
  @project[:state, :active_view] = state[:active_view]
  @project[:state, :cursor_positions] = state[:cursor_positions]
  nil
end

Slot Signature:

save_settings()