]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/Qt2BC.C
better selection and scrolling behaviour
[lyx.git] / src / frontends / qt2 / Qt2BC.C
index 437be4830851791b5b3a10f357a5f605f4b1d30f..cd152b3c4a0771a95495efeff8937a65496fb45c 100644 (file)
@@ -1,10 +1,12 @@
 /**
  * \file Qt2BC.C
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Allan Rae <rae@lyx.org>
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Allan Rae
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
@@ -19,6 +21,7 @@
 #include <qbutton.h>
 #include <qlineedit.h>
 
+
 Qt2BC::Qt2BC(string const & cancel, string const & close)
        : GuiBC<QButton, QWidget>(cancel, close)
 {}
@@ -26,9 +29,6 @@ Qt2BC::Qt2BC(string const & cancel, string const & close)
 
 void Qt2BC::setButtonEnabled(QButton * obj, bool enabled)
 {
-       lyxerr << "Qt2BC: setting button " 
-               << obj << " to " << enabled << std::endl;
        obj->setEnabled(enabled);
 }
 
@@ -37,14 +37,14 @@ void Qt2BC::setWidgetEnabled(QWidget * obj, bool enabled)
 {
        // yuck, rtti, but the user comes first
        if (obj->inherits("QLineEdit")) {
-               QLineEdit * le(static_cast<QLineEdit*>(obj)); 
-               le->setReadOnly(enabled);
+               QLineEdit * le(static_cast<QLineEdit*>(obj));
+               le->setReadOnly(!enabled);
        } else {
                obj->setEnabled(enabled);
        }
+
        QWidget::FocusPolicy const p =
-               (enabled) ? QWidget::StrongFocus : QWidget::NoFocus; 
+               (enabled) ? QWidget::StrongFocus : QWidget::NoFocus;
        obj->setFocusPolicy(p);
 }