D16837: Persist after closing last tab when running in background mode

Andrew Smith noreply at phabricator.kde.org
Mon Nov 12 12:34:39 GMT 2018


EspadaV8 added a comment.


  Sorry, I tried to update D16482 <https://phabricator.kde.org/D16482> using `arc` but it's created a new revision instead. I wanted to update the previous one so that it used the `--background-mode` flag instead of adding a new option. The update should now mean that if Konsole is started with `--background-mode` it will behave like Yakuake does so that if the last tab is closed, the window is hidden and a new default session is started for when the window it shown again.
  
  As I mentioned in D16482 <https://phabricator.kde.org/D16482>, I was originally using Yakuake, but rather than updating that it seemed better to update Konsole with a (long term) goal of deprecating Yakuake. I'm not aware of many features that Yakuake offers over Konsole while it does lack some and has bugs related to others (like the `Start in same directory as current tab` mentioned in D16482 <https://phabricator.kde.org/D16482>).
  
  Regarding this revision, I'm not super happy with how the `MainWindow` needs to have the new public signal and private slot to emit `lastTabClosed` that the `Application` needs to listen to. I couldn't think of another nice way to handle this since `Application` is the only place that knows if the programme was started with `--background-mode`. Passing that down into `MainWindow` seemed wrong and having `Application` handle the closing of `window`s seems wrong too (although less wrong). Also, is there any way to emit `lastTabClosed(this)` without needing to wrap it in the `allTabsClosed` method? I was hoping that the `connect(...)` line could just pass in a pointer but I couldn't find a way to do that.
  
  Other than that I think the code is pretty straight forward. We can easily check in `Application` if `_backgroundInstance` is set and if it isn't we know to tell `window` to `close()`, otherwise we want to create a new default session and call `_backgroundInstance->hide()`.

REPOSITORY
  R319 Konsole

REVISION DETAIL
  https://phabricator.kde.org/D16837

To: EspadaV8
Cc: konsole-devel, ngraham, maximilianocuria, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20181112/db9cc71e/attachment-0001.html>


More information about the konsole-devel mailing list