Bug 331533 - [JJ] send file file chooser dialog says 'open'
Summary: [JJ] send file file chooser dialog says 'open'
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: common-internals (show other bugs)
Version: 0.7.80
Platform: unspecified Linux
: NOR wishlist
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2014-02-26 12:57 UTC by Harald Sitter
Modified: 2014-03-18 15:32 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Creates a new widget which renames the "Open" button to "Send" (1.13 KB, patch)
2014-03-01 20:53 UTC, mayank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2014-02-26 12:57:38 UTC
when trying to send a file, a file chooser dialog comes up to select the file to send

the confirmation button will say 'Open' rather than for example 'Send'

Reproducible: Always
Comment 1 Martin Klapetek 2014-02-26 13:32:50 UTC
Quick investigation shows we're using

KFileDialog::getOpenFileNames(...)

and that does not provide any option to change the buttons or at least their captions.

Possible way is to create the dialog ourselves and set custom text on KFileDialog::okButton().

String freeze however makes this 0.9 material. Also JJ.
Comment 2 mayank 2014-03-01 18:07:45 UTC
I plan to add a new file say, SendFIleDialog.cpp which inherits the KFileDialog class, and has a custom method called, getSendFileUrls(), which has the button renamed as "Send". Does this sound good ? Should I go ahead with this ?
Comment 3 David Edmundson 2014-03-01 18:16:36 UTC
@mayank.

Sounds good.
Comment 4 mayank 2014-03-01 20:53:42 UTC
Created attachment 85375 [details]
Creates a new widget which renames the "Open" button to "Send"

It creates a new widget inheriting the current KFileDialog class.
Comment 5 mayank 2014-03-01 20:56:57 UTC
Is this not, a part of ktp-send-file instead of ktp-common-internals ?
Comment 6 mayank 2014-03-01 21:04:01 UTC
I will put it in kTp/Widgets once it is approved.
Comment 7 David Edmundson 2014-03-01 21:07:45 UTC
Can you put sendfile.h/cpp in a patch somewhere. Ideally reviewboard.
Comment 8 mayank 2014-03-01 21:38:25 UTC
https://git.reviewboard.kde.org/r/116520/
Comment 9 Martin Klapetek 2014-03-02 20:13:21 UTC
As stated on the review, all you need to do is mentioned in comment #1. No new class is needed for this.
Comment 10 mayank 2014-03-02 20:45:38 UTC
but that would be a hack, if I am not wrong ?


On Mon, Mar 3, 2014 at 1:43 AM, Martin Klapetek <mklapetek@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=331533
>
> --- Comment #9 from Martin Klapetek <mklapetek@kde.org> ---
> As stated on the review, all you need to do is mentioned in comment #1. No
> new
> class is needed for this.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 11 Martin Klapetek 2014-03-02 20:52:33 UTC
It would not, that method is specifically there for this purpose. Citing the docs:

"Returns a pointer to the OK-Button in the filedialog. You may use it e.g. to set a custom text to it."

See

http://api.kde.org/4.12-api/kdelibs-apidocs/kio/html/classKFileDialog.html#afe0157d8f50eabfe38cbf8066b7d6efe
Comment 12 mayank 2014-03-02 20:57:59 UTC
Yes, I read it. But since that would not leave any scope of modifying the
KFileDialog later, Also as you mentioned that we need to make the file
dialog ourselves, so I chose making a new class instead.


On Mon, Mar 3, 2014 at 2:22 AM, Martin Klapetek <mklapetek@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=331533
>
> --- Comment #11 from Martin Klapetek <mklapetek@kde.org> ---
> It would not, that method is specifically there for this purpose. Citing
> the
> docs:
>
> "Returns a pointer to the OK-Button in the filedialog. You may use it e.g.
> to
> set a custom text to it."
>
> See
>
>
> http://api.kde.org/4.12-api/kdelibs-apidocs/kio/html/classKFileDialog.html#afe0157d8f50eabfe38cbf8066b7d6efe
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 13 Martin Klapetek 2014-03-02 21:06:13 UTC
> But since that would not leave any scope of modifying the
KFileDialog later

What do you mean? We don't need the dialog later, we need it only that one time and it should be deleted afterwards.

> Also as you mentioned that we need to make the file
> dialog ourselves

Yes, using "new KFileDialog(..)" instead of using the static helper methods giving you the file name directly :) We actually do not create the dialog right now, it all happens behind the scenes for us.

> so I chose making a new class instead.

There's no use for a whole class reimplementing things when all you need to do is change one line; you would just move that one line inside the class (all the instantiating would be there just like with normal KFileDialog). So it adds code (more maintainance) for very very little gain.

(also when replying to bugs, can you please either comment via the web interface or remove all of the previous mail, it makes the bug report too noisy).
Comment 14 mayank 2014-03-03 08:48:42 UTC
changes, implemented.
Comment 15 David Edmundson 2014-03-13 10:26:35 UTC
Git commit dd42fafe15fe3cf2d2685899a28b7e2899b269dd by David Edmundson, on behalf of mayank jha.
Committed on 13/03/2014 at 10:25.
Pushed by davidedmundson into branch 'master'.

Renames the label of the File Dialog Button from "Open" to "Send"

Modifies the label of FileDialog button from "Open" button to "Send".

REVIEW: 116520

M  +8    -1    main.cpp

http://commits.kde.org/telepathy-send-file/dd42fafe15fe3cf2d2685899a28b7e2899b269dd
Comment 16 Martin Klapetek 2014-03-18 15:32:06 UTC
Git commit 9170e58d9ad8b0a66aae31556e1e468a2555a801 by Martin Klapetek, on behalf of mayank jha.
Committed on 18/03/2014 at 15:30.
Pushed by mklapetek into branch 'master'.

Renames the "Open" button of KFileDialog to "Send"

REVIEW: 116556

M  +8    -4    contact-list-widget.cpp

http://commits.kde.org/telepathy-contact-list/9170e58d9ad8b0a66aae31556e1e468a2555a801