1
###################################################
3
# Copyright (C) Mario Kemper <mario.kemper@googlemail.com> and Shutter Team
5
# This file is part of Shutter.
7
# Shutter is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
12
# Shutter is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with Shutter; if not, write to the Free Software
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
###################################################
23
package Shutter::App::HelperFunctions;
26
#--------------------------------------
31
#Gettext and filename parsing
32
use POSIX qw/setlocale strftime/;
36
#--------------------------------------
37
use constant TRUE => 1;
38
use constant FALSE => 0;
40
#--------------------------------------
42
##################public subs##################
47
my $self = { _common => shift };
54
my ( $self, $dialog, $link, $user_data ) = @_;
55
system("gnome-open $link");
60
my ( $self, $dialog, $mail, $user_data ) = @_;
61
system("gnome-open mailto:$mail");
66
my ( $self, $filename ) = @_;
67
return FALSE unless $filename;
68
$filename = $self->switch_home_in_file($filename);
69
return TRUE if ( -f $filename && -r $filename );
73
sub switch_home_in_file {
74
my ( $self, $filename ) = @_;
75
$filename =~ s/^~/$ENV{ HOME }/; #switch ~ in path to /home/username
83
#see https://bugs.launchpad.net/shutter/+bug/347821
92
print "shutter [options]\n";
93
print "Available options:\n\n"
95
. "--full (starts shutter and takes a full screen screenshot directly)\n"
96
. "--selection (starts shutter in selection mode)\n"
97
. "--window (starts shutter in window selection mode)\n"
98
. "--section (starts shutter in section selection mode)\n\n"
102
. "--min_at_startup (starts shutter minimized to tray)\n"
103
. "--clear_cache (clears cache, e.g. installed plugins, at startup)\n"
104
. "--debug (prints a lot of debugging information to STDOUT)\n"
105
. "--disable_systray (disable systray icon)\n"
106
. "--help (displays this help)\n";