- ..! Send main window creation also when there is acually a sever

- Check periodically its existence each 2 seconds before launching the preflet



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36023 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2010-04-02 10:24:16 +00:00
parent 470ca9dab6
commit 2168c373a2
+28 -24
View File
@@ -38,7 +38,6 @@ BluetoothApplication::ReadyToRun()
switch (choice) { switch (choice) {
case 1: case 1:
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
return;
case 2: case 2:
{ {
status_t error; status_t error;
@@ -50,18 +49,40 @@ BluetoothApplication::ReadyToRun()
// a BMessenger to yourself and the BT server could // a BMessenger to yourself and the BT server could
// use that messenger to send back a reply indicating // use that messenger to send back a reply indicating
// when it's ready and you could just create window // when it's ready and you could just create window
// when you get that
BMessageRunner::StartSending(be_app_messenger, BMessageRunner::StartSending(be_app_messenger,
new BMessage('Xtmp'), 2 * 1000000, 1); new BMessage('Xtmp'), 2 * 1000000, 1);
break;
} }
default:
PostMessage(new BMessage('Xtmp'));
break;
} }
return;
} }
PostMessage(new BMessage('Xtmp'));
}
void
BluetoothApplication::MessageReceived(BMessage* message)
{
switch (message->what) {
case kMsgAddToRemoteList:
fWindow->PostMessage(message);
break;
case 'Xtmp':
if (!be_roster->IsRunning(BLUETOOTH_SIGNATURE)) {
// Give another chance
BMessageRunner::StartSending(be_app_messenger,
new BMessage('Xtmp'), 2 * 1000000, 1);
} else {
fWindow = new BluetoothWindow(BRect(100, 100, 550, 420));
fWindow->Show();
}
break;
default:
BApplication::MessageReceived(message);
}
} }
@@ -103,23 +124,6 @@ BluetoothApplication::AboutRequested()
} }
void
BluetoothApplication::MessageReceived(BMessage* message)
{
switch (message->what) {
case kMsgAddToRemoteList:
fWindow->PostMessage(message);
break;
case 'Xtmp':
fWindow = new BluetoothWindow(BRect(100, 100, 550, 420));
fWindow->Show();
break;
default:
BApplication::MessageReceived(message);
}
}
int int
main(int, char**) main(int, char**)
{ {