21 files changed, 135 insertions, 93 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index a37f980..6d57703 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp @@ -58,51 +58,55 @@ Another technic are UNIX 98 PTY's. These are supported also, and prefered over the (obsolete) predecessor. There's a sinister ioctl(2), signal(2) and job control stuff nessesary to make everything work as it should. */ +#include "procctl.h" +#include "MyPty.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qsocketnotifier.h> #include <qfile.h> +/* STD */ #include <stdlib.h> #include <stdio.h> #include <signal.h> #include <fcntl.h> #include <unistd.h> #include <termios.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/wait.h> #ifdef HAVE_OPENPTY #include <pty.h> #endif -#include "procctl.h" -#include "MyPty.h" - - #undef VERBOSE_DEBUG /* -------------------------------------------------------------------------- */ /*! Informs the client program about the actual size of the window. */ void MyPty::setSize(int lines, int columns) { - qWarning("setting size"); + owarn << "setting size" << oendl; struct winsize wsize; wsize.ws_row = (unsigned short)lines; wsize.ws_col = (unsigned short)columns; if(m_fd < 0) return; ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); } diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index e535296..d168a5e 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp @@ -1024,17 +1024,17 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) return FALSE; // not us if ( e->type() == QEvent::Wheel) { QApplication::sendEvent(scrollbar, e); } #ifdef FAKE_CTRL_AND_ALT static bool control = FALSE; static bool alt = FALSE; -// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); +// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; bool dele=FALSE; if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { QKeyEvent* ke = (QKeyEvent*)e; bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); switch (ke->key()) { case Key_F9: // let this be "Control" control = keydown; e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); @@ -1063,21 +1063,21 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) } #endif if ( e->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)e; actSel=0; // Key stroke implies a screen update, so TEWidget won't // know where the current selection is. -// qDebug("key pressed is 0x%x",ke->key()); +// odebug << "key pressed is 0x" << ke->key() << "" << oendl; if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker -// qDebug("key pressed 2 is 0x%x",ke->key()); +// odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl; emitText("\\"); // expose } else emit keyPressedSignal(ke); // expose ke->accept(); #ifdef FAKE_CTRL_AND_ALT if ( dele ) delete e; #endif return true; // stop the event diff --git a/noncore/apps/opie-console/TEmulation.cpp b/noncore/apps/opie-console/TEmulation.cpp index d0169d7..6ff73af 100644 --- a/noncore/apps/opie-console/TEmulation.cpp +++ b/noncore/apps/opie-console/TEmulation.cpp @@ -65,16 +65,22 @@ of incoming bulks (`bulk_incnt'). */ /* FIXME - evtl. the bulk operations could be made more transparent. */ #include "TEmulation.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* STD */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> /* ------------------------------------------------------------------------- */ /* */ /* TEmulation */ @@ -199,17 +205,17 @@ void TEmulation::onRcvChar(int c) /* */ /* ------------------------------------------------------------------------- */ /*! */ void TEmulation::onKeyPress( QKeyEvent* ev ) { - qWarning("onKeyPress,...."); + owarn << "onKeyPress,...." << oendl; if (!connected) return; // someone else gets the keys if (scr->getHistCursor() != scr->getHistLines()); scr->setHistCursor(scr->getHistLines()); if (!ev->text().isEmpty()) { // A block of text // Note that the text is proper unicode. // We should do a conversion here, but since this // routine will never be used, we simply emit plain ascii. diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp index 8e91b9e..c998f96 100644 --- a/noncore/apps/opie-console/atconfigdialog.cpp +++ b/noncore/apps/opie-console/atconfigdialog.cpp @@ -1,21 +1,24 @@ +#include "atconfigdialog.h" +#include "io_modem.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qlineedit.h> #include <qspinbox.h> #include <qlayout.h> #include <qcombobox.h> #include <qtabwidget.h> #include <qlabel.h> #include <qscrollview.h> -#include "atconfigdialog.h" -#include "io_modem.h" - - ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { setCaption( tr( "Dialing parameter setup" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); QTabWidget *tabWidget = new QTabWidget( this ); @@ -147,17 +150,17 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) { multiLineUntagBox->insertItem( tr("Yes") ); return returnWidget; } void ATConfigDialog::readConfig( const Profile& config ) { - qWarning("config in atconfigdialog"); + owarn << "config in atconfigdialog" << oendl; initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 67ad10e..7010594 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp @@ -1,25 +1,30 @@ #include "dialer.h" +#include "io_modem.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; +/* QT */ #include <qlayout.h> #include <qprogressbar.h> #include <qlabel.h> #include <qpushbutton.h> #include <qapp.h> #include <qtimer.h> #include <qmessagebox.h> +/* STD */ #include <unistd.h> #include <string.h> #include <fcntl.h> #include <errno.h> -#include "io_modem.h" - // State machine: | When an error occurs, we don't have to // | reset everything. // (init) <------+ | But if the user wants to reset, // | | | we stop dialing immediately. // v | | // (options) ----+ | Following the state machine is necessary // | \ | to get determinable results. // v ^ | @@ -99,17 +104,17 @@ void Dialer::slotCancel() } else { accept(); } } void Dialer::reset() { - qWarning("reset"); + owarn << "reset" << oendl; switchState(state_cancel); } void Dialer::slotAutostart() { //state = state_preinit; dial(m_profile.readEntry("Number")); } @@ -131,39 +136,39 @@ void Dialer::dial(const QString& number) // modem hangup trydial(QString::null); reject(); } } void Dialer::trydial(const QString& number) { - qWarning("TryDial:%s", number.latin1() ); + owarn << "TryDial:" << number.latin1() << "" << oendl; if(state != state_cancel) switchState(state_preinit); if(cleanshutdown) { - qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING)); + owarn << "HangupString " << m_profile.readEntry("HangupString") << oendl; send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); } if(state != state_cancel) { switchState(state_init); -// qWarning("Init String " + m_profile.readEntry("InitString") ); +// owarn << "Init String " + m_profile.readEntry("InitString") << oendl; send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); QString response2 = receive(); if(!response2.contains("\nOK\r")) reset(); } /* if(state != state_cancel) { switchState(state_options); - qWarning("ATM3l3"); + owarn << "ATM3l3" << oendl; send("ATM3L3\r"); QString response3 = receive(); if(!response3.contains("\nOK\r")) reset(); } */ if(state != state_cancel) @@ -173,17 +178,17 @@ void Dialer::trydial(const QString& number) send("ATX1\r"); QString response4 = receive(); if(!response4.contains("\nOK\r")) reset(); } if(state != state_cancel) { - qWarning("progress"); + owarn << "progress" << oendl; switchState(state_dialing); // send(QString("ATDT %1\r").arg(number)); send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 )) .arg(number)); QString response5 = receive(); if(!response5.contains("CONNECT") ) @@ -209,17 +214,17 @@ void Dialer::trydial(const QString& number) } void Dialer::send(const QString& msg) { QString m = msg; int bytes; QString termination; - qWarning("Sending: %s", m.latin1()); + owarn << "Sending: " << m.latin1() << "" << oendl; /* termination = "\r"; //termination = m_profile.readEntry("Termination"); if(termination == "\n") m = m + "\n"; else if(termination == "\r") m = m + "\r"; else m = m + "\r\n"; */ m = m.replace(QRegExp("\n"), "\r"); @@ -242,21 +247,21 @@ QString Dialer::receive() { ret = ::read(m_fd, buffer, sizeof(buffer)); if(ret > 0) { for(int i = 0; i < ret; i++) buffer[i] = buffer[i] & 0x7F; buffer[ret] = 0; - qWarning("Got: %s", buffer); + owarn << "Got: " << buffer << "" << oendl; buf.append(QString(buffer)); if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) { - //qWarning("Receiving: '%s'", buf.latin1()); + //owarn << "Receiving: '" << buf.latin1() << "'" << oendl; cleanshutdown = 1; return buf; }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) { cleanshutdown = 1; return QString::null; } } else if(ret < 0) diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 99d069f..89b70c6 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp @@ -1,15 +1,17 @@ - #include "TEmuVt102.h" - #include "profile.h" #include "emulation_handler.h" #include "script.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) : QObject(0, name ) { m_teWid = new TEWidget( parent, "TerminalMain"); // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) // use setWrapAt(80) for normal console with scrollbar setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); m_teWid->setMinimumSize(150, 70 ); @@ -123,21 +125,21 @@ QColor EmulationHandler::foreColor(int col) { case Profile::White: /* color is black */ co = Qt::white; break; case Profile::Black: co = Qt::black; break; case Profile::Green: - qWarning("Foreground green"); + owarn << "Foreground green" << oendl; co = Qt::green; break; case Profile::Orange: - qWarning("Foreground orange"); + owarn << "Foreground orange" << oendl; co.setRgb( 231, 184, 98 ); break; } return co; } QColor EmulationHandler::backColor(int col ) { QColor co; @@ -147,21 +149,21 @@ QColor EmulationHandler::backColor(int col ) { case Profile::White: /* color is white */ co = Qt::black; break; case Profile::Black: co = Qt::white; break; case Profile::Green: - qWarning("Background black"); + owarn << "Background black" << oendl; co = Qt::black; break; case Profile::Orange: - qWarning("Background black"); + owarn << "Background black" << oendl; co = Qt::black; break; } return co; } QPushButton* EmulationHandler::cornerButton() { diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp index ad8ecba..4688551 100644 --- a/noncore/apps/opie-console/emulation_widget.cpp +++ b/noncore/apps/opie-console/emulation_widget.cpp @@ -219,19 +219,19 @@ void EmulationWidget::paintEvent( QPaintEvent* pe ) drawFrame( &painter ); painter.end(); } void EmulationWidget::calcGeometry() { m_scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() ); - qDebug( QString(" TEST").arg( contentsRect().width() ) ); - qDebug( QString(" TEST").arg( contentsRect().height() ) ); - qDebug("NEUER TESTT!!!!!!!!"); + odebug << QString(" TEST").arg( contentsRect().width() ) << oendl; + odebug << QString(" TEST").arg( contentsRect().height() ) << oendl; + odebug << "NEUER TESTT!!!!!!!!" << oendl; switch( scrollLoc ) { case SCRNONE : m_columns = ( contentsRect().width() -2 * rimX ) / f_width; m_blX = ( contentsRect().width() - ( m_columns*f_width ) ) / 2; m_brX = m_blX; m_scrollbar->hide(); @@ -253,31 +253,31 @@ void EmulationWidget::calcGeometry() } m_lines = ( contentsRect().height() - 2 * rimY ) / f_height; m_bY = ( contentsRect().height() - (m_lines * f_height ) ) / 2; } void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect rect, Character attr, bool usePixmap, bool clear ) { - qWarning("Color1 %s", color_table[attr.b].color.name().latin1() ); + owarn << "Color1 " << color_table[attr.b].color.name().latin1() << "" << oendl; if ( usePixmap && color_table[attr.b].transparent ) { painter.setBackgroundMode( TransparentMode ); if ( clear ) erase( rect ); } else { if ( blinking ) painter.fillRect( rect, color_table[attr.b].color ); else { painter.setBackgroundMode( OpaqueMode ); - qWarning("Color %s", color_table[attr.b].color.name().latin1() ); + owarn << "Color " << color_table[attr.b].color.name().latin1() << "" << oendl; painter.setBackgroundColor( color_table[attr.b].color ); } } if ( color_table[attr.f].bold ) painter.setPen( QColor( 0x8F, 0x00, 0x00 ) ); else painter.setPen( color_table[attr.f].color ); painter.drawText( rect.x(), rect.y() + f_ascent, string ); diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index eb32551..6613183 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp @@ -1,10 +1,15 @@ #include "function_keyboard.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qlayout.h> #include <qlistbox.h> #include <qlabel.h> #include <qdir.h> #define DEFAULT_ROWS 2 #define DEFAULT_COLS 12 @@ -32,17 +37,17 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : if (value_list.isEmpty()) continue; keys.insert( handle, FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) ); } - //qWarning("loaded %d keys", keys.count()); + //owarn << "loaded " << keys.count() << " keys" << oendl; */ if (keys.isEmpty()) loadDefaults(); } FunctionKeyboard::~FunctionKeyboard() {} @@ -251,17 +256,17 @@ void FunctionKeyboard::loadDefaults() { } /* FunctionKeyboardConfig {{{1 */ FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) : ProfileDialogKeyWidget(name, parent, na), selectedRow(0), selectedCol(0) { - qWarning("FunctionKeyboardConfig"); + owarn << "FunctionKeyboardConfig" << oendl; kb = new FunctionKeyboard(this); connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); QLabel *l = new QLabel("Rows", dimentions); diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index a29fa8e..c102427 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp @@ -1,12 +1,15 @@ #include "io_bt.h" +/* OPIE */ +#include <opie2/odebug.h> using namespace Opie::Core; + IOBt::IOBt( const Profile &config ) : IOSerial( config ) { m_attach = 0; } IOBt::~IOBt() { if ( m_attach ) { delete m_attach; @@ -38,17 +41,17 @@ bool IOBt::open() { // then start hcid, then rcfomm handling (m_mac) connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( slotExited(Opie::Core::OProcess*) ) ); if ( m_attach->start() ) { ret = IOSerial::open(); } else { - qWarning("could not attach to device"); + owarn << "could not attach to device" << oendl; delete m_attach; m_attach = 0; } } else { // directly to the normal serial // TODO: look first if the connection really exists. ( is set up ) ret =IOSerial::open(); @@ -84,10 +87,10 @@ QBitArray IOBt::supports() const { return QBitArray( 3 ); } bool IOBt::isConnected() { return false; } void IOBt::send(const QByteArray &data) { - qDebug( "Please overload me..." ); + odebug << "Please overload me..." << oendl; } diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index 07c2b62..38542f5 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp @@ -1,12 +1,14 @@ - #include "io_irda.h" +/* OPIE */ +#include <opie2/odebug.h> using namespace Opie::Core; + IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { m_attach = 0; } IOIrda::~IOIrda() { if ( m_attach ) { delete m_attach; @@ -30,17 +32,17 @@ bool IOIrda::open() { connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( slotExited(Opie::Core::OProcess*) ) ); if ( m_attach->start() ) { ret= IOSerial::open(); } else { // emit error!!! - qWarning("could not attach to device"); + owarn << "could not attach to device" << oendl; delete m_attach; m_attach = 0l; } return ret; } void IOIrda::reload( const Profile &config ) { m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); @@ -69,10 +71,10 @@ QBitArray IOIrda::supports()const { return QBitArray( 3 ); } bool IOIrda::isConnected() { return false; } void IOIrda::send(const QByteArray &data) { - qDebug( "Please overload me..." ); + odebug << "Please overload me..." << oendl; } diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index b74d076..c499dfe 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -1,23 +1,23 @@ #include "io_modem.h" - #include "dialer.h" +/* OPIE */ +#include <opie2/odebug.h> using namespace Opie::Core; -using namespace Opie::Core; + IOModem::IOModem( const Profile &profile ) : IOSerial( profile ) { m_profile = profile; } IOModem::~IOModem() { - } void IOModem::close() { // Hangup, discarding result // int fd = rawIO(); internDetach(); Dialer d(m_profile, m_fd); @@ -99,10 +99,10 @@ QBitArray IOModem::supports()const { return QBitArray( 3 ); } bool IOModem::isConnected() { return false; } void IOModem::send(const QByteArray &data) { - qDebug( "Please overload me..." ); + odebug << "Please overload me..." << oendl; } diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp index dfb2f83..1bd4338 100644 --- a/noncore/apps/opie-console/main.cpp +++ b/noncore/apps/opie-console/main.cpp @@ -86,17 +86,17 @@ void FixIt::fixIt() { } #endif int main(int argc, char **argv) { // too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; QPEApplication app( argc, argv ); #ifdef FSCKED_DISTRIBUTION - qWarning("fscked"); + owarn << "fscked" << oendl; FixIt it; it.fixIt(); #endif MainWindow mw; mw.setCaption(QObject::tr("Opie Console") ); app.showMainWidget( &mw ); diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 06a8f7d..b403b4d 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -1,35 +1,38 @@ -#include <assert.h> - -#include <qaction.h> -#include <qmenubar.h> -#include <qtoolbar.h> -#include <qmessagebox.h> -#include <qwhatsthis.h> -#include <qfileinfo.h> - -#include <qpe/filemanager.h> - -#include <opie2/ofiledialog.h> - #include "TEmulation.h" #include "profileeditordialog.h" #include "configdialog.h" #include "default.h" #include "profilemanager.h" #include "mainwindow.h" #include "tabwidget.h" #include "transferdialog.h" #include "function_keyboard.h" #include "emulation_handler.h" #include "script.h" - +/* OPIE */ +#include <opie2/odebug.h> +#include <opie2/ofiledialog.h> +#include <qpe/filemanager.h> +using namespace Opie::Core; using namespace Opie::Ui; + +/* QT */ +#include <qaction.h> +#include <qmenubar.h> +#include <qtoolbar.h> +#include <qmessagebox.h> +#include <qwhatsthis.h> +#include <qfileinfo.h> + +/* STD */ +#include <assert.h> + MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { KeyTrans::loadAll(); for (int i = 0; i < KeyTrans::count(); i++ ) { KeyTrans* s = KeyTrans::find(i ); assert( s ); } m_factory = new MetaFactory(); Default def(m_factory); @@ -441,23 +444,23 @@ void MainWindow::slotConfigure() { * delete it * and set the currentSession() */ void MainWindow::slotClose() { if (!currentSession() ) return; Session* ses = currentSession(); - qWarning("removing! currentSession %s", currentSession()->name().latin1() ); + owarn << "removing! currentSession " << currentSession()->name().latin1() << "" << oendl; /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ m_curSession = NULL; tabWidget()->remove( /*currentSession()*/ses ); /*it's autodelete */ m_sessions.remove( ses ); - qWarning("after remove!!"); + owarn << "after remove!!" << oendl; if (!currentSession() ) { m_connect->setEnabled( false ); m_disconnect->setEnabled( false ); m_terminate->setEnabled( false ); m_transfer->setEnabled( false ); m_recordScript->setEnabled( false ); m_saveScript->setEnabled( false ); @@ -565,26 +568,26 @@ void MainWindow::slotOpenButtons( bool state ) { } else { m_buttonBar->hide(); } } void MainWindow::slotSessionChanged( Session* ses ) { - qWarning("changed!"); + owarn << "changed!" << oendl; if(m_curSession) if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); if(ses) if(ses->transferDialog()) ses->transferDialog()->show(); if ( ses ) { m_curSession = ses; - qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); + odebug << QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) << oendl; if ( m_curSession->layer()->isConnected() ) { m_connect->setEnabled( false ); m_disconnect->setEnabled( true ); m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); m_scripts->setItemEnabled(m_runScript_id, true); } else { m_connect->setEnabled( true ); diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index 3466e3a..9fdaf73 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp @@ -1,20 +1,23 @@ +#include "modemconfigwidget.h" +#include "dialdialog.h" +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> +using namespace Opie::Core; +/* QT */ #include <qlabel.h> #include <qlayout.h> #include <qcombobox.h> #include <qpushbutton.h> #include <qhbox.h> -#include "modemconfigwidget.h" -#include "dialdialog.h" - namespace { void setCurrent( const QString& str, QComboBox* bo ) { uint b = bo->count(); for (int i = 0; i < bo->count(); i++ ) { if ( bo->text(i) == str ) { bo->setCurrentItem( i ); return; } @@ -130,17 +133,17 @@ void ModemConfigWidget::load( const Profile& prof ) { m_base->setStop( IOLayerBase::Stop_OnePointFive ); } else { m_base->setStop( IOLayerBase::Stop_One ); } atConf->readConfig( prof ); if ( prof.readEntry( "Device" ).isEmpty() ) { - qWarning("device empty!"); + owarn << "device empty!" << oendl; return; } setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); } /* diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index 7a15828..f7e33e9 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro @@ -1,12 +1,10 @@ TEMPLATE = app -TMAKE_CXXFLAGS += -DHAVE_OPENPTY CONFIG += qt warn_on -#CONFIG = qt DESTDIR = $(OPIEDIR)/bin HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ file_layer.h filetransfer.h \ metafactory.h \ session.h \ mainwindow.h \ profile.h \ profileconfig.h \ @@ -65,12 +63,12 @@ SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ INTERFACES = configurebase.ui editbase.ui INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopiecore2 -lopieui2 -lutil TARGET = opie-console - +DEFINES += HAVE_OPENPTY include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index fbc5306..f505998 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp @@ -36,17 +36,17 @@ void SzTransfer::sendFile(const QString& file) { connect(layer(), SIGNAL(received(const QByteArray&)), this, SLOT(receivedStdin(const QByteArray&))); proc->start(OProcess::NotifyOnExit, OProcess::All); } void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { - qWarning("recieved from sz on stdout %d bytes", buflen); + owarn << "recieved from sz on stdout " << buflen << " bytes" << oendl; QByteArray data(buflen); data.fill(*buffer, buflen); for (uint i = 0; i < data.count(); i++ ) { printf("%c", buffer[i] ); } printf("\n"); @@ -60,26 +60,26 @@ void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { printf("stderr:\n"); //for (int i = 0; i < length; i++) // printf("%c", buffer[i]); //printf("\n"); } void SzTransfer::receivedStdin(const QByteArray &data) { - qWarning("recieved from io_serial %d bytes", data.size()); + owarn << "recieved from io_serial " << data.size() << " bytes" << oendl; // recieved data from the io layer goes to sz proc->writeStdin(data.data(), data.size()); } void SzTransfer::sent() { - qWarning("sent file"); + owarn << "sent file" << oendl; //setcbreak(0); /* default */ delete proc; disconnect(layer(), SIGNAL(received(const QByteArray&)), this, SLOT(receivedStdin(const QByteArray&))); diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp index 6429e3c..41a91ed 100644 --- a/noncore/apps/opie-console/tabwidget.cpp +++ b/noncore/apps/opie-console/tabwidget.cpp @@ -1,23 +1,26 @@ - #include "tabwidget.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; using namespace Opie::Ui; + TabWidget::TabWidget( QWidget* parent, const char* name ) : OTabWidget( parent, name ) { connect(this, SIGNAL( currentChanged(QWidget*) ), this, SLOT( slotCurChanged(QWidget*) ) ); } TabWidget::~TabWidget() { } void TabWidget::add( Session* ses ) { - qWarning("session ses " + ses->name() ); + owarn << "session ses " + ses->name() << oendl; if ( !ses->widgetStack() ) return; //reparent( ses->widgetStack(), QPoint() ); addTab( ses->widgetStack(), "console/konsole", ses->name() ); //addTab( ses->widgetStack(), ses->name() ); m_map.insert( ses->widgetStack(), ses ); } void TabWidget::remove( Session* ses ) { diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp index 6870487..087476b 100644 --- a/noncore/apps/opie-console/terminalwidget.cpp +++ b/noncore/apps/opie-console/terminalwidget.cpp @@ -1,18 +1,23 @@ +#include "terminalwidget.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qlabel.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qradiobutton.h> #include <qhgroupbox.h> #include <qhbuttongroup.h> #include <qlayout.h> -#include "terminalwidget.h" - namespace { enum TermIds { id_term_vt100 = 0, id_term_vt102, id_term_linux, id_term_xterm }; @@ -64,17 +69,17 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, m_colorBox->add( m_colorLabel ); m_colorBox->add( m_colorCmb ); m_lroot->add( m_groupConv ); m_lroot->add( m_groupOptions ); m_lroot->addStretch( 0 ); // Fill in some options - qWarning("Options for terminal box"); + owarn << "Options for terminal box" << oendl; m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); m_colorCmb->insertItem( tr("black on white"), id_term_black ); m_colorCmb->insertItem( tr("white on black"), id_term_white ); diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index df27055..45fd11d 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp @@ -21,25 +21,25 @@ SenderUI::SenderUI() : Sender() { /* we do that manually */ Profile prof; QString str = "/dev/bty0"; prof.writeEntry("Device",str ); prof.writeEntry("Baud", 19200 ); - qWarning("prof " + prof.readEntry("Device") + " " + str); + owarn << "prof " + prof.readEntry("Device") + " " + str << oendl; ser = new IOSerial(prof); connect(ser, SIGNAL(received(const QByteArray&) ), this, SLOT(got(const QByteArray&) ) ); if ( ser->open() ) - qWarning("opened!!!"); + owarn << "opened!!!" << oendl; else - qWarning("could not open"); + owarn << "could not open" << oendl; } SenderUI::~SenderUI() { } void SenderUI::slotSendFile() { @@ -47,33 +47,33 @@ void SenderUI::slotSendFile() { sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); connect (sz, SIGNAL(sent()), this, SLOT(fileTransComplete())); } void SenderUI::slotSend() { QCString str = MultiLineEdit1->text().utf8(); - qWarning("sending: %s", str.data() ); + owarn << "sending: " << str.data() << "" << oendl; str = str.replace( QRegExp("\n"), "\r"); ser->send( str ); } void SenderUI::got(const QByteArray& ar) { - qWarning("got:"); + owarn << "got:" << oendl; for ( uint i = 0; i < ar.count(); i++ ) { printf("%c", ar[i] ); } printf("\n"); } void SenderUI::fileTransComplete() { - qWarning("file transfer complete"); + owarn << "file transfer complete" << oendl; } void SenderUI::send() { } void SenderUI::slotRev(){ -qWarning("Going to receive!"); +owarn << "Going to receive!" << oendl; FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); rev->receive(); } diff --git a/noncore/apps/opie-console/widget.cpp b/noncore/apps/opie-console/widget.cpp index e17dfd4..c51983f 100644 --- a/noncore/apps/opie-console/widget.cpp +++ b/noncore/apps/opie-console/widget.cpp @@ -990,17 +990,17 @@ bool Widget::eventFilter( QObject *obj, QEvent *e ) return FALSE; // not us if ( e->type() == QEvent::Wheel) { QApplication::sendEvent(scrollbar, e); } #ifdef FAKE_CTRL_AND_ALT static bool control = FALSE; static bool alt = FALSE; -// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); +// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; bool dele=FALSE; if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { QKeyEvent* ke = (QKeyEvent*)e; bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); switch (ke->key()) { case Key_F9: // let this be "Control" control = keydown; e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); @@ -1029,21 +1029,21 @@ bool Widget::eventFilter( QObject *obj, QEvent *e ) } #endif if ( e->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)e; actSel=0; // Key stroke implies a screen update, so Widget won't // know where the current selection is. -// qDebug("key pressed is 0x%x",ke->key()); +// odebug << "key pressed is 0x" << ke->key() << "" << oendl; if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker -// qDebug("key pressed 2 is 0x%x",ke->key()); +// odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl; emitText("\\"); // expose } else emit keyPressedSignal(ke); // expose ke->accept(); #ifdef FAKE_CTRL_AND_ALT if ( dele ) delete e; #endif return true; // stop the event diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp index 96dda1c..ab25919 100644 --- a/noncore/apps/opie-console/widget_layer.cpp +++ b/noncore/apps/opie-console/widget_layer.cpp @@ -70,17 +70,17 @@ bool WidgetLayer::eventFilter( QObject *obj, QEvent *e ) return true; } if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) return false; // not us #ifdef FAKE_CTRL_AND_ALT static bool control = false; static bool alt = false; -// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); +// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; bool dele = false; if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { QKeyEvent* ke = (QKeyEvent*)e; bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); switch (ke->key()) { case Key_F9: // let this be "Control" control = keydown; e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); @@ -110,17 +110,17 @@ QChar(a,0)); } #endif if ( e->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)e; //actSel=0; // Key stroke implies a screen update, so Widget won't // know where the current selection is. -// qDebug("key pressed is 0x%x",ke->key()); +// odebug << "key pressed is 0x" << ke->key() << "" << oendl; if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker insertText("\\"); // expose } else emit keyPressed( ke ); // expose ke->accept(); #ifdef FAKE_CTRL_AND_ALT if ( dele ) delete e; |