|
a/src/qtgui/preview_w.cpp |
|
b/src/qtgui/preview_w.cpp |
|
... |
|
... |
326 |
PreviewTextEdit *edit = 0;
|
326 |
PreviewTextEdit *edit = 0;
|
327 |
if (tw) {
|
327 |
if (tw) {
|
328 |
edit = tw->findChild<PreviewTextEdit*>("pvEdit");
|
328 |
edit = tw->findChild<PreviewTextEdit*>("pvEdit");
|
329 |
}
|
329 |
}
|
330 |
return edit;
|
330 |
return edit;
|
|
|
331 |
}
|
|
|
332 |
|
|
|
333 |
// Save current document to file
|
|
|
334 |
void Preview::emitSaveDocToFile()
|
|
|
335 |
{
|
|
|
336 |
PreviewTextEdit *ce = currentEditor();
|
|
|
337 |
if (ce && !ce->m_dbdoc.url.empty()) {
|
|
|
338 |
emit saveDocToFile(ce->m_dbdoc);
|
|
|
339 |
}
|
331 |
}
|
340 |
}
|
332 |
|
341 |
|
333 |
// Perform text search. If next is true, we look for the next match of the
|
342 |
// Perform text search. If next is true, we look for the next match of the
|
334 |
// current search, trying to advance and possibly wrapping around. If next is
|
343 |
// current search, trying to advance and possibly wrapping around. If next is
|
335 |
// false, the search string has been modified, we search for the new string,
|
344 |
// false, the search string has been modified, we search for the new string,
|
|
... |
|
... |
889 |
// in editor->m_richtxt
|
898 |
// in editor->m_richtxt
|
890 |
bool textempty = fdoc.text.empty();
|
899 |
bool textempty = fdoc.text.empty();
|
891 |
if (!textempty)
|
900 |
if (!textempty)
|
892 |
fdoc.text.clear();
|
901 |
fdoc.text.clear();
|
893 |
editor->m_fdoc = fdoc;
|
902 |
editor->m_fdoc = fdoc;
|
|
|
903 |
editor->m_dbdoc = idoc;
|
894 |
if (textempty)
|
904 |
if (textempty)
|
895 |
editor->displayFields();
|
905 |
editor->displayFields();
|
896 |
|
906 |
|
897 |
// If this is an image, display it instead of the text.
|
907 |
// If this is an image, display it instead of the text.
|
898 |
if (!idoc.mimetype.compare(0, 6, "image/")) {
|
908 |
if (!idoc.mimetype.compare(0, 6, "image/")) {
|
|
... |
|
... |
996 |
break;
|
1006 |
break;
|
997 |
}
|
1007 |
}
|
998 |
popup->addAction(tr("Select All"), this, SLOT(selectAll()));
|
1008 |
popup->addAction(tr("Select All"), this, SLOT(selectAll()));
|
999 |
popup->addAction(tr("Copy"), this, SLOT(copy()));
|
1009 |
popup->addAction(tr("Copy"), this, SLOT(copy()));
|
1000 |
popup->addAction(tr("Print"), this, SLOT(print()));
|
1010 |
popup->addAction(tr("Print"), this, SLOT(print()));
|
|
|
1011 |
// Need to check ipath until we fix the internfile bug that always
|
|
|
1012 |
// has it convert to html for top level docs
|
|
|
1013 |
if (!m_dbdoc.url.empty() && !m_dbdoc.ipath.empty())
|
|
|
1014 |
popup->addAction(tr("Save document to file"),
|
|
|
1015 |
m_preview, SLOT(emitSaveDocToFile()));
|
1001 |
popup->popup(mapToGlobal(pos));
|
1016 |
popup->popup(mapToGlobal(pos));
|
1002 |
}
|
1017 |
}
|
1003 |
|
1018 |
|
1004 |
// Display main text
|
1019 |
// Display main text
|
1005 |
void PreviewTextEdit::displayText()
|
1020 |
void PreviewTextEdit::displayText()
|