#include "support/FileName.h"
#include "support/gettext.h"
+#include <QDialogButtonBox>
#include <QThread>
setupUi(this);
setModal(Qt::WindowModal);
- connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
- connect(closePB, SIGNAL(clicked()), this, SLOT(slotCancel()));
+ connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+ this, SLOT(slotButtonBox(QAbstractButton *)));
connect(newFilePB, SIGNAL(clicked()), this, SLOT(selectNewFile()));
connect(oldFilePB, SIGNAL(clicked()), this, SLOT(selectOldFile()));
newSettingsRB->setChecked(true);
trackingCB->setChecked(true);
- closePB->setCursor(Qt::ArrowCursor);
+ buttonBox->button(QDialogButtonBox::Ok)->setCursor(Qt::ArrowCursor);
bc().setPolicy(ButtonPolicy::OkApplyCancelPolicy);
- bc().setOK(okPB);
+ bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
}
GuiCompare::~GuiCompare()
if (lyxview().documentBufferView()) {
QString path = bufferFilePath();
filename = browseRelToParent(in_name, path, title, filters, false,
- qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+ qt_("D&ocuments"), toqstr(lyxrc.document_path));
} else {
QString path = toqstr(lyxrc.document_path);
QString rel_filename = browseRelToParent(in_name, path, title, filters, false,
- qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+ qt_("D&ocuments"), toqstr(lyxrc.document_path));
filename = makeAbsPath(rel_filename, path);
}
return filename;
oldFileLA->setEnabled(enable);
oldFilePB->setEnabled(enable);
oldFileCB->setEnabled(enable);
- okPB->setEnabled(enable);
+ buttonBox->button(QDialogButtonBox::Ok)->setEnabled(enable);
groupBox->setEnabled(enable);
progressBar->setEnabled(!enable);
if (enable)
- closePB->setText(qt_("Close"));
+ buttonBox->button(QDialogButtonBox::Cancel)->setText(qt_("Close"));
else
- closePB->setText(qt_("Cancel"));
+ buttonBox->button(QDialogButtonBox::Cancel)->setText(qt_("Cancel"));
}
}
+void GuiCompare::slotButtonBox(QAbstractButton * button)
+{
+ switch (buttonBox->standardButton(button)) {
+ case QDialogButtonBox::Ok:
+ slotOK();
+ break;
+ case QDialogButtonBox::Cancel:
+ slotCancel();
+ break;
+ default:
+ break;
+ }
+}
+
+
Buffer const * GuiCompare::bufferFromFileName(string const & file) const
{
FileName fname;