|
|
@ -44,7 +44,6 @@ bool TrActive; |
|
|
|
QString DetailViewTemplate; |
|
|
|
QString DetailViewTemplate; |
|
|
|
bool EventOccurred; |
|
|
|
bool EventOccurred; |
|
|
|
bool EventOccurredBlock = false; |
|
|
|
bool EventOccurredBlock = false; |
|
|
|
EventListener* eventListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QPixmap* EntryIcons; |
|
|
|
QPixmap* EntryIcons; |
|
|
|
IIconTheme* IconLoader=NULL; |
|
|
|
IIconTheme* IconLoader=NULL; |
|
|
@ -77,7 +76,7 @@ int main(int argc, char **argv) |
|
|
|
fileDlgHistory.load(); |
|
|
|
fileDlgHistory.load(); |
|
|
|
|
|
|
|
|
|
|
|
// PlugIns
|
|
|
|
// PlugIns
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11 |
|
|
|
if(config->integrPlugin()!=KpxConfig::NoIntegr){ |
|
|
|
if(config->integrPlugin()!=KpxConfig::NoIntegr){ |
|
|
|
QString LibName="libkeepassx-"; |
|
|
|
QString LibName="libkeepassx-"; |
|
|
|
if(config->integrPlugin()==KpxConfig::KDE) |
|
|
|
if(config->integrPlugin()==KpxConfig::KDE) |
|
|
@ -103,14 +102,14 @@ int main(int argc, char **argv) |
|
|
|
if(config->integrPlugin()==KpxConfig::KDE){ |
|
|
|
if(config->integrPlugin()==KpxConfig::KDE){ |
|
|
|
IKdeInit* kdeinit=qobject_cast<IKdeInit*>(plugin.instance()); |
|
|
|
IKdeInit* kdeinit=qobject_cast<IKdeInit*>(plugin.instance()); |
|
|
|
app=kdeinit->getMainAppObject(argc,argv); |
|
|
|
app=kdeinit->getMainAppObject(argc,argv); |
|
|
|
if(!app)PluginLoadError=QObject::tr("Initialization failed."); |
|
|
|
if(!app) PluginLoadError = "Initialization failed."; |
|
|
|
} |
|
|
|
} |
|
|
|
if(config->integrPlugin()==KpxConfig::Gnome){ |
|
|
|
if(config->integrPlugin()==KpxConfig::Gnome){ |
|
|
|
IGnomeInit* ginit=qobject_cast<IGnomeInit*>(plugin.instance()); |
|
|
|
IGnomeInit* ginit=qobject_cast<IGnomeInit*>(plugin.instance()); |
|
|
|
if(!ginit->init(argc,argv)){ |
|
|
|
if(!ginit->init(argc,argv)){ |
|
|
|
KpxFileDialogs::setPlugin(NULL); |
|
|
|
KpxFileDialogs::setPlugin(NULL); |
|
|
|
qWarning("GtkIntegrPlugin: Gtk init failed."); |
|
|
|
qWarning("GtkIntegrPlugin: Gtk init failed."); |
|
|
|
PluginLoadError=QObject::tr("Initialization failed."); |
|
|
|
PluginLoadError = "Initialization failed."; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -120,6 +119,7 @@ int main(int argc, char **argv) |
|
|
|
PluginLoadError=QObject::tr("Could not locate library file."); |
|
|
|
PluginLoadError=QObject::tr("Could not locate library file."); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
if(!app){ |
|
|
|
if(!app){ |
|
|
|
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE) |
|
|
|
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE) |
|
|
|
app = new KeepassApplication(argc,argv); |
|
|
|
app = new KeepassApplication(argc,argv); |
|
|
@ -137,23 +137,23 @@ int main(int argc, char **argv) |
|
|
|
else |
|
|
|
else |
|
|
|
loc=QLocale(args.language()); |
|
|
|
loc=QLocale(args.language()); |
|
|
|
|
|
|
|
|
|
|
|
QTranslator* translator = NULL; |
|
|
|
QTranslator* translator = new QTranslator; |
|
|
|
QTranslator* qtTranslator=NULL; |
|
|
|
QTranslator* qtTranslator = new QTranslator; |
|
|
|
translator=new QTranslator; |
|
|
|
|
|
|
|
qtTranslator=new QTranslator; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(loadTranslation(translator,"keepass-",loc.name(),QStringList() |
|
|
|
if(loadTranslation(translator,"keepass-",loc.name(),QStringList() |
|
|
|
<< DataDir+"/i18n/" |
|
|
|
<< DataDir+"/i18n/" |
|
|
|
<< HomeDir)) |
|
|
|
<< HomeDir)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
app->installTranslator(translator); |
|
|
|
QApplication::installTranslator(translator); |
|
|
|
TrActive=true; |
|
|
|
TrActive=true; |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
if(loc.name()!="en_US") |
|
|
|
if(loc.name()!="en_US") |
|
|
|
qWarning(QString("Kpx: No Translation found for '%1 (%2)' using 'English (UnitedStates)'") |
|
|
|
qWarning(CSTR( |
|
|
|
|
|
|
|
QString("Kpx: 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())) |
|
|
|
|
|
|
|
)); |
|
|
|
delete translator; |
|
|
|
delete translator; |
|
|
|
TrActive=false; |
|
|
|
TrActive=false; |
|
|
|
} |
|
|
|
} |
|
|
@ -163,12 +163,14 @@ int main(int argc, char **argv) |
|
|
|
<< QLibraryInfo::location(QLibraryInfo::TranslationsPath) |
|
|
|
<< QLibraryInfo::location(QLibraryInfo::TranslationsPath) |
|
|
|
<< DataDir+"/i18n/" |
|
|
|
<< DataDir+"/i18n/" |
|
|
|
<< HomeDir)) |
|
|
|
<< HomeDir)) |
|
|
|
app->installTranslator(qtTranslator); |
|
|
|
QApplication::installTranslator(qtTranslator); |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
if(loc.name()!="en_US") |
|
|
|
if(loc.name()!="en_US") |
|
|
|
qWarning(QString("Qt: No Translation found for '%1 (%2)' using 'English (UnitedStates)'") |
|
|
|
qWarning(CSTR( |
|
|
|
|
|
|
|
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())) |
|
|
|
|
|
|
|
)); |
|
|
|
delete qtTranslator; |
|
|
|
delete qtTranslator; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -180,7 +182,7 @@ int main(int argc, char **argv) |
|
|
|
initYarrow(); //init random number generator
|
|
|
|
initYarrow(); //init random number generator
|
|
|
|
SecString::generateSessionKey(); |
|
|
|
SecString::generateSessionKey(); |
|
|
|
|
|
|
|
|
|
|
|
eventListener = new EventListener(); |
|
|
|
EventListener* eventListener = new EventListener(); |
|
|
|
app->installEventFilter(eventListener); |
|
|
|
app->installEventFilter(eventListener); |
|
|
|
|
|
|
|
|
|
|
|
QApplication::setQuitOnLastWindowClosed(false); |
|
|
|
QApplication::setQuitOnLastWindowClosed(false); |
|
|
@ -201,8 +203,8 @@ void loadImages(){ |
|
|
|
QPixmap tmpImg(getImageFile("clientic.png")); |
|
|
|
QPixmap tmpImg(getImageFile("clientic.png")); |
|
|
|
EntryIcons=new QPixmap[BUILTIN_ICONS]; |
|
|
|
EntryIcons=new QPixmap[BUILTIN_ICONS]; |
|
|
|
for(int i=0;i<BUILTIN_ICONS;i++){ |
|
|
|
for(int i=0;i<BUILTIN_ICONS;i++){ |
|
|
|
EntryIcons[i]=tmpImg.copy(i*16,0,16,16);} |
|
|
|
EntryIcons[i]=tmpImg.copy(i*16,0,16,16); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|