-if everything is fine, konsole may end up being a part tonight

svn path=/trunk/kdebase/konsole/; revision=45199
wilder-portage
Lotzi Boloni 26 years ago
parent 0e82778904
commit fa6327c409
  1. 7
      include/konsole.h
  2. 23
      src/Makefile.am
  3. 1070
      src/konsole.C
  4. 198
      src/konsole_part.C
  5. 1082
      src/main.C

@ -1,6 +1,6 @@
/* -------------------------------------------------------------------------- */
/* */
/* [main.h] Konsole */
/* [konsole.h] Konsole */
/* */
/* -------------------------------------------------------------------------- */
/* */
@ -13,12 +13,13 @@
/* */
/* -------------------------------------------------------------------------- */
#ifndef MAIN_H
#define MAIN_H
#ifndef KONSOLE_H
#define KONSOLE_H
#include <ktmainwindow.h>
#include <ksimpleconfig.h>
#include <kaction.h>
#include <qstrlist.h>
#include "TEPty.h"

@ -20,13 +20,24 @@ INCLUDES = -I$(INCDIR) $(all_includes)
# you can add here more. This one gets installed
bin_PROGRAMS = konsole konsole_grantpty kwrited #kcmkonsole
lib_LTLIBRARIES = kwrited.la
lib_LTLIBRARIES = libkonsole.la kwrited.la
noinst_LTLIBRARIES = libkonsole.la
#noinst_LTLIBRARIES = libkonsole.la
libkonsole_la_SOURCES =konsole.C \
schema.C \
session.C \
TEWidget.C \
TEmuVt102.C \
TEScreen.C \
TEmulation.C \
TEPty.C \
TEHistory.C \
keytrans.C
libkonsole_la_SOURCES = TEWidget.C TEmuVt102.C TEScreen.C TEmulation.C TEPty.C TEHistory.C keytrans.C
libkonsole_la_LDFLAGS = -no-undefined $(all_libraries) # -version-info `expr $(VERSION) + $(SUBVERS)`:$(RELEASE):$(SUBVERS)
libkonsole_la_LIBADD = $(LIB_KDEUI) $(LIBUTEMPTER)
libkonsole_la_LIBADD = $(LIB_KDEUI) $(LIBUTEMPTER) -lkparts
# Which sources should be compiled for konsole.
@ -38,7 +49,7 @@ kwrited_SOURCES = dummy.C
kwrited_LDADD = kwrited.la
kwrited_LDFLAGS = $(all_libraries) $(KDE_RPATH)
konsole_SOURCES = main.C schema.C session.C
konsole_SOURCES = main.C
konsole_LDADD = libkonsole.la $(LIB_KIMGIO)
konsole_LDFLAGS = $(all_libraries) $(KDE_RPATH)
@ -60,7 +71,7 @@ install-exec-local: install-binPROGRAMS
@(chown root $(bindir)/konsole_grantpty && chmod 4755 $(bindir)/konsole_grantpty) || echo "Please make konsole_grandpty setuid root"
# just to make sure, automake makes them
METASOURCES = TEWidget.moc TEmuVt102.moc session.moc main.moc \
METASOURCES = TEWidget.moc TEmuVt102.moc session.moc konsole.moc \
TEmulation.moc TEPty.moc kwrited.moc
META_INCLUDES = $(srcdir)/../include

File diff suppressed because it is too large Load Diff

@ -0,0 +1,198 @@
/*
This file is part of the KDE system
Copyright (C) 1999,2000 Boloni Laszlo
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
konsole_part.h
*/
#include "konsole_part.h"
#include <kinstance.h>
#include <klocale.h>
#include <kaboutdata.h>
#include <kaction.h>
#include <kparts/partmanager.h>
#include <kiconloader.h>
#include <kdebug.h>
#include <qlabel.h>
#include <qsplitter.h>
#include <qdom.h>
extern "C"
{
/**
* This function is the 'main' function of this part. It takes
* the form 'void *init_lib<library name>() It always returns a
* new factory object
*/
void *init_libkonsole()
{
// printf(" \n\n\nKonsole in actions!!! \n\n\n");
return new konsoleFactory;
}
};
/**
* We need one static instance of the factory for our C 'main'
* function
*/
KInstance *konsoleFactory::s_instance = 0L;
konsoleFactory::konsoleFactory()
{
}
konsoleFactory::~konsoleFactory()
{
if (s_instance)
delete s_instance;
s_instance = 0;
}
QObject *konsoleFactory::create(QObject *parent, const char *name, const char*,
const QStringList& )
{
QObject *obj = new konsolePart((QWidget*)parent, name);
emit objectCreated(obj);
return obj;
}
KInstance *konsoleFactory::instance()
{
if ( !s_instance )
{
KAboutData about("konsole", I18N_NOOP("Konsole"), "1.0");
s_instance = new KInstance(&about);
}
return s_instance;
}
konsolePart::konsolePart(QWidget *parent, const char *name)
: KParts::ReadOnlyPart(parent, name)
{
setInstance(konsoleFactory::instance());
// create a canvas to insert our widget
m_extension = new konsoleBrowserExtension(this);
QSplitter *splitter = new QSplitter(parent);
splitter->setFocusPolicy(QWidget::ClickFocus);
splitter->setOrientation( QSplitter::Vertical );
setWidget(splitter);
gofw = new konsoleWidget(splitter);
konsoleDetailWidget *detail = new konsoleDetailWidget(splitter);
gofw->detail = detail;
gofw->ds = new konsoleDataSource_Memory();
konsoleDataQuery gq;
gq.getView(*(gofw->ds), gofw->dv);
gofw->dv.createVisuals(200,200,150);
QValueList<int> splitinit;
splitinit.append(80);
splitinit.append(20);
splitter->setSizes(splitinit);
splitter->show();
setXMLFile("konsole_part.rc");
kDebugInfo("Loading successful");
kDebugInfo("XML file set");
}
void konsolePart::slotNew() {
kDebugInfo("slotNew called");
}
void konsolePart::slotSaveFile() {
kDebugInfo("slotSaveFile called");
}
void konsolePart::slotLoadFile() {
kDebugInfo("slotLoadFile called");
}
void konsolePart::slotTestDialog() {
kDebugInfo("slotTestDialog called");
}
void konsolePart::slotDelayedLoad() {
if (!gofw->ds->open(m_file)) {
return;
}
gofw->dv.center = NULL;
gofw->refresh();
gofw->detail->setValues(gofw->dv.center->val);
}
konsolePart::~konsolePart()
{
closeURL();
}
bool konsolePart::openFile()
{
// This is a horrible hack
QTimer *delayedLoadTimer = new QTimer(this);
delayedLoadTimer->start(3,true);
connect(delayedLoadTimer, SIGNAL(timeout()),
this, SLOT(slotDelayedLoad()) );
return true;
// widget->setText(m_file);
/*
QFile f(m_file);
f.open(IO_ReadOnly);
QDomDocument *doc = new QDomDocument(&f);
kDebugInfo("This simple stuff kills it!");
*/
/*
if (!gofw->ds->loadXML(m_file))
return false;
gofw->dv.center = NULL; // FIXME: this is a hack
gofw->refresh();
gofw->detail->setValues(gofw->dv.center->val);
// return true;
kDebugInfo("Loading successful");
*/
return true;
}
/*
bool konsolePart::closeURL()
{
return true;
}
*/
konsoleBrowserExtension::konsoleBrowserExtension(konsolePart *parent)
: KParts::BrowserExtension(parent, "konsoleBrowserExtension")
{
}
konsoleBrowserExtension::~konsoleBrowserExtension()
{
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save