]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QGraphicsDialog.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QGraphicsDialog.C
index 51fc9510c73edf57a2b66b330b7aeb23d00a3325..33c6e8b42edfec7445b6278025debc1b2f43246c 100644 (file)
@@ -1,25 +1,39 @@
 /**
  * \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>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "ControlGraphics.h"
+#include "debug.h"
+#include "gettext.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 "LString.h" 
 #include "QGraphicsDialog.h"
-#include "ControlGraphics.h" 
-#include "Dialogs.h"
 #include "QGraphics.h"
-#include "debug.h" 
+
+#include <vector>
+
 
 QGraphicsDialog::QGraphicsDialog(QGraphics * form)
        : QGraphicsDialogBase(0, 0, false, 0),
@@ -28,18 +42,45 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form)
        connect(okPB, SIGNAL(clicked()),
                form, SLOT(slotOK()));
        connect(applyPB, SIGNAL(clicked()),
-               form, SLOT(slotOK()));
+               form, SLOT(slotApply()));
        connect(closePB, SIGNAL(clicked()),
                form, SLOT(slotClose()));
+       connect(restorePB, SIGNAL(clicked()),
+               form, SLOT(slotRestore()));
 }
 
+
+void QGraphicsDialog::show()
+{
+       QGraphicsDialogBase::show();
+       filename->setFocus();
+}
+
+
 void QGraphicsDialog::change_adaptor()
 {
        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();
+}
+
+
 void QGraphicsDialog::closeEvent(QCloseEvent * e)
 {
        form_->slotWMHide();
@@ -47,7 +88,20 @@ void QGraphicsDialog::closeEvent(QCloseEvent * e)
 }
 
 
-void QGraphicsDialog::browseClicked()
+void QGraphicsDialog::browse_clicked()
+{
+       QString file = QFileDialog::getOpenFileName(
+               QString::null, _("Files (*)"),
+               this, 0, _("Select a graphic file"));
+       if (!file.isNull()) {
+               string const name = file.latin1();
+               filename->setText(name.c_str());
+               form_->changed();
+       }
+}
+
+
+void QGraphicsDialog::getBB_clicked()
 {
-       form_->browse();
+       form_->getBB();
 }