changeset 25:1a28b62792cf

Added SubtlyUriPaste and SubtlyUriYank
author unexist
date Fri, 22 Jan 2010 14:38:19 +0100
parents 4652f9744833
children b8a8e3c5b6c6
files subtly.rb subtly/browser.rb
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/subtly.rb	Fri Jan 22 14:37:21 2010 +0100
+++ b/subtly.rb	Fri Jan 22 14:38:19 2010 +0100
@@ -17,6 +17,7 @@
   "o"   => :SubtlyUriOpen,
   "O"   => :SubtlyUriEdit,
   "p"   => :SubtlyUriPaste,
+  "y"   => :SubtlyUriYank,
   "i"   => :SubtlyModeInsert,
   "Esc" => :SubtlyModeCommand,
   "s"   => :SubtlyBrowserStop,
--- a/subtly/browser.rb	Fri Jan 22 14:37:21 2010 +0100
+++ b/subtly/browser.rb	Fri Jan 22 14:38:19 2010 +0100
@@ -170,6 +170,16 @@
           @input.text = ":open %s" % [ @webkit.uri ]
           @input.editable = true
           @mode = :uri
+        when :SubtlyUriPaste then
+          uri = Subtly::Gtk::Clipboard.text
+
+          if(uri.include?("http://"))
+            @webkit.uri = uri
+            @info.text  = "Loading %s" % [ format_status(uri[0..LIMIT]) ]
+          end
+        when :SubtlyUriYank then
+          Subtly::Gtk::Clipboard.text = @webkit.uri
+          @input.text = "Yanked %s" % [ @webkit.uri ]
         when :SubtlyModeInsert then
           @mode             = :insert
           @webkit.focusable = true
@@ -291,6 +301,7 @@
     # webkit_finished {{{
     def webkit_finished(widget, arg)
       @status.text = ""
+      @info.text = format_status(@webkit.uri[0..LIMIT])
     end # }}}
 
     # webkit_progress {{{