#include <config.h>
#include "GuiSendto.h"
+#include "qt_helpers.h"
#include "Buffer.h"
#include "Converter.h"
#include "Format.h"
#include "FuncRequest.h"
#include "LyXRC.h"
-#include "qt_helpers.h"
+#include "support/qstring_helpers.h"
#include "support/filetools.h"
-#include "support/lstrings.h"
#include <QListWidget>
#include <QPushButton>
-#include <QCloseEvent>
using namespace std;
using namespace lyx::support;
GuiSendTo::GuiSendTo(GuiView & lv)
- : GuiDialog(lv, "sendto")
+ : GuiDialog(lv, "sendto", qt_("Send Document to Command"))
{
setupUi(this);
- setViewTitle(_("Send Document to Command"));
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
}
-void GuiSendTo::closeEvent(QCloseEvent * e)
-{
- slotClose();
- e->accept();
-}
-
-
void GuiSendTo::updateContents()
{
all_formats_ = allFormats();
for (vector<string>::const_iterator it = keys.begin();
it != keys.end(); ++it) {
- formatLW->addItem(toqstr(*it));
+ formatLW->addItem(qt_(*it));
}
- commandCO->addItem(toqstr(command_));
+ commandCO->addItem(command_);
}
{
int const line = formatLW->currentRow();
- if (line < 0 || line > int(formatLW->count()))
+ if (line < 0 || line > formatLW->count())
return;
format_ = all_formats_[line];
- command_ = trim(fromqstr(commandCO->currentText()));
+ command_ = commandCO->currentText().trimmed();
}
bool GuiSendTo::initialiseParams(string const &)
{
format_ = 0;
- command_ = lyxrc.custom_export_command;
+ command_ = toqstr(lyxrc.custom_export_command);
return true;
}
void GuiSendTo::dispatchParams()
{
- if (command_.empty() || !format_ || format_->name().empty())
+ if (command_.isEmpty() || !format_ || format_->name().empty())
return;
- string const data = format_->name() + " " + command_;
+ string const data = format_->name() + " " + fromqstr(command_);
dispatch(FuncRequest(getLfun(), data));
}