diff --git a/data/launch/system b/data/launch/system index 8ff688c775..194db4cd8a 100644 --- a/data/launch/system +++ b/data/launch/system @@ -70,7 +70,7 @@ service x-vnd.Haiku-print_server { service x-vnd.Haiku-notification_server { launch /system/servers/notification_server no_safemode - legacy + on_demand } service x-vnd.Haiku-power_daemon { diff --git a/src/servers/notification/Jamfile b/src/servers/notification/Jamfile index def4c22604..b6d99df613 100644 --- a/src/servers/notification/Jamfile +++ b/src/servers/notification/Jamfile @@ -1,6 +1,6 @@ SubDir HAIKU_TOP src servers notification ; -UsePrivateHeaders notification ; +UsePrivateHeaders app notification ; Server notification_server : AppGroupView.cpp diff --git a/src/servers/notification/NotificationServer.cpp b/src/servers/notification/NotificationServer.cpp index ef1d49e626..5247ea3d40 100644 --- a/src/servers/notification/NotificationServer.cpp +++ b/src/servers/notification/NotificationServer.cpp @@ -1,11 +1,12 @@ /* - * Copyright 2010, Haiku, Inc. All Rights Reserved. + * Copyright 2010-2015, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: * Pier Luigi Fiorini, pierluigi.fiorini@gmail.com */ + #include #include #include @@ -13,6 +14,7 @@ #include "NotificationWindow.h" #include "NotificationServer.h" + const char* kSoundNames[] = { "Information notification", "Important notification", @@ -22,8 +24,9 @@ const char* kSoundNames[] = { }; -NotificationServer::NotificationServer() - : BApplication(kNotificationServerSignature) +NotificationServer::NotificationServer(status_t& error) + : + BServer(kNotificationServerSignature, true, &error) { } @@ -96,6 +99,9 @@ NotificationServer::ResolveSpecifier(BMessage* msg, int32 index, } +// #pragma mark - + + int main(int argc, char* argv[]) { @@ -106,8 +112,10 @@ main(int argc, char* argv[]) add_system_beep_event(kSoundNames[i++], 0); // Start! - NotificationServer server; - server.Run(); + status_t error; + NotificationServer server(error); + if (error == B_OK) + server.Run(); - return 0; + return error == B_OK ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/src/servers/notification/NotificationServer.h b/src/servers/notification/NotificationServer.h index 7a504fbf33..50122f57af 100644 --- a/src/servers/notification/NotificationServer.h +++ b/src/servers/notification/NotificationServer.h @@ -1,28 +1,33 @@ /* - * Copyright 2010, Haiku, Inc. All Rights Reserved. + * Copyright 2010-2015, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _NOTIFICATION_SERVER_H #define _NOTIFICATION_SERVER_H -#include + +#include + class NotificationWindow; -class NotificationServer : public BApplication { + +class NotificationServer : public BServer { public: - NotificationServer(); - virtual ~NotificationServer(); + NotificationServer(status_t& error); + virtual ~NotificationServer(); - virtual void ReadyToRun(); - virtual void MessageReceived(BMessage* message); + virtual void ReadyToRun(); + virtual void MessageReceived(BMessage* message); - virtual status_t GetSupportedSuites(BMessage* msg); - virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec, - int32 form, const char* prop); + virtual status_t GetSupportedSuites(BMessage* msg); + virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index, + BMessage* spec, int32 form, + const char* prop); private: - NotificationWindow* fWindow; + NotificationWindow* fWindow; }; + #endif // _NOTIFICATION_SERVER_H