Media: add icon to media server restart notification

Use the media preferences icon for lack of anything more specific.
This commit is contained in:
Adrien Destugues 2014-12-19 10:07:28 +01:00
parent a882137926
commit 21d247bb58
3 changed files with 20 additions and 7 deletions

View File

@ -21,7 +21,7 @@
Media::Media() Media::Media()
: :
BApplication("application/x-vnd.Haiku-Media"), BApplication(kApplicationSignature),
fIcons(), fIcons(),
fWindow(NULL) fWindow(NULL)
{ {

View File

@ -17,6 +17,9 @@
#include <Locale.h> #include <Locale.h>
static const char* kApplicationSignature = "application/x-vnd.Haiku-Media";
class Media : public BApplication { class Media : public BApplication {
public: public:
Media(); Media();

View File

@ -21,6 +21,7 @@
#include <Catalog.h> #include <Catalog.h>
#include <Debug.h> #include <Debug.h>
#include <Deskbar.h> #include <Deskbar.h>
#include <IconUtils.h>
#include <LayoutBuilder.h> #include <LayoutBuilder.h>
#include <Locale.h> #include <Locale.h>
#include <MediaRoster.h> #include <MediaRoster.h>
@ -36,6 +37,7 @@
#include <String.h> #include <String.h>
#include <TextView.h> #include <TextView.h>
#include "Media.h"
#include "MediaIcons.h" #include "MediaIcons.h"
#include "MidiSettingsView.h" #include "MidiSettingsView.h"
@ -676,12 +678,20 @@ MediaWindow::_UpdateProgress(int stage, const char* message, void* cookie)
void void
MediaWindow::_Notify(float progress, const char* message) MediaWindow::_Notify(float progress, const char* message)
{ {
BNotification info(B_PROGRESS_NOTIFICATION); BNotification notification(B_PROGRESS_NOTIFICATION);
info.SetMessageID(MEDIA_SERVICE_NOTIFICATION_ID); notification.SetMessageID(MEDIA_SERVICE_NOTIFICATION_ID);
info.SetProgress(progress); notification.SetProgress(progress);
info.SetTitle(B_TRANSLATE("Media Service")); notification.SetGroup(B_TRANSLATE("Media Service"));
info.SetContent(message); notification.SetContent(message);
info.Send();
app_info info;
be_roster->GetAppInfo(kApplicationSignature, &info);
BBitmap icon(BRect(0, 0, 32, 32), B_RGBA32);
BNode node(&info.ref);
BIconUtils::GetVectorIcon(&node, "BEOS:ICON", &icon);
notification.SetIcon(&icon);
notification.Send();
} }