on xenial help sign in
Added reply/activate enabled.
f9d592eNick Dedekind
plugins/Unity/Indicators/Messaging/qml/ActionTextField.qml+2−1
@@ -25,6 +25,7 @@ Item {
25 id: textField
25 id: textField
26 property alias text: replyField.text
26 property alias text: replyField.text
27 property alias buttonText: sendButton.text
27 property alias buttonText: sendButton.text
28+ property bool activateEnabled: false
28
29
29 signal activate(var value)
30 signal activate(var value)
30
31
@@ -58,7 +59,7 @@ Item {
58 right: parent.right
59 right: parent.right
59 }
60 }
60 width: units.gu(9)
61 width: units.gu(9)
61− enabled: replyField.text !== ""
62+ enabled: replyField.text !== "" && textField.activateEnabled
62 color: enabled ? "#c94212" : "#bababa"
63 color: enabled ? "#c94212" : "#bababa"
63
64
64 onClicked: {
65 onClicked: {
plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml+5−1
@@ -91,11 +91,12 @@ Indicators.BaseMenuItem {
91 title: menu && menu.label ? menu.label : ""
91 title: menu && menu.label ? menu.label : ""
92 time: menu ? Utils.formatDate(menu.ext.xCanonicalTime) : ""
92 time: menu ? Utils.formatDate(menu.ext.xCanonicalTime) : ""
93 message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
93 message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
94+ replyButtonText: actionsDescription && actionsDescription[0].label ? actionsDescription[0].label : "Send"
94 // icons
95 // icons
95 avatar: menu && menu.ext.xCanonicalIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalIcon) : "qrc:/indicators/artwork/messaging/default_contact.png"
96 avatar: menu && menu.ext.xCanonicalIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalIcon) : "qrc:/indicators/artwork/messaging/default_contact.png"
96 appIcon: menu && menu.ext.xCanonicalAppIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalAppIcon) : ""
97 appIcon: menu && menu.ext.xCanonicalAppIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalAppIcon) : ""
97 // actions
98 // actions
98− replyButtonText: actionsDescription && actionsDescription[0].label ? actionsDescription[0].label : "Send"
99+ replyEnabled: replyAction.valid && replyAction.enabled
99
100
100 onActivateApp: {
101 onActivateApp: {
101 menuItem.model.activate(modelIndex, true);
102 menuItem.model.activate(modelIndex, true);
@@ -130,6 +131,9 @@ Indicators.BaseMenuItem {
130 // icons
131 // icons
131 avatar: menu && menu.ext.xCanonicalIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalIcon) : "qrc:/indicators/artwork/messaging/default_contact.png"
132 avatar: menu && menu.ext.xCanonicalIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalIcon) : "qrc:/indicators/artwork/messaging/default_contact.png"
132 appIcon: menu && menu.ext.xCanonicalAppIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalAppIcon) : ""
133 appIcon: menu && menu.ext.xCanonicalAppIcon ? "image://gicon/" + encodeURI(menu.ext.xCanonicalAppIcon) : ""
134+ // actions
135+ activateEnabled: activateAction.valid && activateAction.enabled
136+ replyEnabled: replyAction.valid && replyAction.enabled
133
137
134 onActivateApp: {
138 onActivateApp: {
135 menuItem.model.activate(modelIndex, true);
139 menuItem.model.activate(modelIndex, true);
plugins/Unity/Indicators/Messaging/qml/QuickReply.qml+2
@@ -27,6 +27,7 @@ Item {
27 property alias buttonText: actionTextField.buttonText
27 property alias buttonText: actionTextField.buttonText
28 property real expandedHeight: childrenRect.height
28 property real expandedHeight: childrenRect.height
29 property alias messages : messagelistRepeater.model
29 property alias messages : messagelistRepeater.model
30+ property alias replyEnabled: actionTextField.activateEnabled
30
31
31 signal reply(var value)
32 signal reply(var value)
32
33
@@ -150,6 +151,7 @@ Item {
150
151
151 anchors.fill: parent
152 anchors.fill: parent
152 anchors.margins: units.gu(1)
153 anchors.margins: units.gu(1)
154+ activateEnabled: replyEnabled
153
155
154 onActivate: {
156 onActivate: {
155 quickReply.reply(value)
157 quickReply.reply(value)
plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml+6−1
@@ -30,7 +30,10 @@ HeroMessage {
30 property string time: ""
30 property string time: ""
31 property string message: ""
31 property string message: ""
32
32
33+ property bool activateEnabled: true
33 property alias actionButtonText: actionButton.text
34 property alias actionButtonText: actionButton.text
35+
36+ property bool replyEnabled: true
34 property alias replyMessages: quickreply.messages
37 property alias replyMessages: quickreply.messages
35 property alias replyButtonText: quickreply.buttonText
38 property alias replyButtonText: quickreply.buttonText
36
39
@@ -76,11 +79,12 @@ HeroMessage {
76 Button {
79 Button {
77 id: actionButton
80 id: actionButton
78 text: "Call back"
81 text: "Call back"
79− color: "#c94212"
82+ color: enabled ? "#c94212" : "#bababa"
80 anchors.right: parent.right
83 anchors.right: parent.right
81 anchors.top: parent.top
84 anchors.top: parent.top
82 anchors.bottom: parent.bottom
85 anchors.bottom: parent.bottom
83 width: (parent.width - units.gu(1)) / 2
86 width: (parent.width - units.gu(1)) / 2
87+ enabled: snapDecision.activateEnabled
84
88
85 onClicked: {
89 onClicked: {
86 snapDecision.activate();
90 snapDecision.activate();
@@ -123,6 +127,7 @@ HeroMessage {
123 height: 0
127 height: 0
124 opacity: 0.0
128 opacity: 0.0
125 enabled: false
129 enabled: false
130+ replyEnabled: snapDecision.replyEnabled
126
131
127 states: State {
132 states: State {
128 name: "expanded"
133 name: "expanded"
plugins/Unity/Indicators/Messaging/qml/TextMessage.qml+2
@@ -25,6 +25,7 @@ import Unity.Indicators 0.1 as Indicators
25SimpleTextMessage {
25SimpleTextMessage {
26 id: simpleMessage
26 id: simpleMessage
27
27
28+ property bool replyEnabled: false
28 property string replyButtonText: "Send"
29 property string replyButtonText: "Send"
29
30
30 signal reply(string value)
31 signal reply(string value)
@@ -32,6 +33,7 @@ SimpleTextMessage {
32 footer: ActionTextField {
33 footer: ActionTextField {
33 anchors.fill: parent
34 anchors.fill: parent
34
35
36+ activateEnabled: simpleMessage.replyEnabled
35 buttonText: simpleMessage.replyButtonText
37 buttonText: simpleMessage.replyButtonText
36
38
37 onActivate: {
39 onActivate: {