]> git.lyx.org Git - features.git/commitdiff
minimal effort implementation of:
authorEdwin Leuven <e.leuven@gmail.com>
Fri, 25 Aug 2006 13:40:01 +0000 (13:40 +0000)
committerEdwin Leuven <e.leuven@gmail.com>
Fri, 25 Aug 2006 13:40:01 +0000 (13:40 +0000)
* float widget as a .ui file
* floatplacement.[Ch] -> FloatPlacement.[Ch]

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14838 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
development/scons/scons_manifest.py
src/frontends/qt4/FloatPlacement.C [new file with mode: 0644]
src/frontends/qt4/FloatPlacement.h [new file with mode: 0644]
src/frontends/qt4/Makefile.dialogs
src/frontends/qt4/QDocument.C
src/frontends/qt4/QDocumentDialog.C
src/frontends/qt4/QFloat.C
src/frontends/qt4/QFloatDialog.C
src/frontends/qt4/floatplacement.C [deleted file]
src/frontends/qt4/floatplacement.h [deleted file]
src/frontends/qt4/ui/FloatPlacementUi.ui [new file with mode: 0644]
src/frontends/qt4/ui/QFloatUi.ui

index 0d3ed613be405731e80f60e0b8112e5583fc16bb..146870181f521149ab8180b8ceb1a038ee222f0d 100644 (file)
@@ -669,7 +669,7 @@ src_frontends_qt3_moc_files = Split('''
     BulletsModule.C
     emptytable.C
     FileDialog_private.C
-    floatplacement.C
+    FloatPlacement.C
     iconpalette.C
     lengthcombo.C
     panelstack.C
@@ -824,7 +824,7 @@ src_frontends_qt3_header_files = Split('''
     QtView.h
     checkedwidgets.h
     emptytable.h
-    floatplacement.h
+    FloatPlacement.h
     iconpalette.h
     lcolorcache.h
     lengthcombo.h
@@ -942,7 +942,7 @@ src_frontends_qt3_files = Split('''
     QtView.C
     checkedwidgets.C
     emptytable.C
-    floatplacement.C
+    FloatPlacement.C
     iconpalette.C
     lcolorcache.C
     lengthcombo.C
@@ -1039,7 +1039,7 @@ src_frontends_qt4_moc_files = Split('''
     BulletsModule.C
     emptytable.C
     FileDialog_private.C
-    floatplacement.C
+    FloatPlacement.C
     iconpalette.C
     lengthcombo.C
     InsertTableWidget.C
@@ -1204,7 +1204,7 @@ src_frontends_qt4_header_files = Split('''
     UrlView.h
     checkedwidgets.h
     emptytable.h
-    floatplacement.h
+    FloatPlacement.h
     iconpalette.h
     lengthcombo.h
     panelstack.h
@@ -1323,7 +1323,7 @@ src_frontends_qt4_files = Split('''
     UrlView.C
     checkedwidgets.C
     emptytable.C
-    floatplacement.C
+    FloatPlacement.C
     iconpalette.C
     lengthcombo.C
     lyx_gui.C
diff --git a/src/frontends/qt4/FloatPlacement.C b/src/frontends/qt4/FloatPlacement.C
new file mode 100644 (file)
index 0000000..2e11747
--- /dev/null
@@ -0,0 +1,241 @@
+/**
+ * \file floatplacement.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Edwin Leuven
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "FloatPlacement.h"
+#include "qt_helpers.h"
+
+#include "insets/insetfloat.h"
+#include "support/lstrings.h"
+
+using lyx::support::contains;
+using std::string;
+
+FloatPlacement::FloatPlacement(QWidget *)
+{
+       setupUi(this);
+
+       connect(topCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
+       connect(bottomCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
+       connect(pageCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
+       connect(herepossiblyCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
+       connect(defaultsCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
+
+       connect(defaultsCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+       connect(ignoreCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+       connect(pageCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+       connect(heredefinitelyCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+       connect(herepossiblyCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+       connect(bottomCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+       connect(topCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+
+       spanCB->hide();
+       sidewaysCB->hide();
+}
+
+
+FloatPlacement::~FloatPlacement()
+{
+}
+
+
+void FloatPlacement::useWide()
+{
+       spanCB->show();
+}
+
+
+void FloatPlacement::useSideways()
+{
+       sidewaysCB->show();
+}
+
+
+void FloatPlacement::changedSlot()
+{
+       // emit signal
+       changed();
+}
+
+
+void FloatPlacement::set(string const & placement)
+{
+       bool def_placement = false;
+       bool top = false;
+       bool bottom = false;
+       bool page = false;
+       bool here = false;
+       bool force = false;
+       bool here_definitely = false;
+
+       if (placement.empty()) {
+               def_placement = true;
+       } else if (contains(placement, 'H')) {
+               here_definitely = true;
+       } else {
+               if (contains(placement, '!')) {
+                       force = true;
+               }
+               if (contains(placement, 't')) {
+                       top = true;
+               }
+               if (contains(placement, 'b')) {
+                       bottom = true;
+               }
+               if (contains(placement, 'p')) {
+                       page = true;
+               }
+               if (contains(placement, 'h')) {
+                       here = true;
+               }
+       }
+
+       defaultsCB->setChecked(def_placement);
+       topCB->setChecked(top);
+       bottomCB->setChecked(bottom);
+       pageCB->setChecked(page);
+       herepossiblyCB->setChecked(here);
+       ignoreCB->setChecked(force);
+       ignoreCB->setEnabled(top || bottom || page || here);
+       heredefinitelyCB->setChecked(here_definitely);
+       checkAllowed();
+}
+
+
+void FloatPlacement::set(InsetFloatParams const & params)
+{
+       set(params.placement);
+
+       if (params.wide) {
+               herepossiblyCB->setChecked(false);
+               heredefinitelyCB->setChecked(false);
+               bottomCB->setChecked(false);
+       }
+
+       spanCB->setChecked(params.wide);
+       sidewaysCB->setChecked(params.sideways);
+       sidewaysCB->setEnabled(params.type == "figure"
+               || params.type == "table");
+       checkAllowed();
+}
+
+
+string const FloatPlacement::get(bool & wide, bool & sideways) const
+{
+       wide = spanCB->isChecked();
+       sideways = sidewaysCB->isChecked();
+
+       return get();
+}
+
+
+string const FloatPlacement::get() const
+{
+       string placement;
+
+       if (defaultsCB->isChecked())
+               return placement;
+
+       if (heredefinitelyCB->isChecked()) {
+               placement += 'H';
+       } else {
+               if (ignoreCB->isChecked()) {
+                       placement += '!';
+               }
+               if (topCB->isChecked()) {
+                       placement += 't';
+               }
+               if (bottomCB->isChecked()) {
+                       placement += 'b';
+               }
+               if (pageCB->isChecked()) {
+                       placement += 'p';
+               }
+               if (herepossiblyCB->isChecked()) {
+                       placement += 'h';
+               }
+       }
+       return placement;
+}
+
+
+void FloatPlacement::tbhpClicked()
+{
+       heredefinitelyCB->setChecked(false);
+       checkAllowed();
+}
+
+
+void FloatPlacement::on_heredefinitelyCB_clicked()
+{
+       if (heredefinitelyCB->isChecked())
+               ignoreCB->setEnabled(false);
+
+       topCB->setChecked(false);
+       bottomCB->setChecked(false);
+       pageCB->setChecked(false);
+       herepossiblyCB->setChecked(false);
+       ignoreCB->setChecked(false);
+}
+
+
+void FloatPlacement::on_spanCB_clicked()
+{
+       checkAllowed();
+
+       if (!spanCB->isChecked())
+               return;
+
+       herepossiblyCB->setChecked(false);
+       heredefinitelyCB->setChecked(false);
+       bottomCB->setChecked(false);
+}
+
+
+void FloatPlacement::on_sidewaysCB_clicked()
+{
+       checkAllowed();
+}
+
+
+void FloatPlacement::checkAllowed()
+{
+       bool const defaults(defaultsCB->isChecked());
+       bool ignore(topCB->isChecked());
+       ignore |= bottomCB->isChecked();
+       ignore |= pageCB->isChecked();
+       ignore |= herepossiblyCB->isChecked();
+
+       // float or document dialog?
+       if (spanCB->isVisible()) {
+               bool const span(spanCB->isChecked());
+               bool const sideways(sidewaysCB->isChecked());
+               defaultsCB->setEnabled(!sideways);
+               topCB->setEnabled(!sideways && !defaults);
+               bottomCB->setEnabled(!sideways && !defaults && !span);
+               pageCB->setEnabled(!sideways && !defaults);
+               ignoreCB->setEnabled(!sideways && !defaults && ignore);
+               herepossiblyCB->setEnabled(!sideways && !defaults && !span);
+               heredefinitelyCB->setEnabled(!sideways && !defaults && !span);
+               spanCB->setEnabled(!sideways);
+       } else {
+               topCB->setEnabled(!defaults);
+               bottomCB->setEnabled(!defaults);
+               pageCB->setEnabled(!defaults);
+               ignoreCB->setEnabled(!defaults && ignore);
+               herepossiblyCB->setEnabled(!defaults);
+               heredefinitelyCB->setEnabled(!defaults);
+       }
+}
+
+
+#include "FloatPlacement_moc.cpp"
diff --git a/src/frontends/qt4/FloatPlacement.h b/src/frontends/qt4/FloatPlacement.h
new file mode 100644 (file)
index 0000000..e3ddc34
--- /dev/null
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+/**
+ * \file floatplacement.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Edwin Leuven
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef QT_FLOATPLACEMENT_H
+#define QT_FLOATPLACEMENT_H
+
+#include "ui/FloatPlacementUi.h"
+#include <QWidget>
+
+#include <string>
+
+class InsetFloatParams;
+
+class FloatPlacement : public QWidget, public Ui::FloatPlacementUi {
+       Q_OBJECT
+public:
+       FloatPlacement(QWidget * parent = 0);
+       ~FloatPlacement();
+
+       void useWide();
+       void useSideways();
+
+       void set(InsetFloatParams const & params);
+       void set(std::string const & placement);
+       void checkAllowed();
+
+       std::string const get(bool & wide, bool & sideways) const;
+       std::string const get() const;
+
+public Q_SLOTS:
+       void tbhpClicked();
+       void changedSlot();
+       void on_spanCB_clicked();
+       void on_heredefinitelyCB_clicked();
+       void on_sidewaysCB_clicked();
+
+Q_SIGNALS:
+       void changed();
+
+};
+
+#endif
index b7b0076e8b03d2daed3c9492e17efbc5ea6b29f2..681416f551a99bb9223840b59103e9ad79b156bf 100644 (file)
@@ -4,6 +4,7 @@ UIFILES = \
        BiblioUi.ui \
        BranchesUi.ui \
        BulletsUi.ui \
+       FloatPlacementUi.ui \
        FontUi.ui \
        TextLayoutUi.ui \
        LanguageUi.ui \
@@ -76,7 +77,7 @@ MOCFILES = \
        BulletsModule.C BulletsModule.h \
        emptytable.C emptytable.h \
        FileDialog_private.C FileDialog_private.h \
-       floatplacement.C floatplacement.h \
+       FloatPlacement.C FloatPlacement.h \
        GuiView.C GuiView.h \
        GuiWorkArea.C GuiWorkArea.h \
        iconpalette.C iconpalette.h \
index 3d60bf8d568ebbafd1d55687a7d2bcdb732925f5..e357eee876a863668513c9e82c01dcaf102faadd 100644 (file)
@@ -16,7 +16,7 @@
 #include "qt_helpers.h"
 
 #include "bufferparams.h"
-#include "floatplacement.h"
+#include "FloatPlacement.h"
 #include "gettext.h"
 #include "helper_funcs.h" // getSecond()
 #include "language.h"
index 2fbe8417db9755b9f938a2e1ae66bc309b703aac..3c555a31fca5fb3353a626febaf829990f1420b1 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <QCloseEvent>
 
-#include "floatplacement.h"
+#include "FloatPlacement.h"
 #include "lengthcombo.h"
 #include "validators.h"
 #include "panelstack.h"
index c08f09400de800814b150c36aa9fda016a8bfa10..1d1ccfc581c70f547e19dfae85a124a2a661d223 100644 (file)
 #include "QFloat.h"
 #include "QFloatDialog.h"
 #include "Qt2BC.h"
-#include "floatplacement.h"
+#include "FloatPlacement.h"
 
 #include "controllers/ControlFloat.h"
 
 #include "insets/insetfloat.h"
 
-#include <qpushbutton.h>
+#include <QPushButton>
 
 namespace lyx {
 namespace frontend {
index 84c24f81fcd2f964597229213032f7ed9747cdf8..caa05f51a30f9987bb99063263a10907283f90cd 100644 (file)
 
 #include "QFloatDialog.h"
 #include "QFloat.h"
-//Added by qt3to4:
+
 #include <QCloseEvent>
-#include "floatplacement.h"
+#include <QPushButton>
+
+#include "FloatPlacement.h"
 
-#include <qpushbutton.h>
 
 
 namespace lyx {
diff --git a/src/frontends/qt4/floatplacement.C b/src/frontends/qt4/floatplacement.C
deleted file mode 100644 (file)
index 762935a..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/**
- * \file floatplacement.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Edwin Leuven
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "floatplacement.h"
-#include "qt_helpers.h"
-//Added by qt3to4:
-#include <QVBoxLayout>
-#include <QHBoxLayout>
-
-#include "insets/insetfloat.h"
-#include "support/lstrings.h"
-
-#include <QCheckBox>
-#include <QLayout>
-#include <QGroupBox>
-
-using lyx::support::contains;
-
-using std::string;
-
-
-// FIXME: set disabled doesn't work properly
-// should be fixed now (jspitzm)
-FloatPlacement::FloatPlacement(QWidget * parent)
-       : QWidget(parent)
-{
-       QHBoxLayout * toplayout = new QHBoxLayout(this);
-       toplayout->setMargin(11);
-       toplayout->setSpacing(6);
-
-       layout = new QVBoxLayout(0);
-       layout->setMargin(0);
-       layout->setSpacing(6);
-
-       QGroupBox * options = new QGroupBox(qt_("Advanced Placement Options"), this);
-
-       defaultsCB = new QCheckBox(qt_("Use &default placement"), this);
-       topCB = new QCheckBox(qt_("&Top of page"), options);
-       bottomCB = new QCheckBox(qt_("&Bottom of page"), options);
-       pageCB = new QCheckBox(qt_("&Page of floats"), options);
-       herepossiblyCB = new QCheckBox(qt_("&Here if possible"), options);
-       heredefinitelyCB = new QCheckBox(qt_("Here definitely"), options);
-       ignoreCB = new QCheckBox(qt_("&Ignore LaTeX rules"), options);
-       spanCB = 0;
-       sidewaysCB = 0;
-
-       layout->addWidget(defaultsCB);
-
-       QVBoxLayout * optlay = new QVBoxLayout(options);
-       optlay->setMargin(10);
-       optlay->setSpacing(6);
-
-       optlay->addSpacing(6);
-       optlay->addWidget(topCB);
-       optlay->addWidget(bottomCB);
-       optlay->addWidget(pageCB);
-       optlay->addWidget(herepossiblyCB);
-       optlay->addWidget(heredefinitelyCB);
-       optlay->addWidget(ignoreCB);
-
-       layout->addWidget(options);
-
-       toplayout->addLayout(layout);
-
-       connect(defaultsCB, SIGNAL(toggled(bool)), options, SLOT(setDisabled(bool)));
-
-       connect(heredefinitelyCB, SIGNAL(clicked()), this, SLOT(heredefinitelyClicked()));
-       connect(topCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
-       connect(bottomCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
-       connect(pageCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
-       connect(herepossiblyCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
-       connect(defaultsCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
-
-       connect(defaultsCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-       connect(ignoreCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-       connect(pageCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-       connect(heredefinitelyCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-       connect(herepossiblyCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-       connect(bottomCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-       connect(topCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-}
-
-
-void FloatPlacement::useWide()
-{
-       spanCB = new QCheckBox(qt_("&Span columns"), this);
-       layout->addWidget(spanCB);
-       setTabOrder(ignoreCB, spanCB);
-       connect(spanCB, SIGNAL(clicked()), this, SLOT(spanClicked()));
-       connect(spanCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-}
-
-
-void FloatPlacement::useSideways()
-{
-       sidewaysCB = new QCheckBox(qt_("&Rotate sideways"), this);
-       layout->addWidget(sidewaysCB);
-       setTabOrder(spanCB, sidewaysCB);
-       connect(sidewaysCB, SIGNAL(clicked()), this, SLOT(sidewaysClicked()));
-       connect(sidewaysCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
-}
-
-
-void FloatPlacement::changedSlot()
-{
-       // emit signal
-       changed();
-}
-
-
-void FloatPlacement::set(string const & placement)
-{
-       bool def_placement = false;
-       bool top = false;
-       bool bottom = false;
-       bool page = false;
-       bool here = false;
-       bool force = false;
-       bool here_definitely = false;
-
-       if (placement.empty()) {
-               def_placement = true;
-       } else if (contains(placement, 'H')) {
-               here_definitely = true;
-       } else {
-               if (contains(placement, '!')) {
-                       force = true;
-               }
-               if (contains(placement, 't')) {
-                       top = true;
-               }
-               if (contains(placement, 'b')) {
-                       bottom = true;
-               }
-               if (contains(placement, 'p')) {
-                       page = true;
-               }
-               if (contains(placement, 'h')) {
-                       here = true;
-               }
-       }
-
-       defaultsCB->setChecked(def_placement);
-       topCB->setChecked(top);
-       bottomCB->setChecked(bottom);
-       pageCB->setChecked(page);
-       herepossiblyCB->setChecked(here);
-       ignoreCB->setChecked(force);
-       ignoreCB->setEnabled(top || bottom || page || here);
-       heredefinitelyCB->setChecked(here_definitely);
-       checkAllowed();
-}
-
-
-void FloatPlacement::set(InsetFloatParams const & params)
-{
-       set(params.placement);
-
-       if (params.wide) {
-               herepossiblyCB->setChecked(false);
-               heredefinitelyCB->setChecked(false);
-               bottomCB->setChecked(false);
-       }
-
-       spanCB->setChecked(params.wide);
-       sidewaysCB->setChecked(params.sideways);
-       sidewaysCB->setEnabled(params.type == "figure"
-               || params.type == "table");
-       checkAllowed();
-}
-
-
-string const FloatPlacement::get(bool & wide, bool & sideways) const
-{
-       wide = spanCB->isChecked();
-       sideways = sidewaysCB->isChecked();
-
-       return get();
-}
-
-
-string const FloatPlacement::get() const
-{
-       string placement;
-
-       if (defaultsCB->isChecked())
-               return placement;
-
-       if (heredefinitelyCB->isChecked()) {
-               placement += 'H';
-       } else {
-               if (ignoreCB->isChecked()) {
-                       placement += '!';
-               }
-               if (topCB->isChecked()) {
-                       placement += 't';
-               }
-               if (bottomCB->isChecked()) {
-                       placement += 'b';
-               }
-               if (pageCB->isChecked()) {
-                       placement += 'p';
-               }
-               if (herepossiblyCB->isChecked()) {
-                       placement += 'h';
-               }
-       }
-       return placement;
-}
-
-
-void FloatPlacement::tbhpClicked()
-{
-       heredefinitelyCB->setChecked(false);
-       checkAllowed();
-}
-
-
-void FloatPlacement::heredefinitelyClicked()
-{
-       if (heredefinitelyCB->isChecked())
-               ignoreCB->setEnabled(false);
-
-       topCB->setChecked(false);
-       bottomCB->setChecked(false);
-       pageCB->setChecked(false);
-       herepossiblyCB->setChecked(false);
-       ignoreCB->setChecked(false);
-}
-
-
-void FloatPlacement::spanClicked()
-{
-       checkAllowed();
-
-       if (!spanCB->isChecked())
-               return;
-
-       herepossiblyCB->setChecked(false);
-       heredefinitelyCB->setChecked(false);
-       bottomCB->setChecked(false);
-}
-
-
-void FloatPlacement::sidewaysClicked()
-{
-       checkAllowed();
-}
-
-
-void FloatPlacement::checkAllowed()
-{
-       bool const defaults(defaultsCB->isChecked());
-       bool ignore(topCB->isChecked());
-       ignore |= bottomCB->isChecked();
-       ignore |= pageCB->isChecked();
-       ignore |= herepossiblyCB->isChecked();
-
-       // float or document dialog?
-       if (spanCB != 0) {
-               bool const span(spanCB->isChecked());
-               bool const sideways(sidewaysCB->isChecked());
-               defaultsCB->setEnabled(!sideways);
-               topCB->setEnabled(!sideways && !defaults);
-               bottomCB->setEnabled(!sideways && !defaults && !span);
-               pageCB->setEnabled(!sideways && !defaults);
-               ignoreCB->setEnabled(!sideways && !defaults && ignore);
-               herepossiblyCB->setEnabled(!sideways && !defaults && !span);
-               heredefinitelyCB->setEnabled(!sideways && !defaults && !span);
-               spanCB->setEnabled(!sideways);
-       } else {
-               topCB->setEnabled(!defaults);
-               bottomCB->setEnabled(!defaults);
-               pageCB->setEnabled(!defaults);
-               ignoreCB->setEnabled(!defaults && ignore);
-               herepossiblyCB->setEnabled(!defaults);
-               heredefinitelyCB->setEnabled(!defaults);
-       }
-}
-
-#include "floatplacement_moc.cpp"
diff --git a/src/frontends/qt4/floatplacement.h b/src/frontends/qt4/floatplacement.h
deleted file mode 100644 (file)
index 473397d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// -*- C++ -*-
-/**
- * \file floatplacement.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Edwin Leuven
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef QT_FLOATPLACEMENT_H
-#define QT_FLOATPLACEMENT_H
-
-#include <QWidget>
-
-#include <string>
-
-class QCheckBox;
-class QVBoxLayout;
-class InsetFloatParams;
-
-class FloatPlacement : public QWidget {
-       Q_OBJECT
-
-public:
-       FloatPlacement(QWidget * parent=0);
-
-       void useWide();
-       void useSideways();
-
-       void set(InsetFloatParams const & params);
-       void set(std::string const & placement);
-       void checkAllowed();
-
-       std::string const get(bool & wide, bool & sideways) const;
-       std::string const get() const;
-
-public Q_SLOTS:
-       void tbhpClicked();
-       void heredefinitelyClicked();
-       void spanClicked();
-       void sidewaysClicked();
-       void changedSlot();
-
-Q_SIGNALS:
-       void changed();
-
-private:
-       QVBoxLayout * layout;
-
-       QCheckBox * defaultsCB;
-       QCheckBox * spanCB;
-       QCheckBox * sidewaysCB;
-       QCheckBox * ignoreCB;
-       QCheckBox * pageCB;
-       QCheckBox * heredefinitelyCB;
-       QCheckBox * herepossiblyCB;
-       QCheckBox * bottomCB;
-       QCheckBox * topCB;
-};
-
-#endif
diff --git a/src/frontends/qt4/ui/FloatPlacementUi.ui b/src/frontends/qt4/ui/FloatPlacementUi.ui
new file mode 100644 (file)
index 0000000..3b4950c
--- /dev/null
@@ -0,0 +1,125 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>FloatPlacementUi</class>
+ <widget class="QWidget" name="FloatPlacementUi" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>211</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item>
+    <widget class="QCheckBox" name="defaultsCB" >
+     <property name="text" >
+      <string>Use &amp;default placement</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="options" >
+     <property name="title" >
+      <string>Advanced Placement Options</string>
+     </property>
+     <layout class="QGridLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QCheckBox" name="topCB" >
+        <property name="text" >
+         <string>&amp;Top of page</string>
+        </property>
+       </widget>
+      </item>
+      <item row="5" column="0" >
+       <widget class="QCheckBox" name="ignoreCB" >
+        <property name="text" >
+         <string>&amp;Ignore LaTeX rules</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="0" >
+       <widget class="QCheckBox" name="heredefinitelyCB" >
+        <property name="text" >
+         <string>Here de&amp;finitely</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="0" >
+       <widget class="QCheckBox" name="herepossiblyCB" >
+        <property name="text" >
+         <string>&amp;Here if possible</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0" >
+       <widget class="QCheckBox" name="pageCB" >
+        <property name="text" >
+         <string>&amp;Page of floats</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QCheckBox" name="bottomCB" >
+        <property name="text" >
+         <string>&amp;Bottom of page</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="spanCB" >
+     <property name="text" >
+      <string>&amp;Span columns</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="sidewaysCB" >
+     <property name="text" >
+      <string>&amp;Rotate sideways</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>defaultsCB</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>options</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>51</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>201</x>
+     <y>47</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index 031ce110654dd6b9df8c27d762298b23f5d9aeee..3abe39adf857a8a751f0d2200ccbbaa51d201777 100644 (file)
@@ -95,7 +95,7 @@
   <customwidget>
    <class>FloatPlacement</class>
    <extends></extends>
-   <header>floatplacement.h</header>
+   <header>FloatPlacement.h</header>
    <container>1</container>
    <pixmap></pixmap>
   </customwidget>