3cf2d117e5
Added two new methods to the Locale Kit in order to create a custom time formats from a format string. One method is outputs into a char* array, the other into a BString() and you can set the timezone. These methods should be cleaned up, we only need 2, one to get the time in a predefined style, the other to get a custom time format. Also should probably do the same for dates and datetimes. But I'll let this go for now. I added myself to the Locale.cpp file. I retained the copyright instead of assigning it to Haiku, Inc. because the file is under the OpenBeOS license and I don't know what the concequences of copyright sharing are for that license, unlike MIT. These new methods are used to generate custom time formats in Deskbar. Instead of using a set of Radio Buttons to choose between the predefined time options I build my own by creating a format string and passing it to the Locale Kit. The format string is generated from 3 checkboxes, show seconds, show day of week, and show time zone. You can mix and match between them choose any that you like. By default they are all off. There are 3 new deskbar settings associated with these new options: showSeconds, showDayOfWeek, and showTimeZone. timeFormat has gone away. The time format string gets cached and updated only when Update() gets called on the TimeView class. In order to fit all the options in (there is 1 more than before) I had to reduce the font size of the clock to 11pt when all options are turned on in 12 hour mode. For those with no imagination it looks like this: http://imagebin.org/208162 Renamed "Open time preferences..." menuitem to "Time preferences...". Renamed "Show Time" and "Hide Time" to "Show time" and "Hide time". Other changes include refactoring the header files a bit. There were a lot of headers included by header files uneccessarily. For instance BarWindow.h now only includes <Window.h> and <Deskbar.h>. This change is mainly to to speed up the compile time since it takes a while right now. I copy the fBarView pointer from BarWindow in the BarApp constructor and then use that throughout the file rather than getting the pointer from the window each time by calling BarView(). BarView() is still available in the header for other classes though. I moved some message constants around since it was getting a bit jumbled. Most of the messages related to settings are in PreferenceWindow.h. fChangeState is moved to BarView.h since that is where the ChangeState() function is and BarView.cpp uses that constant. The time interval and format constants are in TimeView.h. Make some methods public in their respective classes where it made sense. The preference window methods to update dependent items are public, that might get called from BarWindow when a message gets received at some point. Also made ShowHideTime() and Time() public in StatusView.h. These methods activate showing and hiding the clock and return the fTime clock object. No reason they should be private. I reindented the StatusView.h and PreferenceWindow.h headers to the standard style. Question here, are the public: protected: and private: lines inside of classes suppose to get indented 1 tab or not? I've seen both, the style guide says no indent but 1 indent seems reasonable and looks pretty good. Style fixes here and there. That's enough for one commit I think. |
||
---|---|---|
.. | ||
build | ||
compatibility | ||
config | ||
cpp | ||
glibc | ||
libs | ||
os | ||
posix | ||
private | ||
tools |