From a13df0dc01b4f961be77fbb11ed08d177a4bae43 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 9 Jul 2005 20:23:28 +0000 Subject: [PATCH] Added a "confirm" parameter to BRoster::Shutdown() which causes the registrar to ask the user to confirm shutting down the system. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13563 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- docs/develop/servers/registrar/Protocols | 1 + headers/os/app/Roster.h | 2 +- headers/private/app/RosterPrivate.h | 4 ++-- src/bin/shutdown.cpp | 8 +++++++- src/kits/app/Roster.cpp | 6 +++++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/develop/servers/registrar/Protocols b/docs/develop/servers/registrar/Protocols index 7b6b89e807..d57039875c 100644 --- a/docs/develop/servers/registrar/Protocols +++ b/docs/develop/servers/registrar/Protocols @@ -73,6 +73,7 @@ on error: - B_NO_REPLY (fatal) message fields: - "reboot": If true, the system reboots instead of turning the power off. +- "confirm": If true, the user will be asked to confirm to shut down the system. ----------------------------------------------------------------------- diff --git a/headers/os/app/Roster.h b/headers/os/app/Roster.h index b2d7b0c1d9..d92dc77e96 100644 --- a/headers/os/app/Roster.h +++ b/headers/os/app/Roster.h @@ -143,7 +143,7 @@ private: class ArgVector; friend class Private; - status_t ShutDown(bool reboot); + status_t ShutDown(bool reboot, bool confirm); status_t AddApplication(const char *mimeSig, const entry_ref *ref, uint32 flags, team_id team, thread_id thread, diff --git a/headers/private/app/RosterPrivate.h b/headers/private/app/RosterPrivate.h index bf7931abae..94525ac5ad 100644 --- a/headers/private/app/RosterPrivate.h +++ b/headers/private/app/RosterPrivate.h @@ -20,8 +20,8 @@ public: status_t SendTo(BMessage *message, BMessage *reply, bool mime); bool IsMessengerValid(bool mime) const; - status_t ShutDown(bool reboot) - { return fRoster->ShutDown(reboot); } + status_t ShutDown(bool reboot, bool confirm) + { return fRoster->ShutDown(reboot, confirm); } // needed by BApplication diff --git a/src/bin/shutdown.cpp b/src/bin/shutdown.cpp index ee06bd9c34..431a8a2a43 100644 --- a/src/bin/shutdown.cpp +++ b/src/bin/shutdown.cpp @@ -13,6 +13,7 @@ // This program behaves identically as the BeOS R5 version, with these // added arguments: // +// -a asks the user to confirm the shutdown // -c cancels any running shutdown // // Some code from Shard's Archiver from BeBits (was BSD/MIT too :). @@ -81,6 +82,7 @@ usage(const char *arg0) fprintf(stderr, "usage: %s [-rqca] [-d time]\n" "\t-r reboot,\n" "\t-q quick shutdown (don't broadcast apps),\n" + "\t-a ask user to confirm the shutdown (ignored when -q is given),\n" "\t-c cancel a running shutdown,\n" "\t-d delay shutdown by