Task #12: add confirmation dialog
This commit is contained in:
parent
6de2682326
commit
fb5f1c38cf
|
@ -125,12 +125,19 @@ MainWindow::Start()
|
||||||
bool
|
bool
|
||||||
MainWindow::QuitRequested()
|
MainWindow::QuitRequested()
|
||||||
{
|
{
|
||||||
fListView->MakeEmpty();
|
BAlert* alert = new BAlert("Closing", "Are you sure you wan to quit?", "Yes", "No", NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
|
||||||
fServer->Quit();
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
CayaPreferences::Get()->Save();
|
int32 button_index = alert->Go();
|
||||||
ReplicantStatusView::RemoveReplicant();
|
if(button_index == 0) {
|
||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
fListView->MakeEmpty();
|
||||||
return true;
|
fServer->Quit();
|
||||||
|
CayaPreferences::Get()->Save();
|
||||||
|
ReplicantStatusView::RemoveReplicant();
|
||||||
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,9 +71,9 @@ PreferencesAccounts::PreferencesAccounts()
|
||||||
fProtosMenu->AddItem(item);
|
fProtosMenu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolButton* proto = new ToolButton("+", NULL);
|
ToolButton* proto = new ToolButton("Add", NULL);
|
||||||
proto->SetMenu(fProtosMenu);
|
proto->SetMenu(fProtosMenu);
|
||||||
fDelButton = new ToolButton("-", new BMessage(kDelAccount));
|
fDelButton = new ToolButton("Del", new BMessage(kDelAccount));
|
||||||
fEditButton = new ToolButton("Edit...", new BMessage(kEditAccount));
|
fEditButton = new ToolButton("Edit...", new BMessage(kEditAccount));
|
||||||
fDelButton->SetEnabled(false);
|
fDelButton->SetEnabled(false);
|
||||||
fEditButton->SetEnabled(false);
|
fEditButton->SetEnabled(false);
|
||||||
|
|
Ŝarĝante…
Reference in New Issue