Class: Ruber::RI::ToolWidget

Inherits:
Qt::Widget
  • Object
show all
Defined in:
plugins/ruberri/ruberri.rb

Instance Method Summary (collapse)

Constructor Details

- (ToolWidget) initialize(parent = nil)

A new instance of ToolWidget



189
190
191
192
193
194
195
196
197
# File 'plugins/ruberri/ruberri.rb', line 189

def initialize parent = nil
  super
  @ui = Ui::RIToolWidget.new
  @ui.setup_ui self
  connect @ui.search_term, SIGNAL(:returnPressed), @ui.search, SIGNAL(:clicked)
  connect @ui.search, SIGNAL(:clicked), self, SLOT(:start_search)
  @ui.content.open_links = false
  connect @ui.content, SIGNAL('anchorClicked(QUrl)'), Ruber[:ruberri], SLOT('display_url(QUrl)')
end

Instance Method Details

- (Object) content



199
200
201
# File 'plugins/ruberri/ruberri.rb', line 199

def content
  @ui.content.to_html
end

- (Object) content=(txt)



203
204
205
# File 'plugins/ruberri/ruberri.rb', line 203

def content= txt
  @ui.content.text = txt
end

- (Object) set_focus(reason = Qt::OtherFocusReason)



207
208
209
210
# File 'plugins/ruberri/ruberri.rb', line 207

def set_focus reason = Qt::OtherFocusReason
  super
  @ui.search_term.set_focus
end

- (Object) start_search (private)



214
215
216
217
218
219
# File 'plugins/ruberri/ruberri.rb', line 214

def start_search
  text = @ui.search_term.text
  unless text.empty?
    Ruber[:ruberri].search text
  end
end

Slot Signature:

start_search()