diff --git a/src/apps/softwareupdater/SoftwareUpdaterWindow.cpp b/src/apps/softwareupdater/SoftwareUpdaterWindow.cpp index c0f211a6ac..43c38f28e7 100644 --- a/src/apps/softwareupdater/SoftwareUpdaterWindow.cpp +++ b/src/apps/softwareupdater/SoftwareUpdaterWindow.cpp @@ -28,8 +28,8 @@ #define B_TRANSLATION_CONTEXT "SoftwareUpdater" -const uint32 UPDATE_MESSAGE = 'iUPD'; -const uint32 EXIT_MESSAGE = 'iEXT'; +const uint32 kMsgUpdate = 'iUPD'; +const uint32 kMsgExit = 'iEXT'; SoftwareUpdaterWindow::SoftwareUpdaterWindow() @@ -50,10 +50,10 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow() fStripeView = new StripeView(icon); BButton* updateButton = new BButton("Update now", - new BMessage(UPDATE_MESSAGE)); + new BMessage(kMsgUpdate)); BButton* exitButton = new BButton("Cancel", - new BMessage(EXIT_MESSAGE)); + new BMessage(kMsgExit)); // Form text based on updates available BStringView* headerView; @@ -118,3 +118,18 @@ SoftwareUpdaterWindow::QuitRequested() be_app->PostMessage(B_QUIT_REQUESTED); return true; } + + +void +SoftwareUpdaterWindow::MessageReceived(BMessage* message) +{ + switch (message->what) { + case kMsgExit: + QuitRequested(); + break; + case kMsgUpdate: + break; + default: + BWindow::MessageReceived(message); + } +} diff --git a/src/apps/softwareupdater/SoftwareUpdaterWindow.h b/src/apps/softwareupdater/SoftwareUpdaterWindow.h index 41e39820d0..fb3d979b76 100644 --- a/src/apps/softwareupdater/SoftwareUpdaterWindow.h +++ b/src/apps/softwareupdater/SoftwareUpdaterWindow.h @@ -22,6 +22,8 @@ public: ~SoftwareUpdaterWindow(); bool QuitRequested(); + void MessageReceived(BMessage* message); + private: StripeView* fStripeView; app_info* fAppInfo;