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

« back to all changes in this revision

Viewing changes to share/qtcreator/ubuntu/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
 
 
5
 
Dialog {
6
 
    id: dialogue
7
 
    title: deviceId >= 0 ? i18n.tr("Delete device") : i18n.tr("Delete emulator")
8
 
    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?")
9
 
 
10
 
    property string emulatorImageName
11
 
    property int    deviceId: -1
12
 
 
13
 
    Button {
14
 
        text: i18n.tr("Cancel")
15
 
        color: UbuntuColors.warmGrey
16
 
        onClicked: PopupUtils.close(dialogue)
17
 
    }
18
 
    Button {
19
 
        text: i18n.tr("Delete")
20
 
        color: UbuntuColors.orange
21
 
        onClicked: {
22
 
            if(deviceId >= 0) {
23
 
                console.log("Deleting device: "+dialogue.deviceId);
24
 
                devicesModel.deleteDevice(dialogue.deviceId);
25
 
            } else {
26
 
                console.log("Deleting emu: "+dialogue.emulatorImageName);
27
 
                devicesModel.deleteEmulator(dialogue.emulatorImageName);
28
 
            }
29
 
            PopupUtils.close(dialogue);
30
 
        }
31
 
    }
32
 
}