Skip to content

Commit

Permalink
Added functionality to switch between edit and monitor modes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dinusv committed Mar 9, 2017
1 parent b8ac565 commit 397e572
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/qml/Project.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Rectangle{

signal addEntry(ProjectEntry parentEntry, bool isFile)
signal openEntry(ProjectEntry entry, bool monitor)
signal editEntry(ProjectEntry entry)
signal removeEntry(ProjectEntry entry, bool isFile)
signal moveEntry(ProjectEntry entry, ProjectEntry newParent)
signal renameEntry(ProjectEntry entry, string newName)
Expand Down Expand Up @@ -110,7 +111,7 @@ Rectangle{
project.setActive(styleData.value)
}
function openFile(){
root.openEntry(styleData.value, false)
root.editEntry(styleData.value)
}
function monitorFile(){
root.openEntry(styleData.value, true)
Expand Down Expand Up @@ -287,7 +288,7 @@ Rectangle{
style: ContextMenuStyle{}

MenuItem{
text: "Open File"
text: "Edit File"
onTriggered: {
view.contextDelegate.openFile()
}
Expand Down
5 changes: 5 additions & 0 deletions application/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ ApplicationWindow {
project.inFocus.dumpContent(editor.text)
project.openFile(entry, monitor ? ProjectDocument.Monitor : ProjectDocument.EditIfNotOpen)
}
onEditEntry : {
if ( project.inFocus )
project.inFocus.dumpContent(editor.text)
project.openFile(entry, ProjectDocument.Edit)
}
onAddEntry: {
projectAddEntry.show(parentEntry, isFile)
}
Expand Down

0 comments on commit 397e572

Please sign in to comment.