After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725088 - Fpaste when message is long and misclick prevention
Fpaste when message is long and misclick prevention
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
: 722011 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-02-24 19:45 UTC by Daniel Korostil
Modified: 2015-10-14 01:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Update and activate paste service integration (7.22 KB, patch)
2015-08-17 23:29 UTC, Bastian Ilsø
none Details | Review
entryArea: Update and activate paste service integration (8.07 KB, patch)
2015-08-20 14:26 UTC, Florian Müllner
committed Details | Review

Description Daniel Korostil 2014-02-24 19:45:34 UTC
Usecases:

(1) when you type a message longer then 100 (we can discuss the limit) characters it make sense to use paste-bin service automatically.

(2) drag'n'drop can occasually cause the misclick and paste the unwanted URL.



So, I suggest to paste the URL if only text is long and only by entry.
Comment 1 Bastian Ilsø 2015-08-17 23:29:01 UTC
Created attachment 309432 [details] [review]
Update and activate paste service integration

Brings back paste service integration to Polari.
When pasting more than 5 lines into the entry area,
ask the user if the multiline text should be uploaded
to a public paste service. 'Enter' confirms and 'Esc'
cancels.
Comment 2 Florian Müllner 2015-08-20 13:11:52 UTC
Review of attachment 309432 [details] [review]:

As talked on hangouts, this approach doesn't really work with DND (and non-textual data as images in particular). However that requires some more thinking, and should be fixable post-freeze without a break, so let's go with this for 3.17.90 - couple of issues still, but overall looks good (nice work!)

::: src/entryArea.js
@@ +103,3 @@
+        multiLineBox.add(this._multiLinelabel);
+
+        this._pasteButton = new Gtk.Button({ label: _("Paste"), has_focus: true,

Probably a good idea to use mnemonics

@@ +108,3 @@
+        this._pasteButton.connect('clicked', Lang.bind(this, function() {
+                this._entry.text = '';
+                this.stack.visible_child_name = 'default';

This is exactly the as the cancelButton's ::clicked handler - please split out into a named function to share the code between both buttons.

@@ +110,3 @@
+                this.stack.visible_child_name = 'default';
+            }));
+        multiLineBox.add(this._pasteButton);

[Paste][Cancel] is very un-gnomey when compared to [Cancel][Paste] ...
Comment 3 Florian Müllner 2015-08-20 14:26:34 UTC
Created attachment 309728 [details] [review]
entryArea: Update and activate paste service integration

This is the patch with the comments from the review applied, plus a couple more things:
 - make the stack the toplevel EntryArea widget - no point in having
   a box with a single child in the hierarchy
 - fix 'linked' style of nick and main entry
 - use ngettext() for plural - not an issue for English and most (all?)
   Western language (as the paste code never triggers for "1 line"),
   but some languages have far more complicated plural rules (e.g. the
   word "line" varies between "20 lines", "21 lines" and "22 lines"
 - some style issues like space before opening parentheses
Comment 4 Florian Müllner 2015-08-20 14:43:20 UTC
Attachment 309728 [details] pushed as ec24d29 - entryArea: Update and activate paste service integration

(need to get 3.17.90 out, sorry)
Comment 5 Florian Müllner 2015-10-14 01:51:31 UTC
*** Bug 722011 has been marked as a duplicate of this bug. ***