~aacid/unity8/fix_testDash

« back to all changes in this revision

Viewing changes to qml/Shell.qml

  • Committer: CI Train Bot
  • Author(s): Michael Terry
  • Date: 2014-12-04 20:54:46 UTC
  • mfrom: (1432.3.19 wizard-plugin)
  • Revision ID: ci-train-bot@canonical.com-20141204205446-pbuftf6d5yt854oj
Convert the welcome wizard from a separate executable into a qml plugin (with a small C++ plugin for support).

- This changes the path for adding customized wizard pages (drops system-settings namespacing).  I checked with cwayne, that support isn't being used yet.  So that's safe to adjust while we're here.

- I did not change the path for the 'has the wizard run yet' marker, since that is being used in the wild.  But I added a comment as to why we're using the phrase "ubuntu-system-settings" in that filename.

- I fleshed out unity8's support for changing the language on the fly, since that's now done in-process.  I believe I caught all cases (anything that used a qml binding to i18n worked automatically, just had to catch the cases that were pulling from outside sources like infographics).

- If an incoming call happens during the wizard, we just bail out of it and the edge demo. I'm not sure what the ideal behavior is, but this is at least reasonable. There's nothing in the wizard that *needs* to be done.

- Making the wizard a plugin lets us drop the gap between the end of the wizard and the start of the shell.  Yay! 
Approved by: Andrea Cimitan

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
import "Notifications"
38
38
import "Stages"
39
39
import "Panel/Indicators"
 
40
import "Wizard"
40
41
import Unity.Notifications 1.0 as NotificationBackend
41
42
import Unity.Session 0.1
42
43
import Unity.DashCommunicator 0.1
236
237
            onApplicationAdded: {
237
238
                if (greeter.shown && appId != "unity8-dash") {
238
239
                    greeter.startUnlock()
 
240
 
 
241
                    // If this happens on first boot, we may be in edge
 
242
                    // tutorial or wizard while receiving a call.  But a call
 
243
                    // is more important than wizard so just bail out of those.
 
244
                    if (edgeDemo.running) {
 
245
                        edgeDemo.hideEdgeDemos();
 
246
                        wizard.hide();
 
247
                    }
239
248
                }
240
249
                if (greeter.narrowMode && greeter.hasLockedApp && appId === greeter.lockedApp) {
241
250
                    lockscreen.hide() // show locked app
354
363
        minPinLength: 4
355
364
        maxPinLength: 4
356
365
 
 
366
        property string promptText
 
367
        infoText: promptText !== "" ? i18n.tr("Enter %1").arg(promptText) :
 
368
                  alphaNumeric ? i18n.tr("Enter passphrase") :
 
369
                                 i18n.tr("Enter passcode")
 
370
        errorText: promptText !== "" ? i18n.tr("Sorry, incorrect %1").arg(promptText) :
 
371
                   alphaNumeric ? i18n.tr("Sorry, incorrect passphrase") + "\n" +
 
372
                                  i18n.tr("Please re-enter") :
 
373
                                  i18n.tr("Sorry, incorrect passcode")
 
374
 
357
375
        // FIXME: We *should* show emergency dialer if there is a SIM present,
358
376
        // regardless of whether the side stage is enabled.  But right now,
359
377
        // the assumption is that narrow screens are phones which have SIMs
407
425
                return; // could happen if hideGreeter() comes in before we prompt
408
426
            }
409
427
            if (greeter.narrowMode) {
410
 
                if (isDefaultPrompt) {
411
 
                    if (lockscreen.alphaNumeric) {
412
 
                        lockscreen.infoText = i18n.tr("Enter passphrase")
413
 
                        lockscreen.errorText = i18n.tr("Sorry, incorrect passphrase") + "\n" +
414
 
                                               i18n.tr("Please re-enter")
415
 
                    } else {
416
 
                        lockscreen.infoText = i18n.tr("Enter passcode")
417
 
                        lockscreen.errorText = i18n.tr("Sorry, incorrect passcode")
418
 
                    }
419
 
                } else {
420
 
                    lockscreen.infoText = i18n.tr("Enter %1").arg(text.toLowerCase())
421
 
                    lockscreen.errorText = i18n.tr("Sorry, incorrect %1").arg(text.toLowerCase())
422
 
                }
423
 
 
 
428
                lockscreen.promptText = isDefaultPrompt ? "" : text.toLowerCase();
424
429
                lockscreen.maybeShow();
425
430
            }
426
431
        }
748
753
            }
749
754
        }
750
755
 
 
756
        Wizard {
 
757
            id: wizard
 
758
            anchors.fill: parent
 
759
            background: shell.background
 
760
        }
 
761
 
751
762
        Rectangle {
752
763
            id: modalNotificationBackground
753
764
 
809
820
        id: edgeDemo
810
821
        objectName: "edgeDemo"
811
822
        z: dialogs.z + 10
812
 
        paused: Powerd.status === Powerd.Off // Saves power
 
823
        paused: Powerd.status === Powerd.Off || wizard.active // Saves power
813
824
        greeter: greeter
814
825
        launcher: launcher
815
826
        panel: panel