News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

[Idea] Button to copy the text in the chat

Started by Yona-TYT, June 24, 2018, 01:51:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT


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.

prissi

While not too difficult to code, why? For that purpose there is the simutranslator.

Yona-TYT

Quote from: prissi on June 24, 2018, 03:04:06 PMWhile 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



An_dz

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.

Yona-TYT

Quote from: An_dz on June 24, 2018, 09:38:54 PMSimutranslator 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.  :-[

prissi

Ok, I seem. Well I could send it directly to google translate, if wished for. It is just a http request ...

DrSuperGood

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.

prissi

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.

Ters

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).

prissi

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.

DrSuperGood

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.

Ters

Quote from: prissi 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.
Well, that's what SDL2 uses anyway. Saves us from maintaining that window.

Quote from: DrSuperGood 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.
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?

prissi

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 ...

Yona-TYT

#13
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
ifeq ($(OSTYPE),mingw)
  SOURCES += clipboard_w32.cc
else
  SOURCES += clipboard_s2.cc
endif

Yona-TYT

I wonder what happened to this, any progress? or it has been forgotten.  ::'(

Ters

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.

Yona-TYT

@Prissi
The SDL2 clipboard is not in use, could you modify the linux makefile to use "clipboard_s2.cc"?.  ???

Ters

Quote from: Yona-TYT 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"?.  ???
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.


prissi


Yona-TYT

Quote from: prissi on December 01, 2018, 01:59:25 PMShould be used now ... (r8640)

[]Sorry, I didn't see your message (problems with my Gmail). :(

Does it mean we need a new button in the title bar?.

prissi