mirror of https://github.com/buggins/dlangide.git
ask user to save unsaved files when closing IDE window - issue #28 implemented for win32 backend
This commit is contained in:
parent
b874f3e060
commit
b1d4e29057
|
@ -67,6 +67,7 @@ class IDEFrame : AppFrame {
|
||||||
super();
|
super();
|
||||||
window.mainWidget = this;
|
window.mainWidget = this;
|
||||||
window.onFilesDropped = &onFilesDropped;
|
window.onFilesDropped = &onFilesDropped;
|
||||||
|
window.onCanClose = &onCanClose;
|
||||||
}
|
}
|
||||||
|
|
||||||
override protected void init() {
|
override protected void init() {
|
||||||
|
@ -444,6 +445,7 @@ class IDEFrame : AppFrame {
|
||||||
if (a) {
|
if (a) {
|
||||||
switch (a.id) {
|
switch (a.id) {
|
||||||
case IDEActions.FileExit:
|
case IDEActions.FileExit:
|
||||||
|
if (onCanClose())
|
||||||
window.close();
|
window.close();
|
||||||
return true;
|
return true;
|
||||||
case IDEActions.HelpAbout:
|
case IDEActions.HelpAbout:
|
||||||
|
@ -628,6 +630,14 @@ class IDEFrame : AppFrame {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// return false to prevent closing
|
||||||
|
bool onCanClose() {
|
||||||
|
askForUnsavedEdits(delegate() {
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget createAboutWidget()
|
Widget createAboutWidget()
|
||||||
|
|
Loading…
Reference in New Issue