changeset 13646:2e1f54803758

Lowered size limits for subwindows.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Tue, 23 Aug 2011 18:06:45 +0200
parents 484a487f3999
children ac3d9480292d
files gui/src/MainWindow.cpp gui/src/terminal/LinuxTerminalEmulation.cpp gui/src/terminal/kpty.cpp gui/src/terminal/kptydevice.cpp gui/src/terminal/kptydevice.h
diffstat 5 files changed, 4 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/gui/src/MainWindow.cpp	Tue Aug 23 16:32:23 2011 +0200
+++ b/gui/src/MainWindow.cpp	Tue Aug 23 18:06:45 2011 +0200
@@ -296,7 +296,7 @@
       ->setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Terminal));
   m_octaveTerminalSubWindow->setFocusProxy (m_octaveTerminal);
   m_octaveTerminalSubWindow->setStatusTip (tr ("Enter your commands into the Octave terminal."));
-  m_octaveTerminalSubWindow->setMinimumSize (670, 300);
+  m_octaveTerminalSubWindow->setMinimumSize (300, 300);
 
   // Documentation subwindow.
   m_documentationWidgetSubWindow = new NonClosableMdiSubWindow (this);
@@ -309,7 +309,7 @@
       ->setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Documentation));
   m_documentationWidgetSubWindow->setFocusProxy (m_documentationWidget);
   m_documentationWidgetSubWindow->setStatusTip (tr ("Browse the Octave documentation for help."));
-  m_documentationWidgetSubWindow->setMinimumSize (670, 300);
+  m_documentationWidgetSubWindow->setMinimumSize (300, 300);
 
   // Chat subwindow.
   m_ircWidgetSubWindow = new NonClosableMdiSubWindow (this);
@@ -322,7 +322,7 @@
       ->setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Chat));
   m_ircWidgetSubWindow->setStatusTip(tr ("Instantly chat with other Octave users for help."));
   m_ircWidgetSubWindow->setFocusProxy (m_ircWidget);
-  m_ircWidgetSubWindow->setMinimumSize (670, 300);
+  m_ircWidgetSubWindow->setMinimumSize (300, 300);
   connect (m_ircWidget, SIGNAL (unreadMessages (bool)), this, SLOT (handleUnreadMessages (bool)));
 
   m_lexer = NULL;  // initialise the empty lexer for the edtiors
--- a/gui/src/terminal/LinuxTerminalEmulation.cpp	Tue Aug 23 16:32:23 2011 +0200
+++ b/gui/src/terminal/LinuxTerminalEmulation.cpp	Tue Aug 23 18:06:45 2011 +0200
@@ -14,14 +14,13 @@
 
   m_pty = new KPtyDevice ();
   m_pty->open (fdm);
-  //m_pty->setPtyChannels (KPtyProcess::AllChannels);
   connect (m_pty, SIGNAL(readyRead ()),
            this, SLOT (handleReadyRead ()));
 }
 
 LinuxTerminalEmulation::~LinuxTerminalEmulation ()
 {
-  //m_pty->terminate ();
+  m_pty->close ();
 }
 
 void LinuxTerminalEmulation::processKeyEvent (QKeyEvent *keyEvent)
--- a/gui/src/terminal/kpty.cpp	Tue Aug 23 16:32:23 2011 +0200
+++ b/gui/src/terminal/kpty.cpp	Tue Aug 23 18:06:45 2011 +0200
@@ -23,26 +23,10 @@
 */
 
 #include "kpty_p.h"
-
-#include <sys/types.h>
-#include <sys/ioctl.h>#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-
-#include <errno.h>
 #include <fcntl.h>
-#include <time.h>
-#include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <grp.h>
-
 #include <pty.h>
-#define _UTMPX_COMPAT
 #include <utmp.h>
-#include <utmpx.h>
 
 /* for HP-UX (some versions) the extern C is needed, and for other
    platforms it doesn't hurt */
--- a/gui/src/terminal/kptydevice.cpp	Tue Aug 23 16:32:23 2011 +0200
+++ b/gui/src/terminal/kptydevice.cpp	Tue Aug 23 18:06:45 2011 +0200
@@ -84,7 +84,6 @@
   if (!readBytes)
     {
       readNotifier->setEnabled (false);
-      emit q->readEof ();
       return false;
     }
   else
@@ -318,20 +317,6 @@
   return d->writeBuffer.size ();
 }
 
-void
-KPtyDevice::setSuspended (bool suspended)
-{
-  Q_D (KPtyDevice);
-  d->readNotifier->setEnabled (!suspended);
-}
-
-bool
-KPtyDevice::isSuspended () const
-{
-  Q_D (const KPtyDevice);
-  return !d->readNotifier->isEnabled ();
-}
-
 // protected
 qint64
 KPtyDevice::readData (char *data, qint64 maxlen)
--- a/gui/src/terminal/kptydevice.h	Tue Aug 23 16:32:23 2011 +0200
+++ b/gui/src/terminal/kptydevice.h	Tue Aug 23 18:06:45 2011 +0200
@@ -82,31 +82,6 @@
   virtual void close ();
 
     /**
-     * Sets whether the KPtyDevice monitors the pty for incoming data.
-     *
-     * When the KPtyDevice is suspended, it will no longer attempt to buffer
-     * data that becomes available from the pty and it will not emit any
-     * signals.
-     *
-     * Do not use on closed ptys.
-     * After a call to open(), the pty is not suspended. If you need to
-     * ensure that no data is read, call this function before the main loop
-     * is entered again (i.e., immediately after opening the pty).
-     */
-  void setSuspended (bool suspended);
-
-    /**
-     * Returns true if the KPtyDevice is not monitoring the pty for incoming
-     * data.
-     *
-     * Do not use on closed ptys.
-     *
-     * See setSuspended()
-     */
-  bool isSuspended () const;
-
-
-    /**
      * @reimp
      */
   bool canReadLine () const;
@@ -126,14 +101,6 @@
      */
   qint64 bytesToWrite () const;
 
-signals:
-    /**
-     * Emitted when EOF is read from the PTY.
-     *
-     * Data may still remain in the buffers.
-     */
-  void readEof ();
-
 protected:
   virtual qint64 readData (char *data, qint64 maxSize);
   virtual qint64 readLineData (char *data, qint64 maxSize);