~ubuntu-branches/ubuntu/saucy/konsole/saucy-proposed

« back to all changes in this revision

Viewing changes to src/ViewManager.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-11-19 16:01:56 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20121119160156-7ohwzglkgwe61gsf
Tags: 4:4.9.80-0ubuntu1
* New upstream beta release
* Remove ControlDragSettings.diff now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
// Qt
24
24
#include <QtCore/QSignalMapper>
25
25
#include <QtCore/QStringList>
26
 
#include <QtGui/QMenu>
 
26
#include <QMenu>
27
27
#include <QtDBus/QtDBus>
28
28
 
29
29
// KDE
620
620
    container->setStyleSheet(_navigationStyleSheet);
621
621
    if (_showQuickButtons) {
622
622
        container->setFeatures(container->features()
623
 
                | ViewContainer::QuickNewView
624
 
                | ViewContainer::QuickCloseView);
 
623
                               | ViewContainer::QuickNewView
 
624
                               | ViewContainer::QuickCloseView);
625
625
    } else {
626
626
        container->setFeatures(container->features()
627
 
                & ~ViewContainer::QuickNewView
628
 
                & ~ViewContainer::QuickCloseView);
 
627
                               & ~ViewContainer::QuickNewView
 
628
                               & ~ViewContainer::QuickCloseView);
629
629
    }
630
630
 
631
631
    // connect signals and slots
805
805
    view->setUnderlineLinks(profile->underlineLinksEnabled());
806
806
    view->setControlDrag(profile->property<bool>(Profile::CtrlRequiredForDrag));
807
807
    view->setBidiEnabled(profile->bidiRenderingEnabled());
 
808
    view->setLineSpacing(profile->lineSpacing());
 
809
    view->setTrimTrailingSpaces(profile->property<bool>(Profile::TrimTrailingSpacesInSelectedText));
 
810
 
 
811
    view->setOpenLinksByDirectClick(profile->property<bool>(Profile::OpenLinksByDirectClickEnabled));
808
812
 
809
813
    int middleClickPasteMode = profile->property<int>(Profile::MiddleClickPasteMode);
810
814
    if (middleClickPasteMode == Enum::PasteFromX11Selection)
823
827
        view->setKeyboardCursorShape(Enum::UnderlineCursor);
824
828
 
825
829
    // cursor color
826
 
    if ( profile->useCustomCursorColor() ) {
 
830
    if (profile->useCustomCursorColor()) {
827
831
        const QColor& cursorColor = profile->customCursorColor();
828
832
        view->setKeyboardCursorColor(cursorColor);
829
833
    } else {
978
982
 
979
983
int ViewManager::newSession(QString profile, QString directory)
980
984
{
981
 
    QList<Profile::Ptr> profilelist = ProfileManager::instance()->allProfiles();
982
 
    QList<Profile::Ptr>::iterator i = profilelist.begin();
983
 
 
 
985
    const QList<Profile::Ptr> profilelist = ProfileManager::instance()->allProfiles();
984
986
    Profile::Ptr profileptr = ProfileManager::instance()->defaultProfile();
985
987
 
986
 
    while (i != profilelist.end()) {
987
 
        Profile::Ptr ptr = *i;
988
 
        if (ptr->name().compare(profile) == 0)
989
 
            profileptr = ptr;
990
 
        i++;
 
988
    for (int i = 0; i < profilelist.size(); ++i) {
 
989
        if (profilelist.at(i)->name() == profile) {
 
990
            profileptr = profilelist.at(i);
 
991
            break;
 
992
        }
991
993
    }
992
994
 
993
995
    Session* session = SessionManager::instance()->createSession(profileptr);
1081
1083
    foreach(ViewContainer* container, _viewSplitter->containers()) {
1082
1084
        if (_showQuickButtons) {
1083
1085
            container->setFeatures(container->features()
1084
 
                    | ViewContainer::QuickNewView
1085
 
                    | ViewContainer::QuickCloseView);
 
1086
                                   | ViewContainer::QuickNewView
 
1087
                                   | ViewContainer::QuickCloseView);
1086
1088
        } else {
1087
1089
            container->setFeatures(container->features()
1088
 
                    & ~ViewContainer::QuickNewView
1089
 
                    & ~ViewContainer::QuickCloseView);
 
1090
                                   & ~ViewContainer::QuickNewView
 
1091
                                   & ~ViewContainer::QuickCloseView);
1090
1092
        }
1091
1093
    }
1092
1094
}