- ..! 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:
parent
470ca9dab6
commit
2168c373a2
@ -38,7 +38,6 @@ BluetoothApplication::ReadyToRun()
|
||||
switch (choice) {
|
||||
case 1:
|
||||
PostMessage(B_QUIT_REQUESTED);
|
||||
return;
|
||||
case 2:
|
||||
{
|
||||
status_t error;
|
||||
@ -50,18 +49,40 @@ BluetoothApplication::ReadyToRun()
|
||||
// a BMessenger to yourself and the BT server could
|
||||
// use that messenger to send back a reply indicating
|
||||
// when it's ready and you could just create window
|
||||
// when you get that
|
||||
BMessageRunner::StartSending(be_app_messenger,
|
||||
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
|
||||
main(int, char**)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user