Commit 8e72dd41 authored by Robert Knight's avatar Robert Knight

Fix primary/alternate shortcuts for next/previous tab (they were the wrong way...

Fix primary/alternate shortcuts for next/previous tab (they were the wrong way round).  More appropriate close icon in search bar.  Make Quit menu item close only the current window, not all Konsole instances.  Change the default shortcut for the Quit menu item to Ctrl+Shift+Q.  The standard Ctrl+Q is reserved for use by terminal applications.  Remove references to Application in MainWindow class.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=666372
parent dcdf9e76
......@@ -72,8 +72,10 @@ MainWindow* Application::newMainWindow()
MainWindow* window = new MainWindow();
window->setSessionList( new ProfileList(window) );
connect( window , SIGNAL(requestSession(const QString&,ViewManager*)),
connect( window , SIGNAL(newSessionRequest(const QString&,ViewManager*)),
this , SLOT(createSession(const QString&,ViewManager*)));
connect( window , SIGNAL(newWindowRequest(const QString&)),
this , SLOT(createWindow(const QString&)) );
connect( window->viewManager() , SIGNAL(viewDetached(Session*)) , this , SLOT(detachView(Session*)) );
return window;
......@@ -150,6 +152,13 @@ void Application::detachView(Session* session)
window->show();
}
void Application::createWindow(const QString& key)
{
MainWindow* window = newMainWindow();
createSession(key,window->viewManager());
window->show();
}
void Application::createSession(const QString& key , ViewManager* view)
{
Session* session = SessionManager::instance()->createSession(key);
......
......@@ -73,6 +73,7 @@ public:
private slots:
void createSession(const QString& key, ViewManager* view);
void createWindow(const QString& key);
void detachView(Session* session);
void toggleBackgroundInstance();
......
......@@ -51,7 +51,7 @@ IncrementalSearchBar::IncrementalSearchBar(Features features , QWidget* parent)
close->setObjectName("close-button");
close->setToolTip("Close the search bar");
close->setAutoRaise(true);
close->setIcon(KIcon("fileclose"));
close->setIcon(KIcon("dialog-cancel"));
connect( close , SIGNAL(clicked()) , this , SIGNAL(closeClicked()) );
QLabel* findLabel = new QLabel(i18n("Find:"),this);
......
......@@ -21,7 +21,6 @@
#include "MainWindow.h"
// Qt
#include <QtGui/QApplication>
#include <QtGui/QBoxLayout>
// KDE
......@@ -39,10 +38,6 @@
#include <KXMLGUIFactory>
// Konsole
#ifndef KONSOLE_PART
#include "Application.h"
#endif
#include "BookmarkHandler.h"
#include "IncrementalSearchBar.h"
#include "RemoteConnectionDialog.h"
......@@ -163,7 +158,10 @@ void MainWindow::setupActions()
#ifndef KONSOLE_PART
KStandardAction::quit( Application::self() , SLOT(quit()) , collection );
QAction* quitAction = KStandardAction::quit( this , SLOT(close()) , collection );
// the default shortcut for quit is typically Ctrl+[Some Letter, usually Q] but that is reserved for
// use by terminal applications
quitAction->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_Q);
#endif
// Bookmark Menu
......@@ -231,14 +229,12 @@ void MainWindow::sessionListChanged(const QList<QAction*>& actions)
void MainWindow::newTab()
{
emit requestSession(QString(),_viewManager);
emit newSessionRequest(QString(),_viewManager);
}
void MainWindow::newWindow()
{
#ifndef KONSOLE_PART
Application::self()->newInstance();
#endif
emit newWindowRequest(QString());
}
void MainWindow::showShortcutsDialog()
......@@ -248,7 +244,7 @@ void MainWindow::showShortcutsDialog()
void MainWindow::newFromProfile(const QString& key)
{
emit requestSession(key,_viewManager);
emit newSessionRequest(key,_viewManager);
}
void MainWindow::showManageProfilesDialog()
{
......@@ -260,7 +256,7 @@ void MainWindow::showRemoteConnectionDialog()
{
RemoteConnectionDialog dialog(this);
if ( dialog.exec() == QDialog::Accepted )
emit requestSession(dialog.sessionKey(),_viewManager);
emit newSessionRequest(dialog.sessionKey(),_viewManager);
}
void MainWindow::setupWidgets()
......
......@@ -86,7 +86,16 @@ class MainWindow : public KXmlGuiWindow
* @param key The key for the profile to use to create the new session.
* @param view The view manager owned by this main window
*/
void requestSession(const QString& key , ViewManager* view);
void newSessionRequest(const QString& key , ViewManager* view);
/**
* Emitted by the main window to request the creation of a
* new session in a new window.
*
* @param key The key for the profile to use to create the
* first session in the new window.
*/
void newWindowRequest(const QString& key);
private slots:
void newTab();
......
......@@ -756,7 +756,7 @@ void SessionController::increaseTextSize()
}
void SessionController::decreaseTextSize()
{
const int MinimumFontSize = 6;
static const int MinimumFontSize = 6;
QFont font = _view->getVTFont();
font.setPointSize( qMax(font.pointSize()-1,MinimumFontSize) );
......
......@@ -92,7 +92,8 @@ SessionManager::SessionManager()
Q_ASSERT( !_defaultProfile.isEmpty() );
// get shortcuts and paths of profiles associated with
// them
// them - this doesn't load the shortcuts themselves,
// that is done on-demand.
loadShortcuts();
}
QString SessionManager::loadProfile(const QString& path)
......@@ -171,6 +172,15 @@ const QList<Session*> SessionManager::sessions()
return _sessions;
}
void SessionManager::updateSession(Session* session)
{
Profile* info = profile(session->profileKey());
Q_ASSERT( info );
applyProfile(session,info,false);
}
Session* SessionManager::createSession(const QString& key )
{
Session* session = 0;
......
......@@ -138,6 +138,11 @@ public:
*/
Session* createSession(const QString& key = QString());
/**
* Updates a session's properties to match its current profile.
*/
void updateSession(Session* session);
/**
* Returns a list of active sessions.
*/
......@@ -159,7 +164,7 @@ public:
/**
* Returns the set of keys for the user's favorite profiles.
*/
QSet<QString> findFavorites() ;
QSet<QString> findFavorites();
/**
* Returns the list of shortcut key sequences which
......@@ -225,6 +230,14 @@ signals:
*/
void favoriteStatusChanged(const QString& key , bool favorite);
/**
* Emitted when the shortcut for a profile is changed.
*
* @param key The key for the profile
* @param newShortcut The new shortcut key sequence for the profile
*/
void shortcutChanged(const QString& key , const QKeySequence& newShortcut);
protected Q_SLOTS:
/**
......
......@@ -163,8 +163,8 @@ void ViewManager::setupActions()
}
KShortcut nextViewShortcut = nextViewAction->shortcut();
nextViewShortcut.setAlternate( QKeySequence(Qt::SHIFT+Qt::Key_Right) );
nextViewShortcut.setPrimary( QKeySequence(Qt::CTRL+Qt::Key_PageUp) );
nextViewShortcut.setPrimary( QKeySequence(Qt::SHIFT+Qt::Key_Right) );
nextViewShortcut.setAlternate( QKeySequence(Qt::CTRL+Qt::Key_PageUp) );
nextViewAction->setShortcut(nextViewShortcut);
connect( nextViewAction, SIGNAL(triggered()) , this , SLOT(nextView()) );
_viewSplitter->addAction(nextViewAction);
......
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