Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1a0b94d8 authored by Robert Knight's avatar Robert Knight

Changed the naming scheme used in Konsole. Several survey respondants said...

Changed the naming scheme used in Konsole.  Several survey respondants said that they didn't understand what a 'Session' was or how it was different from a 'Profile'.  Under the new scheme, a 'Profile' is a saved set of terminal options which can be used to create a new tab, or which can be applied to an existing tab.  Internally, a 'Session' is a running terminal process and emulation created from a particular profile.

svn path=/branches/work/konsole-split-view/; revision=659297
parent 23ead6ba
......@@ -5,10 +5,10 @@
<Menu name="file"><text>File</text>
<Action name="new-tab" />
<Action name="new-window" />
<Action name="remote-connection" />
<Action name="custom-session" />
<Action name="new-from-profile" />
<!-- <Action name="remote-connection" /> !-->
<Separator/>
<ActionList name="new-session-types"/>
<ActionList name="favorite-profiles"/>
<Separator/>
<DefineGroup name="session-operations"/>
<Action name="exit" />
......@@ -37,6 +37,7 @@
<Action name="bookmark"/>
<Menu name="settings"><text>Settings</text>
<DefineGroup name="session-settings"/>
<Action name="manage-profiles"/>
<Separator/>
<Action name="configure-notifications"/>
<Action name="configure-shortcuts"/>
......
......@@ -3,7 +3,6 @@
<kpartgui name="session">
<MenuBar>
<Menu name="file"><text>File</text>
<Action name="save-session" group="session-operations" />
<Action name="close-session" group="session-operations"/>
</Menu>
<Menu name="edit"><text>Edit</text>
......@@ -35,7 +34,7 @@
<Action name="decrease-text-size"/>
</Menu>
<Menu name="settings"><text>Settings</text>
<Action name="terminal-options"/>
<Action name="edit-current-profile"/>
</Menu>
<!--<Menu name="debug"><text>Debug</text>
<Action name="debug-process"/>
......@@ -47,7 +46,7 @@
<Action name="clear-history-and-reset"/>
<Separator/>
<Action name="show-menubar"/>
<Action name="terminal-options" />
<Action name="edit-current-profile" />
<Separator/>
<Action name="close-session"/>
</Menu>
......
......@@ -26,7 +26,7 @@
// Konsole
#include "ColorScheme.h"
#include "SessionList.h"
#include "ProfileList.h"
#include "SessionManager.h"
#include "KeyTrans.h"
#include "KeyboardTranslator.h"
......@@ -66,7 +66,7 @@ Application* Application::self()
MainWindow* Application::newMainWindow()
{
MainWindow* window = new MainWindow();
window->setSessionList( new SessionList(window) );
window->setSessionList( new ProfileList(window) );
connect( window , SIGNAL(requestSession(const QString&,ViewManager*)),
this , SLOT(createSession(const QString&,ViewManager*)));
......
......@@ -28,7 +28,7 @@ class KCmdLineArgs;
namespace Konsole
{
class ColorSchemeManager;
class SessionList;
class ProfileList;
class SessionManager;
class ViewManager;
class MainWindow;
......@@ -79,7 +79,7 @@ private slots:
private:
KCmdLineArgs* _arguments;
SessionList* _sessionList;
ProfileList* _sessionList;
MainWindow* _backgroundInstance;
};
......
......@@ -57,7 +57,7 @@ set(konsole_KDEINIT_SRCS
${sessionadaptors_SRCS}
BlockArray.cpp
ColorScheme.cpp
EditSessionDialog.cpp
EditProfileDialog.cpp
Filter.cpp
HistorySizeDialog.cpp
IncrementalSearchBar.cpp
......@@ -69,10 +69,10 @@ set(konsole_KDEINIT_SRCS
ProcessInfo.cpp
ScreenWindow.cpp
SessionController.cpp
SessionList.cpp
SessionListWidget.cpp
ProfileList.cpp
ProfileListWidget.cpp
SessionManager.cpp
SessionTypeDialog.cpp
ManageProfilesDialog.cpp
History.cpp
Pty.cpp
Screen.cpp
......@@ -94,8 +94,8 @@ set(konsole_KDEINIT_SRCS
kde4_add_ui_files(konsole_KDEINIT_SRCS
EditSessionDialog.ui
SessionTypeDialog.ui
EditProfileDialog.ui
ManageProfilesDialog.ui
RemoteConnectionDialog.ui
)
kde4_automoc(${konsole_KDEINIT_SRCS})
......@@ -126,7 +126,7 @@ set(konsolepart_PART_SRCS
BlockArray.cpp
BookmarkHandler.cpp
ColorScheme.cpp
EditSessionDialog.cpp
EditProfileDialog.cpp
Emulation.cpp
Filter.cpp
History.cpp
......@@ -142,10 +142,10 @@ set(konsolepart_PART_SRCS
ScreenWindow.cpp
Session.cpp
SessionController.cpp
SessionList.cpp
SessionListWidget.cpp
ProfileList.cpp
ProfileListWidget.cpp
SessionManager.cpp
SessionTypeDialog.cpp
ManageProfilesDialog.cpp
TerminalCharacterDecoder.cpp
TerminalDisplay.cpp
ViewContainer.cpp
......
......@@ -29,30 +29,30 @@
// Konsole
#include "ColorScheme.h"
#include "ui_EditSessionDialog.h"
#include "EditSessionDialog.h"
#include "ui_EditProfileDialog.h"
#include "EditProfileDialog.h"
#include "SessionManager.h"
using namespace Konsole;
EditSessionDialog::EditSessionDialog(QWidget* parent)
EditProfileDialog::EditProfileDialog(QWidget* parent)
: KDialog(parent)
{
setCaption("Edit Session");
setCaption("Edit Profile");
setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Default );
_ui = new Ui::EditSessionDialog();
_ui = new Ui::EditProfileDialog();
_ui->setupUi(mainWidget());
}
EditSessionDialog::~EditSessionDialog()
EditProfileDialog::~EditProfileDialog()
{
delete _ui;
}
void EditSessionDialog::setSessionType(const QString& key)
void EditProfileDialog::setSessionType(const QString& key)
{
_sessionTypeKey = key;
const SessionInfo* info = SessionManager::instance()->sessionType(key);
const Profile* info = SessionManager::instance()->sessionType(key);
Q_ASSERT( info );
......@@ -63,14 +63,14 @@ void EditSessionDialog::setSessionType(const QString& key)
setupScrollingPage(info);
setupAdvancedPage(info);
}
void EditSessionDialog::setupGeneralPage(const SessionInfo* info)
void EditProfileDialog::setupGeneralPage(const Profile* info)
{
_ui->sessionNameEdit->setText( info->name() );
_ui->commandEdit->setText( info->command(false,false) );
_ui->initialDirEdit->setText( info->defaultWorkingDirectory() );
_ui->iconSelectButton->setIcon( KIcon(info->icon()) );
}
void EditSessionDialog::setupAppearencePage(const SessionInfo* info)
void EditProfileDialog::setupAppearencePage(const Profile* info)
{
// setup color list
QStandardItemModel* model = new QStandardItemModel(this);
......@@ -99,17 +99,17 @@ void EditSessionDialog::setupAppearencePage(const SessionInfo* info)
connect( _ui->editFontButton , SIGNAL(clicked()) , this ,
SLOT(showFontDialog()) );
}
void EditSessionDialog::setupKeyboardPage(const SessionInfo* )
void EditProfileDialog::setupKeyboardPage(const Profile* )
{
}
void EditSessionDialog::setupScrollingPage(const SessionInfo* )
void EditProfileDialog::setupScrollingPage(const Profile* )
{
}
void EditSessionDialog::setupAdvancedPage(const SessionInfo* )
void EditProfileDialog::setupAdvancedPage(const Profile* )
{
}
void EditSessionDialog::showFontDialog()
void EditProfileDialog::showFontDialog()
{
//TODO Only permit selection of mono-spaced fonts.
// the KFontDialog API does not appear to have a means to do this
......@@ -126,7 +126,7 @@ void EditSessionDialog::showFontDialog()
_ui->fontPreviewLabel->setFont(currentFont);
}
}
void EditSessionDialog::setFontSize(int pointSize)
void EditProfileDialog::setFontSize(int pointSize)
{
QFont newFont = _ui->fontPreviewLabel->font();
newFont.setPointSize(pointSize);
......@@ -213,4 +213,4 @@ QSize KeyBindingViewDelegate::sizeHint( const QStyleOptionViewItem& /*option*/,
}
#include "EditSessionDialog.moc"
#include "EditProfileDialog.moc"
......@@ -29,13 +29,13 @@
namespace Ui
{
class EditSessionDialog;
class EditProfileDialog;
};
namespace Konsole
{
class SessionInfo;
class Profile;
class MutableSessionInfo;
/**
......@@ -43,14 +43,14 @@ class MutableSessionInfo;
*
* TODO: More documentation
*/
class EditSessionDialog : public KDialog
class EditProfileDialog : public KDialog
{
Q_OBJECT
public:
/** Constructs a new dialog with the specified parent. */
EditSessionDialog(QWidget* parent = 0);
virtual ~EditSessionDialog();
EditProfileDialog(QWidget* parent = 0);
virtual ~EditProfileDialog();
/**
* Initialises the dialog with the settings for the specified session
......@@ -64,7 +64,7 @@ public:
* Returns a session info object representing the new or modified session
* type.
*/
SessionInfo* newSessionInfo();
Profile* newSessionInfo();
private slots:
// appearence page
......@@ -73,11 +73,11 @@ private slots:
private:
// initialize various pages of the dialog
void setupGeneralPage(const SessionInfo* info);
void setupAppearencePage(const SessionInfo* info);
void setupKeyboardPage(const SessionInfo* info);
void setupScrollingPage(const SessionInfo* info);
void setupAdvancedPage(const SessionInfo* info);
void setupGeneralPage(const Profile* info);
void setupAppearencePage(const Profile* info);
void setupKeyboardPage(const Profile* info);
void setupScrollingPage(const Profile* info);
void setupAdvancedPage(const Profile* info);
// apply changes from various pages of the dialog
void applyGeneralPage(MutableSessionInfo* info);
......@@ -86,7 +86,7 @@ private:
void applyScrollingPage(MutableSessionInfo* info);
void applyAdvancedPage(MutableSessionInfo* info);
Ui::EditSessionDialog* _ui;
Ui::EditProfileDialog* _ui;
QString _sessionTypeKey;
};
......
<ui version="4.0" >
<class>EditSessionDialog</class>
<widget class="QWidget" name="EditSessionDialog" >
<class>EditProfileDialog</class>
<widget class="QWidget" name="EditProfileDialog" >
<property name="geometry" >
<rect>
<x>0</x>
......
......@@ -44,8 +44,8 @@
#include "MainWindow.h"
#include "RemoteConnectionDialog.h"
#include "SessionController.h"
#include "SessionList.h"
#include "SessionTypeDialog.h"
#include "ProfileList.h"
#include "ManageProfilesDialog.h"
#include "ViewManager.h"
#include "ViewSplitter.h"
......@@ -148,16 +148,17 @@ void MainWindow::setupActions()
newWindowAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_M) );
connect( newWindowAction , SIGNAL(triggered()) , this , SLOT(newWindow()) );
QAction* newFromProfileAction = collection->addAction("new-from-profile");
newFromProfileAction->setText( i18n("New from Profile...") );
// TODO Implement "New from Profile"
QAction* remoteConnectionAction = collection->addAction("remote-connection");
remoteConnectionAction->setText( i18n("Remote Connection...") );
remoteConnectionAction->setIcon( KIcon("network") );
remoteConnectionAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_R) );
connect( remoteConnectionAction , SIGNAL(triggered()) , this , SLOT(showRemoteConnectionDialog()) );
QAction* customSessionAction = collection->addAction("custom-session");
customSessionAction->setText( i18n("Custom Session...") );
connect( customSessionAction , SIGNAL(triggered()) , this , SLOT(showCustomSessionDialog()) );
#ifndef KONSOLE_PART
KStandardAction::quit( Application::self() , SLOT(quit()) , collection );
#endif
......@@ -182,6 +183,11 @@ void MainWindow::setupActions()
// Settings Menu
KStandardAction::configureNotifications( 0 , 0 , collection );
KStandardAction::keyBindings( this , SLOT(showShortcutsDialog()) , collection );
QAction* manageProfilesAction = collection->addAction("manage-profiles");
manageProfilesAction->setText( i18n("Manage Profiles...") );
connect( manageProfilesAction , SIGNAL(triggered()) , this , SLOT(showManageProfilesDialog()) );
}
BookmarkHandler* MainWindow::bookmarkHandler() const
......@@ -189,7 +195,7 @@ BookmarkHandler* MainWindow::bookmarkHandler() const
return _bookmarkHandler;
}
void MainWindow::setSessionList(SessionList* list)
void MainWindow::setSessionList(ProfileList* list)
{
sessionListChanged(list->actions());
......@@ -202,8 +208,8 @@ void MainWindow::setSessionList(SessionList* list)
void MainWindow::sessionListChanged(const QList<QAction*>& actions)
{
unplugActionList("new-session-types");
plugActionList("new-session-types",actions);
unplugActionList("favorite-profiles");
plugActionList("favorite-profiles",actions);
}
void MainWindow::newTab()
......@@ -227,18 +233,11 @@ void MainWindow::sessionSelected(const QString& key)
{
emit requestSession(key,_viewManager);
}
void MainWindow::showCustomSessionDialog()
void MainWindow::showManageProfilesDialog()
{
SessionTypeDialog dialog(this);
ManageProfilesDialog dialog(this);
dialog.exec();
}
void MainWindow::showPreferencesDialog()
{
Q_ASSERT(0); // not implemented
// code to invoke the old preferences dialog
//KToolInvocation::startServiceByDesktopName("konsole",QString());
}
void MainWindow::showRemoteConnectionDialog()
{
......
......@@ -34,7 +34,7 @@ class ViewSplitter;
class ViewManager;
class ViewProperties;
class SessionController;
class SessionList;
class ProfileList;
class BookmarkHandler;
/**
......@@ -71,7 +71,7 @@ class MainWindow : public KXmlGuiWindow
IncrementalSearchBar* searchBar() const;
/** Sets the list of sessions to be displayed in the File menu */
void setSessionList(SessionList* list);
void setSessionList(ProfileList* list);
/**
* Returns the bookmark handler associated with this window.
......@@ -98,8 +98,7 @@ class MainWindow : public KXmlGuiWindow
private slots:
void newTab();
void newWindow();
void showCustomSessionDialog();
void showPreferencesDialog();
void showManageProfilesDialog();
void showRemoteConnectionDialog();
void showShortcutsDialog();
void sessionSelected(const QString&);
......
......@@ -28,24 +28,24 @@
#include <QStandardItemModel>
// Konsole
#include "EditSessionDialog.h"
#include "EditProfileDialog.h"
#include "SessionManager.h"
#include "ui_SessionTypeDialog.h"
#include "SessionTypeDialog.h"
#include "ui_ManageProfilesDialog.h"
#include "ManageProfilesDialog.h"
using namespace Konsole;
SessionTypeDialog::SessionTypeDialog(QWidget* parent)
ManageProfilesDialog::ManageProfilesDialog(QWidget* parent)
: KDialog(parent)
{
setCaption("Sessions");
setCaption("Manage Profiles");
_ui = new Ui::SessionTypeDialog();
_ui = new Ui::ManageProfilesDialog();
_ui->setupUi(mainWidget());
// hide vertical header
_ui->sessionTable->verticalHeader()->hide();
_ui->sessionTable->setItemDelegateForColumn(1,new SessionViewDelegate(this));
_ui->sessionTable->setItemDelegateForColumn(1,new ProfileItemDelegate(this));
// update table and listen for changes to the session types
updateTableModel();
......@@ -69,11 +69,11 @@ SessionTypeDialog::SessionTypeDialog(QWidget* parent)
connect( _ui->setAsDefaultButton , SIGNAL(clicked()) , this , SLOT(setSelectedAsDefault()) );
}
SessionTypeDialog::~SessionTypeDialog()
ManageProfilesDialog::~ManageProfilesDialog()
{
delete _ui;
}
void SessionTypeDialog::updateTableModel()
void ManageProfilesDialog::updateTableModel()
{
// setup session table
_sessionModel = new QStandardItemModel(this);
......@@ -84,7 +84,7 @@ void SessionTypeDialog::updateTableModel()
{
const QString& key = keyIter.next();
SessionInfo* info = SessionManager::instance()->sessionType(key);
Profile* info = SessionManager::instance()->sessionType(key);
QList<QStandardItem*> itemList;
QStandardItem* item = new QStandardItem( info->name() );
......@@ -123,7 +123,7 @@ void SessionTypeDialog::updateTableModel()
tableSelectionChanged( _ui->sessionTable->selectionModel()->selection() );
}
void SessionTypeDialog::tableSelectionChanged(const QItemSelection& selection)
void ManageProfilesDialog::tableSelectionChanged(const QItemSelection& selection)
{
bool enable = !selection.indexes().isEmpty();
const SessionManager* manager = SessionManager::instance();
......@@ -134,33 +134,33 @@ void SessionTypeDialog::tableSelectionChanged(const QItemSelection& selection)
_ui->deleteSessionButton->setEnabled(isNotDefault);
_ui->setAsDefaultButton->setEnabled(isNotDefault);
}
void SessionTypeDialog::deleteSelected()
void ManageProfilesDialog::deleteSelected()
{
Q_ASSERT( selectedKey() != SessionManager::instance()->defaultSessionKey() );
SessionManager::instance()->deleteSessionType(selectedKey());
}
void SessionTypeDialog::setSelectedAsDefault()
void ManageProfilesDialog::setSelectedAsDefault()
{
SessionManager::instance()->setDefaultSessionType(selectedKey());
// do not allow the new default session type to be removed
_ui->deleteSessionButton->setEnabled(false);
_ui->setAsDefaultButton->setEnabled(false);
}
void SessionTypeDialog::newType()
void ManageProfilesDialog::newType()
{
EditSessionDialog dialog(this);
EditProfileDialog dialog(this);
// base new type off the default session type
dialog.setSessionType(QString());
dialog.exec();
}
void SessionTypeDialog::editSelected()
void ManageProfilesDialog::editSelected()
{
EditSessionDialog dialog(this);
EditProfileDialog dialog(this);
dialog.setSessionType(selectedKey());
dialog.exec();
}
QString SessionTypeDialog::selectedKey() const
QString ManageProfilesDialog::selectedKey() const
{
Q_ASSERT( _ui->sessionTable->selectionModel() &&
_ui->sessionTable->selectionModel()->selectedRows().count() == 1 );
......@@ -171,11 +171,11 @@ QString SessionTypeDialog::selectedKey() const
selectedIndexes().first().data( Qt::UserRole + 1 ).value<QString>();
}
SessionViewDelegate::SessionViewDelegate(QObject* parent)
ProfileItemDelegate::ProfileItemDelegate(QObject* parent)
: QItemDelegate(parent)
{
}
bool SessionViewDelegate::editorEvent(QEvent* event,QAbstractItemModel* model,
bool ProfileItemDelegate::editorEvent(QEvent* event,QAbstractItemModel* model,
const QStyleOptionViewItem&,const QModelIndex& index)
{
if ( event->type() == QEvent::MouseButtonPress || event->type() == QEvent::KeyPress )
......@@ -195,4 +195,4 @@ bool SessionViewDelegate::editorEvent(QEvent* event,QAbstractItemModel* model,
return true;
}
#include "SessionTypeDialog.moc"
#include "ManageProfilesDialog.moc"
......@@ -32,7 +32,7 @@ class QStandardItemModel;
namespace Ui
{
class SessionTypeDialog;
class ManageProfilesDialog;
};
namespace Konsole
......@@ -43,14 +43,14 @@ namespace Konsole
* the user to add new sessions, and remove or edit existing
* session types.
*/
class SessionTypeDialog : public KDialog
class ManageProfilesDialog : public KDialog
{
Q_OBJECT
public:
/** Constructs a new session type with the specified parent. */
SessionTypeDialog(QWidget* parent = 0);
virtual ~SessionTypeDialog();
ManageProfilesDialog(QWidget* parent = 0);
virtual ~ManageProfilesDialog();
private slots:
void deleteSelected();
......@@ -69,14 +69,14 @@ private slots:
private:
QString selectedKey() const; // return the key associated with the currently selected
// item in the session table
Ui::SessionTypeDialog* _ui;
Ui::ManageProfilesDialog* _ui;
QStandardItemModel* _sessionModel;
};
class SessionViewDelegate : public QItemDelegate
class ProfileItemDelegate : public QItemDelegate
{
public:
SessionViewDelegate(QObject* parent = 0);
ProfileItemDelegate(QObject* parent = 0);
virtual bool editorEvent(QEvent* event,QAbstractItemModel* model,
const QStyleOptionViewItem& option,const QModelIndex& index);
......
<ui version="4.0" >
<class>SessionTypeDialog</class>
<widget class="QWidget" name="SessionTypeDialog" >
<class>ManageProfilesDialog</class>
<widget class="QWidget" name="ManageProfilesDialog" >
<property name="geometry" >
<rect>
<x>0</x>
......
......@@ -26,6 +26,7 @@
// Konsole
#include "ColorScheme.h"
#include "Emulation.h"
#include "KeyTrans.h"
#include "Part.h"
#include "Session.h"
......
......@@ -7,12 +7,12 @@
#include <KIcon>
// Konsole
#include "SessionList.h"
#include "ProfileList.h"
#include "SessionManager.h"
using namespace Konsole;
SessionList::SessionList(QObject* parent)
ProfileList::ProfileList(QObject* parent)
: QObject(parent)
{
SessionManager* manager = SessionManager::instance();
......@@ -37,11 +37,11 @@ SessionList::SessionList(QObject* parent)
SLOT(favoriteChanged(const QString&,bool)) );
}
void SessionList::favoriteChanged(const QString& key,bool isFavorite)
void ProfileList::favoriteChanged(const QString& key,bool isFavorite)
{
if ( isFavorite )
{
SessionInfo* info = SessionManager::instance()->sessionType(key);
Profile* info = SessionManager::instance()->sessionType(key);
QAction* action = _group->addAction(info->name());
action->setIcon( KIcon(info->icon()) );
......@@ -63,7 +63,7 @@ void SessionList::favoriteChanged(const QString& key,bool isFavorite)
}
}
void SessionList::triggered(QAction* action)
void ProfileList::triggered(QAction* action)
{
// assert that session key is still valid
Q_ASSERT( SessionManager::instance()->sessionType( action->data().toString() ) );
......@@ -71,9 +71,9 @@ void SessionList::triggered(QAction* action)
emit sessionSelected( action->data().toString() );
}
QList<QAction*> SessionList::actions()
QList<QAction*> ProfileList::actions()
{
return _group->actions();
}
#include "SessionList.moc"
#include "ProfileList.moc"
......@@ -12,19 +12,19 @@ namespace Konsole
{
/**
* SessionList provides a list of actions which represent types of session that a SessionManager can
* ProfileList provides a list of actions which represent types of session that a SessionManager can
* create. These actions can be plugged into a GUI
*
* The user-data associated with each session can be passed to the createSession() method of the
* SessionManager to create a new terminal session.
*/
class SessionList : public QObject
class ProfileList : public QObject
{
Q_OBJECT
public:
/** Constructs a new session list which displays sessions that can be created by @p manager */
SessionList(QObject* parent);
ProfileList(QObject* parent);
/**
* Returns a list of actions representing the types of sessions which can be created by
......
......@@ -7,11 +7,11 @@
#include <QMimeData>
// Konsole
#include "SessionListWidget.h"
#include "ProfileListWidget.h"
static const char* konsoleSessionMimeFormat = "konsole/session";
SessionListWidget::SessionListWidget(QWidget* parent)
ProfileListWidget::ProfileListWidget(QWidget* parent)
: QListWidget(parent)
{
// use large icons so that there is a big area for the user to click
......@@ -26,7 +26,7 @@ SessionListWidget::SessionListWidget(QWidget* parent)