diff options
author | dos-reis <gdr@axiomatics.org> | 2013-04-06 21:26:25 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-04-06 21:26:25 +0000 |
commit | d33fc2c04f3832483ea136bbee11cec3beb0bbd0 (patch) | |
tree | e2e00bcda2a6ae4246f1c1173e80849f479d3b01 | |
parent | e4b8b63855846aedf2c6614818163c98a6a7b035 (diff) | |
download | open-axiom-d33fc2c04f3832483ea136bbee11cec3beb0bbd0.tar.gz |
gui: tidy up
-rw-r--r-- | src/gui/conversation.cc | 2 | ||||
-rw-r--r-- | src/gui/conversation.h | 4 | ||||
-rw-r--r-- | src/gui/debate.cc | 2 | ||||
-rw-r--r-- | src/gui/debate.h | 6 |
4 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/conversation.cc b/src/gui/conversation.cc index 5d3fda7a..ccb20b9a 100644 --- a/src/gui/conversation.cc +++ b/src/gui/conversation.cc @@ -272,7 +272,7 @@ namespace OpenAxiom { // Set a minimum preferred widget size, so no layout manager // messes with it. Indicate we can make use of more space. Conversation::Conversation(Debate& parent) - : group(parent), greatings(this), cur_ex(), cur_out(&greatings) { + : group(&parent), greatings(this), cur_ex(), cur_out(&greatings) { setFont(monospace_font()); setBackgroundRole(QPalette::Base); greatings.setFont(font()); diff --git a/src/gui/conversation.h b/src/gui/conversation.h index 31883a8f..2698c199 100644 --- a/src/gui/conversation.h +++ b/src/gui/conversation.h @@ -184,7 +184,7 @@ namespace OpenAxiom { Exchange* exchange() { return cur_ex; } // Return the parent engine widget. - Debate* debate() const { return const_cast<Debate*>(&group); } + Debate* debate() const { return group; } void submit_query(const QString&); @@ -201,7 +201,7 @@ namespace OpenAxiom { private: typedef std::vector<Exchange*> Children; - Debate& group; + Debate* group; Banner greatings; Children children; QProcess proc; diff --git a/src/gui/debate.cc b/src/gui/debate.cc index efa3bb3d..51a5eb69 100644 --- a/src/gui/debate.cc +++ b/src/gui/debate.cc @@ -50,7 +50,7 @@ namespace OpenAxiom { conv->submit_query(""); } - Debate::Debate(QWidget* parent, Command& cmd) + Debate::Debate(QTabWidget* parent, Command& cmd) : QScrollArea(parent), conv(*this) { setWidget(&conv); setViewportMargins(0, 0, 0, 0); diff --git a/src/gui/debate.h b/src/gui/debate.h index 35463fcc..fd69bfbf 100644 --- a/src/gui/debate.h +++ b/src/gui/debate.h @@ -38,16 +38,20 @@ #include <QResizeEvent> #include "open-axiom.h" #include "conversation.h" +#include "main-window.h" namespace OpenAxiom { class Debate : public QScrollArea { Q_OBJECT; public: - explicit Debate(QWidget*, Command&); + explicit Debate(QTabWidget*, Command&); ~Debate(); Conversation* exchanges() { return &conv; } + MainWindow* main_window() const { + return qobject_cast<MainWindow*>(parent()->parent()); + } protected: void resizeEvent(QResizeEvent*); |