Download | Plain Text | No Line Numbers
- --- kdebase-3.5.10.orig/konsole/konsole/konsole.h 2007-10-08 11:51:33.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/konsole.h 2011-05-10 01:25:27.000000000 +0200
- @@ -389,6 +389,7 @@
- QString s_schema;
- QString s_kconfigSchema;
- QString s_word_seps; // characters that are considered part of a word
- + QString s_printer_path;
- QString pmPath; // pixmap path
- QString dropText;
- QFont defaultFont;
- --- kdebase-3.5.10.orig/konsole/konsole/konsole_part.h 2006-10-01 19:32:08.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/konsole_part.h 2011-05-10 01:26:23.000000000 +0200
- @@ -172,6 +172,7 @@
- QString s_schema;
- QString s_kconfigSchema;
- QString s_word_seps; // characters that are considered part of a word
- + QString s_printer_path; // characters that are considered part of a word
-
- bool b_framevis:1;
- bool b_histEnabled:1;
- --- kdebase-3.5.10.orig/konsole/konsole/session.h 2006-10-01 19:32:08.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/session.h 2011-05-10 01:53:43.000000000 +0200
- @@ -89,6 +89,7 @@
- void setIconText(const QString& _iconText);
- void setAddToUtmp(bool);
- void setXonXoff(bool);
- + void setPrinterPath(const QString& _printer_path);
- bool testAndSetStateIconName (const QString& newname);
- bool sendSignal(int signal);
-
- --- kdebase-3.5.10.orig/konsole/konsole/TEmulation.h 2006-10-01 19:32:08.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/TEmulation.h 2011-05-10 01:55:37.000000000 +0200
- @@ -108,6 +108,7 @@
-
- virtual void clearEntireScreen() =0;
- virtual void reset() =0;
- + virtual void setPrinterPath(const QString &_printer_path) = 0;
-
- protected:
-
- --- kdebase-3.5.10.orig/konsole/konsole/TEmuVt102.h 2006-10-01 19:32:08.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/TEmuVt102.h 2011-05-10 14:28:16.000000000 +0200
- @@ -24,6 +24,8 @@
- #include "TEWidget.h"
- #include "TEScreen.h"
- #include "TEmulation.h"
- +#include <kprocess.h>
- +#include <qvaluelist.h>
- #include <stdio.h>
-
- //
- @@ -73,10 +75,12 @@
-
- void clearEntireScreen();
- void reset();
- + void setPrinterPath(const QString &_printer_path);
-
- void onRcvChar(int cc);
- public slots:
- void sendString(const char *);
- + void wroteStdin(KProcess *proc);
-
- public:
-
- @@ -135,12 +139,16 @@
- void restoreCursor();
- void resetCharset(int scrno);
- void setMargins(int t, int b);
- + void doPrint();
-
- CharCodes charset[2];
-
- DECpar currParm;
- DECpar saveParm;
- bool holdScreen;
- + bool capture;
- + QString captured;
- + QString printer_path;
- };
-
- #endif // ifndef ANSIEMU_H
- --- kdebase-3.5.10.orig/kcontrol/konsole/kcmkonsoledialog.ui 2005-09-10 10:25:12.000000000 +0200
- +++ kdebase-3.5.10/kcontrol/konsole/kcmkonsoledialog.ui 2011-05-10 01:17:29.000000000 +0200
- @@ -62,6 +62,43 @@
- </size>
- </property>
- </spacer>
- + <widget class="QGroupBox" row="1" column="1">
- + <property name="name">
- + <cstring>GroupBox4</cstring>
- + </property>
- + <property name="title">
- + <string>xterm Print</string>
- + </property>
- + <grid>
- + <property name="name">
- + <cstring>unnamed</cstring>
- + </property>
- + <widget class="QLabel" row="0" column="0">
- + <property name="name">
- + <cstring>TextLabel1_3</cstring>
- + </property>
- + <property name="text">
- + <string>Path to printer:</string>
- + </property>
- + <property name="buddy" stdset="0">
- + <cstring>printer_path</cstring>
- + </property>
- + </widget>
- + <widget class="QLineEdit" row="1" column="0">
- + <property name="name">
- + <cstring>printer_path</cstring>
- + </property>
- + <property name="sizePolicy">
- + <sizepolicy>
- + <hsizetype>1</hsizetype>
- + <vsizetype>5</vsizetype>
- + <horstretch>0</horstretch>
- + <verstretch>0</verstretch>
- + </sizepolicy>
- + </property>
- + </widget>
- + </grid>
- + </widget>
- <widget class="QGroupBox" row="1" column="0">
- <property name="name">
- <cstring>GroupBox3</cstring>
- @@ -99,7 +136,7 @@
- </widget>
- </grid>
- </widget>
- - <widget class="QGroupBox" row="0" column="0">
- + <widget class="QGroupBox" row="0" column="0" colspan="2">
- <property name="name">
- <cstring>GroupBox2</cstring>
- </property>
- --- kdebase-3.5.10.orig/kcontrol/konsole/kcmkonsole.cpp 2005-09-10 10:25:12.000000000 +0200
- +++ kdebase-3.5.10/kcontrol/konsole/kcmkonsole.cpp 2011-05-10 01:22:21.000000000 +0200
- @@ -73,6 +73,7 @@
- connect(dialog->matchTabWinTitleCB,SIGNAL(toggled(bool)), SLOT( changed() ));
- connect(dialog->silence_secondsSB,SIGNAL(valueChanged(int)), SLOT( changed() ));
- connect(dialog->word_connectorLE,SIGNAL(textChanged(const QString &)), SLOT( changed() ));
- + connect(dialog->printer_path,SIGNAL(textChanged(const QString &)), SLOT( changed() ));
- connect(dialog->SchemaEditor1, SIGNAL(changed()), SLOT( changed() ));
- connect(dialog->SessionEditor1, SIGNAL(changed()), SLOT( changed() ));
- connect(dialog->SchemaEditor1, SIGNAL(schemaListChanged(const QStringList &,const QStringList &)),
- @@ -106,6 +107,7 @@
- dialog->line_spacingSB->setValue(config.readUnsignedNumEntry( "LineSpacing", 0 ));
- dialog->silence_secondsSB->setValue(config.readUnsignedNumEntry( "SilenceSeconds", 10 ));
- dialog->word_connectorLE->setText(config.readEntry("wordseps",":@-./_~"));
- + dialog->printer_path->setText(config.readEntry("printer_path",""));
-
- dialog->SchemaEditor1->setSchema(config.readEntry("schema"));
-
- @@ -144,6 +146,7 @@
- config.writeEntry("LineSpacing" , dialog->line_spacingSB->value());
- config.writeEntry("SilenceSeconds" , dialog->silence_secondsSB->value());
- config.writeEntry("wordseps", dialog->word_connectorLE->text());
- + config.writeEntry("printer_path", dialog->printer_path->text());
-
- config.writeEntry("schema", dialog->SchemaEditor1->schema());
-
- --- kdebase-3.5.10.orig/kcontrol/konsole/kcmkonsole.cpp 2005-09-10 10:25:12.000000000 +0200
- +++ kdebase-3.5.10/kcontrol/konsole/kcmkonsole.cpp 2011-05-10 01:22:21.000000000 +0200
- @@ -73,6 +73,7 @@
- connect(dialog->matchTabWinTitleCB,SIGNAL(toggled(bool)), SLOT( changed() ));
- connect(dialog->silence_secondsSB,SIGNAL(valueChanged(int)), SLOT( changed() ));
- connect(dialog->word_connectorLE,SIGNAL(textChanged(const QString &)), SLOT( changed() ));
- + connect(dialog->printer_path,SIGNAL(textChanged(const QString &)), SLOT( changed() ));
- connect(dialog->SchemaEditor1, SIGNAL(changed()), SLOT( changed() ));
- connect(dialog->SessionEditor1, SIGNAL(changed()), SLOT( changed() ));
- connect(dialog->SchemaEditor1, SIGNAL(schemaListChanged(const QStringList &,const QStringList &)),
- @@ -106,6 +107,7 @@
- dialog->line_spacingSB->setValue(config.readUnsignedNumEntry( "LineSpacing", 0 ));
- dialog->silence_secondsSB->setValue(config.readUnsignedNumEntry( "SilenceSeconds", 10 ));
- dialog->word_connectorLE->setText(config.readEntry("wordseps",":@-./_~"));
- + dialog->printer_path->setText(config.readEntry("printer_path",""));
-
- dialog->SchemaEditor1->setSchema(config.readEntry("schema"));
-
- @@ -144,6 +146,7 @@
- config.writeEntry("LineSpacing" , dialog->line_spacingSB->value());
- config.writeEntry("SilenceSeconds" , dialog->silence_secondsSB->value());
- config.writeEntry("wordseps", dialog->word_connectorLE->text());
- + config.writeEntry("printer_path", dialog->printer_path->text());
-
- config.writeEntry("schema", dialog->SchemaEditor1->schema());
-
- --- kdebase-3.5.10.orig/konsole/konsole/konsole.cpp 2007-01-15 12:32:17.000000000 +0100
- +++ kdebase-3.5.10/konsole/konsole/konsole.cpp 2011-05-10 01:37:34.000000000 +0200
- @@ -1573,6 +1573,7 @@
- for (TESession *ses = sessions.first(); ses; ses = sessions.next())
- ses->setMonitorSilenceSeconds(monitorSilenceSeconds);
-
- + s_printer_path = config->readEntry("printer_path","");
- b_xonXoff = config->readBoolEntry("XonXoff",false);
- b_matchTabWinTitle = config->readBoolEntry("MatchTabWinTitle",false);
- config->setGroup("UTMP");
- @@ -2924,6 +2925,7 @@
- s->setIconName(icon);
- s->setAddToUtmp(b_addToUtmp);
- s->setXonXoff(b_xonXoff);
- + s->setPrinterPath(s_printer_path);
-
- if (b_histEnabled && m_histSize)
- s->setHistory(HistoryTypeBuffer(m_histSize));
- --- kdebase-3.5.10.orig/konsole/konsole/konsole_part.cpp 2007-05-14 09:55:49.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/konsole_part.cpp 2011-05-10 01:37:53.000000000 +0200
- @@ -522,6 +522,7 @@
- else
- se->setHistory( HistoryTypeNone() );
- se->setKeymapNo( n_keytab );
- + se->setPrinterPath( s_printer_path );
-
- // FIXME: Move this somewhere else...
- KConfig* config = new KConfig("konsolerc",true);
- @@ -566,6 +567,7 @@
- n_scroll = QMIN(config->readUnsignedNumEntry("scrollbar",TEWidget::SCRRIGHT),2);
- m_histSize = config->readNumEntry("history",DEFAULT_HISTORY_SIZE);
- s_word_seps= config->readEntry("wordseps",":@-./_~");
- + s_printer_path = config->readEntry("s_printer_path","");
-
- n_encoding = config->readNumEntry("encoding",0);
-
- @@ -635,6 +637,7 @@
- config->writeEntry("schema",s_kconfigSchema);
- config->writeEntry("scrollbar",n_scroll);
- config->writeEntry("wordseps",s_word_seps);
- + config->writeEntry("printer_path",s_printer_path);
- config->writeEntry("encoding",n_encoding);
- config->writeEntry("use_konsole_settings",m_useKonsoleSettings->isChecked());
- }
- --- kdebase-3.5.10.orig/konsole/konsole/session.cpp 2007-05-14 09:55:49.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/session.cpp 2011-05-10 01:54:04.000000000 +0200
- @@ -595,6 +595,11 @@
- xon_xoff = set;
- }
-
- +void TESession::setPrinterPath(const QString& _printer_path)
- +{
- + em->setPrinterPath(_printer_path);
- +}
- +
- void TESession::slotZModemDetected()
- {
- if (!zmodemBusy)
- --- kdebase-3.5.10.orig/konsole/konsole/TEmuVt102.cpp 2006-10-01 19:32:08.000000000 +0200
- +++ kdebase-3.5.10/konsole/konsole/TEmuVt102.cpp 2011-05-10 14:37:10.000000000 +0200
- @@ -78,7 +78,8 @@
- /*!
- */
-
- -TEmuVt102::TEmuVt102(TEWidget* gui) : TEmulation(gui)
- +TEmuVt102::TEmuVt102(TEWidget* gui) : TEmulation(gui),
- + capture(false)
- {
- //kdDebug(1211)<<"TEmuVt102 ctor() connecting"<<endl;
- QObject::connect(gui,SIGNAL(mouseSignal(int,int,int)),
- @@ -146,6 +147,11 @@
- //kdDebug(1211)<<"TEmuVt102::reset() done"<<endl;
- }
-
- +void TEmuVt102::setPrinterPath(const QString &_printer_path)
- +{
- + printer_path = _printer_path;
- +}
- +
- /* ------------------------------------------------------------------------- */
- /* */
- /* Processing the incoming byte stream */
- @@ -443,6 +449,37 @@
- }
- #endif
-
- + if (token == TY_CSI_PS('i', 4))
- + capture = false;
- + if (capture)
- + {
- + switch(token)
- + {
- + case TY_CHR():
- + captured.append(p);
- + break;
- + case TY_CTL('H'):
- + if (captured.length() > 0)
- + captured.truncate(captured.length() - 1);
- + break;
- + case TY_CTL('I'):
- + captured.append('\t');
- + break;
- + case TY_CTL('J'):
- + captured.append('\n');
- + break;
- + case TY_CTL('K'):
- + captured.append('\n');
- + break;
- + case TY_CTL('L'):
- + captured.append('\n');
- + break;
- + default:
- + break;
- + }
- + return;
- + }
- +
- switch (token)
- {
-
- @@ -544,6 +581,13 @@
- case TY_CSI_PS('h', 4) : scr-> setMode (MODE_Insert ); break;
- case TY_CSI_PS('h', 20) : setMode (MODE_NewLine ); break;
- case TY_CSI_PS('i', 0) : /* IGNORE: attached printer */ break; //VT100
- + case TY_CSI_PS('i', 5) :
- + captured.truncate(0);
- + capture = true;
- + break; //VT100
- + case TY_CSI_PS('i', 4) :
- + doPrint();
- + break; //VT100
- case TY_CSI_PS('l', 4) : scr-> resetMode (MODE_Insert ); break;
- case TY_CSI_PS('l', 20) : resetMode (MODE_NewLine ); break;
- case TY_CSI_PS('s', 0) : saveCursor ( ); break;
- @@ -1085,6 +1129,30 @@
- screen[1]->setMargins(t, b);
- }
-
- +void TEmuVt102::doPrint()
- +{
- + if (printer_path.isEmpty())
- + return;
- +
- + KProcess *proc = new KProcess;
- + *proc << printer_path;
- + if (proc->start(KProcess::NotifyOnExit, (KProcess::Communication) (KProcess::Stdin)) == false)
- + {
- + qWarning("Unable to execute printer: %s\n", printer_path.latin1());
- + return;
- + }
- + connect(proc, SIGNAL(wroteStdin(KProcess *)), this, SLOT(wroteStdin(KProcess *)));
- + proc->writeStdin(captured.latin1(), captured.length());
- +}
- +
- +void TEmuVt102::wroteStdin(KProcess *proc)
- +{
- + proc->closeAll();
- + proc->wait();
- + delete proc;
- + captured.truncate(0);
- +}
- +
- /*! Save the cursor position and the rendition attribute settings. */
-
- void TEmuVt102::saveCursor()
-