From a1088622711617cbde28a7c03c3565075ddb51bf Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 8 May 2013 19:16:25 +0200 Subject: remove dep on Gnome --- Makefile.PL | 9 ++++++++- lib/URLQueue/MainController.pm | 14 ++++++++------ script/URLQueue.pl | 4 +--- share/stock_book_blue.png | Bin 0 -> 1220 bytes share/stock_book_green.png | Bin 0 -> 1228 bytes share/stock_book_open.png | Bin 0 -> 1304 bytes share/stock_book_red.png | Bin 0 -> 1239 bytes share/stock_book_yellow.png | Bin 0 -> 1223 bytes 8 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 share/stock_book_blue.png create mode 100644 share/stock_book_green.png create mode 100644 share/stock_book_open.png create mode 100644 share/stock_book_red.png create mode 100644 share/stock_book_yellow.png diff --git a/Makefile.PL b/Makefile.PL index d1a1a73..b090229 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,17 +1,24 @@ use ExtUtils::MakeMaker; +use File::ShareDir::Install; + +install_share 'share'; WriteMakefile( NAME => 'URLQueue', VERSION => '1.0', AUTHOR => 'dakkar ', PREREQ_PM => { - 'Gnome2' => 0, + 'Gtk2' => 0, 'Gtk2::GladeXML::Simple' => 0, 'Path::Class' => 0, 'URI::Find' => 0, 'URI::Title' => 0, 'Email::Send' => 0, 'MIME::EncWords' => 1, + 'File::ShareDir' => 0, }, EXE_FILES => [ 'script/URLQueue.pl' ], ); + +package MY; +use File::ShareDir::Install qw(postamble); diff --git a/lib/URLQueue/MainController.pm b/lib/URLQueue/MainController.pm index 0a793f0..9d4cd5b 100644 --- a/lib/URLQueue/MainController.pm +++ b/lib/URLQueue/MainController.pm @@ -8,6 +8,7 @@ use URI::Title; use Email::Send; use Encode; use MIME::EncWords; +use File::ShareDir 'dist_file'; use POSIX 'strftime'; sub new { @@ -23,6 +24,7 @@ sub new { [qw(default copy move link private ask)], ); $self->{input}->drag_dest_set_target_list($target_list); + $self->{input}->set_from_file(dist_file('URLQueue','stock_book_green.png')); $self->{glade_dir}=$params{glade_dir}; @@ -35,7 +37,7 @@ sub drag_motion { $context->status($context->suggested_action,$time); if (!$self->{_dragging}) { - $self->{input}->set_from_stock('gnome-stock-book-open','large-toolbar'); + $self->{input}->set_from_file(dist_file('URLQueue','stock_book_open.png')); $self->{_dragging}=1; } @@ -46,7 +48,7 @@ sub drag_leave { my ($self, $widget, $context, $time) = @_; if ($self->{_dragging}) { - $self->{input}->set_from_stock('gnome-stock-book-green','large-toolbar'); + $self->{input}->set_from_file(dist_file('URLQueue','stock_book_green.png')); $self->{_dragging}=0; } @@ -57,7 +59,7 @@ sub drag_drop { my ($self, $widget, $context, $x, $y, $time) = @_; if (my $atom=$context->targets) { - $self->{input}->set_from_stock('gnome-stock-book-yellow','large-toolbar'); + $self->{input}->set_from_file(dist_file('URLQueue','stock_book_yellow.png')); $self->{_dragging}=0; $widget->drag_get_data($context, $atom, $time); return 1; @@ -95,7 +97,7 @@ sub button_release { my ($self,$widget,$event)=@_; if ($event->button==2) { - $self->{input}->set_from_stock('gnome-stock-book-yellow','large-toolbar'); + $self->{input}->set_from_file(dist_file('URLQueue','stock_book_yellow.png')); my $clipboard=Gtk2::Clipboard->get(Gtk2::Gdk->SELECTION_PRIMARY); $clipboard->request_text(sub{$self->handle_text($_[1])}); @@ -143,7 +145,7 @@ sub handle_text { $self->send_email($title,$text); - $self->{input}->set_from_stock('gnome-stock-book-green','large-toolbar'); + $self->{input}->set_from_file(dist_file('URLQueue','stock_book_green.png')); } sub handle_uris { @@ -165,7 +167,7 @@ sub handle_uris { } $self->send_email($title,$body); - $self->{input}->set_from_stock('gnome-stock-book-green','large-toolbar'); + $self->{input}->set_from_file(dist_file('URLQueue','stock_book_green.png')); } sub send_email { diff --git a/script/URLQueue.pl b/script/URLQueue.pl index 516167d..835c6ec 100644 --- a/script/URLQueue.pl +++ b/script/URLQueue.pl @@ -1,11 +1,9 @@ #!/usr/bin/perl use strict; use warnings; -use Gnome2; +use Gtk2 -init; use URLQueue::MainController; -Gnome2::Program->init('URLQueue','1.0'); - my $main_controller=URLQueue::MainController->new(); $main_controller->run; diff --git a/share/stock_book_blue.png b/share/stock_book_blue.png new file mode 100644 index 0000000..3eb2b85 Binary files /dev/null and b/share/stock_book_blue.png differ diff --git a/share/stock_book_green.png b/share/stock_book_green.png new file mode 100644 index 0000000..31ecf14 Binary files /dev/null and b/share/stock_book_green.png differ diff --git a/share/stock_book_open.png b/share/stock_book_open.png new file mode 100644 index 0000000..802f771 Binary files /dev/null and b/share/stock_book_open.png differ diff --git a/share/stock_book_red.png b/share/stock_book_red.png new file mode 100644 index 0000000..b288678 Binary files /dev/null and b/share/stock_book_red.png differ diff --git a/share/stock_book_yellow.png b/share/stock_book_yellow.png new file mode 100644 index 0000000..8969ab7 Binary files /dev/null and b/share/stock_book_yellow.png differ -- cgit v1.2.3