From 8daa82e21f27d9bf664ace32847d4468df65e59f Mon Sep 17 00:00:00 2001 From: Konstantin Isakov Date: Mon, 18 May 2009 10:36:12 +0000 Subject: [PATCH] + Add icons for transliterations. --- src/german.cc | 3 ++- src/romaji.cc | 6 ++++-- src/russiantranslit.cc | 3 ++- src/sources.ui | 9 +++++++++ src/transliteration.cc | 3 ++- src/transliteration.hh | 5 +++++ 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/german.cc b/src/german.cc index f976c60c..96fcd80f 100644 --- a/src/german.cc +++ b/src/german.cc @@ -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 ); } diff --git a/src/romaji.cc b/src/romaji.cc index ee63ea6b..3f407e99 100644 --- a/src/romaji.cc +++ b/src/romaji.cc @@ -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 ) ); } } } diff --git a/src/russiantranslit.cc b/src/russiantranslit.cc index 20b9957d..435ac3ba 100644 --- a/src/russiantranslit.cc +++ b/src/russiantranslit.cc @@ -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 ); } } diff --git a/src/sources.ui b/src/sources.ui index c2e61d72..5f0f90ab 100644 --- a/src/sources.ui +++ b/src/sources.ui @@ -357,6 +357,10 @@ of the appropriate groups to use them. Russian transliteration + + + :/flags/ru.png:/flags/ru.png + @@ -377,6 +381,10 @@ of the appropriate groups to use them. German transliteration + + + :/flags/de.png:/flags/de.png + @@ -521,6 +529,7 @@ Standardized as ISO 3602 paths + diff --git a/src/transliteration.cc b/src/transliteration.cc index 6b97e81e..cbd0a1ea 100644 --- a/src/transliteration.cc +++ b/src/transliteration.cc @@ -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_ ) {} diff --git a/src/transliteration.hh b/src/transliteration.hh index 94ba1f06..833aef7a 100644 --- a/src/transliteration.hh +++ b/src/transliteration.hh @@ -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();