lokalize
tmtab.cpp
Go to the documentation of this file.
69 setHeaderData(TMDBModel::Target, Qt::Horizontal, i18nc("@title:column Text in target language","Target"));
72 setHeaderData(TMDBModel::TransationStatus, Qt::Horizontal, i18nc("@title:column","Translation Status"));
104 sourceQuery="AND source_strings.source "%invertSourceStr%"LIKE '%"+escapedSource+"%' ESCAPE '\b' ";
106 targetQuery="AND target_strings.target "%invertTargetStr%"LIKE '%"+escapedTarget+"%' ESCAPE '\b' ";
116 sourceQuery="AND source_strings.source "+invertSourceStr+"LIKE '%"+sourceList.join("%' AND source_strings.source "+invertSourceStr+"LIKE '%")+"%' ";
118 targetQuery="AND target_strings.target "+invertTargetStr+"LIKE '%"+targetList.join("%' AND target_strings.target "+invertTargetStr+"LIKE '%")+"%' ";
180 if (QSqlQueryModel::data(item.sibling(item.row(),Target), Qt::DisplayRole).toString().isEmpty())
191 else if (role==Qt::FontRole && item.column()==TMDBModel::Target) //TODO Qt::ForegroundRole -- brush for orphaned entries
215 else if (item.column()<TMDBModel::Context && !record(item.row()).isNull(TMDBModel::_SourceAccel+item.column()) )//source, target
241 return convertToHtml(result.toString(), item.column()==TMDBModel::Target && !rowIsApproved(item.row()));
269 bool TMResultsSortFilterProxyModel::lessThan(const QModelIndex& left, const QModelIndex& right) const
338 bool TMResultsSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
343 QString source=sourceModel()->index(source_row, TMDBModel::Source, source_parent).data().toString();
344 QString target=sourceModel()->index(source_row, TMDBModel::Target, source_parent).data().toString();
432 //QShortcut* shortcut = new QShortcut(Qt::CTRL + Qt::Key_P,view,0,0,Qt::WidgetWithChildrenShortcut);
458 //connect(m_model,SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),view->itemDelegate(),SLOT(reset()));
467 connect(ui_queryOptions->queryStyle,SIGNAL(currentIndexChanged(int)),m_model,SLOT(setQueryType(int)));
478 static const int maxInitialWidths[4]={QApplication::desktop()->availableGeometry().width()/3,QApplication::desktop()->availableGeometry().width()/3, 50, 200};
495 KActionCategory* tm=new KActionCategory(i18nc("@title actions category","Translation Memory"), ac);
511 view->header()->restoreState(QByteArray::fromBase64( cg.readEntry("TMSearchResultsHeaderState", QByteArray()) ));
518 cg.writeEntry("TMSearchResultsHeaderState",ui_queryOptions->treeView->header()->saveState().toBase64());
563 KLineEdit* const source_target_query[]={ui_queryOptions->queryTarget,ui_queryOptions->querySource};
564 source_target_query[m_partToAlsoTryLater==DocPosition::Source]->setText(source_target_query[m_partToAlsoTryLater!=DocPosition::Source]->text());
568 DocPosition::Comment; //leave a note that we should also try w/o package if the current one doesn't succeed
595 QApplication::clipboard()->setText( ui_queryOptions->treeView->currentIndex().sibling(ui_queryOptions->treeView->currentIndex().row(),column).data().toString());
611 emit fileOpenRequested(item.sibling(item.row(),TMDBModel::Filepath).data(Qt::UserRole).toString(),
723 QDBusConnection::sessionBus().registerObject("/ThisIsWhatYouWant/TranslationMemory/" + QString::number(m_dbusId), this);
751 KLineEdit* const source_target_query[]={ui_queryOptions->queryTarget,ui_queryOptions->querySource};
Definition: tmtab.h:124
bool canConvert(Type t) const
qlonglong toLongLong(bool *ok) const
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
int scanRecursive(const QList< QUrl > &urls, const QString &dbName)
wrapper. returns gross number of jobs started
Definition: tmscanapi.cpp:92
Qt::KeyboardModifiers modifiers() const
QString cap(int nth) const
void setShortcutContext(Qt::ShortcutContext context)
Type type() const
const QMimeData * mimeData() const
Definition: tmtab.h:121
Definition: pos.h:44
Definition: jobs.h:356
void addAction(QAction *action)
QVariant value(int index) const
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
Definition: tmtab.h:138
QSqlRecord record() const
bool restoreState(const QByteArray &state)
const T & at(int i) const
int size() const
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
QDBusConnection sessionBus()
QVariant data(const QModelIndex &item, int role=Qt::DisplayRole) const
Definition: tmtab.cpp:186
QString join(const QString &separator) const
void sortByColumn(int column, Qt::SortOrder order)
QString & remove(int position, int n)
void finalResultCountFetched(int)
int size() const
void resultsFetched()
int matchedLength() const
int indexIn(const QString &str, int offset, CaretMode caretMode) const
void clear()
Definition: tmtab.h:131
void setColumnWidth(int column, int width)
QFont font()
QString number(int n, int base)
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role)
void append(const T &value)
QString & insert(int position, QChar ch)
virtual QVariant data(const QModelIndex &index, int role) const
int toInt(bool *ok) const
QClipboard * clipboard()
QVariant value(int index) const
QString lastQuery() const
Qt::MouseButton button() const
Definition: tmtab.h:132
bool isEmpty() const
bool isEmpty() const
int removeAll(const T &value)
void setItemDelegate(QAbstractItemDelegate *delegate)
int row() const
Definition: tmtab.h:123
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
bool next()
void setOverrideCursor(const QCursor &cursor)
QAbstractItemDelegate * itemDelegate() const
void slotQueryExecuted(ThreadWeaver::Job *)
Definition: tmtab.cpp:157
void restoreOverrideCursor()
void fileOpenRequested(const KUrl &url, const QString &source, const QString &ctxt)
void deleteLater()
void hide()
Definition: tmtab.h:118
Definition: tmtab.h:110
remember to connect appropriate signals to reset slot for delegate to have actual cache ...
Definition: fastsizehintitemdelegate.h:42
Definition: tmtab.h:122
Definition: tmtab.h:117
Definition: tmtab.h:119
int key() const
void setColumnHidden(int column, bool hide)
void accept()
bool contains(QChar ch, Qt::CaseSensitivity cs) const
virtual QVariant data(const QModelIndex &item, int role) const
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void setShortcut(const QKeySequence &shortcut)
void setItalic(bool enable)
int findMatchingRule(const QVector< Rule > &rules, const QString &source, const QString &target, QVector< StartLen > &positions)
Definition: qaview.cpp:100
QString & replace(int position, int n, QChar after)
Definition: tmtab.h:120
void setSortingEnabled(bool enable)
int width() const
QAction * toggleViewAction() const
StatusBarProxy statusBarItems
Definition: lokalizesubwindowbase.h:63
QVariant data(int role) const
QDesktopWidget * desktop()
QList< QUrl > urls() const
QByteArray fromBase64(const QByteArray &base64)
virtual void fetchMore(const QModelIndex &parent)
void insert(int i, const T &value)
QString convertToHtml(QString str, bool italics)
Definition: fastsizehintitemdelegate.cpp:119
QModelIndex sibling(int row, int column) const
Definition: pos.h:43
void setFilter(const QString &source, const QString &target, bool invertSource, bool invertTarget, const QString &filemask)
Definition: tmtab.cpp:85
virtual void setModel(QAbstractItemModel *model)
Definition: qaview.h:36
QTextCodec * codecForMib(int mib)
int column() const
bool canEncode(QChar ch) const
Definition: tmtab.h:130
Definition: tmtab.h:137
bool isValid() const
const QRect availableGeometry(int screen) const
Definition: tmtab.h:125
void setText(const QString &text, Mode mode)
QHeaderView * header() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual int rowCount(const QModelIndex &parent) const
Definition: pos.h:42
QChar * data()
QString toString() const
Q_SCRIPTABLE bool findGuiTextPackage(QString text, QString package)
Definition: tmtab.cpp:747
void setQuery(const QSqlQuery &query)
virtual QVariant data(const QModelIndex &index, int role) const
Definition: pos.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.