mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Remove Base.handle*Replace()
These methods dealt with opening up a sketch inside an existing editor window, but they were unused - all sketches open in a new window now.
This commit is contained in:
parent
7d277b359c
commit
c5c3a771e5
@ -755,46 +755,6 @@ public class Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Replace the sketch in the current window with a new untitled document.
|
|
||||||
*/
|
|
||||||
public void handleNewReplace() {
|
|
||||||
if (!activeEditor.checkModified()) {
|
|
||||||
return; // sketch was modified, and user canceled
|
|
||||||
}
|
|
||||||
|
|
||||||
// Actually replace things
|
|
||||||
handleNewReplaceImpl();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected void handleNewReplaceImpl() {
|
|
||||||
try {
|
|
||||||
File file = createNewUntitled();
|
|
||||||
if (file != null) {
|
|
||||||
activeEditor.handleOpenInternal(file);
|
|
||||||
activeEditor.untitled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
activeEditor.statusError(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void handleOpenReplace(File file) {
|
|
||||||
if (!activeEditor.checkModified()) {
|
|
||||||
return; // sketch was modified, and user canceled
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean loaded = activeEditor.handleOpenInternal(file);
|
|
||||||
if (!loaded) {
|
|
||||||
// replace the document without checking if that's ok
|
|
||||||
handleNewReplaceImpl();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prompt for a sketch to open, and open it in a new window.
|
* Prompt for a sketch to open, and open it in a new window.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user