aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/term/termwidget.cpp
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2011-01-01 20:19:56 +0000
committerGravatar Szymon Tomasz Stefanek2011-01-01 20:19:56 +0000
commitc601b5a27f74b16158adafe429faefbe573e64a2 (patch)
treea3cde3206a45628f8ac86e8dfbdab70b20c3a831 /src/modules/term/termwidget.cpp
parentprobable compilation fix for rijndaled/crypto++ (diff)
downloadKVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.gz
KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.bz2
KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.zip
The big rename for modules. Still some details remaining.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5284 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/term/termwidget.cpp')
-rw-r--r--src/modules/term/termwidget.cpp178
1 files changed, 0 insertions, 178 deletions
diff --git a/src/modules/term/termwidget.cpp b/src/modules/term/termwidget.cpp
deleted file mode 100644
index 410203261..000000000
--- a/src/modules/term/termwidget.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-//=============================================================================
-//
-// File : termwidget.cpp
-// Creation date : Thu Aug 10 2000 17:42:12 by Szymon Stefanek
-//
-// This file is part of the KVIrc irc client distribution
-// Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
-//
-// 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 the Free Software Foundation; either version 2
-// of the License, or (at your opinion) any later version.
-//
-// This program is distributed in the HOPE that it will be USEFUL,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-//=============================================================================
-
-#include "termwidget.h"
-#include "termwindow.h"
-
-#include "KviModule.h"
-#include "KviMainWindow.h"
-#include "KviIconManager.h"
-#include "KviLocale.h"
-#include "KviPointerList.h"
-
-#include <QLabel>
-#include <QToolTip>
-#include <QTimer>
-
-#ifdef COMPILE_KDE_SUPPORT
-
- #include "klibloader.h"
- #include "kparts/part.h"
- #include "kparts/factory.h"
- #include <kde_terminal_interface.h>
-
- extern KviModule * g_pTermModule;
- extern KviPointerList<KviTermWidget> * g_pTermWidgetList;
- extern KviPointerList<KviTermWindow> * g_pTermWindowList;
-
- KviTermWidget::KviTermWidget(QWidget * par,KviMainWindow *,bool bIsStandalone)
- : QFrame(par)
- {
- setObjectName("term_widget");
- if(bIsStandalone)g_pTermWidgetList->append(this);
- m_bIsStandalone = bIsStandalone;
-
- m_pKonsolePart = 0;
- m_pKonsoleWidget = 0;
-
- if(bIsStandalone)
- {
- m_pHBox = new KviTalHBox(this);
- m_pTitleLabel = new QLabel(__tr2qs("Terminal emulator"),m_pHBox);
- m_pTitleLabel->setFrameStyle(QFrame::Raised | QFrame::StyledPanel);
- m_pCloseButton = new QPushButton("",m_pHBox);
- m_pCloseButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CLOSE)));
- m_pCloseButton->setToolTip(__tr2qs("Close this window"));
- m_pHBox->setStretchFactor(m_pTitleLabel,2);
- connect(m_pCloseButton,SIGNAL(clicked()),this,SLOT(closeClicked()));
- } else {
- m_pHBox = 0;
- m_pTitleLabel = 0;
- m_pCloseButton = 0;
- }
-
- setFrameStyle(QFrame::Sunken | QFrame::Panel);
-
- KPluginFactory *pKonsoleFactory = KPluginLoader("libkonsolepart").factory();
-
- if(pKonsoleFactory)
- {
- m_pKonsolePart = static_cast<KParts::ReadOnlyPart *>(pKonsoleFactory->create<QObject>(this, this));
-
- if(m_pKonsolePart)
- {
- // start the terminal
- qobject_cast<TerminalInterface*>(m_pKonsolePart)->showShellInDir( QString() );
-
- m_pKonsoleWidget = m_pKonsolePart->widget();
-
- setFocusProxy(m_pKonsoleWidget);
- m_pKonsoleWidget->show();
-
- connect ( m_pKonsolePart, SIGNAL(destroyed()), this, SLOT(konsoleDestroyed()) );
- } else {
- m_pKonsoleWidget = new QLabel(__tr2qs("Can't create the terminal emulation part"), this);
- }
- } else {
- m_pKonsoleWidget = new QLabel(__tr2qs("Can't retrieve the terminal emulation factory"), this);
- }
- }
-
- KviTermWidget::~KviTermWidget()
- {
- if(m_pKonsoleWidget)
- disconnect(m_pKonsoleWidget,SIGNAL(destroyed()),this,SLOT(konsoleDestroyed()));
-
- if(m_bIsStandalone)g_pTermWidgetList->removeRef(this);
- if(g_pTermWindowList->isEmpty() && g_pTermWidgetList->isEmpty())g_pTermModule->unlock();
- }
-
- void KviTermWidget::resizeEvent(QResizeEvent *)
- {
- int hght = 0;
- if(m_bIsStandalone)
- {
- hght = m_pCloseButton->sizeHint().height();
- m_pHBox->setGeometry(1,1,width() - 2,hght + 1);
-
- }
- if(m_pKonsoleWidget)
- m_pKonsoleWidget->setGeometry(1,hght + 1,width() - 2,height() - (hght + 2));
- }
-
- void KviTermWidget::closeClicked()
- {
- // this is called only in standalone mode
- delete this;
- }
-
- void KviTermWidget::konsoleDestroyed()
- {
- m_pKonsoleWidget = 0;
- m_pKonsolePart = 0;
- hide();
- QTimer::singleShot(0,this,SLOT(autoClose()));
- }
-
- void KviTermWidget::autoClose()
- {
- if(m_bIsStandalone)delete this;
- else ((KviWindow *)parent())->close();
- }
-
- void KviTermWidget::changeTitle(int,const QString& str)
- {
- if(m_bIsStandalone)m_pTitleLabel->setText(str);
- }
-
- void KviTermWidget::notifySize(int,int)
- {
- }
-
- void KviTermWidget::changeColumns(int)
- {
- }
-
- QSize KviTermWidget::sizeHint() const
- {
- int hght = 0;
- int wdth = 0;
- if(m_pKonsoleWidget)
- {
- hght += m_pKonsoleWidget->sizeHint().height();
- wdth = m_pKonsoleWidget->sizeHint().width();
- }
- if(m_pCloseButton)
- {
- hght += m_pCloseButton->sizeHint().height();
- }
-
- return QSize(wdth + 2,hght + 2);
- }
-
-#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
-#include "termwidget.moc"
-#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES
-
-#endif //COMPILE_KDE_SUPPORT