revert to saved confirmation dialog added
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1859 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -657,10 +657,25 @@ StyledEditWindow::OpenFile(entry_ref *ref)
|
|||||||
|
|
||||||
void
|
void
|
||||||
StyledEditWindow::RevertToSaved()
|
StyledEditWindow::RevertToSaved()
|
||||||
{ //translationutils here as well
|
{
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
|
int32 buttonIndex= 0;
|
||||||
|
BAlert *revertAlert;
|
||||||
|
BString alertText;
|
||||||
|
alertText.SetTo("Revert to the last version of \"");
|
||||||
|
alertText<< Title();
|
||||||
|
alertText<<"\"? ";
|
||||||
|
revertAlert= new BAlert("revertAlert",alertText.String(), "Cancel", "Ok", 0,
|
||||||
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||||
|
revertAlert->SetShortcut(0, B_ESCAPE);
|
||||||
|
buttonIndex= revertAlert->Go();
|
||||||
|
|
||||||
|
if (buttonIndex!=2) { // some sort of cancel, don't revert
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fSaveMessage->FindRef("directory", &ref);
|
fSaveMessage->FindRef("directory", &ref);
|
||||||
fSaveMessage->FindString("name", &name);
|
fSaveMessage->FindString("name", &name);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user