Use KTextEditor::Message in KateConsole::slotSync
AbandonedPublic

Authored by cullmann on Dec 22 2017, 10:22 PM.

Details

Reviewers
ederag
Summary

Following D9244, update KateConsole::slotSync (the directory synchronization in terminal)
to use KTextEditor::Message as an information, when the file is not local.
Previously, a string starting with ### was output to the terminal.
This might have been annoying if the # character was not a comment
for the interpreter currently running in the terminal.

The chosen level is just "Information", because when
"Automatic synchronize" is on,
the expected behavior is just a no-op.

Test Plan

Open two files in different directories,
as well as a remote file.

Switching between them and
Tools>Synchronize Terminal with Current Document
or in the Terminal Settings,
check Automatically synchronize the terminal with the current document when possible)

Upon switching to the remote file, a blue message should appear at the top:

Terminal not synchronized with current document, because
 <document url path>
 is not a local file

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
ederag requested review of this revision.Dec 22 2017, 10:22 PM
ederag created this revision.
ederag edited the test plan for this revision. (Show Details)
ederag edited the summary of this revision. (Show Details)Dec 22 2017, 10:24 PM
ederag edited the test plan for this revision. (Show Details)
ederag edited the summary of this revision. (Show Details)

What happens, if you edit several remove documents and switch a lot.
Will this "spam" the current view with the info message again and again?

Is this also displayed, when the terminal toolview is hidden? I would hope not, since maybe the user is no interested at all in the message in this case.

Ideally, the konsole should display this kind of information, and not the view. So far, I am not sure that we really want this.

What happens, if you edit several remove documents and switch a lot.
Will this "spam" the current view with the info message again and again?

Switching back and forth,
there is only one info message, at the top,
spammed several times if switching really fast
(say, more than once per second).

About the spamming, it would be nice to
collapse identical messages in the same view into one,
just resetting the timer.

But there is something weird:
sometimes, the message is stuck there.
And other messages seem locked out
(for instance, trying run in Terminal should issue an error message,
which does not appear)
Closing the document and reopening, everything is back to normal.
KDE Frameworks 5.26.0
Qt 5.6.1 (built against 5.6.1)

Is this also displayed, when the terminal toolview is hidden?

Yes.

I would hope not, since maybe the user is no interested at all in the message in this case.

Probably not in the AutoSync case.

Ideally, the konsole should display this kind of information, and not the view.

That's a possibility.
But having the message in the document view does help spotting the origin.

So far, I am not sure that we really want this.

Maybe add an option like "Inform about non-local files" for AutoSync,
off by default ?
This makes sense, and would suppress the spamming issue.

cullmann commandeered this revision.Nov 24 2018, 4:49 PM
cullmann edited reviewers, added: ederag; removed: cullmann.

I think we should not start to be over-verbose, lets skip this ATM.

cullmann abandoned this revision.Nov 24 2018, 4:49 PM

I think we should not start to be over-verbose, lets skip this ATM.

Let me recall that the current messages are invasive, actually:

Previously, a string starting with ### was output to the terminal.
This might have been annoying if the # character was not a comment
for the interpreter currently running in the terminal.

I do not really care, just making sure that this point did not get buried behind details.