diff options
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r-- | linden/indra/newview/llpanelavatar.cpp | 61 |
1 files changed, 39 insertions, 22 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index e3fe141..8854986 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp | |||
@@ -1004,6 +1004,15 @@ void LLPanelAvatarPicks::refresh() | |||
1004 | childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); | 1004 | childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); |
1005 | 1005 | ||
1006 | sendAvatarProfileRequestIfNeeded("avatarpicksrequest"); | 1006 | sendAvatarProfileRequestIfNeeded("avatarpicksrequest"); |
1007 | |||
1008 | for (int i = 0; i < tab_count; ++i) | ||
1009 | { | ||
1010 | LLTabContainer::LLTabTuple* tab = tabs->getTab(i); | ||
1011 | if (tab) | ||
1012 | { | ||
1013 | tab->mButton->setToolTip(tabs->getPanelTitle(i)); | ||
1014 | } | ||
1015 | } | ||
1007 | } | 1016 | } |
1008 | 1017 | ||
1009 | 1018 | ||
@@ -1951,29 +1960,37 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1951 | self->mPanelSecondLife->childSetValue("acct", caption_text); | 1960 | self->mPanelSecondLife->childSetValue("acct", caption_text); |
1952 | 1961 | ||
1953 | //Chalice - Show avatar age in days. | 1962 | //Chalice - Show avatar age in days. |
1954 | S32 year; | 1963 | S32 year = 0; |
1955 | S32 month; | 1964 | S32 month = 0; |
1956 | S32 day; | 1965 | S32 day = 0; |
1957 | sscanf(born_on.c_str(), "%d/%d/%d", &month, &day, &year); | 1966 | sscanf(born_on.c_str(), "%d/%d/%d", &month, &day, &year); |
1958 | time_t now = time(NULL); | 1967 | if (year == 0 || month == 0 || day == 0) |
1959 | struct tm * timeinfo; | 1968 | { |
1960 | timeinfo = localtime(&now); | 1969 | // In case the string sent gets screwed up. It happens -- MC |
1961 | timeinfo->tm_mon = --month; | 1970 | born_on = self->mPanelSecondLife->getString("invalid"); |
1962 | timeinfo->tm_year = year - 1900; | 1971 | } |
1963 | timeinfo->tm_mday = day; | 1972 | else |
1964 | time_t birth = mktime(timeinfo); | 1973 | { |
1965 | 1974 | time_t now = time(NULL); | |
1966 | std::stringstream numberString; | 1975 | struct tm * timeinfo; |
1967 | S32 days = difftime(now, birth) / 86400; //(60*60*24) | 1976 | timeinfo = localtime(&now); |
1968 | if (days < 0) days = 0; // Happens for people on different timezones -- MC | 1977 | timeinfo->tm_mon = --month; |
1969 | numberString << days; | 1978 | timeinfo->tm_year = year - 1900; |
1970 | 1979 | timeinfo->tm_mday = day; | |
1971 | LLStringUtil::format_map_t targs; | 1980 | time_t birth = mktime(timeinfo); |
1972 | targs["[DAYS]"] = numberString.str(); | 1981 | |
1973 | std::string born_msg = self->mPanelSecondLife->getString("days_old_text"); | 1982 | std::stringstream numberString; |
1974 | LLStringUtil::format(born_msg, targs); | 1983 | S32 days = difftime(now, birth) / 86400; //(60*60*24) |
1975 | born_on += " "; | 1984 | if (days < 0) days = 0; // Happens for people on different timezones -- MC |
1976 | born_on += born_msg; | 1985 | numberString << days; |
1986 | |||
1987 | LLStringUtil::format_map_t targs; | ||
1988 | targs["[DAYS]"] = numberString.str(); | ||
1989 | std::string born_msg = self->mPanelSecondLife->getString("days_old_text"); | ||
1990 | LLStringUtil::format(born_msg, targs); | ||
1991 | born_on += " "; | ||
1992 | born_on += born_msg; | ||
1993 | } | ||
1977 | self->mPanelSecondLife->childSetValue("born", born_on); | 1994 | self->mPanelSecondLife->childSetValue("born", born_on); |
1978 | 1995 | ||
1979 | EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; | 1996 | EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; |