diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2017-10-23 16:11:38 -0500 |
|---|---|---|
| committer | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2017-10-23 16:11:38 -0500 |
| commit | 0c6f9831489840bdb3e74f1cdaa1e6f970d8d428 (patch) | |
| tree | e1f633db13c8624a8c1062c6678e4af40f11cc35 /src/tutorials/tutorial_primer_main.js | |
| parent | ac3953030df11f8c9356fa8998c795608f3180e0 (diff) | |
Fix up tutorial scripts
* Patches for QtQuick 2.x
* Fix up tab refs, names, and other out-of-date info
Diffstat (limited to 'src/tutorials/tutorial_primer_main.js')
| -rw-r--r-- | src/tutorials/tutorial_primer_main.js | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/src/tutorials/tutorial_primer_main.js b/src/tutorials/tutorial_primer_main.js index 7ef65df9..5d5597c1 100644 --- a/src/tutorials/tutorial_primer_main.js +++ b/src/tutorials/tutorial_primer_main.js @@ -4,29 +4,40 @@ var tooltips = []
function tooltipWidget(widgetName, explanation, maxheight, clickable) {
- var rect = tutorialControl.getRect(widgetName)
- var component = Qt.createComponent("TooltipArea.qml")
- if (component.status === Component.Error) {
- console.log("b" + component.errorString())
- }
- if (typeof clickable === 'undefined') {
- clickable = false
- }
- if ((typeof maxheight === 'undefined') || maxheight === 0) {
- maxheight = rect.height
- }
+ var component = Qt.createComponent("TooltipArea.qml")
+ if (component.status === Component.Ready)
+ finishCreation(component, widgetName, explanation, maxheight, clickable);
+ else
+ component.statusChanged.connect(function() {
+ finishCreation(component, widgetName, explanation, maxheight, clickable);
+ });
+}
- var obj = component.createObject(tutToplevel,
- { "x" : rect.x,
- "y" : rect.y,
- "width" : rect.width,
- "height" : maxheight
- })
- obj.tooltipText = explanation
- obj.clickable = clickable
- obj.visible = true
+function finishCreation(component, widgetName, explanation, maxheight, clickable) {
+ if (component.status === Component.Ready) {
+ var rect = tutorialControl.getRect(widgetName)
+ if (typeof clickable === 'undefined') {
+ clickable = false
+ }
+ if ((typeof maxheight === 'undefined') || maxheight === 0) {
+ maxheight = rect.height
+ }
- tooltips.push(obj)
+ var obj = component.createObject(tutToplevel,
+ {
+ "x": rect.x,
+ "y": rect.y,
+ "width": rect.width,
+ "height": maxheight
+ })
+ obj.tooltipText = explanation
+ obj.clickable = clickable
+ obj.visible = true
+
+ tooltips.push(obj)
+ } else if (component.status === Component.Error) {
+ console.log("Error loading component: " + component.errorString())
+ }
}
function tooltipAction(actionName, explanation, maxheight, clickable) {
@@ -79,16 +90,16 @@ function setupTooptips() { tooltipWidget("bossButton", qsTr("Automatically sort plugins using the bundled LOOT application."))
tooltipWidget("espFilterEdit", qsTr("Quickly filter plugin list as you type."))
break
+ // case 1:
+ // tooltipWidget("bsaList", qsTr("All the asset archives (.bsa files) for all active mods."))
+ // break
case 1:
- tooltipWidget("bsaList", qsTr("All the asset archives (.bsa files) for all active mods."))
- break
- case 2:
tooltipWidget("dataTree", qsTr("The directory tree and all files that the program will see."))
break
- case 3:
+ case 2:
tooltipWidget("savegameList", qsTr("Save game browser. Shows all the saves for the current profile and whether or not the current mod-load status is correct."))
break
- case 4:
+ case 3:
tooltipWidget("downloadView", qsTr("Shows the mods that have been downloaded and if they’ve been installed."))
break
}
|
