diff options
author | dos-reis <gdr@axiomatics.org> | 2013-04-08 02:59:02 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-04-08 02:59:02 +0000 |
commit | 5c8f501196981142b3b2a4f5c896e08d90792130 (patch) | |
tree | 709da7ab5e404f0026eac69d7f4e5fa1c6918545 /src/gui/conversation.h | |
parent | a81374ddea280fa56d1bcbb287f41d1ea248c5f7 (diff) | |
download | open-axiom-5c8f501196981142b3b2a4f5c896e08d90792130.tar.gz |
misc gui cleanup
Diffstat (limited to 'src/gui/conversation.h')
-rw-r--r-- | src/gui/conversation.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/conversation.h b/src/gui/conversation.h index d25960a1..90f461a7 100644 --- a/src/gui/conversation.h +++ b/src/gui/conversation.h @@ -40,7 +40,6 @@ #include <QEvent> #include <QResizeEvent> #include <QPaintEvent> -#include "widget.h" #include "server.h" namespace OpenAxiom { @@ -77,7 +76,7 @@ namespace OpenAxiom { // -- Question -- // --------------- // A question is just a one-liner query area. - struct Question : managed_by<QLineEdit, Exchange> { + struct Question : QLineEdit { explicit Question(Exchange*); protected: @@ -88,14 +87,14 @@ namespace OpenAxiom { // ------------ // -- Answer -- // ------------ - struct Answer : managed_by<OutputTextArea, Exchange> { + struct Answer : OutputTextArea { explicit Answer(Exchange*); }; // -------------- // -- Exchange -- // -------------- - class Exchange : public managed_by<QFrame, Conversation> { + class Exchange : public QFrame { Q_OBJECT; public: Exchange(Conversation*, int); @@ -103,6 +102,7 @@ namespace OpenAxiom { // The widget holding the query area Question* question() { return &query; } const Question* question() const { return &query; } + Server* server() const; // The widget holding the reply area. Answer* answer() { return &reply; } @@ -118,6 +118,7 @@ namespace OpenAxiom { void resizeEvent(QResizeEvent*); private: + Conversation* const win; const int no; Question query; Answer reply; @@ -137,12 +138,14 @@ namespace OpenAxiom { // -- We remember and number each topic so that we // -- can go back in the conversation set and reevaluate // -- queries. - class Conversation : public managed_by<QWidget, Debate> { + class Conversation : public QWidget { Q_OBJECT; public: explicit Conversation(Debate*); ~Conversation(); + Debate* debate() const { return win; } + // Holds if this conversation just started. bool fresh() const { return children.empty(); } @@ -179,6 +182,7 @@ namespace OpenAxiom { private: typedef std::vector<Exchange*> Children; + Debate* const win; Banner greatings; Children children; Exchange* cur_ex; |