本文整理汇总了C++中PolycodeEditor::hasChanges方法的典型用法代码示例。如果您正苦于以下问题:C++ PolycodeEditor::hasChanges方法的具体用法?C++ PolycodeEditor::hasChanges怎么用?C++ PolycodeEditor::hasChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolycodeEditor
的用法示例。
在下文中一共展示了PolycodeEditor::hasChanges方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: quitApp
bool PolycodeIDEApp::quitApp() {
quittingApp = true;
while(editorManager->getCurrentEditor()) {
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor->hasChanges()) {
OSFileEntry entry(editor->getFilePath(), OSFileEntry::TYPE_FILE);
frame->yesNoCancelPopup->setCaption("The file \""+entry.name+"\" has unsaved changes. Save before quitting?");
frame->yesNoCancelPopup->action = "closeQuitFile";
frame->showModal(frame->yesNoCancelPopup);
return false;
} else {
if(editor->getEditorHolder()) {
editor->getEditorHolder()->setEditor(NULL);
}
editorManager->destroyEditor(editor);
if(editorManager->openEditors.size() > 0) {
editorManager->setCurrentEditor(editorManager->openEditors[0]);
frame->getActiveProjectFrame()->getActiveTab()->showEditor(editorManager->openEditors[0]);
} else{
editorManager->setCurrentEditor(NULL);
}
}
}
return true;
}
示例2: hasUnsavedFiles
bool PolycodeEditorManager::hasUnsavedFiles() {
for(int i=0; i < openEditors.size();i++) {
PolycodeEditor *editor = openEditors[i];
if(editor->hasChanges())
return true;
}
return false;
}
示例3: hasUnsavedFilesForProject
bool PolycodeEditorManager::hasUnsavedFilesForProject(PolycodeProject *project) {
for(int i=0; i < openEditors.size();i++) {
PolycodeEditor *editor = openEditors[i];
if(editor->hasChanges() && editor->parentProject == project)
return true;
}
return false;
}
示例4: closeProject
void PolycodeIDEApp::closeProject() {
if(projectManager->getActiveProject()) {
std::vector<PolycodeEditor*> editors;
PolycodeEditor *editor;
bool hasChanges = false;
for (int i=0; i < editorManager->openEditors.size(); i++) {
editor = editorManager->openEditors[i];
if (editor->hasChanges())
hasChanges = true;
if (editor->parentProject == projectManager->getActiveProject())
editors.push_back(editor);
}
tempEditorStore = editors; // current project files
if (hasChanges) {
String name = projectManager->getActiveProject()->getProjectName();
frame->yesNoCancelPopup->setCaption("Project '" + name + "' has unsaved changes. Save all?");
frame->yesNoCancelPopup->action = "closeProject";
frame->showModal(frame->yesNoCancelPopup);
} else
doCloseProject();
} else
PolycodeConsole::print("There are no active projects to close.\n");
}