backbone must provide way to create them at start (with specific Settings) and
distinguish each ditionary.
- Backbone also manages bookmarks and history: providing interface to gui.
+ Backbone also manages bookmarks and history: providing interface to GUI.
Backbone is also responsible for saving and spawning session via configs
file (stored in ~/.mdictionary) -> configs are kind of tricky because
configuration (apart from dictionaries and plugin ones).
Other modules may set some internal backbone behaviour via \see setSettings():
- Settings object with option given:
+ Settings object with options given:
* history_size - int, size of stored searches
* search_limit - int, how many different words each dictionary may return
* search_dictionaries - true/false, whether search in dictionaries
* search_bookmarks - true/false, whether search in bookmarks
Searching schema:
- First GUI should ask for list of words matching given pattern
+ At first GUI should ask for list of words matching given pattern,
then each Translation object is capable of finding its own final translation
List of words:
- - Gui calls search(...)
+ - GUI calls search(...)
- Backbone calls plugins searchWordList(...) in idealThreadCount()+1 threads
- - Backbone sets the FutureWatcher to be notifed when plugins are done
- - Backbone fetches results from Future<..> and formats it for gui then
+ - Backbone sets the FutureWatcher to be notified when plugins are done
+ - Backbone fetches results from Future<..> and formats it for GUI, then
emits ready()
- - Gui calls result()
+ - GUI calls result()
Final translation:
- - Gui calls searchHtml()
- - Backbone starts for each translation object toHtml in separate threads
+ - GUI calls searchHtml()
+ - Backbone starts toHtml for each translation object in separate threads
- Backbone sets FutureWatcher to be notified after last toHtml returns
- Backbone fetches translation from Future<...> objects and calls
htmlReady()
/*! Searching for list of bookmarks may take some time, so I moved it to
- new thread (to avoid gui blocking), further it's consistent with ordinary
+ new thread (to avoid GUI blocking), further it's consistent with ordinary
searching for list of words (\see search)
*/
void fetchBookmarks() {
void bookmarksReady();
/*! emitted by direct connection to plugins notifying signals
- \param Notify::NotifyType gui may decide to show different types in
+ \param Notify::NotifyType GUI may decide to show different types in
different ways
\param QString text of the notification
*/
bool dryRun; // mainly for testing - when true then doesn't bother configs etc
bool stopped; // true when user stops searching/fetching
- bool bookmarkFin, dictFin; // inform whether given search type is ready
+ bool bookmarkFin, dictFin; // informs whether given search type is ready
bool _searchDicts, _searchBookmarks; // whether search performed in given source
Bookmarks _bookmarks;
void addInternalDictionary(CommonDictInterface*, bool);
void savePrefs(QSettings*);
- CommonDictInterface* plugin(QString type); // search for given type plugin
+ CommonDictInterface* plugin(QString type); // searches for plugin of given type
QList<CommonDictInterface*> activeDicts();
bool containsDict(uint hash) const;
int _dictNum;