~ubuntu-branches/ubuntu/quantal/padre/quantal

« back to all changes in this revision

Viewing changes to lib/Padre/Wx/Dialog/SessionManager.pm

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2012-01-04 12:04:20 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20120104120420-i5oybqwf91m1d3il
Tags: 0.92.ds1-1
[ gregor herrmann ]
* Remove debian/source/local-options; abort-on-upstream-changes
  and unapply-patches are default in dpkg-source since 1.16.1.
* Swap order of alternative (build) dependencies after the perl
  5.14 transition.

[ Dominique Dumont ]
* Imported Upstream version 0.92.ds1
* removed fix-spelling patch (applied upstream)
* lintian-override: use wildcard to avoid listing a gazillion files
* updated size of some 'not-real-man-page' entries
* rules: remove dekstop cruft (replaced by a file provided in debian
  directory)
* control: removed Breaks statement. Add /me to uploaders. Updated
  dependencies
* rules: make sure that non-DFSG file (i.e. the cute butterfly, sigh)
  is not distributed

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
use Padre::Wx::Icon ();
10
10
use Padre::Current  ();
11
11
 
12
 
our $VERSION = '0.90';
 
12
our $VERSION = '0.92';
13
13
our @ISA     = 'Wx::Dialog';
14
14
 
15
15
use Class::XSAccessor {
35
35
                $parent,
36
36
                -1,
37
37
                Wx::gettext('Session Manager'),
38
 
                Wx::wxDefaultPosition,
 
38
                Wx::DefaultPosition,
39
39
                Wx::Size->new( 480, 300 ),
40
 
                Wx::wxDEFAULT_FRAME_STYLE | Wx::wxTAB_TRAVERSAL,
 
40
                Wx::DEFAULT_FRAME_STYLE | Wx::TAB_TRAVERSAL,
41
41
        );
42
42
 
43
43
        $self->SetIcon(Padre::Wx::Icon::PADRE);
194
194
        my $self = shift;
195
195
 
196
196
        # create vertical box that will host all controls
197
 
        my $vbox = Wx::BoxSizer->new(Wx::wxVERTICAL);
 
197
        my $vbox = Wx::BoxSizer->new(Wx::VERTICAL);
198
198
        $self->SetSizer($vbox);
199
199
        $self->CenterOnParent;
200
200
 
224
224
                $self, -1,
225
225
                Wx::gettext('List of sessions')
226
226
        );
227
 
        $vbox->Add( $label, 0, Wx::wxALL, 5 );
 
227
        $vbox->Add( $label, 0, Wx::ALL, 5 );
228
228
 
229
229
        # create list
230
230
        my $list = Wx::ListView->new(
231
231
                $self,
232
232
                -1,
233
 
                Wx::wxDefaultPosition,
234
 
                Wx::wxDefaultSize,
235
 
                Wx::wxLC_REPORT | Wx::wxLC_SINGLE_SEL,
 
233
                Wx::DefaultPosition,
 
234
                Wx::DefaultSize,
 
235
                Wx::LC_REPORT | Wx::LC_SINGLE_SEL,
236
236
        );
237
237
        $list->InsertColumn( 0, Wx::gettext('Name') );
238
238
        $list->InsertColumn( 1, Wx::gettext('Description') );
245
245
        Wx::Event::EVT_LIST_COL_CLICK( $self, $list, \&_on_list_col_click );
246
246
 
247
247
        # pack the list
248
 
        $vbox->Add( $list, 1, Wx::wxALL | Wx::wxEXPAND, 5 );
 
248
        $vbox->Add( $list, 1, Wx::ALL | Wx::EXPAND, 5 );
249
249
}
250
250
 
251
251
#
261
261
        my $config = Padre->ide->config;
262
262
 
263
263
        # the hbox
264
 
        my $hbox = Wx::BoxSizer->new(Wx::wxHORIZONTAL);
265
 
        $self->_vbox->Add( $hbox, 0, Wx::wxALL | Wx::wxEXPAND, 5 );
 
264
        my $hbox = Wx::BoxSizer->new(Wx::HORIZONTAL);
 
265
        $self->_vbox->Add( $hbox, 0, Wx::ALL | Wx::EXPAND, 5 );
266
266
 
267
267
        # CheckBox
268
268
        $self->{autosave} = Wx::CheckBox->new(
280
280
        #                       }
281
281
        #               );
282
282
 
283
 
        $hbox->Add( $self->{autosave}, 0, Wx::wxALL, 5 );
 
283
        $hbox->Add( $self->{autosave}, 0, Wx::ALL, 5 );
284
284
}
285
285
 
286
286
#
294
294
        my $self = shift;
295
295
 
296
296
        # the hbox
297
 
        my $hbox = Wx::BoxSizer->new(Wx::wxHORIZONTAL);
298
 
        $self->_vbox->Add( $hbox, 0, Wx::wxALL | Wx::wxEXPAND, 5 );
 
297
        my $hbox = Wx::BoxSizer->new(Wx::HORIZONTAL);
 
298
        $self->_vbox->Add( $hbox, 0, Wx::ALL | Wx::EXPAND, 5 );
299
299
 
300
300
        # the buttons
301
 
        my $bo = Wx::Button->new( $self, -1,              Wx::gettext('&Open') );
302
 
        my $bd = Wx::Button->new( $self, -1,              Wx::gettext('&Delete') );
303
 
        my $bc = Wx::Button->new( $self, Wx::wxID_CANCEL, Wx::gettext('&Close') );
 
301
        my $bo = Wx::Button->new( $self, -1,            Wx::gettext('&Open') );
 
302
        my $bd = Wx::Button->new( $self, -1,            Wx::gettext('&Delete') );
 
303
        my $bc = Wx::Button->new( $self, Wx::ID_CANCEL, Wx::gettext('&Close') );
304
304
        $self->_butopen($bo);
305
305
        $self->_butdelete($bd);
306
306
        Wx::Event::EVT_BUTTON( $self, $bo, \&_on_butopen_clicked );
307
307
        Wx::Event::EVT_BUTTON( $self, $bd, \&_on_butdelete_clicked );
308
308
        Wx::Event::EVT_BUTTON( $self, $bc, \&_on_butclose_clicked );
309
 
        $hbox->Add( $bo, 0, Wx::wxALL, 5 );
310
 
        $hbox->Add( $bd, 0, Wx::wxALL, 5 );
 
309
        $hbox->Add( $bo, 0, Wx::ALL, 5 );
 
310
        $hbox->Add( $bd, 0, Wx::ALL, 5 );
311
311
        $hbox->AddStretchSpacer;
312
 
        $hbox->Add( $bc, 0, Wx::wxALL, 5 );
 
312
        $hbox->Add( $bc, 0, Wx::ALL, 5 );
313
313
}
314
314
 
315
315
#
405
405
        # auto-resize columns
406
406
        my $flag =
407
407
                $list->GetItemCount
408
 
                ? Wx::wxLIST_AUTOSIZE
409
 
                : Wx::wxLIST_AUTOSIZE_USEHEADER;
 
408
                ? Wx::LIST_AUTOSIZE
 
409
                : Wx::LIST_AUTOSIZE_USEHEADER;
410
410
        $list->SetColumnWidth( $_, $flag ) for 0 .. 2;
411
411
 
412
412
        # making sure the list can show all columns
429
429
 
430
430
        if ( $list->GetItemCount ) {
431
431
                my $item = $list->GetItem(0);
432
 
                $item->SetState(Wx::wxLIST_STATE_SELECTED);
 
432
                $item->SetState(Wx::LIST_STATE_SELECTED);
433
433
                $list->SetItem($item);
434
434
        } else {
435
435