BibleTime
|
Functions | |
QString | fixSwordBcp47 (QString input) |
QIcon const & | getIconForModule (const CSwordModuleInfo *const module) |
bool | inHTMLTag (const int pos, const QString &text) |
void | initExplanationLabel (QLabel *label, const QString &heading, const QString &text) |
Initializes a QLabel to explain difficult things of dialogs. More... | |
int | mWidth (QWidget const &widget, int const mCount) |
Calculates a maximum rendered text width for a widget and a string with the a given length. More... | |
bool | savePlainFile (const QString &filename, void(&writer)(QTextStream &, void *), void *userPtr) |
bool | savePlainFile (QString const &filename, QString const &text) |
QString util::tool::fixSwordBcp47 | ( | QString | input | ) |
[in] | input | The potentially invalid BCP 47 string from Sword to fix. |
Definition at line 158 of file tool.cpp.
Referenced by CDisplaySettingsPage::initSwordLocaleCombo(), and CDisplaySettingsPage::resetLanguage().
QIcon const & util::tool::getIconForModule | ( | const CSwordModuleInfo * | module | ) |
[in] | module | the module whose icon to return. |
Definition at line 80 of file tool.cpp.
References CSwordModuleInfo::Bible, CSwordModuleInfo::category(), CSwordModuleInfo::Commentary, CSwordModuleInfo::Cult, CSwordModuleInfo::GenericBook, CSwordModuleInfo::isLocked(), CSwordModuleInfo::Lexicon, CSwordModuleInfo::type(), and CSwordModuleInfo::Unknown.
Referenced by Search::CModuleResultView::setupTree().
bool util::tool::inHTMLTag | ( | int | pos, |
const QString & | text | ||
) |
void util::tool::initExplanationLabel | ( | QLabel * | label, |
const QString & | heading, | ||
const QString & | text | ||
) |
Initializes a QLabel to explain difficult things of dialogs.
The label should be used to explain difficult things of the GUI, e.g. in the options dialog pages.
[in] | label | The label to initialize |
[in] | heading | The heading for the label. |
[in] | text | The text for the label. |
Definition at line 116 of file tool.cpp.
Referenced by BtSearchModuleChooserDialog::retranslateUi(), BtStandardWorksTab::retranslateUi(), and BtTextFiltersTab::retranslateUi().
int util::tool::mWidth | ( | QWidget const & | widget, |
int const | mCount | ||
) |
Calculates a maximum rendered text width for a widget and a string with the a given length.
This function can be used for setting the size for a widget. It may be better to roughly calculate the size based on some text width rather than use a hard- coded value.
[in] | widget | the widget whose font metrics to use. |
[in] | mCount | the length of the string of 'M' characters to use for calculating the width. |
Definition at line 155 of file tool.cpp.
Referenced by BtIndexDialog::BtIndexDialog(), Search::BtSearchResultArea::BtSearchResultArea(), Search::BtSearchOptionsArea::initView(), Search::CModuleResultView::initView(), and CBookmarkIndex::paintEvent().
bool util::tool::savePlainFile | ( | QString const & | filename, |
void(&)(QTextStream &, void *) | writer, | ||
void * | userPtr | ||
) |
Creates the file filename and writes to it using a callback..
[in] | filename | the filename to save to. |
[in] | writer | the writer callback. |
[in] | userPtr | arbitrary data passed on to the callback. |
[in] | fileCodec | the codec to use to save the given string data. |
Definition at line 35 of file tool.cpp.
References BT_ASSERT.
Referenced by BtBookmarksModel::save(), BtModelViewReadDisplay::save(), Search::CSearchAnalysisScene::saveAsHTML(), CExportManager::saveKey(), CExportManager::saveKeyList(), and savePlainFile().
bool util::tool::savePlainFile | ( | QString const & | filename, |
QString const & | text | ||
) |
Creates the file filename and put text into the file.
Creates the file filename and save the given text into the file.
[in] | filename | the filename to save to. |
[in] | text | the string data to save. |
[in] | fileCodec | the codec to use to save the given string data. |
Definition at line 71 of file tool.cpp.
References savePlainFile().