The International Simutrans Forum

 

Author Topic: [Idea] Button to copy the text in the chat  (Read 1043 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
[Idea] Button to copy the text in the chat
« on: June 24, 2018, 01:51:15 PM »

I can think of a small button in the title bar that allows to copy the text in the window, it is useful for example to translate some text in Japanese.
I think this is very useful.
« Last Edit: June 24, 2018, 10:16:14 PM by Yona-TYT »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: [Idea] Button to copy the text in the chat
« Reply #1 on: June 24, 2018, 03:04:06 PM »
While not too difficult to code, why? For that purpose there is the simutranslator.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: [Idea] Button to copy the text in the chat
« Reply #2 on: June 24, 2018, 03:07:51 PM »
While not too difficult to code, why? For that purpose there is the simutranslator.
I think it's easier to use google translator, I have no idea how to use simutranslator.  :o

I think A rookie player would say the same thing.   :P


 

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2836
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: [Idea] Button to copy the text in the chat
« Reply #3 on: June 24, 2018, 09:38:54 PM »
Simutranslator won't help here, those are chat messages. And I think it's a good idea to offer a way for people to copy the contents of the messages.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: [Idea] Button to copy the text in the chat
« Reply #4 on: June 24, 2018, 10:12:19 PM »
Simutranslator won't help here, those are chat messages. And I think it's a good idea to offer a way for people to copy the contents of the messages.
Exactly, especially if it is some text in Japanese (it has already happened to me), there is no easy way to translate it.
Unfortunately, for linux users the clipboard does not work, but Windows has no problems with that.  :-[

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: [Idea] Button to copy the text in the chat
« Reply #5 on: June 25, 2018, 02:04:25 AM »
Ok, I seem. Well I could send it directly to google translate, if wished for. It is just a http request ...

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2524
  • Languages: EN
Re: [Idea] Button to copy the text in the chat
« Reply #6 on: June 25, 2018, 04:54:06 AM »
How does the clipboard in Linux work? Windows is using a specific Windows implementation for it to work.

One should be able to copy chat messages to clipboard. A lot of games offer this functionality. Very useful for hyperlinks and such.

I would say the solution would be that when one clicks the chat message the resulting window has the text in a read only editable form. One can then drag select the desired content from the message and use the standard copy and paste features.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: [Idea] Button to copy the text in the chat
« Reply #7 on: June 25, 2018, 02:41:17 PM »
Linux does not have an universal clipboard. There are some window-manager specific implementations and a X11 clipboard for text only content, which ususally clashes with the backends. That is why there is no general Linux support.

But I see that SDL has clipboard support.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: [Idea] Button to copy the text in the chat
« Reply #8 on: June 25, 2018, 03:36:09 PM »
Simutrans only ever copies text, so the X11 clipboard ought to be enough. How does this clash with he backends? clipboard_w32.cc is backend independent (as is simsys_w32_png.cc, sort of).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: [Idea] Button to copy the text in the chat
« Reply #9 on: June 26, 2018, 02:06:32 AM »
The X11 clipboard requires a hidden window and will no work with wayland and may clash with fullscreen SDL using framebuffer. So I am rather in favour of the SDL clipboard.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2524
  • Languages: EN
Re: [Idea] Button to copy the text in the chat
« Reply #10 on: June 26, 2018, 08:17:31 AM »
SDL has clipboard for text which should be fully multi platform. It even takes UTF-8 input and on windows I imagine it implicitly converting to UTF-16 and using the native windows API.

In this case the current windows clipboard implementation would then be placed with the windows GDI front end. The SDL front end would then provide clipboard support via SDL.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: [Idea] Button to copy the text in the chat
« Reply #11 on: June 26, 2018, 08:38:36 AM »
The X11 clipboard requires a hidden window and will no work with wayland and may clash with fullscreen SDL using framebuffer.
Well, that's what SDL2 uses anyway. Saves us from maintaining that window.

SDL has clipboard for text which should be fully multi platform. It even takes UTF-8 input and on windows I imagine it implicitly converting to UTF-16 and using the native windows API.

In this case the current windows clipboard implementation would then be placed with the windows GDI front end. The SDL front end would then provide clipboard support via SDL.
Are we ditching SDL1 support then? As far as I can tell, there is no clipboard support there. And Allegro? Who is maintaining that anyway?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: [Idea] Button to copy the text in the chat
« Reply #12 on: June 26, 2018, 11:34:18 AM »
I am not sure allgro works. It was needed form BeOS and DOS, so it may be ok to officially ditch it. It may work out of the box. It had slightly better performance on Windows, but I am not sure that this is relevant any more.

And SDL still has no cliboard, so no change there ...

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: [Idea] Button to copy the text in the chat
« Reply #13 on: July 01, 2018, 02:28:11 AM »
Hello, what is that?
Any progress with the clipboard in linux?
And what about the idea of the button to copy the text? Regards!.  ;D
edit.
Well it works fine, I've just edited the makefile.  :P
Code: [Select]
ifeq ($(OSTYPE),mingw)
  SOURCES += clipboard_w32.cc
else
  SOURCES += clipboard_s2.cc
endif
« Last Edit: July 01, 2018, 03:16:48 AM by Yona-TYT »

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: [Idea] Button to copy the text in the chat
« Reply #14 on: July 28, 2018, 05:32:45 PM »
I wonder what happened to this, any progress? or it has been forgotten.  ::'(

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: [Idea] Button to copy the text in the chat
« Reply #15 on: July 28, 2018, 06:20:52 PM »
Simutrans isn't made by order. It is made by those who want it, who then share their work free of charge. If nobody who wants it makes it, it has next to no chance of being made.

And developers do so in their limited free time, so they might avoid promising something to avoid being pestered about it until they find the time.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: [Idea] Button to copy the text in the chat
« Reply #16 on: November 28, 2018, 11:59:07 PM »
@Prissi
The SDL2 clipboard is not in use, could you modify the linux makefile to use "clipboard_s2.cc"?.  ???

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: [Idea] Button to copy the text in the chat
« Reply #17 on: November 29, 2018, 06:25:34 AM »
@Prissi
The SDL2 clipboard is not in use, could you modify the linux makefile to use "clipboard_s2.cc"?.  ???
Actually, it is just a typo or two. The makefile tries to use clipboard_s.cc, which doesn't exist, so it shouldn't build at all. However, it may build because case sensitiveness means that SDL2 does not match sdl2, causing the internal clipboard to be used.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: [Idea] Button to copy the text in the chat
« Reply #18 on: November 29, 2018, 10:34:24 AM »
Interesting. 8)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: [Idea] Button to copy the text in the chat
« Reply #19 on: December 01, 2018, 01:59:25 PM »
Should be used now ... (r8640)