]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QExternalDialog.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QExternalDialog.C
index 7fd4048734e5073b6d2156e383edba4f6275b184..adfe745e4b945a5f83987bb9580aabb5a9ce972e 100644 (file)
 #include "support/lyxlib.h"
 
 #include "QExternalDialog.h"
-//Added by qt3to4:
-#include <QCloseEvent>
 
 #include "lengthcombo.h"
 #include "validators.h"
 #include "qt_helpers.h"
 #include "QExternal.h"
 
-#include <qcheckbox.h>
-#include <qpushbutton.h>
-#include <q3filedialog.h>
-#include <q3textview.h>
-#include <qlineedit.h>
+#include <QCloseEvent>
+#include <QCheckBox>
+#include <QPushButton>
+#include <QTextBrowser>
+#include <QLineEdit>
 
 
 using lyx::support::float_equal;
@@ -56,31 +54,31 @@ QExternalDialog::QExternalDialog(QExternal * form)
        connect(closePB, SIGNAL(clicked()),
                form, SLOT(slotClose()));
 
-    connect( displayCB, SIGNAL( toggled(bool) ), showCO, SLOT( setEnabled(bool) ) );
-    connect( displayCB, SIGNAL( toggled(bool) ), displayscaleED, SLOT( setEnabled(bool) ) );
-    connect( showCO, SIGNAL( activated(const QString&) ), this, SLOT( change_adaptor() ) );
-    connect( originCO, SIGNAL( activated(int) ), this, SLOT( change_adaptor() ) );
-    connect( aspectratioCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
-    connect( browsePB, SIGNAL( clicked() ), this, SLOT( browseClicked() ) );
-    connect( editPB, SIGNAL( clicked() ), this, SLOT( editClicked() ) );
-    connect( externalCO, SIGNAL( activated(const QString&) ), this, SLOT( templateChanged() ) );
-    connect( extraED, SIGNAL( textChanged(const QString&) ), this, SLOT( extraChanged(const QString&) ) );
-    connect( extraFormatCO, SIGNAL( activated(const QString&) ), this, SLOT( formatChanged(const QString&) ) );
-    connect( widthUnitCO, SIGNAL( activated(int) ), this, SLOT( widthUnitChanged() ) );
-    connect( heightUnitCO, SIGNAL( selectionChanged(LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
-    connect( displayCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
-    connect( displayscaleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
-    connect( angleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
-    connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
-    connect( heightED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
-    connect( fileED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
-    connect( clipCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
-    connect( getbbPB, SIGNAL( clicked() ), this, SLOT( getbbClicked() ) );
-    connect( xrED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-    connect( ytED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-    connect( xlED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-    connect( ybED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
-    connect( draftCB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
+       connect( displayCB, SIGNAL( toggled(bool) ), showCO, SLOT( setEnabled(bool) ) );
+       connect( displayCB, SIGNAL( toggled(bool) ), displayscaleED, SLOT( setEnabled(bool) ) );
+       connect( showCO, SIGNAL( activated(const QString&) ), this, SLOT( change_adaptor() ) );
+       connect( originCO, SIGNAL( activated(int) ), this, SLOT( change_adaptor() ) );
+       connect( aspectratioCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
+       connect( browsePB, SIGNAL( clicked() ), this, SLOT( browseClicked() ) );
+       connect( editPB, SIGNAL( clicked() ), this, SLOT( editClicked() ) );
+       connect( externalCO, SIGNAL( activated(const QString&) ), this, SLOT( templateChanged() ) );
+       connect( extraED, SIGNAL( textChanged(const QString&) ), this, SLOT( extraChanged(const QString&) ) );
+       connect( extraFormatCO, SIGNAL( activated(const QString&) ), this, SLOT( formatChanged(const QString&) ) );
+       connect( widthUnitCO, SIGNAL( activated(int) ), this, SLOT( widthUnitChanged() ) );
+       connect( heightUnitCO, SIGNAL( selectionChanged(LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
+       connect( displayCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
+       connect( displayscaleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
+       connect( angleED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
+       connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
+       connect( heightED, SIGNAL( textChanged(const QString&) ), this, SLOT( sizeChanged() ) );
+       connect( fileED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
+       connect( clipCB, SIGNAL( stateChanged(int) ), this, SLOT( change_adaptor() ) );
+       connect( getbbPB, SIGNAL( clicked() ), this, SLOT( getbbClicked() ) );
+       connect( xrED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
+       connect( ytED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
+       connect( xlED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
+       connect( ybED, SIGNAL( textChanged(const QString&) ), this, SLOT( bbChanged() ) );
+       connect( draftCB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
 
        QIntValidator * validator = new QIntValidator(displayscaleED);
        validator->setBottom(1);
@@ -110,7 +108,7 @@ void QExternalDialog::show()
 
 bool QExternalDialog::activateAspectratio() const
 {
-       if (widthUnitCO->currentItem() == 0)
+       if (widthUnitCO->currentIndex() == 0)
                return false;
 
        string const wstr = fromqstr(widthED->text());
@@ -145,7 +143,7 @@ void QExternalDialog::bbChanged()
 
 void QExternalDialog::browseClicked()
 {
-       int const choice =  externalCO->currentItem();
+       int const choice =  externalCO->currentIndex();
        string const template_name =
                form_->controller().getTemplate(choice).lyxName;
        string const str =
@@ -212,7 +210,7 @@ void QExternalDialog::templateChanged()
 
 void QExternalDialog::widthUnitChanged()
 {
-       bool useHeight = (widthUnitCO->currentItem() > 0);
+       bool useHeight = (widthUnitCO->currentIndex() > 0);
 
        if (useHeight)
                widthED->setValidator(unsignedLengthValidator(widthED));
@@ -226,3 +224,5 @@ void QExternalDialog::widthUnitChanged()
 
 } // namespace frontend
 } // namespace lyx
+
+#include "QExternalDialog_moc.cpp"