Skip to content

Commit

Permalink
Rename Backend
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Aug 30, 2024
1 parent 02123b1 commit 12c1c82
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/IntermediatePy/src/IntermediatePy.pyproject
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"IntermediatePy/Gui/StatusBar.qml",
"IntermediatePy/Gui/Globals/qmldir",
"IntermediatePy/Gui/Globals/ApplicationInfo.qml",
"IntermediatePy/Gui/Globals/Backend.qml",
"IntermediatePy/Gui/Globals/BackendProxy.qml",
"IntermediatePy/Gui/Globals/References.qml",
"IntermediatePy/Gui/Pages/Home/Content.qml",
"IntermediatePy/Gui/Pages/Home/Popups/About.qml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ EaComponents.ApplicationWindow {
appBarLeftButtons: [

EaElements.ToolButton {
enabled: Globals.Backend.project.created
enabled: Globals.BackendProxy.project.created
highlighted: true
fontIcon: 'save'
ToolTip.text: qsTr('Save current state of the project')
onClicked: Globals.Backend.project.save()
onClicked: Globals.BackendProxy.project.save()
}

]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import QtQuick
// It is needed to run the GUI frontend via the qml runtime tool without any Python backend.
import Logic


QtObject {

////////////////
Expand Down Expand Up @@ -69,8 +70,7 @@ QtObject {
property bool created: activeProxy.report.created
onCreatedChanged: activeProxy.project.created = created

property string asHtml: activeProxy.report.asHtml
onAsHtmlChanged: activeProxy.report.asHtml = asHtml
readonly property string asHtml: activeProxy.report.asHtml
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import QtQuick
// Initialisation of the reference dictionary. It is filled in later, when the required object is
// created and its unique id is assigned and added here instead of 'null'. After that, any object
// whose id is stored here can be accessed from any other qml file.

QtObject {

// Populated in ApplicationWindows.qml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Globals

singleton ApplicationInfo ApplicationInfo.qml
singleton Backend Backend.qml
singleton BackendProxy BackendProxy.qml
singleton References References.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Gui.Globals as Globals

EaComponents.ContentPage {

defaultInfo: Globals.Backend.project.created ?
defaultInfo: Globals.BackendProxy.project.created ?
'' :
qsTr('No project defined')

Expand All @@ -42,7 +42,7 @@ EaComponents.ContentPage {
Loader { source: 'Sidebar/Text/Layout.qml' }
]

continueButton.text: Globals.Backend.project.created ?
continueButton.text: Globals.BackendProxy.project.created ?
qsTr('Continue') :
qsTr('Continue without project')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Rectangle {
font.weight: Font.ExtraLight
validator: RegularExpressionValidator { regularExpression: /^[a-zA-Z][a-zA-Z0-9_\-\.]{1,30}$/ }
placeholderText: qsTr("Enter project name here")
text: Globals.Backend.project.name
onEditingFinished: Globals.Backend.project.name = text
text: Globals.BackendProxy.project.name
onEditingFinished: Globals.BackendProxy.project.name = text
}
// Project title

Expand All @@ -53,8 +53,8 @@ Rectangle {
EaElements.TextInput {
width: Math.max(implicitWidth, 1)
placeholderText: qsTr("Enter project description here")
text: Globals.Backend.project.info.description
onEditingFinished: Globals.Backend.project.editInfo('description', text)
text: Globals.BackendProxy.project.info.description
onEditingFinished: Globals.BackendProxy.project.editInfo('description', text)
}

EaElements.Label {
Expand All @@ -63,7 +63,7 @@ Rectangle {
}
EaElements.Label {
width: Math.max(implicitWidth, 1)
text: Globals.Backend.project.info.location
text: Globals.BackendProxy.project.info.location
}

EaElements.Label {
Expand All @@ -72,7 +72,7 @@ Rectangle {
}
EaElements.Label {
width: Math.max(implicitWidth, 1)
text: Globals.Backend.project.info.creationDate
text: Globals.BackendProxy.project.info.creationDate
}
}
// Project info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EaComponents.TableView {

defaultInfoText: qsTr('No examples available')

model: Globals.Backend.project.examples
model: Globals.BackendProxy.project.examples

// header
header: EaComponents.TableViewHeader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ EaComponents.ProjectDescriptionDialog {
visible: EaGlobals.Vars.showProjectDescriptionDialog
onClosed: EaGlobals.Vars.showProjectDescriptionDialog = false

projectName: Globals.Backend.project.name
projectDescription: Globals.Backend.project.info.description
projectName: Globals.BackendProxy.project.name
projectDescription: Globals.BackendProxy.project.info.description

onAccepted: {
Globals.Backend.project.name = projectName
Globals.Backend.project.editInfo('description', projectDescription)
Globals.Backend.project.create()
Globals.BackendProxy.project.name = projectName
Globals.BackendProxy.project.editInfo('description', projectDescription)
Globals.BackendProxy.project.create()
Globals.References.applicationWindow.appBarCentralTabs.summaryButton.enabled = true
}

Component.onCompleted: {
projectLocation = Globals.Backend.project.info.location
projectLocation = Globals.BackendProxy.project.info.location
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Gui.Globals as Globals

EaComponents.ContentPage {

defaultInfo: Globals.Backend.report.created ?
defaultInfo: Globals.BackendProxy.report.created ?
'' :
qsTr('No Summary Generated')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Rectangle {
padding: 2.5 * EaStyle.Sizes.fontPixelSize

textFormat: TextEdit.RichText
text: Globals.Backend.report.asHtml
text: Globals.BackendProxy.report.asHtml
}
// Main text area

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Gui.Globals as Globals

Column {

property string projectLocation: Globals.Backend.project.info.location +
property string projectLocation: Globals.BackendProxy.project.info.location +
EaLogic.Utils.osPathSep() +
'summary'

Expand Down
12 changes: 6 additions & 6 deletions examples/IntermediatePy/src/IntermediatePy/Gui/StatusBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,42 @@ EaElements.StatusBar {
EaElements.StatusBarItem {
keyIcon: 'archive'
keyText: qsTr('Project')
valueText: Globals.Backend.status.project
valueText: Globals.BackendProxy.status.project
ToolTip.text: qsTr('Current project')
}

EaElements.StatusBarItem {
keyIcon: 'layer-group'
keyText: qsTr('Models')
valueText: Globals.Backend.status.phasesCount
valueText: Globals.BackendProxy.status.phasesCount
ToolTip.text: qsTr('Number of models added')
}

EaElements.StatusBarItem {
keyIcon: 'microscope'
keyText: qsTr('Experiments')
valueText: Globals.Backend.status.experimentsCount
valueText: Globals.BackendProxy.status.experimentsCount
ToolTip.text: qsTr('Number of experiments added')
}

EaElements.StatusBarItem {
keyIcon: 'calculator'
keyText: qsTr('Calculator')
valueText: Globals.Backend.status.calculator
valueText: Globals.BackendProxy.status.calculator
ToolTip.text: qsTr('Current calculation engine')
}

EaElements.StatusBarItem {
keyIcon: 'level-down-alt'
keyText: qsTr('Minimizer')
valueText: Globals.Backend.status.minimizer
valueText: Globals.BackendProxy.status.minimizer
ToolTip.text: qsTr('Current minimization engine and method')
}

EaElements.StatusBarItem {
keyIcon: 'th-list'
keyText: qsTr('Parameters')
valueText: Globals.Backend.status.variables
valueText: Globals.BackendProxy.status.variables
ToolTip.text: qsTr('Number of parameters: total, free and fixed')
}

Expand Down
2 changes: 1 addition & 1 deletion examples/IntermediatePy/src/IntermediatePy/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import Gui as Gui

Gui.ApplicationWindow {

id: applicationWindow // Global access
id: applicationWindow // applicationWindow is globally accessible

}

0 comments on commit 12c1c82

Please sign in to comment.