aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-05-30 01:40:03 +0000
committerdos-reis <gdr@axiomatics.org>2011-05-30 01:40:03 +0000
commit0d9c24084859d19eb5a97ecd1486be6264c728a3 (patch)
tree9fd349c3f7ad08f1e935fc01a8a7d47b05b7dc04 /src/gui
parentde1dcbbf938c5468fc5803ddc0bcd595188fc9a3 (diff)
downloadopen-axiom-0d9c24084859d19eb5a97ecd1486be6264c728a3.tar.gz
have the gui quit if the interpreter quits
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/debate.cc10
-rw-r--r--src/gui/debate.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/debate.cc b/src/gui/debate.cc
index 24608c0f..92209db8 100644
--- a/src/gui/debate.cc
+++ b/src/gui/debate.cc
@@ -29,6 +29,7 @@
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <QApplication>
#include <QScrollBar>
#include "debate.h"
#include <iostream>
@@ -56,6 +57,9 @@ namespace OpenAxiom {
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
adjustSize();
start_interpreter(exchanges());
+ connect(conv.oracle(),
+ SIGNAL(finished(int,QProcess::ExitStatus)),
+ this, SLOT(done(int)));
}
Debate::~Debate() { }
@@ -68,4 +72,10 @@ namespace OpenAxiom {
QSizePolicy::MinimumExpanding);
}
+ void Debate::done(int exit_code) {
+ // For the time being, shut done the whole application
+ // if the interpreter quits. FIXME.
+ QApplication::exit(exit_code);
+ }
+
}
diff --git a/src/gui/debate.h b/src/gui/debate.h
index cf645880..fa7116bc 100644
--- a/src/gui/debate.h
+++ b/src/gui/debate.h
@@ -41,6 +41,7 @@
namespace OpenAxiom {
class Debate : public QScrollArea {
+ Q_OBJECT;
public:
explicit Debate(QWidget*);
~Debate();
@@ -50,6 +51,9 @@ namespace OpenAxiom {
protected:
void resizeEvent(QResizeEvent*);
+ private slots:
+ void done(int);
+
private:
Conversation conv;
};