Bump the changelog for the 0.7.5 release
[email-reminder.git] / EmailReminder / WeeklyStore.pm
blobff221f62eb802a4d5ebccbe7e8e8b67078981def
1 # This file is part of Email-Reminder.
3 # Email-Reminder is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License as
5 # published by the Free Software Foundation; either version 3 of the
6 # License, or (at your option) any later version.
8 # Email-Reminder is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with Email-Reminder; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 # 02110-1301, USA.
18 package EmailReminder::WeeklyStore;
20 use strict;
21 use warnings;
23 use Gtk2;
24 use Glib::Object::Subclass
25 Glib::Object::,
26 interfaces => [ Gtk2::TreeModel:: ],
29 use EmailReminder::EventStore;
30 use EmailReminder::WeeklyEvent;
32 use base qw(EmailReminder::EventStore);
34 # Column indices
35 my $NAME_INDEX = 1;
36 my $DAY_INDEX = 2;
38 sub init
40 my ($self) = @_;
42 $self->{TYPE} = EmailReminder::WeeklyEvent->get_type();
43 $self->{NB_COLUMNS} = EmailReminder::WeeklyEvent->get_nb_fields();
45 $self->EmailReminder::EventStore::init();
46 return 1;
49 sub get_event_column
51 my ($self, $event, $col) = @_;
53 if ($col == $NAME_INDEX) {
54 return $event->get_name();
56 elsif ($col == $DAY_INDEX) {
57 return $event->get_day();
59 else {
60 return $self->EmailReminder::EventStore::get_event_column($event, $col);
64 sub set_event_column
66 my ($self, $event, $col, $new_value) = @_;
68 if ($col == $NAME_INDEX) {
69 $event->set_name($new_value);
71 elsif ($col == $DAY_INDEX) {
72 $event->set_day($new_value);
74 else {
75 $self->EmailReminder::EventStore::set_event_column($event, $col, $new_value);
77 return 1;