]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QGraphicsDialog.C
Get rid of the static_casts.
[lyx.git] / src / frontends / qt2 / QGraphicsDialog.C
index cf667ba912e2ead6c7b55981372c1514ff4f66fc..99fee73aad16b608f62b32cfac915fe745b65da9 100644 (file)
@@ -1,25 +1,37 @@
 /**
  * \file QGraphicsDialog.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 John Levon <moz@compsoc.man.ac.uk>
+ * \author John Levon
+ * \author Herbert Voss
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
-#include <vector>
+
 
 #include "ControlGraphics.h"
 #include "debug.h"
+#include "qt_helpers.h"
 #include "LString.h"
 
 #include <qwidget.h>
 #include <qpushbutton.h>
+#include <qlineedit.h>
 #include <qcheckbox.h>
+#include <qfiledialog.h>
+#include <qcombobox.h>
+
+#include "lengthcombo.h"
 
 #include "QGraphicsDialog.h"
 #include "QGraphics.h"
 
+#include <vector>
+
+
 QGraphicsDialog::QGraphicsDialog(QGraphics * form)
        : QGraphicsDialogBase(0, 0, false, 0),
        form_(form)
@@ -35,9 +47,33 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form)
 }
 
 
+void QGraphicsDialog::show()
+{
+       QGraphicsDialogBase::show();
+       filename->setFocus();
+}
+
+
 void QGraphicsDialog::change_adaptor()
 {
-       lyxerr << "changed" << endl; 
+       form_->changed();
+}
+
+
+void QGraphicsDialog::change_bb()
+{
+       form_->controller().bbChanged = true;
+       lyxerr[Debug::GRAPHICS]
+               << "[controller().bb_Changed set to true]\n";
+       form_->changed();
+}
+
+
+void QGraphicsDialog::change_WUnit()
+{
+       bool useHeight = (widthUnit->currentItem() > 0);
+       height->setEnabled(useHeight);
+       heightUnit->setEnabled(useHeight);
        form_->changed();
 }
 
@@ -51,10 +87,14 @@ void QGraphicsDialog::closeEvent(QCloseEvent * e)
 
 void QGraphicsDialog::browse_clicked()
 {
-       form_->browse();
+       string const str = 
+               form_->controller().Browse(fromqstr(filename->text()));
+       filename->setText(toqstr(str));
+       form_->changed();
 }
 
-void QGraphicsDialog::get_clicked()
+
+void QGraphicsDialog::getBB_clicked()
 {
-       form_->get();
+       form_->getBB();
 }