lokalize
editortab.cpp
Go to the documentation of this file.
129 connect(SettingsController::instance(),SIGNAL(generalSettingsChanged()),m_view, SLOT(settingsChanged()));
133 connect(m_view, SIGNAL(tmLookupRequested(DocPosition::Part,QString)), this, SLOT(lookupSelectionInTranslationMemory()));
135 connect(this, SIGNAL(fileOpened()), this, SLOT(indexWordsForCompletion()),Qt::QueuedConnection);
137 connect (m_catalog,SIGNAL(signalFileAutoSaveFailed(QString)),this,SLOT(fileAutoSaveFailedWarning(QString)));
166 statusBarItems.insert(ID_STATUS_FUZZY,i18nc("@info:status message entries\n'fuzzy' in gettext terminology","Not ready: %1",0));
167 statusBarItems.insert(ID_STATUS_UNTRANS,i18nc("@info:status message entries","Untranslated: %1",0));
171 connect(m_catalog,SIGNAL(signalNumberOfEmptyChanged()),this,SLOT(numberOfUntranslatedChanged()));
176 QString text=i18nc("@info:status message entries\n'fuzzy' in gettext terminology","Not ready: %1", count);
217 KActionCategory* glossary=new KActionCategory(i18nc("@title actions category","Glossary"), actionCollection());
218 KActionCategory* tools=new KActionCategory(i18nc("@title actions category","Tools"), actionCollection());
249 actionCollection()->addAction( QLatin1String("showmsgiddiff_action"), m_altTransView->toggleViewAction() );
250 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),m_altTransView,SLOT(slotNewEntryDisplayed(DocPosition)));
252 connect (m_altTransView,SIGNAL(refreshRequested()),m_view,SLOT(gotoEntry()),Qt::QueuedConnection);
258 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),m_syncView,SLOT(slotNewEntryDisplayed(DocPosition)));
265 sync2->addAction( QLatin1String("showmergeviewsecondary_action"), m_syncViewSecondary->toggleViewAction() );
266 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),m_syncViewSecondary,SLOT(slotNewEntryDisplayed(DocPosition)));
268 connect (m_catalog,SIGNAL(signalFileLoaded(KUrl)),m_syncViewSecondary,SLOT(mergeOpen(KUrl)),Qt::QueuedConnection);
274 actionCollection()->addAction( QLatin1String("showcatalogtreeview_action"), m_transUnitsView->toggleViewAction() );
275 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),m_transUnitsView,SLOT(slotNewEntryDisplayed(DocPosition)));
276 connect (m_transUnitsView,SIGNAL(gotoEntry(DocPosition,int)),this,SLOT(gotoEntry(DocPosition,int)));
283 actionCollection()->addAction( QLatin1String("showmsgctxt_action"), m_notesView->toggleViewAction() );
285 connect(m_notesView,SIGNAL(srcFileOpenRequested(QString,int)),this,SLOT(dispatchSrcFileOpenRequest(QString,int)));
322 connect (_tmView,SIGNAL(fileOpenRequested(KUrl,QString,QString)),this,SIGNAL(fileOpenRequested(KUrl,QString,QString)));
324 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),m_catalog,SLOT(flushUpdateDBBuffer()));
325 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),_tmView,SLOT(slotNewEntryDisplayed(DocPosition))); //do this after flushUpdateDBBuffer
363 GlossaryNS::GlossaryView* _glossaryView = new GlossaryNS::GlossaryView(this,m_catalog,gactions);
365 glossary->addAction( QLatin1String("showglossaryview_action"), _glossaryView->toggleViewAction() );
366 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),_glossaryView,SLOT(slotNewEntryDisplayed(DocPosition)));
378 connect(m_view,SIGNAL(binaryUnitSelectRequested(QString)),binUnitsView,SLOT(selectUnit(QString)));
409 actionCollection()->addAction( QLatin1String("showwebqueryview_action"), _webQueryView->toggleViewAction() );
410 connect (this,SIGNAL(signalNewEntryDisplayed(DocPosition)),_webQueryView,SLOT(slotNewEntryDisplayed(DocPosition)));
480 action = actionCategory->addAction("edit_approve", new KToolBarPopupAction(KIcon("approved"),i18nc("@option:check whether message is marked as translated/reviewed/approved (depending on your role)","Approved"),this));
484 connect(m_view, SIGNAL(signalApprovedEntryDisplayed(bool)),this,SIGNAL(signalApprovedEntryDisplayed(bool)));
486 connect(this, SIGNAL(signalApprovedEntryDisplayed(bool)),this,SLOT(msgStrChanged()),Qt::QueuedConnection);
513 ADD_ACTION_SHORTCUT_ICON("edit_msgid2msgstr",i18nc("@action:inmenu","Copy source to target"),copyShortcut,"msgid2msgstr")
516 ADD_ACTION_SHORTCUT("edit_unwrap-target",i18nc("@action:inmenu","Unwrap target"),Qt::CTRL+Qt::Key_I)
570 ADD_ACTION_SHORTCUT_ICON("go_prev_fuzzy",i18nc("@action:inmenu\n'not ready' means 'fuzzy' in gettext terminology","Previous non-empty but not ready"),Qt::CTRL+Qt::Key_PageUp,"prevfuzzy")
575 ADD_ACTION_SHORTCUT_ICON("go_next_fuzzy",i18nc("@action:inmenu\n'not ready' means 'fuzzy' in gettext terminology","Next non-empty but not ready"),Qt::CTRL+Qt::Key_PageDown,"nextfuzzy")
580 ADD_ACTION_SHORTCUT_ICON("go_prev_untrans",i18nc("@action:inmenu","Previous untranslated"),Qt::ALT+Qt::Key_PageUp,"prevuntranslated")
582 connect( m_view->viewPort(), SIGNAL(gotoPrevUntranslatedRequested()), this, SLOT(gotoPrevUntranslated()) );
585 ADD_ACTION_SHORTCUT_ICON("go_next_untrans",i18nc("@action:inmenu","Next untranslated"),Qt::ALT+Qt::Key_PageDown,"nextuntranslated")
587 connect( m_view->viewPort(), SIGNAL(gotoNextUntranslatedRequested()), this, SLOT(gotoNextUntranslated()) );
590 ADD_ACTION_SHORTCUT_ICON("go_prev_fuzzyUntr",i18nc("@action:inmenu\n'not ready' means 'fuzzy' in gettext terminology","Previous not ready"),Qt::CTRL+Qt::SHIFT/*ALT*/+Qt::Key_PageUp,"prevfuzzyuntrans")
592 connect( m_view->viewPort(), SIGNAL(gotoPrevFuzzyUntrRequested()), this, SLOT(gotoPrevFuzzyUntr()) );
595 ADD_ACTION_SHORTCUT_ICON("go_next_fuzzyUntr",i18nc("@action:inmenu\n'not ready' means 'fuzzy' in gettext terminology","Next not ready"),Qt::CTRL+Qt::SHIFT+Qt::Key_PageDown,"nextfuzzyuntrans")
597 connect( m_view->viewPort(), SIGNAL(gotoNextFuzzyUntrRequested()), this, SLOT(gotoNextFuzzyUntr()) );
626 ADD_ACTION_SHORTCUT("tools_tm_batch",i18nc("@action:inmenu","Fill in all exact suggestions"),Qt::CTRL+Qt::ALT+Qt::Key_B)
630 ADD_ACTION_SHORTCUT("tools_tm_batch_fuzzy",i18nc("@action:inmenu","Fill in all exact suggestions and mark as fuzzy"),Qt::CTRL+Qt::ALT+Qt::Key_N)
634 ADD_ACTION_SHORTCUT("tools_wordcount",i18nc("@action:inmenu","Word count"),Qt::CTRL+Qt::ALT+Qt::Key_C)
640 action->setStatusTip(i18nc("@info:status","Open catalog to be merged into the current one / replicate base file changes to"));
647 action->setStatusTip(i18nc("@info:status","Previous entry which is translated differently in the file being merged, including empty translations in merge source"));
656 action->setStatusTip(i18nc("@info:status","Next entry which is translated differently in the file being merged, including empty translations in merge source"));
672 connect( m_syncView, SIGNAL(signalEntryWithMergeDisplayed(bool)),action,SLOT(setEnabled(bool)));
677 action->setStatusTip(i18nc("@info:status","This changes only empty and non-ready entries in base file"));
693 action->setStatusTip(i18nc("@info:status","Open catalog to be merged into the current one / replicate base file changes to"));
700 action->setStatusTip(i18nc("@info:status","Previous entry which is translated differently in the file being merged, including empty translations in merge source"));
703 connect( m_syncViewSecondary, SIGNAL(signalPriorChangedAvailable(bool)),action,SLOT(setEnabled(bool)) );
708 action->setStatusTip(i18nc("@info:status","Next entry which is translated differently in the file being merged, including empty translations in merge source"));
711 connect( m_syncViewSecondary, SIGNAL(signalNextChangedAvailable(bool)),action,SLOT(setEnabled(bool)) );
716 connect( m_syncViewSecondary, SIGNAL(signalEntryWithMergeDisplayed(bool)),action,SLOT(setEnabled(bool)));
719 action = sync2->addAction("mergesecondary_acceptnew",m_syncViewSecondary,SLOT(mergeAcceptAllForEmpty()));
811 url=KFileDialog::getOpenFileName(baseUrl, Catalog::supportedMimeFilters + " text/x-gettext-translation-template", SettingsController::instance()->mainWindowPtr());
841 statusBarItems.insert(ID_STATUS_TOTAL,i18nc("@info:status message entries","Total: %1", m_catalog->numberOfEntries()));
891 if (errorLine>0) KMessageBox::error(this, i18nc("@info","Error opening the file <filename>%1</filename>, line: %2",url.pathOrUrl(),errorLine) );
892 else KMessageBox::error(this, i18nc("@info","Error opening the file <filename>%1</filename>",url.pathOrUrl()) );
1050 statusBarItems.insert(ID_STATUS_CURRENT,i18nc("@info:status","Current: %1", m_currentPos.entry+1));
1250 QAction* a=m_approveAction->menu()->addAction(i18nc("@info:status 'fuzzy' in gettext terminology","Needs review"));
1255 a=m_approveAction->menu()->addAction(i18nc("@info:status 'non-fuzzy' in gettext terminology","Ready"));
1375 KMessageBox::information(this, i18nc("@info","Cannot open source files: no scripts to do so are currently loaded. "
1376 "Refer to the Lokalize handbook for script examples and how to plug them into your project.") );
1395 QDBusConnection::sessionBus().registerObject("/ThisIsWhatYouWant/Editor/" + QString::number(m_dbusId), this);
1407 void EditorTab::lookupSelectionInTranslationMemory(){emit tmLookupRequested(selectionInSource(),selectionInTarget());}
1410 void EditorTab::setEntryFilteredOut(int entry, bool filteredOut){m_transUnitsView->setEntryFilteredOut(entry, filteredOut);}
1411 void EditorTab::setEntriesFilteredOut(bool filteredOut){m_transUnitsView->setEntriesFilteredOut(filteredOut);}
1414 QString EditorTab::entrySource(int entry, int form){return m_catalog->sourceWithTags(DocPosition(entry, form)).string;}
1415 QString EditorTab::entryTarget(int entry, int form){return m_catalog->targetWithTags(DocPosition(entry, form)).string;}
1416 int EditorTab::entryPluralFormCount(int entry){return m_catalog->isPlural(entry)?m_catalog->numberOfPluralForms():1;}
1420 void EditorTab::addEntryNote(int entry, const QString& note){m_notesView->addNote(entry, note);}
1421 void EditorTab::addTemporaryEntryNote(int entry, const QString& note){m_notesView->addTemporaryEntryNote(entry, note);}
1423 void EditorTab::addAlternateTranslation(int entry, const QString& translation){m_altTransView->addAlternateTranslation(entry, translation);}
1424 void EditorTab::addTemporaryAlternateTranslation(int entry, const QString& translation){m_altTransView->addAlternateTranslation(entry, translation);}
1425 void EditorTab::attachAlternateTranslationFile(const QString& path){m_altTransView->attachAltTransFile(path);}
void gotoEntry(const DocPosition &, int selection=0)
Definition: msgctxtview.cpp:78
void addAlternateTranslation(int entry, const QString &, bool temp=true)
Definition: alttransview.cpp:116
void gotoEntry(DocPosition pos=DocPosition(), int selection=0)
Definition: editorview.cpp:177
CatalogString targetWithTags(const DocPosition &pos) const
Definition: catalog.cpp:211
void signalApprovedEntryDisplayed(bool)
int loadFromUrl(const KUrl &url, const KUrl &saidUrl=KUrl(), int *fileSize=0, bool fast=false)
Definition: catalog.cpp:508
#define ADD_ACTION_SHORTCUT_ICON(_name, _text, _shortcut, _icon)
bool isApproved(TargetState state, ProjectLocal::PersonRole role)
Definition: catalog.cpp:993
Definition: pos.h:44
void addAction(QAction *action)
Definition: state.h:36
unlike other views, we keep data like catalog pointer in our child view: ui_queryControl contains our...
Definition: webqueryview.h:58
void setChecked(bool)
QVariant data() const
Definition: cataloglistview.h:41
const T & at(int i) const
bool isFloating() const
void signalEntryWithMergeDisplayed(bool, const DocPosition &)
static CompletionStorage * instance()
Definition: completionstorage.cpp:37
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
void signalEquivTranslatedEntryDisplayed(bool)
Definition: projectlocal.h:13
Q_SCRIPTABLE void srcFileOpenRequested(const QString &srcPath, int line)
void signalLastDisplayed(bool)
QDBusConnection sessionBus()
void signalNextFuzzyOrUntrAvailable(bool)
bool exists() const
Q_SCRIPTABLE void attachAlternateTranslationFile(const QString &path)
Definition: editortab.cpp:1425
Definition: state.h:32
void setActivePhase(const QString &phase, ProjectLocal::PersonRole role=ProjectLocal::Approver)
Definition: catalog.cpp:339
Q_SCRIPTABLE void setDesirablePath(const QString &path)
Definition: project.h:95
Q_SCRIPTABLE void addEntryNote(int entry, const QString ¬e)
Definition: editortab.cpp:1420
int size() const
#define ADD_ACTION_SHORTCUT(_name, _text, _shortcut)
void signalFirstDisplayed(bool)
GlossaryNS::GlossaryWindow * defineNewTerm(QString en=QString(), QString target=QString())
Definition: project.cpp:211
void signalNewEntryDisplayed(const DocPosition &)
QString number(int n, int base)
bool removeTargetSubstring(Catalog *catalog, DocPosition pos, int delStart, int delLen)
Definition: cmd.cpp:364
Q_SCRIPTABLE void setEntryFilteredOut(int entry, bool filteredOut)
Definition: editortab.cpp:1410
int toInt(bool *ok) const
void reflectNonApprovedCount(int count, int total)
Definition: editortab.cpp:174
Q_SCRIPTABLE void addTemporaryEntryNote(int entry, const QString ¬e)
Definition: editortab.cpp:1421
Definition: glossaryview.h:45
static QString content(QDomElement elem, ContentEditingData *data=0)
walks through XLIFF XML and performs actions depending on ContentEditingData:
Definition: tsstorage.cpp:170
Definition: state.h:42
Q_SCRIPTABLE void setEntriesFilteredOut(bool filteredOut)
Definition: editortab.cpp:1411
bool isEmpty() const
int removeAll(const T &value)
Q_SCRIPTABLE void fileOpened()
Q_SCRIPTABLE QString entrySource(int entry, int form)
Definition: editortab.cpp:1414
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
Q_SCRIPTABLE void entryDisplayed()
void setOverrideCursor(const QCursor &cursor)
Definition: tmview.h:49
Definition: mergeview.h:41
void addTemporaryEntryNote(int entry, const QString &text)
Definition: msgctxtview.cpp:235
void restoreOverrideCursor()
void signalNextBookmarkAvailable(bool)
void signalPriorFuzzyAvailable(bool)
void fileClosed()
void hide()
Definition: msgctxtview.h:38
Q_SCRIPTABLE void fileAboutToBeClosed()
void tmLookupRequested(DocPosition::Part, const QString &)
void reflectUntranslatedCount(int count, int total)
Definition: editortab.cpp:182
Q_SCRIPTABLE QString entryTarget(int entry, int form)
Definition: editortab.cpp:1415
void setData(const QVariant &userData)
QString toLower() const
Definition: state.h:40
bool contains(QChar ch, Qt::CaseSensitivity cs) const
void signalPriorFuzzyOrUntrAvailable(bool)
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
Q_SCRIPTABLE int entryPluralFormCount(int entry)
Definition: editortab.cpp:1416
void signalPriorBookmarkAvailable(bool)
void setCheckable(bool)
void signalPriorUntranslatedAvailable(bool)
QString & replace(int position, int n, QChar after)
data structure used to pass info about inline elements a XLIFF tag is represented by a TAGRANGE_IMAGE...
Definition: catalogstring.h:128
Definition: binunitsview.h:40
void insertCatalogString(Catalog *catalog, DocPosition pos, const CatalogString &catStr, int start)
Definition: cmd.cpp:421
bool isClean() const
void signalNextFuzzyAvailable(bool)
QAction * toggleViewAction() const
QString mid(int position, int n) const
void signalBookmarkDisplayed(bool)
Definition: catalogcapabilities.h:32
StatusBarProxy statusBarItems
Definition: lokalizesubwindowbase.h:63
Definition: editortab.h:60
void insert(int i, const T &value)
CatalogString sourceWithTags(const DocPosition &pos) const
Definition: catalog.cpp:203
Q_SCRIPTABLE void fileSaved(const QString &path)
This class represents a catalog It uses CatalogStorage interface to work with catalogs in different f...
Definition: catalog.h:74
void setEntryFilteredOut(int entry, bool filteredOut)
Definition: cataloglistview.cpp:302
void show()
Definition: alttransview.h:36
Q_SCRIPTABLE QByteArray currentFileContents()
Definition: editortab.cpp:1402
Definition: pos.h:42
void fileOpenRequested(const KUrl &path, const QString &str, const QString &ctxt)
void setEntriesFilteredOut(bool filteredOut=false)
Definition: cataloglistview.cpp:307
bool fileOpen(KUrl url=KUrl(), KUrl baseUrl=KUrl(), bool silent=false)
Definition: editortab.cpp:789
void signalNextUntranslatedAvailable(bool)
Q_SCRIPTABLE void addTemporaryAlternateTranslation(int entry, const QString &translation)
Definition: editortab.cpp:1424
Definition: phaseswindow.h:41
Definition: pos.h:45
Q_SCRIPTABLE void setEntryTarget(int entry, int form, const QString &content)
Definition: editortab.cpp:1427
Q_SCRIPTABLE void addAlternateTranslation(int entry, const QString &translation)
Definition: editortab.cpp:1423
void attachAltTransFile(const QString &)
Definition: alttransview.cpp:109
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.