← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~nikwen/ubuntu-calculator-app/bracket-paste-fix into lp:ubuntu-calculator-app

 

Niklas Wenzel has proposed merging lp:~nikwen/ubuntu-calculator-app/bracket-paste-fix into lp:ubuntu-calculator-app.

Commit message:
Fix pasting brackets

Requested reviews:
  Ubuntu Calculator Developers (ubuntu-calculator-dev)
Related bugs:
  Bug #1516321 in Ubuntu Calculator App: "Pasting with CTRL+V do not pasting brackets at the end"
  https://bugs.launchpad.net/ubuntu-calculator-app/+bug/1516321

For more details, see:
https://code.launchpad.net/~nikwen/ubuntu-calculator-app/bracket-paste-fix/+merge/279368

Fix pasting brackets
-- 
Your team Ubuntu Calculator Developers is requested to review the proposed merge of lp:~nikwen/ubuntu-calculator-app/bracket-paste-fix into lp:ubuntu-calculator-app.
=== modified file 'app/ubuntu-calculator-app.qml'
--- app/ubuntu-calculator-app.qml	2015-11-28 20:44:02 +0000
+++ app/ubuntu-calculator-app.qml	2015-12-02 22:18:10 +0000
@@ -648,6 +648,9 @@
                                                             acceptedBits.push({ "chars": item.pushText, "push": item.pushText });
                                                         if (item.text)
                                                             acceptedBits.push({ "chars": item.text, "push": item.pushText ? item.pushText : item.text });
+                                                        if (item.pasteTexts)
+                                                            for (var pos = 0; pos < item.pasteTexts.length; pos++)
+                                                                acceptedBits.push({ "chars": item.pasteTexts[pos], "push": item.pasteTexts[pos] });
                                                     }
                                                 }
                                             }

=== modified file 'app/ui/LandscapeKeyboard.qml'
--- app/ui/LandscapeKeyboard.qml	2015-11-09 14:18:18 +0000
+++ app/ui/LandscapeKeyboard.qml	2015-12-02 22:18:10 +0000
@@ -61,7 +61,7 @@
             { text: "tan", name: "tangens", pushText: "tan(", kbdKeys: [Qt.Key_T] },
             { text: decimalPoint, name: "point", pushText: ".", textColor: "#DD4814" },
             { number: 0, name: "zero", textColor: "#DD4814", forceNumber: true },
-            { text: "( )", name: "universalBracket", pushText: "()", textColor: "#DD4814", kbdKeys: [Qt.Key_ParenLeft, Qt.Key_ParenRight, Qt.Key_BracketLeft, Qt.Key_BracketRight] },
+            { text: "( )", name: "universalBracket", pushText: "()", pasteTexts: ["(", ")"], textColor: "#DD4814", kbdKeys: [Qt.Key_ParenLeft, Qt.Key_ParenRight, Qt.Key_BracketLeft, Qt.Key_BracketRight] },
             { text: "=", name: "equals", action: "calculate", kbdKeys: [Qt.Key_Enter, Qt.Key_Return] },
             { text: "|x|", name: "abs", pushText: "abs(", kbdKeys: [Qt.Key_A, Qt.Key_Bar] },
             { text: "sin⁻¹", name: "arcsinus", pushText: "asin(" },

=== modified file 'app/ui/PortraitKeyboard.qml'
--- app/ui/PortraitKeyboard.qml	2015-11-09 14:18:18 +0000
+++ app/ui/PortraitKeyboard.qml	2015-12-02 22:18:10 +0000
@@ -43,7 +43,7 @@
             { text: "+", name: "plus" },
             { text: decimalPoint, name: "point", pushText: ".", textColor: "#DD4814" },
             { number: 0, name: "zero", textColor: "#DD4814", forceNumber: true },
-            { text: "( )", name: "universalBracket", pushText: "()", textColor: "#DD4814", kbdKeys: [Qt.Key_ParenLeft, Qt.Key_ParenRight, Qt.Key_BracketLeft, Qt.Key_BracketRight] },
+            { text: "( )", name: "universalBracket", pushText: "()", pasteTexts: ["(", ")"], textColor: "#DD4814", kbdKeys: [Qt.Key_ParenLeft, Qt.Key_ParenRight, Qt.Key_BracketLeft, Qt.Key_BracketRight] },
             { text: "=", name: "equals", action: "calculate", kbdKeys: [Qt.Key_Enter, Qt.Key_Return] }
         )
     }


Follow ups