Commit 07b1e29c authored by Robert Knight's avatar Robert Knight

Provide more sensible suggestions for bookmark names. Make suggestions...

Provide more sensible suggestions for bookmark names.  Make suggestions context ( local vs. remote ) sensitive.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=663708
parent e9c4c9cc
......@@ -26,6 +26,7 @@
// Qt
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
// KDE
#include <kshell.h>
......@@ -123,8 +124,18 @@ QString BookmarkHandler::titleForView(ViewProperties* view) const
{
QString path = u.path();
path = KShell::tildeExpand(path);
path = QFileInfo(path).baseName();
return path;
}
else if ( u.hasHost() )
{
if ( u.hasUser() )
return i18n("%1 on %2",u.user(),u.host());
else
return i18n("%1",u.host());
}
return u.prettyUrl();
}
......
......@@ -88,9 +88,9 @@ public:
* The number of lines which are kept and the storage location depend on the
* type of store.
*/
virtual void setHistory(const HistoryType&);
void setHistory(const HistoryType&);
/** Returns the history store used by this emulation. See setHistory() */
virtual const HistoryType& history();
const HistoryType& history();
/**
* Copies the entire output history to a text stream.
......@@ -141,19 +141,7 @@ public Q_SLOTS: // signals incoming from TerminalDisplay
*/
virtual void sendString(const char *) = 0;
/** Clear the current selection */
//virtual void clearSelection();
/** Begin a new selection at column @p x, row @p y. TODO: What does columnmode do? */
//virtual void onSelectionBegin(const int x, const int y, const bool columnmode);
/** Extend the current selection to column @p x, row @p y. */
//virtual void onSelectionExtend(const int x, const int y);
/** Calls the TerminalDisplay::setSelection() method of each associated view with the currently selected text */
//virtual void setSelection(const bool preserve_line_breaks);
virtual void isBusySelecting(bool busy);
//virtual void testIsSelected(const int x, const int y, bool &selected);
public Q_SLOTS: // signals incoming from data source
......
......@@ -529,7 +529,7 @@ QString Session::keyBindings() const
return _emulation->keymap();
}
const QString& Session::terminalType() const
QString Session::terminalType() const
{
return _term;
}
......
......@@ -132,7 +132,7 @@ public:
*
* Defaults to "xterm".
*/
const QString& terminalType() const;
QString terminalType() const;
/**
* Sets the value of the TERM variable which will be used in the
* session's environment when it is started using the run() method.
......
......@@ -305,7 +305,7 @@ void ViewManager::splitView(Qt::Orientation orientation)
{
Session* session = _sessionMap[(TerminalDisplay*)existingViewIter.next()];
TerminalDisplay* display = createTerminalDisplay();
loadViewSettings(display,SessionManager::instance()->profile(session->type()));
applyProfile(display,session->type());
ViewProperties* properties = createController(session,display);
_sessionMap[display] = session;
......@@ -402,7 +402,7 @@ void ViewManager::createView(Session* session)
{
ViewContainer* container = containerIter.next();
TerminalDisplay* display = createTerminalDisplay();
loadViewSettings(display,SessionManager::instance()->profile(session->type()));
applyProfile(display,session->type());
// set initial size
// temporary default used for now
......@@ -526,8 +526,10 @@ TerminalDisplay* ViewManager::createTerminalDisplay()
return display;
}
void ViewManager::loadViewSettings(TerminalDisplay* view , Profile* info)
void ViewManager::applyProfile(TerminalDisplay* view , const QString& profileKey)
{
Profile* info = SessionManager::instance()->profile(profileKey);
Q_ASSERT( info );
const ColorScheme* colorScheme = ColorSchemeManager::instance()->
......@@ -594,8 +596,6 @@ void ViewManager::loadViewSettings(TerminalDisplay* view , Profile* info)
void ViewManager::profileChanged(const QString& key)
{
Profile* info = SessionManager::instance()->profile(key);
QHashIterator<TerminalDisplay*,Session*> iter(_sessionMap);
while ( iter.hasNext() )
......@@ -605,7 +605,7 @@ void ViewManager::profileChanged(const QString& key)
// if session uses this profile, update the display
if ( iter.value() != 0 && iter.value()->type() == key )
{
loadViewSettings(iter.key(),info);
applyProfile(iter.key(),key);
}
}
}
......
......@@ -81,6 +81,12 @@ public:
*/
void createView(Session* session);
/**
* Applies the view-specific settings associated with specified @p profile
* to the terminal display @p view.
*/
void applyProfile(TerminalDisplay* view , const QString& profile);
/**
* Merges views from another view manager into this manager.
* Only views from the active container in the other manager are merged.
......@@ -194,23 +200,18 @@ private:
// creates a new terminal display
TerminalDisplay* createTerminalDisplay();
// applies the view-specific settings such as colour scheme associated
// with 'session' to 'view'
void loadViewSettings(TerminalDisplay* view , Profile* profile);
// creates a new controller for a session/display pair which provides the menu
// actions associated with that view, and exposes basic information
// about the session ( such as title and associated icon ) to the display.
SessionController* createController(Session* session , TerminalDisplay* display);
private:
MainWindow* _mainWindow;
// KToggleAction* _splitViewAction;
ViewSplitter* _viewSplitter;
QPointer<SessionController> _pluggedController;
QHash<TerminalDisplay*,Session*> _sessionMap;
KActionCollection* _actionCollection;
QSignalMapper* _containerSignalMapper;
ViewSplitter* _viewSplitter;
QPointer<SessionController> _pluggedController;
QHash<TerminalDisplay*,Session*> _sessionMap;
KActionCollection* _actionCollection;
QSignalMapper* _containerSignalMapper;
};
}
......
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