~verzegnassi-stefano/edit/brand-name-not-translatable

« back to all changes in this revision

Viewing changes to app/components/UnsavedDialog.qml

  • Committer: pawstr
  • Date: 2015-01-23 19:41:38 UTC
  • Revision ID: pawstr@gmail.com-20150123194138-bd8zysyrzcqa0uq6
All files added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
import Ubuntu.Components 1.1
 
3
import Ubuntu.Components.Popups 1.0
 
4
 
 
5
Component {
 
6
    Dialog {
 
7
        id: dialogue
 
8
        title: "Unsaved changes"
 
9
        text: "There are unsaved changes. Do you want to save this file before closing?"
 
10
        Button {
 
11
            text: "Save"
 
12
            color: UbuntuColors.green
 
13
            onClicked: {
 
14
                PopupUtils.close(dialogue)
 
15
 
 
16
                saveFile(root.importItems[0],"/home/phablet/.local/share/com.ubuntu.developer.pawstr.edit/")
 
17
 
 
18
                root.importItems = [nullItem]
 
19
                textArea.text = ""
 
20
            }
 
21
        }
 
22
        Button {
 
23
            text: "Save as"
 
24
            color: UbuntuColors.green
 
25
            onClicked: {
 
26
                PopupUtils.close(dialogue)
 
27
                PopupUtils.open(saveAsDialog)
 
28
 
 
29
                root.importItems = [nullItem]
 
30
                textArea.text = ""
 
31
            }
 
32
        }
 
33
        Button {
 
34
            text: "Close without saving"
 
35
            color: UbuntuColors.red
 
36
            onClicked: {
 
37
                PopupUtils.close(dialogue)
 
38
 
 
39
                root.importItems = [nullItem]
 
40
                textArea.text = ""
 
41
                root.title = "edIt"
 
42
            }
 
43
        }
 
44
    }
 
45
}