~ubuntu-branches/ubuntu/vivid/qtcreator-plugin-ubuntu/vivid

« back to all changes in this revision

Viewing changes to share/qtcreator/ubuntu/qml/DevicesPage/DeleteDeviceDialog.qml

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Benjamin Zeller
  • Date: 2015-01-30 06:05:59 UTC
  • mfrom: (1.1.81)
  • Revision ID: package-import@ubuntu.com-20150130060559-1kirdtmm6bl6eb26
Tags: 3.1.1+15.04.20150130-0ubuntu1
[ Benjamin Zeller ]
Refactoring of the publish Tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
import Ubuntu.Components 1.0
 
3
import Ubuntu.Components.Popups 1.0
 
4
import "../Components"
 
5
 
 
6
Dialog {
 
7
    id: dialogue
 
8
    title: deviceId >= 0 ? i18n.tr("Delete device") : i18n.tr("Delete emulator")
 
9
    text:  deviceId >= 0 ? i18n.tr("Are you sure you want to delete this device?") : i18n.tr("Are you sure you want to delete this emulator?")
 
10
 
 
11
    property string emulatorImageName
 
12
    property int    deviceId: -1
 
13
 
 
14
    Button {
 
15
        text: i18n.tr("Cancel")
 
16
        color: UbuntuColors.warmGrey
 
17
        onClicked: PopupUtils.close(dialogue)
 
18
    }
 
19
    Button {
 
20
        text: i18n.tr("Delete")
 
21
        color: UbuntuColors.orange
 
22
        onClicked: {
 
23
            if(deviceId >= 0) {
 
24
                console.log("Deleting device: "+dialogue.deviceId);
 
25
                devicesModel.deleteDevice(dialogue.deviceId);
 
26
            } else {
 
27
                console.log("Deleting emu: "+dialogue.emulatorImageName);
 
28
                devicesModel.deleteEmulator(dialogue.emulatorImageName);
 
29
            }
 
30
            PopupUtils.close(dialogue);
 
31
        }
 
32
    }
 
33
}