#include <QApplication>
#include <QBoxLayout>
+#ifndef QT_NO_CLIPBOARD
#include <QClipboard>
+#endif
#include <QDebug>
#include <QDockWidget>
#include <QHeaderView>
setupEditorPage();
// Signals
+#ifndef QT_NO_CLIPBOARD
connect(qApp->clipboard(), SIGNAL(dataChanged()),
SLOT(clipboardChanged()));
+#endif
connect(m_dataModel, SIGNAL(modelAppended()),
SLOT(messageModelAppended()));
connect(m_dataModel, SIGNAL(modelDeleted(int)),
m_tabOrderTimer.setSingleShot(true);
connect(&m_tabOrderTimer, SIGNAL(timeout()), SLOT(reallyFixTabOrder()));
+#ifndef QT_NO_CLIPBOARD
clipboardChanged();
+#endif
setWhatsThis(tr("This whole panel allows you to view and edit "
"the translation of some source text."));
m_selectionHolder = (te->textCursor().hasSelection() ? te : 0);
if (FormatTextEdit *fte = qobject_cast<FormatTextEdit*>(m_selectionHolder))
connect(fte, SIGNAL(editorDestroyed()), SLOT(editorDestroyed()));
+#ifndef QT_NO_CLIPBOARD
updateCanCutCopy();
+#endif
}
}
clearSelection(m_selectionHolder);
disconnect(this, SLOT(editorDestroyed()));
m_selectionHolder = 0;
+#ifndef QT_NO_CLIPBOARD
updateCanCutCopy();
+#endif
}
}
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
if (ke->modifiers() & Qt::ControlModifier) {
+#ifndef QT_NO_CLIPBOARD
if (ke->key() == Qt::Key_C) {
if (m_source->getEditor()->textCursor().hasSelection()) {
m_source->getEditor()->copy();
m_pluralSource->getEditor()->copy();
return true;
}
- } else if (ke->key() == Qt::Key_A) {
+ } else
+#endif
+ if (ke->key() == Qt::Key_A) {
return true;
}
}
emit activeModelChanged(activeModel());
updateBeginFromSource();
updateUndoRedo();
+#ifndef QT_NO_CLIPBOARD
updateCanPaste();
+#endif
}
}
widget->clearTranslation();
m_editors[j].transCommentText->clearTranslation();
}
+#ifndef QT_NO_CLIPBOARD
emit pasteAvailable(false);
+#endif
updateBeginFromSource();
updateUndoRedo();
}
widget->setEditingEnabled(enabled);
ed.transCommentText->setEditingEnabled(enabled);
+#ifndef QT_NO_CLIPBOARD
updateCanPaste();
+#endif
}
void MessageEditor::setLengthVariants(bool on)
}
}
+#ifndef QT_NO_CLIPBOARD
void MessageEditor::cut()
{
m_selectionHolder->cut();
m_clipboardEmpty = qApp->clipboard()->text().isNull();
updateCanPaste();
}
+#endif
void MessageEditor::selectAll()
{
emit activeModelChanged(activeModel());
updateBeginFromSource();
updateUndoRedo();
+#ifndef QT_NO_CLIPBOARD
updateCanPaste();
+#endif
} else {
m_editors[model].transTexts.first()->getEditors().first()->setFocus();
}
void undoAvailable(bool avail);
void redoAvailable(bool avail);
+#ifndef QT_NO_CLIPBOARD
void cutAvailable(bool avail);
void copyAvailable(bool avail);
void pasteAvailable(bool avail);
+#endif
void beginFromSourceAvailable(bool enable);
public slots:
void undo();
void redo();
+#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
void paste();
+#endif
void selectAll();
void beginFromSource();
void setEditorFocus();
void resetHoverSelection();
void emitTranslationChanged(QTextEdit *);
void emitTranslatorCommentChanged(QTextEdit *);
+#ifndef QT_NO_CLIPBOARD
void updateCanPaste();
void clipboardChanged();
+#endif
void messageModelAppended();
void messageModelDeleted(int model);
void allModelsDeleted();
QStringList translations(int model) const;
void updateBeginFromSource();
void updateUndoRedo();
+#ifndef QT_NO_CLIPBOARD
void updateCanCutCopy();
+#endif
void addPluralForm(int model, const QString &label, bool writable);
void fixTabOrder();
QPalette paletteForModel(int model) const;