diff --git a/TODO b/TODO index fa3c79c56..5850fba4e 100644 --- a/TODO +++ b/TODO @@ -29,16 +29,17 @@ The KDE 4.0 TODO List: ( this is the list which maps key sequences pressed by the user to the corresponding text sequences which are send to the terminal ) -- Allow the window title set by the terminal program - to be used in the title bar of the Konsole window, - and/or the tab for the relevant terminal session. - Get the Konsole part working properly in other major KDE programs, such as Dolphin, KDevelop, Kate etc. - Make as much of the functionality from the main - program available in the part as possible. + Essential: Make the part function and be stable in + Dolphin, KDevelop and Kate + + + Nice to have: Make as much of the functionality from the main + program available in the part as possible. - Implement changing of the Konsole window size by @@ -49,20 +50,14 @@ The KDE 4.0 TODO List: the term "DCOP" for ideas on what users would like to be able to do using Konsole's scripting facilities. -- Changing of profile settings, changing of profile using +- Changing of profile using a command-line tool - ( because going to the GUI to change a profile setting - is slower for advanced users since it requires a switch from - the keyboard to the mouse. Advanced users may also - appreciate the ability to script profile changes ) - - Better documentation for shortcuts to move between views (Shift+ and Shift+Tab) == ESSENTIAL TWEAKS == - - When splitting the view, avoid scrolling existing views. - More intelligent tab title format which can adjust its output @@ -175,6 +170,13 @@ behaviour in KDE 3. === DONE === +- Changing of profile settings via a command-line tool + ( konsoleprofile ) + +- Allow the window title set by the terminal program + to be used in the title bar of the Konsole window, + and/or the tab for the relevant terminal session. + - When new output is added to a session, views should avoid scrolling if possible unless they are tracking the output or if the lines that the view was showing have been removed diff --git a/src/Part.cpp b/src/Part.cpp index dda82bb65..4fd9c57a4 100644 --- a/src/Part.cpp +++ b/src/Part.cpp @@ -50,15 +50,15 @@ extern "C" using namespace Konsole; -KParts::Part* PartFactory::createPartObject( QWidget* /*parentWidget*/, +KParts::Part* PartFactory::createPartObject( QWidget* parentWidget, QObject* parent, const char* /*classname*/, const QStringList& /*args*/) { - return new Part(parent); + return new Part(parentWidget,parent); } -Part::Part(QObject* parent) +Part::Part(QWidget* parentWidget , QObject* parent) : KParts::ReadOnlyPart(parent) ,_viewManager(0) ,_pluggedController(0) @@ -79,6 +79,10 @@ Part::Part(QObject* parent) connect( _viewManager , SIGNAL(activeViewChanged(SessionController*)) , this , SLOT(activeViewChanged(SessionController*)) ); + connect( _viewManager , SIGNAL(empty()) , this , SLOT(debugFinished()) ); + + _viewManager->widget()->setParent(parentWidget); + setWidget(_viewManager->widget()); // create basic session @@ -91,14 +95,29 @@ bool Part::openFile() { return false; } +void Part::debugFinished() +{ + qDebug() << __FUNCTION__; +} Session* Part::activeSession() const { - // for now, just return the first available session - QList list = SessionManager::instance()->sessions(); + if ( _pluggedController ) + { + qDebug() << __FUNCTION__ << " - have plugged controller"; - Q_ASSERT( !list.isEmpty() ); + return _pluggedController->session(); + } + else + { + // for now, just return the first available session + QList list = SessionManager::instance()->sessions(); - return list.first(); + qDebug() << __FUNCTION__ << " - no plugged controller, selectin first from" << list.count() << "sessions"; + + Q_ASSERT( !list.isEmpty() ); + + return list.first(); + } } void Part::startProgram( const QString& program, const QStringList& arguments ) diff --git a/src/Part.h b/src/Part.h index bedf48249..a550bda45 100644 --- a/src/Part.h +++ b/src/Part.h @@ -57,7 +57,7 @@ Q_OBJECT Q_INTERFACES(TerminalInterface) public: /** Constructs a new Konsole part with the specified parent. */ - Part(QObject* parent = 0); + Part(QWidget* parentWidget , QObject* parent = 0); virtual ~Part(); /** Reimplemented from TerminalInterface. */ @@ -79,6 +79,8 @@ private slots: Session* createSession(const QString& key); void activeViewChanged(SessionController* controller); + void debugFinished(); + private: Session* activeSession() const; diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index 017e8776a..d3e363c1c 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -248,16 +248,15 @@ void ViewManager::detachActiveView() container->views().count() == 0 ) { removeContainer(container); - - // this will need to be removed if Konsole is modified so the menu item to - // split the view is no longer one toggle-able item - //_splitViewAction->setChecked(false); } } void ViewManager::sessionFinished() { + // switch to the previous view before deleting the session views to prevent flicker + // occurring as a result of an interval between removing the active view and switching + // to the previous view previousView(); Session* session = qobject_cast(sender()); @@ -440,7 +439,6 @@ void ViewManager::createView(Session* session) // set initial size // temporary default used for now display->setSize(80,40); - ViewProperties* properties = createController(session,display); diff --git a/src/ViewManager.h b/src/ViewManager.h index f4c6d15ca..e81ff7d6d 100644 --- a/src/ViewManager.h +++ b/src/ViewManager.h @@ -202,7 +202,7 @@ private: SessionController* createController(Session* session , TerminalDisplay* display); private: - ViewSplitter* _viewSplitter; + QPointer _viewSplitter; QPointer _pluggedController; QHash,QPointer > _sessionMap; KActionCollection* _actionCollection;