From dfdd8ecabd2fa5cdcf2b65a4ba22aaa28274d48e Mon Sep 17 00:00:00 2001 From: Lars Doelle Date: Wed, 28 Oct 1998 23:52:28 +0000 Subject: [PATCH] sessions reactivated svn path=/trunk/kdebase/konsole/; revision=11854 --- src/Makefile.am | 5 +++-- src/TEWidget.C | 4 ++++ src/main.C | 21 ++++++++++++++++++--- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index dd77c6430..0ba3e71b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,8 +52,9 @@ konsole_LDFLAGS = $(all_libraries) $(KDE_RPATH) # the library search path. -# extra libraries for jpeg and png image formats; kfiledialog -EXTRALIBS = $(LIB_KIMGIO) +# i have had troubles with the @LIB_KIMGIO@ macro. +# if you like to put it in here, please make sure it works before commiting +EXTRALIBS = $(KIMGIO_LIBS) -lkimgio # just to make sure, automake makes them BUILTSOURCES =TEWidget.moc TEmuVt102.moc session.moc main.moc TEmulation.moc TEShell.moc diff --git a/src/TEWidget.C b/src/TEWidget.C index 866f4311d..24d2edf5c 100644 --- a/src/TEWidget.C +++ b/src/TEWidget.C @@ -61,6 +61,7 @@ #define MAX(a,b) ((a)>(b)?(a):(b)) #define HERE printf("%s(%d): here\n",__FILE__,__LINE__) +#define HCNT(Name) //{ static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); } #define loc(X,Y) ((Y)*columns+(X)) @@ -236,6 +237,7 @@ void TEWidget::setImage(const ca* const newimg, int lines, int columns) QPainter paint; setUpdatesEnabled(FALSE); paint.begin( this ); +HCNT("setImage"); QPoint tL = contentsRect().topLeft(); int tLx = tL.x(); @@ -307,6 +309,7 @@ void TEWidget::paintEvent( QPaintEvent* pe ) setUpdatesEnabled(FALSE); paint.begin( this ); paint.setBackgroundMode( TransparentMode ); +HCNT("paintEvent"); // Note that the actual widget size can be slightly larger // that the image (the size is truncated towards the smaller @@ -373,6 +376,7 @@ void TEWidget::resizeEvent(QResizeEvent* ev) //printf("approx: %d,%d\n",ev->size().width()/font_w,ev->size().height()/font_h); //printf("leaves: %d,%d\n",ev->size().width()%font_w,ev->size().height()%font_h); //printf("curren: %d,%d\n",width(),height()); +HCNT("resizeEvent"); // see comment in `paintEvent' concerning the rounding. //FIXME: could make a routine here; check width(),height() diff --git a/src/main.C b/src/main.C index 3c0e92ca5..2e826e568 100644 --- a/src/main.C +++ b/src/main.C @@ -99,11 +99,17 @@ TEDemo::TEDemo(char* args[]) : KTMainWindow() addSession(new TESession(this,te,args,"xterm"),args[0]); se->setFontNo(n_font); + setSchema(s_schema); setColLin(lincol.width(),lincol.height()); } +/*! + sets application window to a size + based on columns X lines of the te + guest widget +*/ + void TEDemo::setColLin(int columns, int lines) -// set set application to a specific size { te->setFixedSize(te->calcSize(columns,lines)); updateRects(); @@ -229,8 +235,8 @@ void TEDemo::makeMenu() //FIXME: deactivated mainly because it flickers like crasy // appears to do well otherwise -//menubar->insertItem(i18n("New"), m_commands); -//menubar->insertItem(i18n("Sessions"), m_sessions); + menubar->insertItem(i18n("New"), m_commands); + menubar->insertItem(i18n("Sessions"), m_sessions); menubar->insertItem(i18n("Options"), m_options); menubar->insertSeparator(); @@ -467,6 +473,15 @@ static QIntDict no2session; static QPtrDict session2no; static int session_no = 0; +//FIXME: activating sessions creates a lot flicker in the moment. +// it comes from setting the attributes of a session individually. +// ONE setImage call should actually be enough to match all cases. +// These can be quite different: +// - The screen size might have changed while the session was +// detached. A propagation of the resize should in this case +// make the drawEvent. +// - font, background image and color palette should be set in one go. + void TEDemo::activateSession(int sn) { TESession* s = no2session.find(sn);