Commit Graph

176 Commits

Author SHA1 Message Date
Jekyll Wu
1c275207e0 Rename and constify 2012-03-12 15:35:35 +08:00
Jekyll Wu
7dee255b14 Add workaround for the problem that Session::processId() might return 0
That was not an actual problem before KDE 4.8, because the old code
guaranteed when Session::processId() was called, the session had
already started running so it wouldn't return 0.

Since KDE 4.8, that guarantee was not there any more since a hard-coded
200ms delay is introduced to avoid the session starting "too quickly".
In short, this is another side effect of the fix for infameous BKO #176902.

See https://bugzilla.novell.com/show_bug.cgi?id=745954 for one concrete
issue caused by this underlying problem
2012-03-11 13:13:38 +08:00
Jekyll Wu
507619dff2 Emit signal on receiving escape sequence for changing terminal size
This is just one needed prerequisite for supporting the resizing
escape sequence. I still have no clear clue of adding the support
correctly
2012-03-09 15:16:42 +08:00
Jekyll Wu
f4fb943132 Most of time we only need <KLocalizedString> instead of <KLocale> 2012-03-07 06:48:26 +08:00
Jekyll Wu
d49da53277 Avoid redundant information in warning messages 2012-03-06 21:35:01 +08:00
Jekyll Wu
d81e355b54 Session does not need to know about internal detail of Pty 2012-03-06 21:24:55 +08:00
Jekyll Wu
78dbf8f1c1 Remove the left-over & unused code for supporting "Scroll Lock" key
It is decided to not reimplement this feature in KDE4 konsole:

  * It is non-trivial work to implement it correctly
  * It annoyed some users when it was available in KDE3 konsole
  * Not many users want this feature back

This is a follow up of commit cee0ce539b

CCBUG:172271
REVIEW:104156
2012-03-05 08:29:12 +08:00
Jekyll Wu
ac291d69d6 Add extra safeguard for calling kill() 2012-03-04 06:32:22 +08:00
Jekyll Wu
a6e40263e1 Add extra safeguard for calling kill() 2012-03-04 06:28:16 +08:00
Jekyll Wu
597d0cf71e Rename and move code around 2012-03-04 06:26:28 +08:00
Jekyll Wu
f57cf2fd10 No need to check _emulation for Null explicitly
That _emulation must have been initialized in the constructor.
2012-03-04 05:21:17 +08:00
Jekyll Wu
cc1b3a482b Remove unused accessor 2012-03-04 04:54:38 +08:00
Jekyll Wu
38e6f89e4a Add enum entry for the escape code of changing session icon 2012-02-27 21:03:39 +08:00
Jekyll Wu
363a270177 Allow changing tab title through escape sequence
Users can now change the tab title through "\e]30;Tab Title\a" .

This is a feature previously available in KDE3 konsole.

FEATURE: 179142
FIXED-IN: 4.9.0

REVIEW: 103862
2012-02-24 21:21:07 +08:00
Jekyll Wu
3b7e953523 Yet another around of cleaning up #includes 2012-02-22 07:18:30 +08:00
Jekyll Wu
0331f97b60 Another try of cleaning up of #includes 2012-02-21 05:18:31 +08:00
Jekyll Wu
f42fd4721b Clean up unneeded #includes 2012-02-20 19:41:38 +08:00
Jekyll Wu
10e1f01fc2 Just rename :) 2012-02-14 08:19:51 +08:00
Jekyll Wu
ad947159e2 Why modify _notifiedActivity in the handler for notifying silence? 2012-02-14 07:46:48 +08:00
Jekyll Wu
8d626c16cf Improve the logic of Session::setMonitorActivity(bool)
* do nothing when current status is the same as new status
  * alwasy stop the related timer
2012-02-14 07:28:36 +08:00
Jekyll Wu
83c8296d1c Add simple comment for resetting the timer for monitoring silence 2012-02-14 06:56:34 +08:00
Jekyll Wu
10341b7c76 [Trivial] Rename and move code around 2012-02-14 06:52:45 +08:00
Jekyll Wu
8e9e391d2a Trivial fix for comments 2012-02-14 06:33:23 +08:00
Jekyll Wu
f19eb2a964 Remove inappropriate comments 2012-02-14 06:27:58 +08:00
Jekyll Wu
f0529c1c02 Prefer foreach(..) over iterating manually for readability 2012-02-13 21:28:48 +08:00
Kurt Hindenburg
8bceb701a7 Add comment about changing Icon using ]32; 2012-02-09 23:01:47 -05:00
Kurt Hindenburg
fc2ae02a23 I don't think \033]31 has ever worked in KDE 4.x 2012-02-09 22:18:16 -05:00
Jekyll Wu
7e6916d57c Move some environment varibale settings from Pty to Session
I failed to see the intention of adding some environment variables in
class Session while adding some other environment variables in class
Pty. The current way makes Pty::start() contain too many parameters,
which looks ugly and is not easy to understand.

The only side effect of this commit is dbus method environment() will
return more. I don't think that would be harmful.
2012-02-10 02:38:04 +08:00
Jekyll Wu
ee95187bce Better not manipulate _environemnt member directly
In general, I think the current way of setting environment is a bit
problematic. This commit is a preparation for further changes
2012-02-10 02:06:07 +08:00
Jekyll Wu
07cddfe302 Create dbus object for each Konsole window respectively
Its naming scheme is "/Windows/N", similar to "/Sessions/N" for
sessions. That is not the final decision and might change before next
major release.

The old "/Konsole" dbus object is still available at this moment, but
it might disappear or be used for something different in the future, so
it is better to use "/Windows/N" from now on.

For convenience, $KONSOLE_DBUS_WINDOW can be used to refer to the dbus
object corresponding to the Konsole window containing current session.
Note, that environment variable does not work well with detaching and
draging. Maybe it should not be added at all.

CCBUG:276912
CCBUG:281513
CCBUG:292309

REVIEW:103790
2012-02-09 01:50:43 +08:00
Jekyll Wu
95b8d5551e Add dbus method for setting and querying history size per session
FEATURE: 120040
FIXED-IN: 4.9
2012-01-26 21:20:09 +08:00
Jekyll Wu
3d8da1f878 Make 'foreach(...)' more readable 2012-01-14 22:54:56 +08:00
Kurt Hindenburg
d8e05a0672 Use the Qt versions of strlen, strncpy, strncmp 2012-01-03 23:29:05 -05:00
Kurt Hindenburg
1baa56feda White space changes - astyle and Qt normalize don't like each other.
Use 'git diff -w --ignore-all-space' to see non-whitespace changes.
2011-12-25 13:13:55 -05:00
Kurt Hindenburg
73b7f56968 Apply astyle-kdelibs
Over the years, the coding style is all over the place.

Use 'git diff -w --ignore-all-space' to see non-whitespace changes.
2011-12-24 11:18:00 -05:00
Jekyll Wu
36bd1828f3 Revert "Ensure %w and %# are also expaned in the 'Copy input' dialog"
That fix is not good enough because it makes '%w' being updated only
after keystroke instead of immediately . The issue of updating title is
actually a little more complicated than I have understood.

Revert it because the regression should influence more users than the
fixed problem does. Need to spend more time to find a better fix.

CCBUG: 175755
CCBUG: 287536

This reverts commit 1c1981501b.
2011-11-29 14:15:47 +08:00
Jekyll Wu
142e6b73ca Normalize signal/slot 2011-11-07 17:28:58 +08:00
Jekyll Wu
125e2c7bd2 Declare pointer and reference in a consistent way
Most code use the "const QString& text" form, instead of the "const
QString &text" form. So change the minority to be consistent with
the majority.
2011-11-06 06:13:28 +08:00
Jekyll Wu
cf92cece2b Remove leading white spaces in blank lines to make them really empty 2011-11-05 07:29:21 +08:00
Jekyll Wu
102371bb3a Rename _closePerUser to _closePerUserRequest for clarity 2011-10-24 18:42:03 +08:00
Jekyll Wu
841206fb13 Title set by dbus method setTitle() should be sticky by default
It is not intuitive and easy for users to find they need also
call dbus method setTabTitleFormat() to avoid that title being
replaced on session activity.

BUG: 262089
FIXED-IN: 4.8
2011-10-22 18:56:26 +08:00
Jekyll Wu
1c1981501b Ensure %w and %# are also expaned in the 'Copy input' dialog
The fix is quite simple. Just move the existing code for expanding
%# and %w into Session::getDynamicTitle(), where all other tab title
formatters are expanded. That also makes the code simple and natural.

BUG: 175755
FIXED-IN:4.8
2011-10-22 03:18:01 +08:00
Jekyll Wu
07bf74c335 Adjust #include to make the dependency more explicit 2011-10-21 22:09:48 +08:00
Jekyll Wu
a2a54f41d8 make Session::updateForegroundProcessInfo() easier to understand 2011-10-21 19:09:59 +08:00
Jekyll Wu
379c5bb7de Minor change on initial value and code style 2011-10-21 19:09:59 +08:00
Jekyll Wu
3d0b5a74d0 'delete NULL' is always safe 2011-10-21 19:09:51 +08:00
Jekyll Wu
fc6c244335 fix the compiler warning for the order of member initialization 2011-10-21 17:03:59 +08:00
Jekyll Wu
ed88c7f5da Refactor Session::activityStateSet() to make it more readable 2011-10-21 13:23:22 +08:00
Jekyll Wu
277038478b Allow activity notification to be triggered more than once.
The activity notification is now masked for a while after it is triggered.
That is basically what KDE3 konsole does. The mask interval is intended
to avoid the flooding of notification and is hardcoded as 15 seconds
at the moment. Maybe that interval should be user configurable.

FIXED-IN:4.8
CCBUG: 257752
2011-10-21 12:37:47 +08:00
Jekyll Wu
b4d30060c2 Rename the timer related with "Monitor Silence" for clarity
That timer is dedicated for the "Monitor Silence" feature, so
_monitorTimer is a too generic name.
2011-10-21 05:05:09 +08:00