Improved debug output in case adding the volume tray icon failed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15830 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-01-03 22:59:23 +00:00
parent fc62f08d8a
commit 41d9fd9ce4
+37 -35
View File
@@ -1,19 +1,12 @@
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ /*
// * Copyright (c) 2003-2005, Haiku, Inc.
// Copyright (c) 2003, OpenBeOS * Distributed under the terms of the MIT license.
// *
// This software is part of the OpenBeOS distribution and is covered * Authors:
// by the OpenBeOS license. * Sikosis, Jérôme Duval
// */
//
// File: MediaWindow.cpp
// Author: Sikosis, Jérôme Duval
// Description: Media Preferences
// Created : June 25, 2003
//
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
// Includes -------------------------------------------------------------------------------------------------- //
#include <MediaTheme.h> #include <MediaTheme.h>
#include <MediaRoster.h> #include <MediaRoster.h>
#include <Alert.h> #include <Alert.h>
@@ -486,30 +479,39 @@ MediaWindow::MessageReceived (BMessage *message)
} }
break; break;
case ML_RESTART_MEDIA_SERVER: case ML_RESTART_MEDIA_SERVER:
{ {
thread_id tid; thread_id thread = spawn_thread(&MediaWindow::RestartMediaServices,
tid = spawn_thread(&MediaWindow::RestartMediaServices, "restart_thread", B_NORMAL_PRIORITY, this); "restart_thread", B_NORMAL_PRIORITY, this);
if(tid<B_OK) if (thread < B_OK)
fprintf(stderr, "couldn't create restart thread\n"); fprintf(stderr, "couldn't create restart thread\n");
resume_thread(tid); else
} resume_thread(thread);
break; break;
}
case ML_SHOW_VOLUME_CONTROL: case ML_SHOW_VOLUME_CONTROL:
{ {
BDeskbar deskbar; BDeskbar deskbar;
if(mAudioView->mVolumeCheckBox->Value()==B_CONTROL_ON) { if (mAudioView->mVolumeCheckBox->Value() == B_CONTROL_ON) {
BEntry entry("/bin/desklink", true); BEntry entry("/bin/desklink", true);
int32 id; int32 id;
entry_ref ref; entry_ref ref;
entry.GetRef(&ref); status_t status = entry.GetRef(&ref);
if(deskbar.AddItem(&ref, &id)!=B_OK) if (status == B_OK)
fprintf(stderr, "Couldn't add Volume control in Deskbar\n"); status = deskbar.AddItem(&ref, &id);
} else {
if(deskbar.RemoveItem("MediaReplicant")!=B_OK) if (status != B_OK) {
fprintf(stderr, "Couldn't remove Volume control in Deskbar\n"); fprintf(stderr, "Couldn't add Volume control in Deskbar: %s\n",
} strerror(status));
}
} else {
status_t status = deskbar.RemoveItem("MediaReplicant");
if (status != B_OK) {
fprintf(stderr, "Couldn't remove Volume control in Deskbar: %s\n",
strerror(status));
}
} }
break; break;
}
case ML_ENABLE_REAL_TIME: case ML_ENABLE_REAL_TIME:
{ {
bool isVideo = true; bool isVideo = true;