~phablet-team/telephony-service/trunk

« back to all changes in this revision

Viewing changes to phone-app.qml

  • Committer: Tarmac
  • Author(s): Gustavo Pichorim Boiko
  • Date: 2013-03-20 04:37:03 UTC
  • mfrom: (609.1.14 phone-app-rename)
  • Revision ID: tarmac-20130320043703-ws4n78rv8b3ihqyi
Rename telephony-app to phone-app.

Approved by PS Jenkins bot, Günter Schwann.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2012 Canonical Ltd.
3
 
 *
4
 
 * This file is part of telephony-app.
5
 
 *
6
 
 * telephony-app is free software; you can redistribute it and/or modify
 
2
 * Copyright 2012-2013 Canonical Ltd.
 
3
 *
 
4
 * This file is part of phone-app.
 
5
 *
 
6
 * phone-app is free software; you can redistribute it and/or modify
7
7
 * it under the terms of the GNU General Public License as published by
8
8
 * the Free Software Foundation; version 3.
9
9
 *
10
 
 * telephony-app is distributed in the hope that it will be useful,
 
10
 * phone-app is distributed in the hope that it will be useful,
11
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
13
 * GNU General Public License for more details.
20
20
import "Widgets" as LocalWidgets
21
21
import Ubuntu.Components 0.1
22
22
import Ubuntu.HUD 0.1 as HUD
23
 
import TelephonyApp 0.1
 
23
import Ubuntu.PhoneApp 0.1
24
24
import "PanelContacts"
25
25
import "PanelCommunications"
26
26
import "PanelDialer"
27
27
 
28
28
MainView {
29
 
    id: telephony
 
29
    id: mainView
30
30
 
31
31
    width: singlePane ? units.gu(40) : units.gu(80)
32
32
    height: units.gu(71)
68
68
            mainStack.push(leftPane);
69
69
        } else {
70
70
            mainStack.clear();
71
 
            leftPane.parent = telephony;
 
71
            leftPane.parent = mainView;
72
72
        }
73
73
    }
74
74
 
75
75
    Connections {
76
76
        target: contactModel
77
 
        onContactLoaded: telephony.showContactDetails(contact);
 
77
        onContactLoaded: mainView.showContactDetails(contact);
78
78
    }
79
79
 
80
80
    Connections {
236
236
        anchors.bottom: parent.bottom
237
237
        anchors.right: singlePane ? parent.right : undefined
238
238
        width: singlePane ? undefined : units.gu(31)
239
 
        parent: singlePane ? mainStack : telephony
 
239
        parent: singlePane ? mainStack : mainView
240
240
 
241
241
        Tabs {
242
242
            id: tabs
317
317
 
318
318
        property bool shown
319
319
        shown: {
320
 
            if (telephony.singlePane) {
 
320
            if (mainView.singlePane) {
321
321
                return false;
322
322
            }
323
323
 
324
324
            if (!callManager.hasCalls) {
325
325
                return false
326
326
            } else {
327
 
                if (isVoicemailActive() && !telephony.voicemail.loaded) {
 
327
                if (isVoicemailActive() && !mainView.voicemail.loaded) {
328
328
                    return true
329
 
                } else if (!isVoicemailActive() && !telephony.liveCall.loaded) {
 
329
                } else if (!isVoicemailActive() && !mainView.liveCall.loaded) {
330
330
                    return true
331
331
                }
332
332
            }
333
333
            return false
334
334
        }
335
335
 
336
 
        onClicked: isVoicemailActive() ? telephony.showVoicemail() : telephony.showLiveCall()
 
336
        onClicked: isVoicemailActive() ? mainView.showVoicemail() : mainView.showLiveCall()
337
337
    }
338
338
 
339
339
    Item {
452
452
    Connections {
453
453
        target: telepathyHelper
454
454
        onAccountReady: {
455
 
            telephony.applicationReady()
 
455
            mainView.applicationReady()
456
456
        }
457
457
    }
458
458
 
459
459
    Connections {
460
460
        target: callManager
461
461
        onCallReady: {
462
 
            var currentPage = singlePane ? telephony.view : rightPaneStacks.stacks[dialer.tab].currentPage
 
462
            var currentPage = singlePane ? mainView.view : rightPaneStacks.stacks[dialer.tab].currentPage
463
463
            if (currentPage.source == dialer.source) {
464
464
                currentPage.dialNumber = ""
465
465
            }
480
480
    }
481
481
 
482
482
    HUD.HUD {
483
 
        applicationIdentifier: "telephony-app" // this must match the .desktop file!
 
483
        applicationIdentifier: "phone-app" // this must match the .desktop file!
484
484
        HUD.Context {
485
485
            toolbar.quitAction.onTriggered: Qt.quit()
486
486
 
487
487
            HUD.Action {
488
488
                label: "Compose"
489
489
                keywords: "New Message"
490
 
                onTriggered: telephony.startNewMessage()
 
490
                onTriggered: mainView.startNewMessage()
491
491
            }
492
492
            HUD.Action {
493
493
                label: "Add"
494
494
                keywords: "New Contact"
495
 
                onTriggered: telephony.createNewContact()
 
495
                onTriggered: mainView.createNewContact()
496
496
            }
497
497
        }
498
498
    }