Ticket #13689: 0001-Time-Preferences-Update-CalendarView-day-name-header.patch

File 0001-Time-Preferences-Update-CalendarView-day-name-header.patch, 2.3 KB (added by akshay, 7 years ago)

Time Preferences: update day name header in calendar view on locale preferences change.

  • src/preferences/time/DateTimeView.cpp

    From 98d5b7a87cbeddbf061f130a87c647da34d48794 Mon Sep 17 00:00:00 2001
    From: Akshay Agarwal <agarwal.akshay.akshay8@gmail.com>
    Date: Fri, 1 Sep 2017 20:51:02 +0530
    Subject: [PATCH] Time Preferences: Update CalendarView day name header on
     locale preferences change.
    
    ---
     src/preferences/time/DateTimeView.cpp | 5 +++++
     src/preferences/time/Time.cpp         | 2 ++
     src/preferences/time/TimeWindow.cpp   | 8 ++++++++
     3 files changed, 15 insertions(+)
    
    diff --git a/src/preferences/time/DateTimeView.cpp b/src/preferences/time/DateTimeView.cpp
    index abc7557..9f19b75 100644
    a b  
    2424#include <Entry.h>
    2525#include <File.h>
    2626#include <FindDirectory.h>
     27#include <LocaleRoster.h>
    2728#include <Message.h>
    2829#include <Path.h>
    2930#include <StringView.h>
    DateTimeView::MessageReceived(BMessage* message)  
    9394            }
    9495            break;
    9596
     97        case B_LOCALE_CHANGED:
     98            fCalendarView->UpdateDayNameHeader();
     99            break;
     100
    96101        case kDayChanged:
    97102        {
    98103            BMessage msg(*message);
  • src/preferences/time/Time.cpp

    diff --git a/src/preferences/time/Time.cpp b/src/preferences/time/Time.cpp
    index 21a65ea..ff32eee 100644
    a b  
    1818
    1919#include <Alert.h>
    2020#include <Catalog.h>
     21#include <LocaleRoster.h>
    2122
    2223#include "NetworkTimeView.h"
    2324#include "TimeMessages.h"
    TimeApplication::MessageReceived(BMessage* message)  
    7172    switch (message->what) {
    7273        case kSelectClockTab:
    7374        case kShowHideTime:
     75        case B_LOCALE_CHANGED:
    7476            fWindow->PostMessage(message);
    7577            break;
    7678
  • src/preferences/time/TimeWindow.cpp

    diff --git a/src/preferences/time/TimeWindow.cpp b/src/preferences/time/TimeWindow.cpp
    index c248628..da5c718 100644
    a b  
    1414#include <Button.h>
    1515#include <Catalog.h>
    1616#include <LayoutBuilder.h>
     17#include <LocaleRoster.h>
    1718#include <Message.h>
    1819#include <Screen.h>
    1920#include <SeparatorView.h>
    TTimeWindow::MessageReceived(BMessage* message)  
    7778            be_app->PostMessage(B_ABOUT_REQUESTED);
    7879            break;
    7980
     81        case B_LOCALE_CHANGED:
     82        {
     83            BLocaleRoster::Default()->Refresh();
     84            fDateTimeView->MessageReceived(message);
     85            break;
     86        }
     87
    8088        case kMsgRevert:
    8189            fDateTimeView->MessageReceived(message);
    8290            fTimeZoneView->MessageReceived(message);