Skip to content

Conversation

gkapad
Copy link
Contributor

@gkapad gkapad commented Sep 21, 2025

  • using biboumi irc gateway, that keep connections open with upstream irc networks,
    found my self in the case of seeing a dialog like: You are in or joining this room already, without to be able to figure out what is that room, or what is the account i'm trying to connect with.
  • so, here a more informative dialog for that specific case.
  • maybe there are more dialogs like this, with limited information, but that commit fix just this.

QMessageBox::information(
this,
tr("Error"),
tr("You are in or joining this room already!\n\n- Account: %1\n- Room: %2\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm maybe to ease translations it would be better to

QString("%1\n\n- %2: %3\n- %4: %5").arg(
  tr("You are in or joining this room already!"),
  tr("Account"),
  account_->jid().bare(),
  tr("Room"),
  j.bare()
);

And please don't use formatting with extra spaces in translatable strings. It will look weird in other translations. You can try to use html instead (read about rich text in QMessageBox docs)

- like @rion pointed out pass variable text in the `tr` function,
will broke the translation of the project.
- also, hardcoded spaces in order to make a good looking message,
is rather impossible to stay after a translation, so this is not the way either.
- play some with html, but when doing that long texts will make the messages
to wrap in the first dash `-` ...
- so for now, also to keep a common look to these kind of dialogs,
i think @rion's simple example is how it should be.
@gkapad
Copy link
Contributor Author

gkapad commented Sep 22, 2025

  • i dont know if this is the right way to update/continue a commit, i'm not so familiar with git...

@gkapad
Copy link
Contributor Author

gkapad commented Sep 22, 2025

** another issue imo with this certain dialog, is that is a modal, means lock focus and dont allow interact with the main gui, unless you close it. I try to set it's parent to a nullptr, but that didnt work either. i think, should not block. it's just an infromation dialog, that also would be useful to stay there if the user needs to investigate further.
dont know how to fix that

@Ri0n Ri0n merged commit ba8260b into psi-im:master Sep 23, 2025
@Ri0n
Copy link
Member

Ri0n commented Sep 23, 2025

the modality is easy to fix. just don't use static helpers to show the dialog. create it explicitly via new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants