fixed Östereich issue
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@94 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
fa68023a76
commit
b3a1a6d216
|
@ -4,10 +4,11 @@
|
||||||
-fixed crash when parsing config file under Win32
|
-fixed crash when parsing config file under Win32
|
||||||
-fixed loss of entry icons when saving a database which was not created
|
-fixed loss of entry icons when saving a database which was not created
|
||||||
with KeePassX (no KPX_CUSTOM_ICONS metastream)
|
with KeePassX (no KPX_CUSTOM_ICONS metastream)
|
||||||
|
-when there is no translation installed for the system's country preference but
|
||||||
|
one for the same language the program will now use it
|
||||||
-when canceling the file dialog for the opening of an existing database a already
|
-when canceling the file dialog for the opening of an existing database a already
|
||||||
openend database will not longer be closed
|
openend database will not longer be closed
|
||||||
-same for the creation of a new database
|
-same for the creation of a new database
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
0.2.1
|
0.2.1
|
||||||
---------------
|
---------------
|
||||||
|
|
57
src/main.cpp
57
src/main.cpp
|
@ -77,6 +77,7 @@ QIcon *Icon_Swap;
|
||||||
|
|
||||||
inline void loadImages();
|
inline void loadImages();
|
||||||
inline void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg,QString& ArgLang);
|
inline void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg,QString& ArgLang);
|
||||||
|
bool loadTranslation(QTranslator* tr,const QString& prefix,const QString& LocaleCode,const QStringList& SearchPaths);
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -113,38 +114,33 @@ QTranslator* translator = NULL;
|
||||||
QTranslator* qtTranslator=NULL;
|
QTranslator* qtTranslator=NULL;
|
||||||
translator=new QTranslator;
|
translator=new QTranslator;
|
||||||
qtTranslator=new QTranslator;
|
qtTranslator=new QTranslator;
|
||||||
bool TrFound=true;
|
|
||||||
QString locname;
|
|
||||||
|
|
||||||
if(!translator->load("keepass-"+loc.name(),app->applicationDirPath()+"/../share/keepass/i18n/")){
|
if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
|
||||||
if(!translator->load("keepass-"+loc.name(),QDir::homePath()+"/.keepass/")){
|
<< app->applicationDirPath()+"/../share/keepass/i18n/"
|
||||||
if(loc.name()!="en_US")
|
<< QDir::homePath()+"/.keepass/" ))
|
||||||
qWarning(QString("KeePassX: No Translation found language '%1 (%2)' using 'English (UnitedStates)'")
|
app->installTranslator(translator);
|
||||||
.arg(QLocale::languageToString(loc.language()))
|
else{
|
||||||
.arg(QLocale::countryToString(loc.country())).toAscii());
|
if(loc.name()!="en_US")
|
||||||
TrFound=false;
|
qWarning(QString("Kpx: No Translation found for '%1 (%2)'using 'English (UnitedStates)'")
|
||||||
}
|
.arg(QLocale::languageToString(loc.language()))
|
||||||
|
.arg(QLocale::countryToString(loc.country())).toAscii());
|
||||||
|
delete translator;
|
||||||
|
TrActive=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TrFound)
|
if(loadTranslation(qtTranslator,"qt_",loc.name(),QStringList()
|
||||||
app->installTranslator(translator);
|
<< QLibraryInfo::location(QLibraryInfo::TranslationsPath)
|
||||||
else
|
<< app->applicationDirPath()+"/../share/keepass/i18n/"
|
||||||
delete translator;
|
<< QDir::homePath()+"/.keepass/" ))
|
||||||
|
app->installTranslator(qtTranslator);
|
||||||
|
else{
|
||||||
if(!qtTranslator->load("qt_"+loc.name().left(2),QLibraryInfo::location(QLibraryInfo::TranslationsPath))){
|
|
||||||
if(loc.name()!="en_US")
|
if(loc.name()!="en_US")
|
||||||
qWarning(QString("Qt: No Translation found for '%1 (%2)'using 'English (UnitedStates)'")
|
qWarning(QString("Qt: No Translation found for '%1 (%2)'using 'English (UnitedStates)'")
|
||||||
.arg(QLocale::languageToString(loc.language()))
|
.arg(QLocale::languageToString(loc.language()))
|
||||||
.arg(QLocale::countryToString(loc.country())).toAscii());
|
.arg(QLocale::countryToString(loc.country())).toAscii());
|
||||||
delete qtTranslator;
|
delete qtTranslator;
|
||||||
}else{
|
|
||||||
app->installTranslator(qtTranslator);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TrActive=TrFound;
|
|
||||||
loadImages();
|
loadImages();
|
||||||
SecString::generateSessionKey();
|
SecString::generateSessionKey();
|
||||||
int r=0;
|
int r=0;
|
||||||
|
@ -297,6 +293,23 @@ _loadIcon(Icon_Swap,"/actions/reload.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool loadTranslation(QTranslator* tr,const QString& prefix,const QString& loc,const QStringList& paths){
|
||||||
|
for(int i=0;i<paths.size();i++)
|
||||||
|
if(tr->load(prefix+loc+".qm",paths[i])) return true;
|
||||||
|
for(int i=0;i<paths.size();i++){
|
||||||
|
QDir dir(paths[i]);
|
||||||
|
QStringList TrFiles=dir.entryList(QStringList()<<"*.qm",QDir::Files);
|
||||||
|
for(int j=0;j<TrFiles.size();j++){
|
||||||
|
if(TrFiles[j].left(prefix.length()+2)==prefix+loc.left(2)){
|
||||||
|
if(tr->load(TrFiles[j],paths[i]))return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg,QString& ArgLang){
|
void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg,QString& ArgLang){
|
||||||
if(argc>1){
|
if(argc>1){
|
||||||
int i=1;
|
int i=1;
|
||||||
|
|
Loading…
Reference in New Issue