FirstBootPrompt: launch installer/desktop targets directly.
* No need for shell scripting here.
This commit is contained in:
+5
-3
@@ -11,9 +11,11 @@ target desktop {
|
||||
}
|
||||
|
||||
target first_boot {
|
||||
job x-vnd.Haiku-FirstBootPrompt {
|
||||
legacy
|
||||
}
|
||||
job x-vnd.Haiku-FirstBootPrompt
|
||||
}
|
||||
|
||||
target installer {
|
||||
job x-vnd.Haiku-Installer
|
||||
}
|
||||
|
||||
run {
|
||||
|
||||
@@ -22,7 +22,10 @@ public:
|
||||
port_id GetPort(const char* signature,
|
||||
const char* name);
|
||||
|
||||
status_t Target(const char* name, BMessage& data,
|
||||
status_t Target(const char* name, const BMessage& data,
|
||||
const char* baseName = NULL);
|
||||
status_t Target(const char* name,
|
||||
const BMessage* data = NULL,
|
||||
const char* baseName = NULL);
|
||||
|
||||
status_t StartSession(const char* login);
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "BootPrompt.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Catalog.h>
|
||||
#include <LaunchRoster.h>
|
||||
#include <Locale.h>
|
||||
|
||||
#include "BootPromptWindow.h"
|
||||
@@ -43,10 +45,12 @@ BootPromptApp::MessageReceived(BMessage* message)
|
||||
{
|
||||
switch (message->what) {
|
||||
case MSG_BOOT_DESKTOP:
|
||||
BLaunchRoster().Target("desktop");
|
||||
sExitValue = 1;
|
||||
PostMessage(B_QUIT_REQUESTED);
|
||||
break;
|
||||
case MSG_RUN_INSTALLER:
|
||||
BLaunchRoster().Target("installer");
|
||||
sExitValue = 0;
|
||||
PostMessage(B_QUIT_REQUESTED);
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SubDir HAIKU_TOP src apps firstbootprompt ;
|
||||
|
||||
UsePrivateHeaders interface locale shared ;
|
||||
UsePrivateHeaders app interface locale shared ;
|
||||
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src preferences keymap ] ;
|
||||
|
||||
|
||||
@@ -146,7 +146,16 @@ BLaunchRoster::GetPort(const char* signature, const char* name)
|
||||
|
||||
|
||||
status_t
|
||||
BLaunchRoster::Target(const char* name, BMessage& data, const char* baseName)
|
||||
BLaunchRoster::Target(const char* name, const BMessage& data,
|
||||
const char* baseName)
|
||||
{
|
||||
return Target(name, &data, baseName);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BLaunchRoster::Target(const char* name, const BMessage* data,
|
||||
const char* baseName)
|
||||
{
|
||||
if (name == NULL)
|
||||
return B_BAD_VALUE;
|
||||
@@ -155,8 +164,8 @@ BLaunchRoster::Target(const char* name, BMessage& data, const char* baseName)
|
||||
status_t status = request.AddInt32("user", getuid());
|
||||
if (status == B_OK)
|
||||
status = request.AddString("target", name);
|
||||
if (status == B_OK && !data.IsEmpty())
|
||||
status = request.AddMessage("data", &data);
|
||||
if (status == B_OK && data != NULL && !data->IsEmpty())
|
||||
status = request.AddMessage("data", data);
|
||||
if (status == B_OK && baseName != NULL)
|
||||
status = request.AddString("base target", baseName);
|
||||
if (status != B_OK)
|
||||
|
||||
Reference in New Issue
Block a user