Debugger: Implement part of #12729.
TeamsWindow: - Add a button allowing one to specify loading a core file in addition to attaching to/creating teams. - Slight layout tweak.
This commit is contained in:
@@ -444,6 +444,27 @@ Debugger::MessageReceived(BMessage* message)
|
|||||||
message->SendReply(&reply);
|
message->SendReply(&reply);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case MSG_LOAD_CORE_TEAM:
|
||||||
|
{
|
||||||
|
TargetHostInterface* interface;
|
||||||
|
if (message->FindPointer("interface", reinterpret_cast<void**>(
|
||||||
|
&interface)) != B_OK) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry_ref ref;
|
||||||
|
if (message->FindRef("core", &ref) != B_OK)
|
||||||
|
break;
|
||||||
|
|
||||||
|
BPath path(&ref);
|
||||||
|
if (path.InitCheck() != B_OK)
|
||||||
|
break;
|
||||||
|
|
||||||
|
Options options;
|
||||||
|
options.coreFilePath = path.Path();
|
||||||
|
_HandleOptions(options);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message);
|
BApplication::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ enum {
|
|||||||
MSG_START_TEAM_WINDOW_CLOSED = 'stwc',
|
MSG_START_TEAM_WINDOW_CLOSED = 'stwc',
|
||||||
MSG_START_NEW_TEAM = 'sttt',
|
MSG_START_NEW_TEAM = 'sttt',
|
||||||
MSG_DEBUG_THIS_TEAM = 'dbtt',
|
MSG_DEBUG_THIS_TEAM = 'dbtt',
|
||||||
|
MSG_LOAD_CORE_TEAM = 'lcte',
|
||||||
MSG_SHOW_INSPECTOR_WINDOW = 'sirw',
|
MSG_SHOW_INSPECTOR_WINDOW = 'sirw',
|
||||||
MSG_INSPECTOR_WINDOW_CLOSED = 'irwc',
|
MSG_INSPECTOR_WINDOW_CLOSED = 'irwc',
|
||||||
MSG_SHOW_EXPRESSION_WINDOW = 'seww',
|
MSG_SHOW_EXPRESSION_WINDOW = 'seww',
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
|
#include <FilePanel.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <LayoutBuilder.h>
|
#include <LayoutBuilder.h>
|
||||||
#include <ListView.h>
|
#include <ListView.h>
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MSG_TEAM_SELECTION_CHANGED = 'tesc'
|
MSG_TEAM_SELECTION_CHANGED = 'tesc',
|
||||||
|
MSG_CHOSE_CORE_FILE = 'chcf'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -42,6 +44,8 @@ TeamsWindow::TeamsWindow(SettingsManager* settingsManager)
|
|||||||
fTeamsListView(NULL),
|
fTeamsListView(NULL),
|
||||||
fAttachTeamButton(NULL),
|
fAttachTeamButton(NULL),
|
||||||
fCreateTeamButton(NULL),
|
fCreateTeamButton(NULL),
|
||||||
|
fLoadCoreButton(NULL),
|
||||||
|
fCoreSelectionPanel(NULL),
|
||||||
fSettingsManager(settingsManager)
|
fSettingsManager(settingsManager)
|
||||||
{
|
{
|
||||||
team_info info;
|
team_info info;
|
||||||
@@ -128,6 +132,39 @@ TeamsWindow::MessageReceived(BMessage* message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case MSG_CHOSE_CORE_FILE:
|
||||||
|
case B_CANCEL:
|
||||||
|
{
|
||||||
|
delete fCoreSelectionPanel;
|
||||||
|
fCoreSelectionPanel = NULL;
|
||||||
|
if (message->what == B_CANCEL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
entry_ref ref;
|
||||||
|
if (message->FindRef("refs", &ref) != B_OK)
|
||||||
|
break;
|
||||||
|
|
||||||
|
BMessage coreMessage(MSG_LOAD_CORE_TEAM);
|
||||||
|
coreMessage.AddPointer("interface", fTargetHostInterface);
|
||||||
|
coreMessage.AddRef("core", &ref);
|
||||||
|
be_app_messenger.SendMessage(&coreMessage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MSG_LOAD_CORE_TEAM:
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
BMessenger messenger(this);
|
||||||
|
fCoreSelectionPanel = new BFilePanel(B_OPEN_PANEL, &messenger,
|
||||||
|
NULL, 0, false, new BMessage(MSG_CHOSE_CORE_FILE));
|
||||||
|
fCoreSelectionPanel->Show();
|
||||||
|
} catch (...) {
|
||||||
|
delete fCoreSelectionPanel;
|
||||||
|
fCoreSelectionPanel = NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
@@ -166,13 +203,16 @@ TeamsWindow::_Init()
|
|||||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||||
.Add(fTeamsListView = new TeamsListView("TeamsList", fCurrentTeam,
|
.Add(fTeamsListView = new TeamsListView("TeamsList", fCurrentTeam,
|
||||||
fTargetHostInterface))
|
fTargetHostInterface))
|
||||||
.SetInsets(1.0f, 1.0f, 1.0f, 1.0f)
|
.SetInsets(1.0f, 1.0f, 1.0f, 5.0f)
|
||||||
.AddGroup(B_HORIZONTAL)
|
.AddGroup(B_HORIZONTAL)
|
||||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
.Add(fAttachTeamButton = new BButton("Attach", new BMessage(
|
.Add(fAttachTeamButton = new BButton("Attach", new BMessage(
|
||||||
MSG_DEBUG_THIS_TEAM)))
|
MSG_DEBUG_THIS_TEAM)))
|
||||||
|
.AddGlue()
|
||||||
.Add(fCreateTeamButton = new BButton("Start new team"
|
.Add(fCreateTeamButton = new BButton("Start new team"
|
||||||
B_UTF8_ELLIPSIS, new BMessage(MSG_SHOW_START_TEAM_WINDOW)))
|
B_UTF8_ELLIPSIS, new BMessage(MSG_SHOW_START_TEAM_WINDOW)))
|
||||||
|
.Add(fLoadCoreButton = new BButton("Load core" B_UTF8_ELLIPSIS,
|
||||||
|
new BMessage(MSG_LOAD_CORE_TEAM)))
|
||||||
.End()
|
.End()
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
@@ -182,6 +222,7 @@ TeamsWindow::_Init()
|
|||||||
|
|
||||||
fAttachTeamButton->SetEnabled(false);
|
fAttachTeamButton->SetEnabled(false);
|
||||||
fCreateTeamButton->SetTarget(this);
|
fCreateTeamButton->SetTarget(this);
|
||||||
|
fLoadCoreButton->SetTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
class BButton;
|
class BButton;
|
||||||
class BListView;
|
class BListView;
|
||||||
class BFile;
|
class BFile;
|
||||||
|
class BFilePanel;
|
||||||
class BMessage;
|
class BMessage;
|
||||||
class SettingsManager;
|
class SettingsManager;
|
||||||
class TargetHostInterface;
|
class TargetHostInterface;
|
||||||
@@ -41,6 +42,8 @@ private:
|
|||||||
TeamsListView* fTeamsListView;
|
TeamsListView* fTeamsListView;
|
||||||
BButton* fAttachTeamButton;
|
BButton* fAttachTeamButton;
|
||||||
BButton* fCreateTeamButton;
|
BButton* fCreateTeamButton;
|
||||||
|
BButton* fLoadCoreButton;
|
||||||
|
BFilePanel* fCoreSelectionPanel;
|
||||||
SettingsManager* fSettingsManager;
|
SettingsManager* fSettingsManager;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user