+ Add icons for transliterations.

This commit is contained in:
Konstantin Isakov 2009-05-18 10:36:12 +00:00
parent ecc3d39fdb
commit 8daa82e21f
6 changed files with 24 additions and 5 deletions

View file

@ -45,7 +45,8 @@ sptr< Dictionary::Class > makeDictionary() throw( std::exception )
static GermanTable t;
return new Transliteration::TransliterationDictionary( "cf1b74acd98adea9b2bba16af38f1081",
QCoreApplication::translate( "GermanTranslit", "German Transliteration" ).toUtf8().data(), t );
QCoreApplication::translate( "GermanTranslit", "German Transliteration" ).toUtf8().data(),
QIcon( ":/flags/de.png" ), t );
}

View file

@ -87,7 +87,8 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & r )
static HepburnHiragana t;
result.push_back( new Transliteration::TransliterationDictionary( "94eae5a5aaf5b0a900490f4d6b36aac0",
QCoreApplication::translate( "Romaji", "Hepburn Romaji for Hiragana" ).toUtf8().data(), t, false ) );
QCoreApplication::translate( "Romaji", "Hepburn Romaji for Hiragana" ).toUtf8().data(),
QIcon( ":/flags/jp.png" ), t, false ) );
}
if ( r.enableKatakana )
@ -95,7 +96,8 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & r )
static HepburnKatakana t;
result.push_back( new Transliteration::TransliterationDictionary( "3252a35767d3f6e85e3e39069800dd2f",
QCoreApplication::translate( "Romaji", "Hepburn Romaji for Katakana" ).toUtf8().data(), t, false ) );
QCoreApplication::translate( "Romaji", "Hepburn Romaji for Katakana" ).toUtf8().data(),
QIcon( ":/flags/jp.png" ), t, false ) );
}
}
}

View file

@ -104,7 +104,8 @@ sptr< Dictionary::Class > makeDictionary() throw( std::exception )
static RussianTable t;
return new Transliteration::TransliterationDictionary( "cf1b74acd98adea9b2bba16af38f1086",
QCoreApplication::translate( "RussianTranslit", "Russian Transliteration" ).toUtf8().data(), t );
QCoreApplication::translate( "RussianTranslit", "Russian Transliteration" ).toUtf8().data(),
QIcon( ":/flags/ru.png" ), t );
}
}

View file

@ -357,6 +357,10 @@ of the appropriate groups to use them.</string>
<property name="text">
<string>Russian transliteration</string>
</property>
<property name="icon">
<iconset resource="flags.qrc">
<normaloff>:/flags/ru.png</normaloff>:/flags/ru.png</iconset>
</property>
</widget>
</item>
<item>
@ -377,6 +381,10 @@ of the appropriate groups to use them.</string>
<property name="text">
<string>German transliteration</string>
</property>
<property name="icon">
<iconset resource="flags.qrc">
<normaloff>:/flags/de.png</normaloff>:/flags/de.png</iconset>
</property>
</widget>
</item>
<item>
@ -521,6 +529,7 @@ Standardized as ISO 3602</string>
<tabstop>paths</tabstop>
</tabstops>
<resources>
<include location="flags.qrc"/>
<include location="resources.qrc"/>
</resources>
<connections/>

View file

@ -22,10 +22,11 @@ void Table::ins( char const * from, char const * to )
TransliterationDictionary::TransliterationDictionary( string const & id,
string const & name_,
QIcon icon_,
Table const & table_,
bool caseSensitive_ ):
Dictionary::Class( id, vector< string >() ),
name( name_ ), table( table_ ),
name( name_ ), icon( icon_ ), table( table_ ),
caseSensitive( caseSensitive_ )
{}

View file

@ -37,17 +37,22 @@ protected:
class TransliterationDictionary: public Dictionary::Class
{
string name;
QIcon icon;
Table const & table;
bool caseSensitive;
public:
TransliterationDictionary( string const & id, string const & name,
QIcon icon,
Table const & table,
bool caseSensitive = true );
virtual string getName() throw();
virtual QIcon getIcon() throw()
{ return icon; }
virtual map< Dictionary::Property, string > getProperties() throw();
virtual unsigned long getArticleCount() throw();