Initial version of a command-line tool (konsoleprofile) to change profile options. Usage: konsoleprofile option=value . Applies to the profile used by the session in which konsoleprofile was executed. All of the logic is in Konsole itself. 'konsoleprofile' is just a very simple shell script which can be placed anywhere. Example usage: 'konsoleprofile colorscheme=WhiteOnBlack' will change the colors used by the active tab.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=670582
This commit is contained in:
Robert Knight
2007-06-02 05:02:55 +00:00
parent 317c5cb153
commit c345da0ccf
9 changed files with 115 additions and 5 deletions

View File

@@ -229,6 +229,9 @@ Session* SessionManager::createSession(const QString& key )
connect( session , SIGNAL(profileChanged(const QString&)) , this ,
SLOT(sessionProfileChanged()) );
connect( session , SIGNAL(profileChangeCommandReceived(const QString&)) , this ,
SLOT(sessionProfileCommandReceived(const QString&)) );
//ask for notification when session dies
_sessionMapper->setMapping(session,session);
connect( session , SIGNAL(finished()) , _sessionMapper ,
@@ -658,12 +661,22 @@ QString SessionManager::findByShortcut(const QKeySequence& shortcut)
void SessionManager::sessionProfileChanged()
{
Session* session = qobject_cast<Session*>(sender());
Q_ASSERT( session );
updateSession(session);
}
void SessionManager::sessionProfileCommandReceived(const QString& text)
{
Session* session = qobject_cast<Session*>(sender());
Q_ASSERT( session );
ProfileCommandParser parser;
QHash<Profile::Property,QVariant> changes = parser.parse(text);
changeProfile(session->profileKey(),changes,false);
}
QKeySequence SessionManager::shortcut(const QString& profileKey) const
{
Profile* info = profile(profileKey);