24 |
24 |
25 // User includes |
25 // User includes |
26 #include "datetimesettingsview.h" |
26 #include "datetimesettingsview.h" |
27 #include "clocksettingsview.h" |
27 #include "clocksettingsview.h" |
28 #include "timezoneclient.h" |
28 #include "timezoneclient.h" |
|
29 #include "OstTraceDefinitions.h" |
|
30 #ifdef OST_TRACE_COMPILER_IN_USE |
|
31 #include "datetimesettingsviewTraces.h" |
|
32 #endif |
|
33 |
29 |
34 |
30 /*! |
35 /*! |
31 \class DateTimeSettingsView |
36 \class DateTimeSettingsView |
32 |
37 |
33 This class launches the clock settings view from control panel. |
38 This class launches the clock settings view from control panel. |
47 const QString &description, const HbIcon &icon, |
52 const QString &description, const HbIcon &icon, |
48 const HbDataFormModelItem *parent): |
53 const HbDataFormModelItem *parent): |
49 CpSettingFormEntryItemData( |
54 CpSettingFormEntryItemData( |
50 itemDataHelper, text, description, icon, parent) |
55 itemDataHelper, text, description, icon, parent) |
51 { |
56 { |
|
57 OstTraceFunctionEntry0( DATETIMESETTINGSVIEW_DATETIMESETTINGSVIEW_ENTRY ); |
52 // Construct the timezone client. |
58 // Construct the timezone client. |
53 mTimezoneClient = TimezoneClient::getInstance(); |
59 mTimezoneClient = TimezoneClient::getInstance(); |
54 connect( |
60 connect( |
55 mTimezoneClient, SIGNAL(timechanged()), |
61 mTimezoneClient, SIGNAL(timechanged()), |
56 this, SLOT(updateDisplayTime())); |
62 this, SLOT(updateDisplayTime())); |
60 // Start the Timer for 1 minute. |
66 // Start the Timer for 1 minute. |
61 mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); |
67 mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); |
62 connect( |
68 connect( |
63 mTickTimer, SIGNAL(timeout()), |
69 mTickTimer, SIGNAL(timeout()), |
64 this, SLOT(updateDisplayTime())); |
70 this, SLOT(updateDisplayTime())); |
|
71 OstTraceFunctionExit0( DATETIMESETTINGSVIEW_DATETIMESETTINGSVIEW_EXIT ); |
65 } |
72 } |
66 |
73 |
67 /*! |
74 /*! |
68 Destructor. |
75 Destructor. |
69 */ |
76 */ |
70 DateTimeSettingsView::~DateTimeSettingsView() |
77 DateTimeSettingsView::~DateTimeSettingsView() |
71 { |
78 { |
|
79 OstTraceFunctionEntry0( DUP1_DATETIMESETTINGSVIEW_DATETIMESETTINGSVIEW_ENTRY ); |
72 if (mTickTimer) { |
80 if (mTickTimer) { |
73 mTickTimer->stop(); |
81 mTickTimer->stop(); |
74 delete mTickTimer; |
82 delete mTickTimer; |
75 mTickTimer = 0; |
83 mTickTimer = 0; |
76 } |
84 } |
77 |
85 |
78 if (!mTimezoneClient->isNull()) { |
86 if (!mTimezoneClient->isNull()) { |
79 mTimezoneClient->deleteInstance(); |
87 mTimezoneClient->deleteInstance(); |
80 } |
88 } |
|
89 OstTraceFunctionExit0( DUP1_DATETIMESETTINGSVIEW_DATETIMESETTINGSVIEW_EXIT ); |
81 } |
90 } |
82 |
91 |
83 /*! |
92 /*! |
84 Launches the clock settings view. |
93 Launches the clock settings view. |
85 */ |
94 */ |
86 void DateTimeSettingsView::onLaunchView() |
95 void DateTimeSettingsView::onLaunchView() |
87 { |
96 { |
|
97 OstTraceFunctionEntry0( DATETIMESETTINGSVIEW_ONLAUNCHVIEW_ENTRY ); |
88 ClockSettingsView *settingsView = new ClockSettingsView(this); |
98 ClockSettingsView *settingsView = new ClockSettingsView(this); |
89 settingsView->loadSettingsView(); |
99 settingsView->loadSettingsView(); |
|
100 OstTraceFunctionExit0( DATETIMESETTINGSVIEW_ONLAUNCHVIEW_EXIT ); |
90 } |
101 } |
91 |
102 |
92 /*! |
103 /*! |
93 Updates the second line i.e date & time. |
104 Updates the second line i.e date & time. |
94 */ |
105 */ |
95 void DateTimeSettingsView::updateDisplayTime() |
106 void DateTimeSettingsView::updateDisplayTime() |
96 { |
107 { |
|
108 OstTraceFunctionEntry0( DATETIMESETTINGSVIEW_UPDATEDISPLAYTIME_ENTRY ); |
97 HbExtendedLocale locale = HbExtendedLocale::system(); |
109 HbExtendedLocale locale = HbExtendedLocale::system(); |
98 QString timeInfo = locale.format( |
110 QString timeInfo = locale.format( |
99 QTime::currentTime(), r_qtn_time_usual_with_zero); |
111 QTime::currentTime(), r_qtn_time_usual_with_zero); |
100 QString dateinfo = locale.format( |
112 QString dateinfo = locale.format( |
101 QDate::currentDate(), r_qtn_date_usual_with_zero); |
113 QDate::currentDate(), r_qtn_date_usual_with_zero); |
104 displayString.append(" "); |
116 displayString.append(" "); |
105 displayString.append(dateinfo); |
117 displayString.append(dateinfo); |
106 setDescription(displayString); |
118 setDescription(displayString); |
107 // Start the Timer for 1 minute. |
119 // Start the Timer for 1 minute. |
108 mTickTimer->start(60000); |
120 mTickTimer->start(60000); |
|
121 OstTraceFunctionExit0( DATETIMESETTINGSVIEW_UPDATEDISPLAYTIME_EXIT ); |
109 } |
122 } |
110 |
123 |
111 /*! |
124 /*! |
112 createSettingView() |
125 createSettingView() |
113 */ |
126 */ |
114 CpBaseSettingView *DateTimeSettingsView::createSettingView() const |
127 CpBaseSettingView *DateTimeSettingsView::createSettingView() const |
115 { |
128 { |
|
129 OstTraceFunctionEntry0( DATETIMESETTINGSVIEW_CREATESETTINGVIEW_ENTRY ); |
|
130 OstTraceFunctionExit0( DATETIMESETTINGSVIEW_CREATESETTINGVIEW_EXIT ); |
116 return 0; |
131 return 0; |
117 } |
132 } |
118 |
133 |
119 // End of file --Don't remove this |
134 // End of file --Don't remove this |