trunk 20080912
[gitenigma.git] / src / time_settings.cpp
blob276fb1978c94cf3e77c74a498d01da0d61c701e3
1 /*
2 * time_settings.cpp
4 * Copyright (C) 2003 Andreas Monzner <ghostrider@tuxbox.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * $Id: time_settings.cpp,v 1.4 2004/06/15 10:35:51 ghostrider Exp $
23 #include <time_settings.h>
24 #include <setup_timezone.h>
25 #include <time_correction.h>
26 #include <timer.h>
27 #include <lib/dvb/edvb.h>
28 #include <lib/dvb/dvbservice.h>
29 #include <lib/gui/emessage.h>
31 eTimeSettings::eTimeSettings()
32 :eSetupWindow(_("Time Settings"), 5, 350)
34 move(ePoint(130, 135));
35 int entry=0;
36 CONNECT((new eListBoxEntryMenu(&list, _("Timezone Configuration"), eString().sprintf("(%d) %s", ++entry, _("open timezone selector")) ))->selected, eTimeSettings::time_zone);
37 CONNECT((new eListBoxEntryMenu(&list, _("Time Correction"), eString().sprintf("(%d) %s", ++entry, _("open time correction window")) ))->selected, eTimeSettings::time_correction);
40 void eTimeSettings::time_zone()
42 hide();
43 eZapTimeZoneSetup setup;
44 #ifndef DISABLE_LCD
45 setup.setLCD(LCDTitle, LCDElement);
46 #endif
47 setup.show();
48 setup.exec();
49 setup.hide();
50 show();
53 void eTimeSettings::time_correction()
55 eDVBServiceController *sapi = eDVB::getInstance()->getServiceAPI();
56 if (sapi && sapi->transponder)
58 tsref ref = *sapi->transponder;
59 hide();
60 eTimeCorrectionEditWindow w(ref);
61 #ifndef DISABLE_LCD
62 w.setLCD(LCDTitle, LCDElement);
63 #endif
64 w.show();
65 w.exec();
66 w.hide();
67 show();
69 else
71 hide();
72 eMessageBox mb( _("To change time correction you must tune first to any transponder"), _("time correction change error"), eMessageBox::btOK|eMessageBox::iconInfo );
73 mb.show();
74 mb.exec();
75 mb.hide();
76 show();