Commit 53d5b769 authored by Robert Knight's avatar Robert Knight

Allow tab titles to include the window title set by the shell. Fix arithmetic...

Allow tab titles to include the window title set by the shell.  Fix arithmetic exception when trying to shrink/expand the current view if it is the only view open.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=663712
parent 07b1e29c
......@@ -131,6 +131,7 @@ void MainWindow::activeViewChanged(SessionController* controller)
void MainWindow::activeViewTitleChanged(ViewProperties* properties)
{
setPlainCaption(properties->title());
setWindowIcon(properties->icon());
}
IncrementalSearchBar* MainWindow::searchBar() const
......
......@@ -63,7 +63,7 @@ QString ProcessInfo::format(const QString& input) const
output.replace("%d",QFileInfo(currentDir(&ok)).baseName());
// remove any remaining %[LETTER] sequences
output.replace(QRegExp("%\\w"),QString::null);
// output.replace(QRegExp("%\\w"),QString::null);
return output;
}
......@@ -476,7 +476,7 @@ QString SSHProcessInfo::format(const QString& input) const
output.replace("%c",_command);
// remove any remaining %[LETTER] character sequences
output.replace(QRegExp("%\\w"),QString::null);
// output.replace(QRegExp("%\\w"),QString::null);
return output;
}
......
......@@ -138,6 +138,8 @@ void SessionController::snapshot()
process = snapshot;
bool ok = false;
// format tab titles using process info
QString title;
if ( process->name(&ok) == "ssh" && ok )
{
......@@ -147,11 +149,7 @@ void SessionController::snapshot()
else
title = process->format(_session->tabTitleFormat(Session::LocalTabTitle) ) ;
if ( !title.simplified().isEmpty() )
setTitle(title);
else
setTitle(_session->title());
if ( snapshot != process )
{
delete snapshot;
......@@ -159,6 +157,15 @@ void SessionController::snapshot()
}
else
delete snapshot;
// format tab titles using session title
title.replace("%w",_session->userTitle());
// apply new title
if ( !title.simplified().isEmpty() )
setTitle(title);
else
setTitle(_session->title());
}
KUrl SessionController::url() const
......
......@@ -31,18 +31,18 @@ using namespace Konsole;
const TabTitleFormatAction::Element TabTitleFormatAction::_localElements[] =
{
{ "%n" , i18n("Program Name") },
{ "%p" , i18n("Profile Name") },
{ "%d" , i18n("Current Directory (Short)") },
{ "%D" , i18n("Current Directory (Long)") }
{ "%n" , i18n("Program name") },
{ "%d" , i18n("Current directory (Short)") },
{ "%D" , i18n("Current directory (Long)") },
{ "%w" , i18n("Window title set by shell") }
};
const int TabTitleFormatAction::_localElementCount = 4;
const TabTitleFormatAction::Element TabTitleFormatAction::_remoteElements[] =
{
{ "%p" , i18n("Profile Name") },
{ "%u" , i18n("User Name") },
{ "%h" , i18n("Remote Host (Short)") },
{ "%H" , i18n("Remote Host (Long)") }
{ "%u" , i18n("User name") },
{ "%h" , i18n("Remote host (Short)") },
{ "%H" , i18n("Remote host (Long)") },
{ "%w" , i18n("Window title set by shell") }
};
const int TabTitleFormatAction::_remoteElementCount = 4;
......
......@@ -62,7 +62,7 @@ void ViewSplitter::adjustContainerSize(ViewContainer* container , int percentage
// qDebug() << "Old container size:" << oldSize << ", new size:" << newSize;
int perContainerDelta = ( (newSize-oldSize) / (count()-1) ) * (-1);
int perContainerDelta = (count() == 1 ) ? 0 : ( (newSize-oldSize) / (count()-1) ) * (-1);
// qDebug() << "Changing sizes of other containers by " << perContainerDelta << "pixels.";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment