Added server notification

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5087 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-10-18 23:58:59 +00:00
parent 6d6540131a
commit 01490aa446
2 changed files with 11 additions and 21 deletions
+10 -20
View File
@@ -684,30 +684,20 @@ void APRView::SetDefaults(void)
void APRView::NotifyServer(void) void APRView::NotifyServer(void)
{ {
// Send a message to the app_server with the settings which we have. // Send a message to the app_server with the settings which we have.
// While it might be worthwhile to someday have a separate protocol for
// updating just one color, for now, we just need something to get things port_id port=find_port(SERVER_PORT_NAME);
// done. Extract all the colors from the settings BMessage, attach them
// to a PortLink message and fire it off to the server.
// For now, we do not have the OBOS app_server, so we simply do what if(port!=B_NAME_NOT_FOUND)
// we can with tbe R5 server
rgb_color col;
// Set menu color
menu_info minfo;
get_menu_info(&minfo);
col=currentset->StringToColor("Menu Background").GetColor32();
if(col.alpha==0 && col.red==0 && col.green==0 && col.blue==0)
{ {
// do nothing STRACE(("Notifying app_server\n"));
} PortLink link(port);
else
{ link.SetOpCode(AS_SET_UI_COLORS);
minfo.background_color=col; link.Attach<ColorSet>(*currentset);
set_menu_info(&minfo); link.Flush();
} }
// We also need to send the message to the window so that the Decorators tab updates itself
if(Window()) if(Window())
Window()->PostMessage(SET_UI_COLORS); Window()->PostMessage(SET_UI_COLORS);
} }
+1 -1
View File
@@ -57,7 +57,7 @@ public:
void LoadSettings(void); void LoadSettings(void);
void SetDefaults(void); void SetDefaults(void);
void NotifyServer(void); void NotifyServer(void);
// rgb_color GetColorFromMessage(BMessage *msg, const char *name, int32 index=0);
protected: protected:
friend APRWindow; friend APRWindow;
void UpdateControlsFromAttr(const char *string); void UpdateControlsFromAttr(const char *string);