]> git.lyx.org Git - lyx.git/commitdiff
merge QWrapDialog and QWrap
authorAndré Pönitz <poenitz@gmx.net>
Tue, 24 Apr 2007 14:59:51 +0000 (14:59 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 24 Apr 2007 14:59:51 +0000 (14:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17951 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/Makefile.am
src/frontends/qt4/Makefile.dialogs
src/frontends/qt4/QWrap.C
src/frontends/qt4/QWrap.h
src/frontends/qt4/QWrapDialog.C [deleted file]
src/frontends/qt4/QWrapDialog.h [deleted file]

index b4a801312e0188afe6b19ad053a8565e210062c2..5e1571997728771aa7a205ffc84592dd9bc67d13 100644 (file)
@@ -41,7 +41,6 @@ libqt4_la_SOURCES = \
        GuiSelection.h GuiSelection.C \
        LyXKeySymFactory.C \
        QLMenubar.C QLMenubar.h \
-       QAbout.C QAbout.h \
        QBibitem.C QBibitem.h \
        QBibtex.C QBibtex.h \
        QBox.C QBox.h \
@@ -53,7 +52,6 @@ libqt4_la_SOURCES = \
        QDocument.C QDocument.h \
        QDialogView.C QDialogView.h \
        QErrorList.C QErrorList.h \
-       QERT.C QERT.h \
        QExternal.C QExternal.h \
        QFloat.C QFloat.h \
        QGraphics.C QGraphics.h \
@@ -70,16 +68,12 @@ libqt4_la_SOURCES = \
        QPrefs.C QPrefs.h \
        QPrint.C QPrint.h \
        QRef.C QRef.h \
-       QSearch.C QSearch.h \
        QSendto.C QSendto.h \
        QShowFile.C QShowFile.h \
        QSpellchecker.C QSpellchecker.h \
        QTabular.C QTabular.h \
        QTabularCreate.C QTabularCreate.h \
        QTexinfo.C QTexinfo.h \
-       QThesaurus.C QThesaurus.h \
-       QVSpace.C QVSpace.h \
-       QWrap.C QWrap.h \
        Qt2BC.C Qt2BC.h \
        checkedwidgets.C checkedwidgets.h \
        panelstack.h panelstack.C \
index aa65de0d6ec3cbb07488792a0e2f469e1bf389b8..83c605b945a682f951fb8b67d6252bb6f3790751 100644 (file)
@@ -133,7 +133,7 @@ MOCFILES = \
        QToc.C QToc.h \
        QURLDialog.C QURLDialog.h \
        QVSpace.C QVSpace.h \
-       QWrapDialog.C QWrapDialog.h \
+       QWrap.C QWrap.h \
        QLToolbar.C QLToolbar.h \
        socket_callback.C socket_callback.h \
        validators.C validators.h
index 04e1f138d47687cac742d46864c51189e53ddcf7..83aad5327e2934c4ef134d8fb48ac9dd2b527217 100644 (file)
@@ -11,7 +11,6 @@
 #include <config.h>
 
 #include "QWrap.h"
-#include "QWrapDialog.h"
 #include "Qt2BC.h"
 
 #include "lengthcombo.h"
@@ -25,6 +24,7 @@
 #include "support/lstrings.h"
 
 #include <QLineEdit>
+#include <QCloseEvent>
 #include <QPushButton>
 
 
@@ -33,6 +33,50 @@ using std::string;
 namespace lyx {
 namespace frontend {
 
+/////////////////////////////////////////////////////////////////////
+//
+// QWrapDialog
+//
+/////////////////////////////////////////////////////////////////////
+
+
+QWrapDialog::QWrapDialog(QWrap * form)
+       : form_(form)
+{
+       setupUi(this);
+
+       connect(restorePB, SIGNAL(clicked()), form, SLOT(slotRestore()));
+       connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
+       connect(applyPB, SIGNAL(clicked()), form, SLOT(slotApply()));
+       connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
+
+       connect(widthED, SIGNAL(textChanged(const QString &)),
+               this, SLOT(change_adaptor()));
+       connect(unitsLC, SIGNAL(selectionChanged(LyXLength::UNIT)),
+               this, SLOT(change_adaptor()));
+       connect(valignCO, SIGNAL(highlighted(const QString &)),
+               this, SLOT(change_adaptor()));
+}
+
+
+void QWrapDialog::closeEvent(QCloseEvent * e)
+{
+       form_->slotWMHide();
+       e->accept();
+}
+
+
+void QWrapDialog::change_adaptor()
+{
+       form_->changed();
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+// QWrap
+//
+/////////////////////////////////////////////////////////////////////
+
 typedef QController<ControlWrap, QView<QWrapDialog> > wrap_base_class;
 
 QWrap::QWrap(Dialog & parent)
@@ -84,10 +128,9 @@ void QWrap::apply()
 }
 
 
-namespace {
-
-string const numtostr(double val) {
-       string a(convert<string>(val));
+static string const numtostr(double val)
+{
+       string a = convert<string>(val);
 #ifdef WITH_WARNINGS
 #warning Will this test ever trigger? (Lgb)
 #endif
@@ -96,8 +139,6 @@ string const numtostr(double val) {
        return a;
 }
 
-} // namespace anon
-
 
 void QWrap::update_contents()
 {
@@ -120,3 +161,6 @@ void QWrap::update_contents()
 
 } // namespace frontend
 } // namespace lyx
+
+
+#include "QWrap_moc.cpp"
index 4ef2ce976c687b108111d7c049b18bd1bb68bd34..167f133dcb0d43be4878785bf0e41e2abe3178d2 100644 (file)
 #define QWRAP_H
 
 #include "QDialogView.h"
-#include "QWrapDialog.h"
+#include "ui/WrapUi.h"
+
+#include <QDialog>
+#include <QCloseEvent>
 
 namespace lyx {
 namespace frontend {
 
+class QWrap;
+
+class QWrapDialog : public QDialog, public Ui::QWrapUi {
+       Q_OBJECT
+public:
+       QWrapDialog(QWrap * form);
+protected Q_SLOTS:
+       virtual void change_adaptor();
+protected:
+       virtual void closeEvent(QCloseEvent * e);
+private:
+       QWrap * form_;
+};
+
+
 class ControlWrap;
 
 class QWrap : public QController<ControlWrap, QView<QWrapDialog> > {
diff --git a/src/frontends/qt4/QWrapDialog.C b/src/frontends/qt4/QWrapDialog.C
deleted file mode 100644 (file)
index eb40d2f..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * \file QWrapDialog.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Jürgen Spitzmüller
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "QWrapDialog.h"
-#include "QWrap.h"
-
-#include <qpushbutton.h>
-//Added by qt3to4:
-#include <QCloseEvent>
-
-namespace lyx {
-namespace frontend {
-
-
-QWrapDialog::QWrapDialog(QWrap * form)
-       : form_(form)
-{
-       setupUi(this);
-
-       connect(restorePB, SIGNAL(clicked()),
-               form, SLOT(slotRestore()));
-       connect(okPB, SIGNAL(clicked()),
-               form, SLOT(slotOK()));
-       connect(applyPB, SIGNAL(clicked()),
-               form, SLOT(slotApply()));
-       connect(closePB, SIGNAL(clicked()),
-               form, SLOT(slotClose()));
-
-    connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
-    connect( unitsLC, SIGNAL( selectionChanged(LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
-    connect( valignCO, SIGNAL( highlighted(const QString&) ), this, SLOT( change_adaptor() ) );
-}
-
-
-void QWrapDialog::closeEvent(QCloseEvent * e)
-{
-       form_->slotWMHide();
-       e->accept();
-}
-
-
-void QWrapDialog::change_adaptor()
-{
-       form_->changed();
-}
-
-} // namespace frontend
-} // namespace lyx
-
-#include "QWrapDialog_moc.cpp"
diff --git a/src/frontends/qt4/QWrapDialog.h b/src/frontends/qt4/QWrapDialog.h
deleted file mode 100644 (file)
index f945218..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- C++ -*-
-/**
- * \file QWrapDialog.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Jürgen Spitzmüller
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef QWRAPDIALOG_H
-#define QWRAPDIALOG_H
-
-#include "ui/WrapUi.h"
-
-#include <QDialog>
-#include <QCloseEvent>
-
-namespace lyx {
-namespace frontend {
-
-class QWrap;
-
-class QWrapDialog : public QDialog, public Ui::QWrapUi {
-       Q_OBJECT
-public:
-       QWrapDialog(QWrap * form);
-protected Q_SLOTS:
-       virtual void change_adaptor();
-protected:
-       virtual void closeEvent(QCloseEvent * e);
-private:
-       QWrap * form_;
-};
-
-} // namespace frontend
-} // namespace lyx
-
-#endif // QWRAPDIALOG_H