~charlesk/indicator-datetime/lp-1424966-fix-ecanceled-errno-rtm-14.09

« back to all changes in this revision

Viewing changes to src/snap.cpp

Update the time strings when a powerd Wakeup signal is detected. Fixes: 1359802
Approved by: Ted Gould, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        b.add_hint (uin::Builder::HINT_TINT);
95
95
        b.add_hint (uin::Builder::HINT_NONSHAPEDICON);
96
96
 
97
 
        const auto timefmt = is_locale_12h() ? _("%a, %l:%M %p") : _("%a, %H:%M");
 
97
        const char * timefmt;
 
98
        if (is_locale_12h()) {
 
99
            /** strftime(3) format for abbreviated weekday,
 
100
                hours, minutes in a 12h locale; e.g. Wed, 2:00 PM */
 
101
            timefmt = _("%a, %l:%M %p");
 
102
        } else {
 
103
            /** A strftime(3) format for abbreviated weekday,
 
104
                hours, minutes in a 24h locale; e.g. Wed, 14:00 */
 
105
            timefmt = _("%a, %H:%M");
 
106
        }
98
107
        const auto timestr = appointment.begin.format(timefmt);
99
108
        auto title = g_strdup_printf(_("Alarm %s"), timestr.c_str());
100
109
        b.set_title (title);