~ubuntu-branches/ubuntu/trusty/shutter/trusty

« back to all changes in this revision

Viewing changes to share/shutter/resources/modules/Shutter/App/SimpleDialogs.pm

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-08-06 16:29:32 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806162932-g00c3k4obbdddb4u
Tags: 0.80.1-1
* New Upstream Version
  - update copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
###################################################
2
2
#
3
 
#  Copyright (C) Mario Kemper <mario.kemper@googlemail.com> and Shutter Team
 
3
#  Copyright (C) 2008, 2009 Mario Kemper <mario.kemper@googlemail.com> and Shutter Team
4
4
#
5
5
#  This file is part of Shutter.
6
6
#
26
26
#--------------------------------------
27
27
use utf8;
28
28
use strict;
 
29
use warnings;
 
30
 
29
31
use Gtk2;
30
32
 
31
33
#Gettext and filename parsing
44
46
        my $class = shift;
45
47
 
46
48
        #constructor
47
 
        my $self = { _window => shift };
 
49
        my $self = { _window => shift, _gdk_window => shift };
48
50
 
49
51
        bless $self, $class;
50
52
        return $self;
58
60
        my $info_dialog = Gtk2::MessageDialog->new( $self->{_window}, [qw/modal destroy-with-parent/],
59
61
                'info', 'ok', $dlg_info_message );
60
62
 
 
63
        $info_dialog->set_title("Shutter");
 
64
 
61
65
        $info_dialog->set( 'text' => $dlg_info_header );
62
66
 
63
67
        $info_dialog->set( 'secondary-text' => $dlg_info_message );
64
68
 
 
69
        $info_dialog->show_all;
 
70
 
 
71
        if(defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk2::Gdk::Window/){
 
72
                $info_dialog->window->set_transient_for($self->{_gdk_window});
 
73
        }else{
 
74
                $info_dialog->set_transient_for($self->{_window});
 
75
        }
 
76
 
65
77
        my $info_response = $info_dialog->run;
66
 
        $info_dialog->destroy() if ( $info_response eq "ok" );
67
78
        
 
79
        $info_dialog->destroy();
68
80
        return TRUE;
69
81
}
70
82
 
82
94
 
83
95
        my $question_dialog = Gtk2::MessageDialog->new( $self->{_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef );
84
96
 
 
97
        $question_dialog->set_title("Shutter");
 
98
 
85
99
        $question_dialog->set( 'image' => Gtk2::Image->new_from_stock( 'gtk-dialog-question', 'dialog' ) );
86
100
 
87
101
        $question_dialog->set( 'text' => $dlg_question_header );
112
126
 
113
127
        $question_dialog->show_all;
114
128
 
 
129
        if(defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk2::Gdk::Window/){
 
130
                $question_dialog->window->set_transient_for($self->{_gdk_window});
 
131
        }else{
 
132
                $question_dialog->set_transient_for($self->{_window});
 
133
        }
 
134
 
115
135
        my $question_response = $question_dialog->run;
116
136
 
117
137
        $question_dialog->destroy();
132
152
        
133
153
        my $error_dialog = Gtk2::MessageDialog->new( $self->{_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef );
134
154
 
 
155
        $error_dialog->set_title("Shutter");
 
156
 
135
157
        $error_dialog->set( 'image' => Gtk2::Image->new_from_stock( 'gtk-dialog-error', 'dialog' ) );
136
158
 
137
159
        $error_dialog->set( 'text' => $dlg_error_header );
163
185
 
164
186
        $error_dialog->show_all;
165
187
 
 
188
        if(defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk2::Gdk::Window/){
 
189
                $error_dialog->window->set_transient_for($self->{_gdk_window});
 
190
        }else{
 
191
                $error_dialog->set_transient_for($self->{_window});
 
192
        }
 
193
 
166
194
        my $error_response = $error_dialog->run;
167
195
 
168
196
        $error_dialog->destroy();
183
211
        
184
212
        my $warning_dialog = Gtk2::MessageDialog->new( $self->{_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef );
185
213
 
 
214
        $warning_dialog->set_title("Shutter");
 
215
 
186
216
        $warning_dialog->set( 'image' => Gtk2::Image->new_from_stock( 'gtk-dialog-warning', 'dialog' ) );
187
217
 
188
218
        $warning_dialog->set( 'text' => $dlg_warning_header );
214
244
 
215
245
        $warning_dialog->show_all;
216
246
 
 
247
        if(defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk2::Gdk::Window/){
 
248
                $warning_dialog->window->set_transient_for($self->{_gdk_window});
 
249
        }else{
 
250
                $warning_dialog->set_transient_for($self->{_window});
 
251
        }
 
252
 
217
253
        my $warning_response = $warning_dialog->run;
218
254
 
219
255
        $warning_dialog->destroy();