Commit 12a859ec authored by Robert Knight's avatar Robert Knight

Header cleanup. Removed bizarre code for supposedly detecting non-responsive...

Header cleanup.  Removed bizarre code for supposedly detecting non-responsive sessions when closing because it doesn't work - now the Konsole window disappears instantly when the close button is clicked and there are lots of sessions open.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=594647
parent 9e64a863
......@@ -205,6 +205,11 @@ SessionManager::~SessionManager()
delete infoIter.next();
}
const QList<TESession*> SessionManager::sessions()
{
return _sessions;
}
void SessionManager::pushSessionSettings( const SessionInfo* info )
{
addSetting( InitialWorkingDirectory , SessionConfig , info->defaultWorkingDirectory() );
......
......@@ -242,7 +242,7 @@ public:
/**
* Returns a list of active sessions.
*/
QList<TESession*> sessions();
const QList<TESession*> sessions();
protected Q_SLOTS:
......
......@@ -19,18 +19,22 @@
*/
// Standard
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <kdebug.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
// Qt
#include <QTextStream>
#include <QTime>
// KDE
#include <kdebug.h>
// Konsole
#include "konsole_wcwidth.h"
#include "TEScreen.h"
#include "TerminalCharacterDecoder.h"
......
......@@ -21,12 +21,14 @@
#ifndef TESCREEN_H
#define TESCREEN_H
#include "TECommon.h"
#include "TEHistory.h"
//Added by qt3to4:
// Qt
#include <QTextStream>
#include <QVarLengthArray>
// Konsole
#include "TECommon.h"
#include "TEHistory.h"
#define MODE_Origin 0
#define MODE_Wrap 1
#define MODE_Insert 2
......
......@@ -38,25 +38,25 @@
#undef HAVE_XKB
#endif
#include <klocale.h>
#include <kmessagebox.h>
#include "TEmuVt102.h"
#include "TEWidget.h"
#include "TEScreen.h"
// Standard
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include "TEmuVt102.moc"
#include <kdebug.h>
//Added by qt3to4:
// Qt
#include <QKeyEvent>
#include <QByteArray>
// KDE
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
// Konsole
#include "TEmuVt102.h"
#include "TEWidget.h"
#include "TEScreen.h"
/* VT102 Terminal Emulation
This class puts together the screens, the pty and the widget to a
......@@ -1550,3 +1550,5 @@ static void scrolllock_set_off()
xkb_set_off();
}
#endif // defined(HAVE_XKB)
#include "TEmuVt102.moc"
......@@ -21,16 +21,20 @@
#ifndef VT102EMU_H
#define VT102EMU_H
#include "TEWidget.h"
#include "TEScreen.h"
#include "TEmulation.h"
// Standard Library
#include <stdio.h>
//Added by qt3to4:
// Qt
#include <QKeyEvent>
#include <QHash>
#include <QTimer>
//
// Konsole
#include "TEWidget.h"
#include "TEScreen.h"
#include "TEmulation.h"
#define MODE_AppScreen (MODES_SCREEN+0)
#define MODE_AppCuKeys (MODES_SCREEN+1)
......
......@@ -22,7 +22,6 @@
#define EMULATION_H
// System
#include <keytrans.h>
#include <stdio.h>
// Qt
......@@ -33,6 +32,7 @@
#include <QTimer>
// Konsole
#include <keytrans.h>
#include "TEScreen.h"
#include "TEWidget.h"
......
/*
This file is part of Konsole, an X terminal.
Copyright (C) 1996 by Matthias Ettrich <ettrich@kde.org>
This file is part of the Konsole Terminal.
Copyright (C) 2006 Robert Knight <robertknight@gmail.com>
Copyright (C) 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
Copyright (C) 1996 by Matthias Ettrich <ettrich@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -18,9 +20,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
/* The material contained in here more or less directly orginates from */
/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */
/* */
/*! \class Konsole
......@@ -30,45 +29,6 @@
terminal sessions and applying settings.
*/
/*STATE:
konsole/kwin session management, parts stuff, config, menus
are all in bad need for a complete rewrite.
While the emulation core (TEmulation, TEVt102, TEScreen, TEWidget)
are pretty stable, the upper level material has certainly drifted.
Everything related to Sessions, Configuration has to be redesigned.
It seems that the konsole now falls apart into individual sessions
and a session manager.
Time to start a requirement list.
- Rework the Emulation::setConnect logic.
Together with session changing (Shift-Left/Right, Ctrl-D) it allows
key events to propagate to other sessions.
- Get rid of the unconfigurable, uncallable initial "Konsole" session.
Leads to code replication in konsole_part and other issues. Related
to the booting of konsole, thus matter of redesign.
*/
/*FIXME:
- All the material in here badly sufferes from the fact that the
configuration can originate from many places, so all is duplicated
and falls out of service. Especially the command line is badly broken.
The sources are:
- command line
- menu
- configuration files
- other events (e.g. resizing)
We have to find a single-place method to better maintain this.
- In general, the material contained in here and in session.C
should be rebalanced. Much more material now comes from configuration
files and the overall routines should better respect this.
- Font+Size list should go to a configuration file, too.
*/
// System
#include <assert.h>
#include <config.h>
......@@ -81,7 +41,6 @@ Time to start a requirement list.
#include <sys/wait.h>
// Qt
#include <Q3CString>
#include <Q3PtrList>
#include <QCheckBox>
#include <QEvent>
......@@ -96,6 +55,7 @@ Time to start a requirement list.
#include <QPainter>
#include <QPixmap>
#include <QPushButton>
#include <QSignalMapper>
#include <QSpinBox>
#include <QStringList>
#include <QTextStream>
......@@ -151,6 +111,7 @@ Time to start a requirement list.
#include <kurlrequesterdlg.h>
#include <netwm.h>
#include <knotifyconfigwidget.h>
#include <kwinmodule.h>
// Konsole
#include "SessionManager.h"
......@@ -303,7 +264,6 @@ Konsole::Konsole(const char* name, int histon, bool menubaron, bool tabbaron, bo
m_sessionGroup = new QActionGroup(this);
isRestored = b_inRestore;
connect( &m_closeTimeout, SIGNAL(timeout()), this, SLOT(slotCouldNotClose()));
menubar = menuBar();
......@@ -376,19 +336,17 @@ Konsole::Konsole(const char* name, int histon, bool menubaron, bool tabbaron, bo
Konsole::~Konsole()
{
sessions.first();
while(sessions.current())
QListIterator<TESession*> sessionIter( sessionManager()->sessions() );
while ( sessionIter.hasNext() )
{
sessions.current()->closeSession();
sessions.next();
sessionIter.next()->closeSession();
}
// Wait a bit for all children to clean themselves up.
while(sessions.count() && KProcessController::theKProcessController->waitForProcessExit(1))
;
sessions.setAutoDelete(true);
resetScreenSessions();
delete m_defaultSession;
......@@ -1236,6 +1194,8 @@ bool Konsole::queryClose()
KMessageBox::PlainCaption)
) {
case KMessageBox::Yes :
return true;
break;
case KMessageBox::Cancel :
return false;
......@@ -1243,38 +1203,7 @@ bool Konsole::queryClose()
}
}
_closing = true;
// WABA: Don't close if there are any sessions left.
// Tell them to go away.
sessions.first();
while(sessions.current())
{
sessions.current()->closeSession();
sessions.next();
}
m_closeTimeout.setSingleShot(true);
m_closeTimeout.start(1500);
return false;
}
void Konsole::slotCouldNotClose()
{
int result = KMessageBox::warningContinueCancel(this,
i18n("The application running in Konsole does not respond to the close request. "
"Do you want Konsole to close anyway?"),
i18n("Application Does Not Respond"),
KStdGuiItem::close());
if (result == KMessageBox::Continue)
{
while(sessions.first())
{
doneSession(sessions.current());
}
}
else
_closing = false;
return true;
}
/**
......@@ -3038,7 +2967,6 @@ void Konsole::doneSession(TESession* s)
m_removeSessionButton->setEnabled(tabwidget->count()>1);
session2action.remove(s);
action2session.remove(ra);
sessionConfigMap.remove(s);
int sessionIndex = sessions.findRef(s);
sessions.remove(s);
delete ra; // will the toolbar die?
......@@ -4095,11 +4023,6 @@ void Konsole::slotSaveHistory()
void Konsole::slotShowSaveHistoryDialog()
{
// FIXME - mostLocalURL can't handle non-existing files yet, so this
// code doesn't work.
// KUrl s_url = KFileDialog::getSaveUrl( QString(),
// "text/plain text/html",
// 0L, i18n("Save History"));
if (!saveHistoryDialog)
{
saveHistoryDialog = new KFileDialog( QString(":konsole") , QString() , this);
......
......@@ -18,48 +18,39 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
/* The material contained in here more or less directly orginates from */
/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */
/* */
#ifndef KONSOLE_H
#define KONSOLE_H
#include <kmainwindow.h>
#include <kdialog.h>
#include <ksimpleconfig.h>
#include <kwinmodule.h>
// Qt
#include <QStringList>
#include <q3intdict.h>
#include <q3ptrdict.h>
#include <QSignalMapper>
//Added by qt3to4:
#include <Q3CString>
#include <Q3PtrDict>
#include <Q3PtrList>
#include <QEvent>
#include <QLabel>
#include <QList>
// KDE
#include <kmainwindow.h>
#include <kdialog.h>
// Konsole
#include "TEPty.h"
#include "TEWidget.h"
#include "TEmuVt102.h"
#include "session.h"
#include "schema.h"
#include "konsolebookmarkhandler.h"
#undef PACKAGE
#undef VERSION
#define PACKAGE "konsole"
#define VERSION "1.9"
class QCheckBox;
class QEvent;
class QLabel;
class QToolButton;
class QWidgetAction;
class QSignalMapper;
class KAction;
class KColorCells;
......@@ -67,11 +58,13 @@ class KFileDialog;
class KFindDialog;
class KMenu;
class KSelectAction;
//class SessionTabWidget;
class KSimpleConfig;
class KTabWidget;
class KTemporaryFile;
class KToggleAction;
class KWinModule;
class TEWidget;
class SessionInfo;
class SessionManager;
......@@ -163,7 +156,6 @@ private Q_SLOTS:
void closeCurrentSession();
void confirmCloseCurrentSession(TESession* _se=0);
void doneSession(TESession*);
void slotCouldNotClose();
void toggleFullScreen();
bool fullScreen();
void setFullScreen(bool on);
......@@ -312,10 +304,6 @@ private:
Q3PtrList<TESession> sessions;
//stores association between sessions and the configuration
//entry used to create it
QHash<TESession*,KSimpleConfig*> sessionConfigMap;
QList<KTemporaryFile*> tempfiles;
KSimpleConfig* m_defaultSession;
QString m_defaultSessionFilename;
......
......@@ -6,6 +6,7 @@
#ifndef _KONSOLE_WCWIDTH_H_
#define _KONSOLE_WCWIDTH_H_
// Qt
#include <qglobal.h>
#include <QString>
......
......@@ -55,6 +55,7 @@
#include <kmessagebox.h>
#include <config.h>
#include <kauthorized.h>
#include <ksimpleconfig.h>
// Konsole
#include "konsole.h"
......
......@@ -19,9 +19,11 @@
02110-1301 USA.
*/
// Standard
#include <assert.h>
#include <stdlib.h>
// Qt
#include <QApplication>
#include <QByteArray>
#include <QDir>
......@@ -30,7 +32,7 @@
#include <QStringList>
#include <QtDBus/QtDBus>
#include <config-konsole.h>
// KDE
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
......@@ -40,6 +42,8 @@
#include <kshell.h>
#include <kstandarddirs.h>
// Konsole
#include <config-konsole.h>
#include "sessionadaptor.h"
#include "sessionscriptingadaptor.h"
#include "zmodem_dialog.h"
......
......@@ -21,11 +21,15 @@
#ifndef SESSION_H
#define SESSION_H
#include <kapplication.h>
#include <kmainwindow.h>
// Qt
#include <QStringList>
#include <QByteArray>
// KDE
#include <kapplication.h>
#include <kmainwindow.h>
// Konsole
#include "TEPty.h"
#include "TEWidget.h"
#include "TEmuVt102.h"
......
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