Add a button to open Time preferences from Deskbar

preferences in the Clock section.
This commit is contained in:
John Scipione 2012-04-15 01:45:05 -04:00
parent 3cf2d117e5
commit a81ab45891
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <LayoutBuilder.h>
#include <OpenWithTracker.h>
#include <RadioButton.h>
#include <Roster.h>
#include <SeparatorView.h>
#include <Slider.h>
#include <StringView.h>
@ -286,6 +287,8 @@ PreferencesWindow::PreferencesWindow(BRect frame)
.Add(fShowDayOfWeek)
.Add(fShowTimeZone)
.End()
.Add(new BButton(B_TRANSLATE("Time preferences" B_UTF8_ELLIPSIS),
new BMessage(kTimePreferences)))
.AddGlue()
.SetInsets(10, 10, 10, 10)
.End()
@ -334,6 +337,11 @@ PreferencesWindow::MessageReceived(BMessage* message)
EnableDisableDependentItems();
break;
case kTimePreferences:
// launch the time prefs app
be_roster->Launch("application/x-vnd.Haiku-Time");
break;
default:
BWindow::MessageReceived(message);
break;

View File

@ -28,6 +28,7 @@ const uint32 kTimeIntervalChanged = 'TiCh';
const uint32 kShowSeconds = 'SwSc';
const uint32 kShowDayOfWeek = 'SwDw';
const uint32 kShowTimeZone = 'SwTz';
const uint32 kTimePreferences = 'TmPr';
class BBox;
class BButton;