diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/URLQueue/MainController.pm | 9 | ||||
-rw-r--r-- | lib/URLQueue/main.glade | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/URLQueue/MainController.pm b/lib/URLQueue/MainController.pm index a40c922..d6fe05a 100644 --- a/lib/URLQueue/MainController.pm +++ b/lib/URLQueue/MainController.pm @@ -78,8 +78,6 @@ sub drag_data_received { warn "What is $info??"; } - $self->{input}->set_from_stock('gnome-stock-book-green','large-toolbar'); - return 1; } @@ -99,6 +97,7 @@ sub button_release { $self->{input}->set_from_stock('gnome-stock-book-yellow','large-toolbar'); my $clipboard=Gtk2::Clipboard->get(Gtk2::Gdk->SELECTION_PRIMARY); $clipboard->request_text(sub{$self->handle_text($_[1])}); + return 1; } @@ -132,14 +131,18 @@ sub handle_text { } } - my ($title)=($text =~ m{ \A ^ (.*?) $}smx); + my ($title)=($text =~ m{ \A ^ (.+?) $}smx); for ($title,$text) { s{\A \s+}{}smx; s{\s+ \z}{}smx; } + $title = 'URLQueue paste' if $title eq ''; + $self->send_email($title,$text); + + $self->{input}->set_from_stock('gnome-stock-book-green','large-toolbar'); } sub handle_uris { diff --git a/lib/URLQueue/main.glade b/lib/URLQueue/main.glade index ac0a0f4..6955651 100644 --- a/lib/URLQueue/main.glade +++ b/lib/URLQueue/main.glade @@ -6,16 +6,18 @@ <property name="width_request">50</property> <property name="height_request">50</property> <property name="visible">True</property> - <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property> + <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property> <property name="title" translatable="yes">URLQueue</property> <property name="icon_name">stock_bookmark</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_UTILITY</property> <property name="skip_pager_hint">True</property> <property name="decorated">False</property> <signal name="destroy" handler="quit"/> + <signal name="button_release_event" handler="button_release"/> <child> <widget class="GtkImage" id="input"> <property name="visible">True</property> + <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property> <property name="stock">gnome-stock-book-green</property> <property name="icon_size">3</property> <signal name="drag_leave" handler="drag_leave"/> |