author | zecke <zecke> | 2002-10-20 13:52:13 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-20 13:52:13 (UTC) |
commit | 89ed0106d3de43c0f39250524bc80de00f2b596c (patch) (side-by-side diff) | |
tree | 4354cc80f93f1a76caea30c350e4fc3350c32726 | |
parent | 4b27ac49b4027ffd59d2606f1aceea313446aede (diff) | |
download | opie-89ed0106d3de43c0f39250524bc80de00f2b596c.zip opie-89ed0106d3de43c0f39250524bc80de00f2b596c.tar.gz opie-89ed0106d3de43c0f39250524bc80de00f2b596c.tar.bz2 |
Enable setSize SIGNAL/SLOT conenction in session
Add some separators to m_console of mainwindow
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/TEmulation.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_layer.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 2 |
5 files changed, 9 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index a2373bf..6b0d6f2 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp @@ -77,48 +77,49 @@ #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"); 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); } void MyPty::donePty() { // This is code from the Qt DumbTerminal example int status = 0; ::close(m_fd); if (m_cpid) { kill(m_cpid, SIGHUP); //waitpid(m_cpid, &status, 0); delete m_sn_e; delete m_sn_r; m_sn_e = 0l; m_sn_r = 0l; } diff --git a/noncore/apps/opie-console/TEmulation.cpp b/noncore/apps/opie-console/TEmulation.cpp index 6f3ad32..7a0c624 100644 --- a/noncore/apps/opie-console/TEmulation.cpp +++ b/noncore/apps/opie-console/TEmulation.cpp @@ -186,48 +186,49 @@ void TEmulation::onRcvChar(int c) { c &= 0xff; switch (c) { case '\b' : scr->BackSpace(); break; case '\t' : scr->Tabulate(); break; case '\n' : scr->NewLine(); break; case '\r' : scr->Return(); break; case 0x07 : gui->Bell(); break; default : scr->ShowCharacter(c); break; }; } /* ------------------------------------------------------------------------- */ /* */ /* Keyboard Handling */ /* */ /* ------------------------------------------------------------------------- */ /*! */ void TEmulation::onKeyPress( QKeyEvent* ev ) { + qWarning("onKeyPress,...."); 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. emit sndBlock(ev->text().ascii(),ev->text().length()); } else if (ev->ascii()>0) { unsigned char c[1]; c[0] = ev->ascii(); emit sndBlock((char*)c,1); } } // Unblocking, Byte to Unicode translation --------------------------------- -- /* We are doing code conversion from locale to unicode first. */ void TEmulation::onRcvBlock(const char *s, int len) diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h index d5f7eab..97a1e1c 100644 --- a/noncore/apps/opie-console/io_layer.h +++ b/noncore/apps/opie-console/io_layer.h @@ -99,28 +99,28 @@ public slots: /** * send a QCString to the device */ virtual void send( const QByteArray& ) = 0; /** * bool open */ virtual bool open() = 0; /** * close the io */ virtual void close() = 0; /** * closes and reloads the settings */ virtual void reload( const Profile& ) = 0; /** * set the size * needed for pty */ - virtual void setSize(int rows, int cols ); + virtual void setSize(int lines, int cols ); }; #endif diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 0c89620..a7541f0 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -56,97 +56,100 @@ void MainWindow::initUI() { m_bar = new QMenuBar( m_tool ); m_console = new QPopupMenu( this ); m_scripts = new QPopupMenu( this ); m_sessionsPop= new QPopupMenu( this ); //m_settings = new QPopupMenu( this ); /* add a toolbar for icons */ m_icons = new QToolBar(this); /* * the settings action */ m_setProfiles = new QAction(tr("Configure Profiles"), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0); // m_setProfiles->addTo( m_settings ); m_setProfiles->addTo( m_icons ); m_setProfiles->addTo( m_console ); connect( m_setProfiles, SIGNAL(activated() ), this, SLOT(slotConfigure() ) ); - + m_console->insertSeparator(); /* * new Action for new sessions */ QAction* a = new QAction(tr("New Connection"), Resource::loadPixmap( "new" ), QString::null, 0, this, 0); a->addTo( m_console ); a->addTo( m_icons ); connect(a, SIGNAL(activated() ), this, SLOT(slotNew() ) ); /* * connect action */ m_connect = new QAction(); m_connect->setText( tr("Connect") ); m_connect->addTo( m_console ); connect(m_connect, SIGNAL(activated() ), this, SLOT(slotConnect() ) ); /* * disconnect action */ m_disconnect = new QAction(); m_disconnect->setText( tr("Disconnect") ); m_disconnect->addTo( m_console ); connect(m_disconnect, SIGNAL(activated() ), this, SLOT(slotDisconnect() ) ); + m_console->insertSeparator(); + m_transfer = new QAction(); m_transfer->setText( tr("Transfer file...") ); m_transfer->addTo( m_console ); connect(m_transfer, SIGNAL(activated() ), this, SLOT(slotTransfer() ) ); /* * fullscreen */ m_isFullscreen = false; m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) , QString::null, 0, this, 0); m_fullscreen->addTo( m_console ); m_fullscreen->addTo( m_icons ); connect( m_fullscreen, SIGNAL( activated() ), this, SLOT( slotFullscreen() ) ); + m_console->insertSeparator(); /* * terminate action */ m_terminate = new QAction(); m_terminate->setText( tr("Terminate") ); m_terminate->addTo( m_console ); connect(m_terminate, SIGNAL(activated() ), this, SLOT(slotTerminate() ) ); m_closewindow = new QAction(); m_closewindow->setText( tr("Close Window") ); m_closewindow->addTo( m_console ); connect( m_closewindow, SIGNAL(activated() ), this, SLOT(slotClose() ) ); /* * script actions */ m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); m_recordScript->addTo(m_scripts); connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp index 2ce6872..03d0fcd 100644 --- a/noncore/apps/opie-console/session.cpp +++ b/noncore/apps/opie-console/session.cpp @@ -34,48 +34,50 @@ IOLayer* Session::layer() { return m_layer; } EmulationHandler* Session::emulationHandler() { return m_emu; } QWidget* Session::widget() { if (!m_emu ) return 0l; return m_emu->widget(); } /* WidgetLayer* Session::emulationWidget() { return m_widLay; } */ void Session::connect() { if ( !m_layer || !m_emu ) return; QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), m_emu, SLOT(recv(const QByteArray&) ) ); QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), m_layer, SLOT(send(const QByteArray&) ) ); + QObject::connect(m_emu, SIGNAL(changeSize(int, int) ), + m_layer, SLOT(setSize(int, int) ) ); } void Session::disconnect() { if ( !m_layer || !m_emu ) return; QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), m_emu, SLOT(recv(const QByteArray&) ) ); QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), m_layer, SLOT(send(const QByteArray&) ) ); } void Session::setName( const QString& na){ m_name = na; } void Session::setWidgetStack( QWidgetStack* wid ) { delete m_emu; m_emu = 0l; delete m_widget; /* the EmulationLayer was destroyed... */ m_widget = wid; |