mirror of
https://github.com/KDE/konsole.git
synced 2026-05-19 03:57:43 -04:00
Squashed commit of the following:
commit 99d61f9bdfe29347050162a5a675bb0c276bc1bf Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 20:45:45 2008 +0000 Allow a normal frame around the table view in ManageProfilesDialog. Works better with Oxygen style. commit 7075de00d8cc88568e108e868e08d071d5aa7bcb Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 20:37:38 2008 +0000 Change base class of ProfileItemDelegate from QItemDelegate to QStyledItemDelegate for better rendering. Fix updates of favorite / non-favorite status in ManageProfilesDialog. QVariant equality comparisons are not properly supported for custom types so QAbstractItemModel::match() has to be replaced with manual iteration through the rows. commit 3baa3307473e037efd500ade7df37d2fd62c60d9 Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 20:09:27 2008 +0000 Remove unecessary deleteProfile() call. Explicitly add new profiles to the SessionManager. Mark the temporary profile in the EditProfileDialog as hidden. commit 53d1e3515d3408c08ba4b019b5faceffae6b0f8a Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 20:02:28 2008 +0000 Do not track deletion of temporary un-named profiles. commit 55c69e15a4247319b0cff73691f072fef39684c9 Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 20:01:25 2008 +0000 Make SessionManager::addProfile() public. Call it automatically in SessionManager::setFavorite() if the profile is not already known to the manager. When a profile is deleted via SessionManager::deleteProfile() mark it as hidden so that it is not recreated on disk if later changed. Add debugging in ~Profile to track deletion of profiles. commit 7a028bac5846cd3689e3351ab139c6f372ca173e Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 19:41:22 2008 +0000 Fix several signal/slot connections in ManageProfilesDialog after the SessionManager changes. commit da7c7b4f939c17885cf0fbaa1fb93d2655021b83 Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 19:36:57 2008 +0000 Use a helper class to pop elements from recursion guard stack when a call to loadProfile() returns rather than requiring a manual call to recursionGuard.pop() commit 14a993d15722ec5270de708154408896fd7418b8 Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 19:12:20 2008 +0000 Fix profiles not being loaded properly if their parent was a profile which had already been loaded. Profile paths were not being taken off the recursion guard stack at one exit from loadProfile(). commit f946fc0cbde26cd816e3f1d172a5e5327ff3295b Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 19:01:06 2008 +0000 Adapt Part to the SessionManager/Profile changes. commit d3155ba0f6dc9ec0ca34a45b5787488c055dc4bf Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 18:55:05 2008 +0000 Update MainWindow API documentation to reflect string key -> ref counted pointer change for profiles. commit 5d546054c031ae6ee6915f2cc6bcf61dd4e03520 Author: Robert Knight <robertknight@gmail.com> Date: Sat Mar 22 18:53:16 2008 +0000 Update SessionManager API documentation to reflect string key -> ref counted pointer change for profiles. commit 856fdf37a5bd81711ff0db1b307b8736ef4ae34e Author: Robert Knight <robertknight@gmail.com> Date: Thu Mar 20 23:43:53 2008 +0000 Fix assert. Fall back to current locale's codec if a null pointer is passed to Emulation::setCodec() commit 127e894d076061b991934adf84256b651bf31724 Author: Robert Knight <robertknight@gmail.com> Date: Thu Mar 20 22:45:11 2008 +0000 Replace string key for profiles with ref-counted profile pointer. commit 53246e5bd4ffcec56ca0ff94730f9ef3946e3f4c Author: Robert Knight <robertknight@gmail.com> Date: Thu Mar 20 20:50:17 2008 +0000 First step towards removing string keys as a means to reference profiles. Change Profile base class from QObject to QSharedData and replace all usage of Profile* with KSharedPtr<Profile> svn path=/trunk/KDE/kdebase/apps/konsole/; revision=788936
This commit is contained in:
@@ -78,8 +78,8 @@ ViewManager::ViewManager(QObject* parent , KActionCollection* collection)
|
||||
SLOT(containerViewsChanged(QObject*)) );
|
||||
|
||||
// listen for profile changes
|
||||
connect( SessionManager::instance() , SIGNAL(profileChanged(const QString&)) , this,
|
||||
SLOT(profileChanged(const QString&)) );
|
||||
connect( SessionManager::instance() , SIGNAL(profileChanged(Profile::Ptr)) , this,
|
||||
SLOT(profileChanged(Profile::Ptr)) );
|
||||
connect( SessionManager::instance() , SIGNAL(sessionUpdated(Session*)) , this,
|
||||
SLOT(updateViewsForSession(Session*)) );
|
||||
}
|
||||
@@ -381,7 +381,7 @@ void ViewManager::splitView(Qt::Orientation orientation)
|
||||
{
|
||||
Session* session = _sessionMap[(TerminalDisplay*)existingViewIter.next()];
|
||||
TerminalDisplay* display = createTerminalDisplay(session);
|
||||
applyProfile(display,session->profileKey());
|
||||
applyProfile(display,SessionManager::instance()->sessionProfile(session));
|
||||
ViewProperties* properties = createController(session,display);
|
||||
|
||||
_sessionMap[display] = session;
|
||||
@@ -389,7 +389,7 @@ void ViewManager::splitView(Qt::Orientation orientation)
|
||||
// create a container using settings from the first
|
||||
// session in the previous container
|
||||
if ( !container )
|
||||
container = createContainer(session->profileKey());
|
||||
container = createContainer(SessionManager::instance()->sessionProfile(session));
|
||||
|
||||
container->addView(display,properties);
|
||||
session->addView( display );
|
||||
@@ -496,7 +496,7 @@ void ViewManager::createView(Session* session)
|
||||
// create the default container
|
||||
if (_viewSplitter->containers().count() == 0)
|
||||
{
|
||||
_viewSplitter->addContainer( createContainer(session->profileKey()) ,
|
||||
_viewSplitter->addContainer( createContainer(SessionManager::instance()->sessionProfile(session)) ,
|
||||
Qt::Vertical );
|
||||
emit splitViewToggle(false);
|
||||
}
|
||||
@@ -515,7 +515,7 @@ void ViewManager::createView(Session* session)
|
||||
{
|
||||
ViewContainer* container = containerIter.next();
|
||||
TerminalDisplay* display = createTerminalDisplay(session);
|
||||
applyProfile(display,session->profileKey());
|
||||
applyProfile(display,SessionManager::instance()->sessionProfile(session));
|
||||
|
||||
// set initial size
|
||||
display->setSize(80,40);
|
||||
@@ -527,7 +527,8 @@ void ViewManager::createView(Session* session)
|
||||
session->addView(display);
|
||||
|
||||
// tell the session whether it has a light or dark background
|
||||
session->setDarkBackground( colorSchemeForProfile(session->profileKey())->hasDarkBackground() );
|
||||
const Profile::Ptr profile = SessionManager::instance()->sessionProfile(session);
|
||||
session->setDarkBackground( colorSchemeForProfile(profile)->hasDarkBackground() );
|
||||
|
||||
if ( container == activeContainer )
|
||||
{
|
||||
@@ -539,10 +540,8 @@ void ViewManager::createView(Session* session)
|
||||
updateDetachViewState();
|
||||
}
|
||||
|
||||
ViewContainer* ViewManager::createContainer(const QString& profileKey)
|
||||
ViewContainer* ViewManager::createContainer(const Profile::Ptr info)
|
||||
{
|
||||
const Profile* info = SessionManager::instance()->profile(profileKey);
|
||||
|
||||
Q_ASSERT( info );
|
||||
|
||||
const int tabPosition = info->property<int>(Profile::TabBarPosition);
|
||||
@@ -655,10 +654,8 @@ TerminalDisplay* ViewManager::createTerminalDisplay(Session* session)
|
||||
return display;
|
||||
}
|
||||
|
||||
const ColorScheme* ViewManager::colorSchemeForProfile(const QString& profileKey) const
|
||||
const ColorScheme* ViewManager::colorSchemeForProfile(const Profile::Ptr info) const
|
||||
{
|
||||
Profile* info = SessionManager::instance()->profile(profileKey);
|
||||
|
||||
const ColorScheme* colorScheme = ColorSchemeManager::instance()->
|
||||
findColorScheme(info->colorScheme());
|
||||
if ( !colorScheme )
|
||||
@@ -668,13 +665,11 @@ const ColorScheme* ViewManager::colorSchemeForProfile(const QString& profileKey)
|
||||
return colorScheme;
|
||||
}
|
||||
|
||||
void ViewManager::applyProfile(TerminalDisplay* view , const QString& profileKey)
|
||||
void ViewManager::applyProfile(TerminalDisplay* view , const Profile::Ptr info )
|
||||
{
|
||||
Profile* info = SessionManager::instance()->profile(profileKey);
|
||||
|
||||
Q_ASSERT( info );
|
||||
|
||||
const ColorScheme* colorScheme = colorSchemeForProfile(profileKey);
|
||||
const ColorScheme* colorScheme = colorSchemeForProfile(info);
|
||||
|
||||
// menu bar visibility
|
||||
emit setMenuBarVisibleRequest( info->property<bool>(Profile::ShowMenuBar) );
|
||||
@@ -751,11 +746,11 @@ void ViewManager::updateViewsForSession(Session* session)
|
||||
QListIterator<TerminalDisplay*> iter(_sessionMap.keys(session));
|
||||
while ( iter.hasNext() )
|
||||
{
|
||||
applyProfile(iter.next(),session->profileKey());
|
||||
applyProfile(iter.next(),SessionManager::instance()->sessionProfile(session));
|
||||
}
|
||||
}
|
||||
|
||||
void ViewManager::profileChanged(const QString& key)
|
||||
void ViewManager::profileChanged(Profile::Ptr profile)
|
||||
{
|
||||
QHashIterator<TerminalDisplay*,Session*> iter(_sessionMap);
|
||||
|
||||
@@ -764,9 +759,11 @@ void ViewManager::profileChanged(const QString& key)
|
||||
iter.next();
|
||||
|
||||
// if session uses this profile, update the display
|
||||
if ( iter.key() != 0 && iter.value() != 0 && iter.value()->profileKey() == key )
|
||||
if ( iter.key() != 0 &&
|
||||
iter.value() != 0 &&
|
||||
SessionManager::instance()->sessionProfile(iter.value()) == profile )
|
||||
{
|
||||
applyProfile(iter.key(),key);
|
||||
applyProfile(iter.key(),profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user