Merge lp:~gang65/ubuntu-calculator-app/ubuntu-calculator-app-copypaste into lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk

Proposed by Bartosz Kosiorek
Status: Merged
Approved by: Mihir Soni
Approved revision: 237
Merged at revision: 243
Proposed branch: lp:~gang65/ubuntu-calculator-app/ubuntu-calculator-app-copypaste
Merge into: lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk
Diff against target: 83 lines (+28/-7)
2 files modified
Simple/CalcLabel.qml (+22/-7)
debian/changelog (+6/-0)
To merge this branch: bzr merge lp:~gang65/ubuntu-calculator-app/ubuntu-calculator-app-copypaste
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Bartosz Kosiorek Approve
Review via email: mp+210932@code.launchpad.net

Commit message

Support select, copy and paste of calculator numbers

Description of the change

Support select, copy and paste of calculator numbers.

You could use mouse selection, double click, CTRL+C, CTRL+V.

If you hold mouse/finger longer on number, the menu will appear, and you would have possibility to select and copy

I have tested it on Desktop and it works perfectly.
Please test it on Smartphone and tablet.

To post a comment you must log in.
234. By Bartosz Kosiorek

Implement selection/copy/paste feature for numbers and labels

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Hi Bartosz ,

Thanks a lot for your MR.

There are couple of suggestions:

1.Could you please remove the cursor (Edit cursor, it misguide to user in calculator)
2.I tried to paste back to the field, it is not working though (If any specific steps , let us know.)
3.Cut operation is not performing , if not required could you please remove the Cut operation.

We need to ask team,for using textbox instead of Labels, i guess it shouldn't be any issue though.

review: Needs Fixing
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Tried on device. When I hold down on a number I get a dialog which says "Select All" or "Select word" If I choose either, another box pops up with "Cut" and "Copy" in, but it then immediately disappears.

http://popey.com/~alan/phablet/device-2014-03-14-103530.png

I couldn't get a screenshot of the cut/copy dialog because it appears too quickly.

Revision history for this message
Bartosz Kosiorek (gang65) wrote :

So we have several issues:
1. Could you please remove the cursor (Edit cursor, it misguide to user in calculator)
   Unfortunately TextField doesn't have option to disable cursor. cursorVisible property disable it only for active focus. I could try once again with cursorDelegate
2. I tried to paste back to the field, it is not working though.
   It is another feature. It will be tricky to implement it. All TextFields are read only, so we could only select it and copy.
3.Cut operation is not performing , if not required could you please remove the Cut operation?
   Very good question. There is no option to remove "Cut operation". Because the TextFields are ReadOnly, there shouldn't be any "Cut" option. This bug should be submitted to Ubuntu SDK
4. Box pops up with "Cut" and "Copy" in, but it then immediately disappears.
   I tested with ubuntu-docviewer-app (on desktop) and it works in the same way.
   This bug should be submitted to Ubuntu SDK with critical priority.

Do you know how to submit errors on Ubuntu SDK? Fourth issue is critical one, and without fix, the copy is not working for other Ubuntu appliacations also.

Revision history for this message
Bartosz Kosiorek (gang65) :
review: Needs Information
Revision history for this message
Bartosz Kosiorek (gang65) wrote :
review: Needs Information
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Bartosz, you can open bug against ubuntu sdk here: https://bugs.launchpad.net/ubuntu-ui-toolkit

I'm not sure that use TextField in place of a label is a good idea, I have to think about possible consequences

Revision history for this message
Bartosz Kosiorek (gang65) wrote :

> Tried on device. When I hold down on a number I get a dialog which says
> "Select All" or "Select word" If I choose either, another box pops up with
> "Cut" and "Copy" in, but it then immediately disappears.
>
> http://popey.com/~alan/phablet/device-2014-03-14-103530.png
>
> I couldn't get a screenshot of the cut/copy dialog because it appears too
> quickly.

Ploblem with disappears Cut/Copy was already registered:
https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1130369

Revision history for this message
Bartosz Kosiorek (gang65) wrote :

I think TextField is optimal for numbers purposes.
When Copy/Paste will be implemented by using TextFields, I would like to implement "Paste" to ubuntu-calculator-app.
So you could take same number from external source and paste it directly into calculator.

I would like to implement also some "correcting".
For example: You could long click on previos result and select "Edit" and edit previous calculations/numbers.

What do you think about that ideas?

235. By Bartosz Kosiorek

rebase from trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

Can we merge copy/paste feature into trunk?

Revision history for this message
Bartosz Kosiorek (gang65) :
review: Approve
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Could you merge from latest trunk again ?

236. By Bartosz Kosiorek

Merge from trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

It seems that there is a problem when you select title label (TextField), and then switch to formulaLabel.
The virtual keyboard doesn't appears.

237. By Bartosz Kosiorek

Fix hiding keyboard, when you select formula

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Mihir, Riccardo, are you happy with the latest changes from Bartosz? Can we merge it?

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

On desktop I tried this and when I long press a result I get a popup "Select all / Select None", and after choosing "Select All" a "Copy" dialog briefly pops up. Long pressing again brings the "Copy" dialog again.

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good to me :)

Thank you.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Simple/CalcLabel.qml'
2--- Simple/CalcLabel.qml 2014-03-03 11:40:38 +0000
3+++ Simple/CalcLabel.qml 2014-04-26 15:30:46 +0000
4@@ -25,7 +25,7 @@
5 width: parent.width
6 height: row.height
7
8- property int operationsWidth: operatorLabel.width+formulaLabel.width
9+ property int operationsWidth: operatorLabel.width + formulaTextField.width
10 property string operation: ""
11 property string numbers: ""
12 property bool labelReadOnly: false
13@@ -39,14 +39,14 @@
14 propagateComposedEvents: true
15 }
16
17- Row{
18+ Row {
19 id: row
20 height: numbersHeight
21 width: parent.width
22 anchors.left: parent.left
23
24 Item {
25- width: row.width - operatorLabel.width - formulaLabel.width
26+ width: row.width - operatorLabel.width - formulaTextField.width
27 height: parent.height
28
29 TextField {
30@@ -103,19 +103,34 @@
31 color: "#FEFEFE"
32 text: root.operation
33 }
34- Label {
35- id: formulaLabel
36+
37+ TextField {
38+ id: formulaTextField
39
40 // this property is used by autopilot tests to find the correct item
41 // FIXME: implement it in a better way
42 property bool isLast: root.isLast
43
44- objectName: "formulaLabel"
45+ objectName: "formulaTextField"
46+ readOnly: true
47+ selectByMouse: true
48+ hasClearButton: false
49 width: parent.width / 1.5
50 color: numbersColor
51+ // removes ubuntu shape
52+ style: TextFieldStyle {
53+ background: Item {}
54+ }
55+
56+ //If formula clicked, then hide keyboard
57+ onActiveFocusChanged: {
58+ if (!numberName.activeFocus) {
59+ labelVisible = false
60+ }
61+ }
62 anchors.bottom: parent.bottom
63 font.pixelSize: numbersHeight
64- fontSizeMode: Text.Fit
65+
66 horizontalAlignment: Text.AlignRight
67 // If is a new calculation or if last calculation as been deleted print 0, else the number
68 text: ((isLast && !newCalculation) || (root.numbers === "" && formulaView.headerItem.state !== "newPush")) ? "0" : root.numbers
69
70=== modified file 'debian/changelog'
71--- debian/changelog 2014-03-10 10:12:24 +0000
72+++ debian/changelog 2014-04-26 15:30:46 +0000
73@@ -1,5 +1,11 @@
74 ubuntu-calculator-app (0.1.3ubuntu3) UNRELEASED; urgency=medium
75
76+ [ Bartosz Kosiorek ]
77+ * Support select, copy and paste of calculator numbers (LP: #1267821)
78+ * Add possibility to correct values by pressing backspace (LP: #1286650)
79+ * Allow input decimals without a numeric value at start (LP: #1273637)
80+ * Fix calculate value after using CLEAR (LP: #1286932)
81+
82 [ Sergio Schvezov ]
83 * Adding cmake
84

Subscribers

People subscribed via source and target branches