mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
Show "Edit Dictionary" button only for supporting dictionary types (DSL, XDXF, StarDict)
For StarDict dictionaries we consider *.ifo as the main file to edit.
This commit is contained in:
parent
de2bf73e66
commit
06bc0acbe0
|
@ -24,7 +24,7 @@ void DictInfo::showInfo( sptr<Dictionary::Class> dict )
|
||||||
ui.dictionaryTranslatesTo->setText( Language::localizedStringForId( dict->getLangTo() ) );
|
ui.dictionaryTranslatesTo->setText( Language::localizedStringForId( dict->getLangTo() ) );
|
||||||
|
|
||||||
ui.openFolder->setVisible( dict->isLocalDictionary() );
|
ui.openFolder->setVisible( dict->isLocalDictionary() );
|
||||||
ui.editDictionary->setVisible( dict->isLocalDictionary() && !cfg.editDictionaryCommandLine.isEmpty());
|
ui.editDictionary->setVisible( dict->isLocalDictionary() && !dict->getMainFilename().isEmpty() && !cfg.editDictionaryCommandLine.isEmpty());
|
||||||
ui.editDictionary->setToolTip(
|
ui.editDictionary->setToolTip(
|
||||||
tr( "Edit the dictionary via command:\n%1" ).arg( cfg.editDictionaryCommandLine ) );
|
tr( "Edit the dictionary via command:\n%1" ).arg( cfg.editDictionaryCommandLine ) );
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,8 @@ public:
|
||||||
|
|
||||||
virtual QString const& getDescription();
|
virtual QString const& getDescription();
|
||||||
|
|
||||||
|
virtual QString getMainFilename();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void loadIcon() throw();
|
void loadIcon() throw();
|
||||||
|
@ -548,6 +550,11 @@ QString const& StardictDictionary::getDescription()
|
||||||
return dictionaryDescription;
|
return dictionaryDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString StardictDictionary::getMainFilename()
|
||||||
|
{
|
||||||
|
return FsEncoding::decode( getDictionaryFilenames()[ 0 ].c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
/// StardictDictionary::findHeadwordsForSynonym()
|
/// StardictDictionary::findHeadwordsForSynonym()
|
||||||
|
|
||||||
class StardictHeadwordsRequest;
|
class StardictHeadwordsRequest;
|
||||||
|
|
Loading…
Reference in a new issue