From bba0c431de24f2291011be1960eeb1f5d15dfb8b Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 25 Jun 2013 00:37:59 +0000 Subject: Misc cleanup. --- src/gui/conversation.cc | 10 +++------- src/gui/server.h | 5 ++++- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gui/conversation.cc b/src/gui/conversation.cc index 6a1ecb18..9ffa4679 100644 --- a/src/gui/conversation.cc +++ b/src/gui/conversation.cc @@ -218,12 +218,6 @@ namespace OpenAxiom { this, SLOT(reply_to_query())); } - // Transfter focus to this input area. - static void - give_focus_to(Question* q) { - q->setFocus(Qt::OtherFocusReason); - } - static void ensure_visibility(Debate* debate, Exchange* e) { const int y = e->y() + e->height(); QScrollBar* vbar = debate->verticalScrollBar(); @@ -233,7 +227,7 @@ namespace OpenAxiom { vbar->setValue(std::max(new_value, 0)); else if (new_value > value) vbar->setValue(std::min(new_value, vbar->maximum())); - give_focus_to(e->question()); + e->question()->setFocus(Qt::OtherFocusReason); } void @@ -242,6 +236,8 @@ namespace OpenAxiom { if (empty_string(input)) return; question()->setReadOnly(true); // Make query area read only. + question()->clearFocus(); + question()->setFocusPolicy(Qt::NoFocus); server()->input(input); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); } diff --git a/src/gui/server.h b/src/gui/server.h index 8cf1f227..acb691d7 100644 --- a/src/gui/server.h +++ b/src/gui/server.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013, Gabriel Dos Reis. +// Copyright (C) 2011-2013, Gabriel Dos Reis. // All rights reserved. // Written by Gabriel Dos Reis. // @@ -49,6 +49,9 @@ namespace OpenAxiom { private: Command cmd; Filesystem fs; + + Server(const Server&) = delete; + Server& operator=(const Server&) = delete; }; } -- cgit v1.2.3