Merge lp://staging/~mcintire-evan/ubuntu-terminal-app/disable-paste into lp://staging/~ubuntu-terminal-dev/ubuntu-terminal-app/reboot

Proposed by Evan McIntire
Status: Superseded
Proposed branch: lp://staging/~mcintire-evan/ubuntu-terminal-app/disable-paste
Merge into: lp://staging/~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
Diff against target: 3410 lines (+971/-635) (has conflicts)
71 files modified
manifest.json.in (+1/-1)
po/am.po (+9/-15)
po/ar.po (+7/-13)
po/ast.po (+7/-13)
po/az.po (+7/-13)
po/be.po (+7/-13)
po/br.po (+7/-13)
po/bs.po (+7/-13)
po/ca.po (+20/-6)
po/com.ubuntu.terminal.pot (+6/-2)
po/cs.po (+5/-5)
po/cy.po (+7/-13)
po/da.po (+5/-5)
po/de.po (+7/-13)
po/el.po (+7/-13)
po/en_AU.po (+7/-13)
po/en_GB.po (+7/-13)
po/eo.po (+6/-9)
po/es.po (+7/-13)
po/eu.po (+7/-13)
po/fa.po (+7/-13)
po/fi.po (+7/-13)
po/fo.po (+20/-6)
po/fr.po (+7/-13)
po/gd.po (+21/-6)
po/gl.po (+8/-14)
po/he.po (+7/-13)
po/hr.po (+7/-13)
po/hu.po (+7/-13)
po/id.po (+7/-13)
po/it.po (+7/-13)
po/ja.po (+7/-13)
po/lv.po (+7/-13)
po/nb.po (+7/-13)
po/nl.po (+7/-13)
po/pa.po (+7/-13)
po/pl.po (+14/-10)
po/pt.po (+8/-14)
po/pt_BR.po (+7/-13)
po/ro.po (+7/-13)
po/ru.po (+7/-13)
po/sl.po (+7/-13)
po/sr.po (+9/-15)
po/sv.po (+7/-13)
po/tr.po (+7/-13)
po/ug.po (+7/-13)
po/uk.po (+7/-13)
po/zh_CN.po (+7/-13)
po/zh_TW.po (+7/-13)
src/app/qml/AlternateActionPopover.qml (+3/-2)
src/app/qml/AuthenticationDialog.qml (+4/-4)
src/app/qml/AuthenticationService.qml (+2/-2)
src/app/qml/CircularTransparentButton.qml (+1/-1)
src/app/qml/ExpandableButton.qml (+1/-1)
src/app/qml/KeyboardBar.qml (+1/-1)
src/app/qml/KeyboardRows/ExpandableKeyboardButton.qml (+1/-1)
src/app/qml/KeyboardRows/JsonTranslator.qml (+1/-1)
src/app/qml/KeyboardRows/KeyModel.qml (+1/-1)
src/app/qml/KeyboardRows/KeyboardButton.qml (+1/-1)
src/app/qml/KeyboardRows/KeyboardLayout.qml (+2/-2)
src/app/qml/KeyboardRows/KeyboardRow.qml (+1/-1)
src/app/qml/LayoutsPage.qml (+11/-15)
src/app/qml/ListItemWithActions.qml (+454/-0)
src/app/qml/SettingsPage.qml (+87/-5)
src/app/qml/TabsPage.qml (+2/-1)
src/app/qml/TerminalComponent.qml (+1/-1)
src/app/qml/TerminalPage.qml (+2/-8)
src/app/qml/ubuntu-terminal-app.qml (+1/-10)
src/plugin/qmltermwidget/lib/TerminalDisplay.cpp (+5/-0)
src/plugin/qmltermwidget/lib/TerminalDisplay.h (+4/-0)
terminal.apparmor (+1/-1)
Text conflict in po/ca.po
Text conflict in po/com.ubuntu.terminal.pot
Text conflict in po/fo.po
Text conflict in po/gd.po
Text conflict in po/pl.po
Contents conflict in src/app/qml/ColorSchemePage.qml
Text conflict in src/app/qml/SettingsPage.qml
To merge this branch: bzr merge lp://staging/~mcintire-evan/ubuntu-terminal-app/disable-paste
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Needs Fixing
Niklas Wenzel (community) Approve
Stefano Verzegnassi Approve
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Review via email: mp+283244@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2016-02-06.

Commit message

Disables "paste" if the clipboard buffer is empty

Description of the change

Disables "paste" if the clipboard buffer is empty

To post a comment you must log in.
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Thank you for the patch!

I really see why you want to implement this feature. However, there are some issues with the code.

What this currently does is the following: it hides the paste option when the user has selected some text and shows it if there is no selection. So currently this does not at all check if the clipboard is empty or not.
In order to change that, you would probably want to use the Clipboard API for that: https://developer.ubuntu.com/api/apps/qml/sdk-15.04.1/Ubuntu.Components.Clipboard/
It should do the trick. ;)

Cheers,
Niklas

review: Needs Fixing
Revision history for this message
Evan McIntire (mcintire-evan) wrote :

Hmm, I did fix that already, i guess the commit didn't push, I'll look into it when I get home

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

Looks good!

review: Approve
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Thanks for changing this. :)

However, there are four lines in the pot file which seem to stem from a merge error. We need to fix this before we can merge the MP. The easiest way to do that would probably be to just run it once again from the Ubuntu SDK and then commit the automatic pot file updates. Would you mind doing that? :)

Thank you very much in advance!

review: Needs Fixing
Revision history for this message
Evan McIntire (mcintire-evan) wrote :

Sure, thanks for the review! These small merge issues always get me

Revision history for this message
Evan McIntire (mcintire-evan) wrote :

Hmm, still not fixed. Any pointers? I assume this is a bzr-ism or a launchpad-ism I'm not used to

Revision history for this message
Niklas Wenzel (nikwen) wrote :

Looks like there have been a few changes in trunk since you branched off your tree. Here is how to resolve this:

$ bzr branch lp:~mcintire-evan/ubuntu-terminal-app/disable-paste
$ bzr branch lp:ubuntu-terminal-app trunk
$ cd disable-paste
$ bzr merge ../trunk
$ bzr conflicts # should list one conflict
$ nano po/com.ubuntu.terminal.pot
$ # Now resolve the conflict by removing the old date and the lines added by bzr
$ bzr resolve po/com.ubuntu.terminal.pot
$ bzr commit -m "Merge trunk"

That's it. :)

Give it a try. I agree that it can be a bit strange at first. ;)

Revision history for this message
Evan McIntire (mcintire-evan) wrote :

Alright, there we go :)

Also, quick question, does launchpad squish all the commits from a branch into one when it merges

Revision history for this message
David Planella (dpm) wrote :

It does, although the individual commits are still there and can be seen under the main merge commit with tools such as 'bzr qlog' ('sudo apt install qbzr' to use it).

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Tested on my BQ, and looks good. Nice job! :D

Having a look at Niklas' review, I guess the "needs-fixing" is about the conflict with .pot, so there shouldn't be any problem in getting this branch merged.

Anyway, here's some note for a further task:

1) I believe it's better to use the Qt APIs (instead of Ubuntu.Components.Clipboard) since currently the QML GUI does not handle the clipboard (everything is done internally in the terminal widget). This could change in future, but I don't think it's a good idea to change heavily the C++ terminal code yet (Filippo, the former terminal-app maintainer, aimed to keep the code in sync with the upstream project from LxQt).

2) I'd prefer to set "enabled: !terminal.isClipboardEmpty()" instead of "visible" in order to stay consistent with the rest of the platform (i.e. see TextField/TextArea popover).
   The entry in the popover should be always visible, but not triggerable if not necessary (I should check the UI specs though).

3) I'd expect to see a similar MP for the copy action too. Currently the action is still visible when no text is actually selected. (TBD in a different branch though)

4) Probably we'd like to redesign the whole popover, so that it looks similar to the popover used in the TextField/TextArea. We'd need to check if the component is publicly available or if we can get its style through a StyledItem.

About the .pot conflict:
If you don't need to update the translations in your branch, remember to "bzr revert po/*.pot" before committing. That way you're sure you won't get any annoying conflict.

Thank you again! :)

review: Approve
Revision history for this message
Evan McIntire (mcintire-evan) wrote :

Thanks for the review - I linked your comment in a wishlist bug[1] relating to improving paste functionality, there are actually a few relating to that idea that we could work towards figuring out how we want it :)

[1] https://bugs.launchpad.net/ubuntu-terminal-app/+bug/1396974

Revision history for this message
Niklas Wenzel (nikwen) wrote :

Thank you for fixing this, Evan! The MP looks very good. :)

@Stefano: You make a really good point with (1). Let's keep that in mind when we continue to add features. :)

[Another note regarding pot file conflicts: If you have already committed stuff which causes a merge conflict, you can revert the po directory to the state which it was in before your first commit using

bzr revert -r 151 po/

where 151 is the revision before your first commit. That will also be handy sometimes. ;) ]

Let's merge the MP now!

review: Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/terminal-app-autolanding/85/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/3390/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Merging 'lp:ubuntu-terminal-app' in to 'build_dir'.
Text conflict in po/com.ubuntu.terminal.pot
1 conflicts encountered.
bzr: ERROR: Conflicts from merge

Looks like the pot file merge conflict we've been talking about. Try the command I posted above. ;)

155. By Evan McIntire

Hopefully fix merge issues

Revision history for this message
Evan McIntire (mcintire-evan) wrote :

Wow, I made it worse. Just a moment, let me re-merge the trunk in and fix all of this nonsense

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Ooh, the magical world of Launchpad trying to merge a .pot update when the
.pot has been updated in the meantime. :)

P.S. Now you know how a DocViewer developer feels, haha :'D

P.S. #2 We probably should prevent this from happening, by avoiding to
update translations every time the app is built in QtCreator
Il 06/feb/2016 21:01, "Evan McIntire" <email address hidden> ha scritto:

Wow, I made it worse. Just a moment, let me re-merge the trunk in and fix
all of this nonsense
--
https://code.launchpad.net/~mcintire-evan/ubuntu-terminal-app/disable-paste/+merge/283244
You are reviewing the proposed merge of
lp:~mcintire-evan/ubuntu-terminal-app/disable-paste into
lp:ubuntu-terminal-app.

Revision history for this message
Niklas Wenzel (nikwen) wrote :

@Stefano: Will Launchpad build the pot file itself in that case or how will it pick up new translatable strings then?

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

@Niklas: Changing the behaviour of the .pot custom target (i.e. removing the "ALL" option) in CMake should be enough, assuming nothing else will be broken.

That would mean that you'd have to explicitely do:
  mkdir build && cd dir
  cmake ../
  make <translations_target_name>
  (bzr commit & bzr push)

So it would be something you should do whenever you're about to release a new version of the app.
We may want to add a script in the root of the project for making this easier for new contributors.

Revision history for this message
Niklas Wenzel (nikwen) wrote :

@Stefano: I'm open to that.

However, we need to make sure to still build a new .pot file every once in a while and with enough time before the next release in order to make sure that translators have at least a week to get their translations in.

Unmerged revisions

155. By Evan McIntire

Hopefully fix merge issues

154. By Evan McIntire

Update POT file to resolve merge issues

153. By Evan McIntire

Use clipboard text, not selection text

152. By Evan McIntire

Hide "paste" option if the clipboard buffer is empty

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches