aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/viewertime.h
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-07-30 17:08:24 -0700
committerMcCabe Maxsted2010-07-30 17:08:24 -0700
commitc5b42b7e783743203d08cc69ac922431cfd58e4d (patch)
tree3125fd9590c3400d87481188aaab50de4b71650b /linden/indra/newview/viewertime.h
parentDon't play typing anim when using a default channel other than 0 (diff)
downloadmeta-impy-c5b42b7e783743203d08cc69ac922431cfd58e4d.zip
meta-impy-c5b42b7e783743203d08cc69ac922431cfd58e4d.tar.gz
meta-impy-c5b42b7e783743203d08cc69ac922431cfd58e4d.tar.bz2
meta-impy-c5b42b7e783743203d08cc69ac922431cfd58e4d.tar.xz
Added option in Preferences > General for setting the default time to 12 hour/24 hour/UTC. Side effects: moved crash logger settings to advanced prefs, fixed french date translations, past/future dates and times still need to be correctly formatted
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/viewertime.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/linden/indra/newview/viewertime.h b/linden/indra/newview/viewertime.h
new file mode 100644
index 0000000..525a2bc
--- /dev/null
+++ b/linden/indra/newview/viewertime.h
@@ -0,0 +1,88 @@
1/**
2* @file viewertime.h
3* @brief sets the viewer time and time format
4*
5* $LicenseInfo:firstyear=2009&license=viewergpl$
6*
7* Copyright (c) 2010, McCabe Maxsted
8*
9* Imprudence Viewer Source Code
10* The source code in this file ("Source Code") is provided to you
11* under the terms of the GNU General Public License, version 2.0
12* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
13* this distribution, or online at
14* http://secondlifegrid.net/programs/open_source/licensing/gplv2
15*
16* There are special exceptions to the terms and conditions of the GPL as
17* it is applied to this Source Code. View the full text of the exception
18* in the file doc/FLOSS-exception.txt in this software distribution, or
19* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
20*
21* By copying, modifying or distributing this software, you acknowledge
22* that you have read and understood your obligations described above,
23* and agree to abide by those obligations.
24*
25* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
26* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27* COMPLETENESS OR PERFORMANCE.
28* $/LicenseInfo$
29*/
30
31#ifndef VIEWERTIME_H
32#define VIEWERTIME_H
33
34
35class ViewerTime
36{
37public:
38 ViewerTime();
39 ~ViewerTime();
40
41 // Per-frame refresh of the time and date (called in LLStatusBar)
42 void refresh();
43
44 std::string getDayOfWeek(const U32& day_num);
45 std::string getMonth(const U32& month_num);
46
47 std::string getCurDay() { return mDay; }
48 std::string getCurMonth() { return mMonth; }
49 S32 getCurDayNum() { return mDayNum; }
50
51 S32 getCurHour() { return mHour; }
52 S32 getCurMin() { return mMinute; }
53 S32 getCurSec() { return mSecond; }
54
55 std::string getCurAMPM() { return mAMPM; }
56 std::string getCurTZ() { return mTZ; }
57 std::string getCurTimeStr() { return mTimeStr; }
58 std::string getCurDateStr() { return mDateStr; }
59
60 static bool sUse24HourTime;
61 static bool sUseUTCTime;
62
63 void updateTimeFormat(const U32& index);
64
65private:
66 // simple method to setup the part that holds the date
67 void setupDate();
68
69 S32 mHour;
70 S32 mMinute;
71 S32 mSecond;
72 std::string mTZ;
73 std::string mAMPM;
74 std::string mTimeStr;
75 std::string mDay;
76 S32 mDayNum;
77 std::string mMonth;
78 S32 mYear;
79 std::string mDateStr;
80
81 static std::vector<std::string> sDays;
82 static std::vector<std::string> sMonths;
83 static const U32 MAX_DATE_STRING_LENGTH;
84};
85
86extern ViewerTime* gViewerTime;
87
88#endif // VIEWERTIME_H