Wire up Start new team button.
This commit is contained in:
@@ -22,12 +22,12 @@
|
|||||||
|
|
||||||
#include "MessageCodes.h"
|
#include "MessageCodes.h"
|
||||||
#include "SettingsManager.h"
|
#include "SettingsManager.h"
|
||||||
|
#include "StartTeamWindow.h"
|
||||||
#include "TeamsWindow.h"
|
#include "TeamsWindow.h"
|
||||||
#include "TeamsListView.h"
|
#include "TeamsListView.h"
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MSG_CREATE_NEW_TEAM = 'crnt',
|
|
||||||
MSG_TEAM_SELECTION_CHANGED = 'tesc'
|
MSG_TEAM_SELECTION_CHANGED = 'tesc'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -72,9 +72,13 @@ void
|
|||||||
TeamsWindow::MessageReceived(BMessage* message)
|
TeamsWindow::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case MSG_CREATE_NEW_TEAM:
|
case MSG_START_NEW_TEAM:
|
||||||
{
|
{
|
||||||
// TODO: implement
|
fStartTeamWindow = StartTeamWindow::Create();
|
||||||
|
if (fStartTeamWindow == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
fStartTeamWindow->Show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,9 +145,10 @@ TeamsWindow::_Init()
|
|||||||
.Add(fTeamsListView = new TeamsListView("TeamsList", fCurrentTeam))
|
.Add(fTeamsListView = new TeamsListView("TeamsList", fCurrentTeam))
|
||||||
.SetInsets(1.0f, 1.0f, 1.0f, 1.0f)
|
.SetInsets(1.0f, 1.0f, 1.0f, 1.0f)
|
||||||
.AddGroup(B_HORIZONTAL, 4.0f)
|
.AddGroup(B_HORIZONTAL, 4.0f)
|
||||||
.Add(fAttachTeamButton = new BButton("Attach"))
|
.Add(fAttachTeamButton = new BButton("Attach", new BMessage(
|
||||||
.Add(fCreateTeamButton = new BButton("Create new team"
|
MSG_DEBUG_THIS_TEAM)))
|
||||||
B_UTF8_ELLIPSIS))
|
.Add(fCreateTeamButton = new BButton("Start new team"
|
||||||
|
B_UTF8_ELLIPSIS, new BMessage(MSG_START_NEW_TEAM)))
|
||||||
.End()
|
.End()
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
@@ -151,10 +156,6 @@ TeamsWindow::_Init()
|
|||||||
fTeamsListView->SetSelectionMessage(new BMessage(
|
fTeamsListView->SetSelectionMessage(new BMessage(
|
||||||
MSG_TEAM_SELECTION_CHANGED));
|
MSG_TEAM_SELECTION_CHANGED));
|
||||||
|
|
||||||
fAttachTeamButton->SetMessage(new BMessage(MSG_DEBUG_THIS_TEAM));
|
|
||||||
fAttachTeamButton->SetEnabled(false);
|
|
||||||
fCreateTeamButton->SetMessage(new BMessage(MSG_CREATE_NEW_TEAM));
|
|
||||||
// TODO: re-enable once action is implemented
|
|
||||||
fAttachTeamButton->SetEnabled(false);
|
fAttachTeamButton->SetEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class BListView;
|
|||||||
class BFile;
|
class BFile;
|
||||||
class BMessage;
|
class BMessage;
|
||||||
class SettingsManager;
|
class SettingsManager;
|
||||||
|
class StartTeamWindow;
|
||||||
class TeamsListView;
|
class TeamsListView;
|
||||||
|
|
||||||
class TeamsWindow : public BWindow {
|
class TeamsWindow : public BWindow {
|
||||||
@@ -36,6 +37,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
team_id fCurrentTeam;
|
team_id fCurrentTeam;
|
||||||
TeamsListView* fTeamsListView;
|
TeamsListView* fTeamsListView;
|
||||||
|
StartTeamWindow* fStartTeamWindow;
|
||||||
BButton* fAttachTeamButton;
|
BButton* fAttachTeamButton;
|
||||||
BButton* fCreateTeamButton;
|
BButton* fCreateTeamButton;
|
||||||
SettingsManager* fSettingsManager;
|
SettingsManager* fSettingsManager;
|
||||||
|
|||||||
Reference in New Issue
Block a user