Completely removed Qt3Support dependency
Cleaned up qmake project file Compiles on Windows + many Windows specific improvements Various small fixes git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@152 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
		
							parent
							
								
									18e99b5a41
								
							
						
					
					
						commit
						97da5c1989
					
				
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 5.3 KiB  | 
| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					IDI_ICON1    ICON    DISCARDABLE    "keepassx.ico"
 | 
				
			||||||
| 
						 | 
					@ -42,7 +42,7 @@ AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
 | 
				
			||||||
		AboutTr+="<br>";
 | 
							AboutTr+="<br>";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	Edit_Translation->setHtml(AboutTr+tr("Information on how to translate KeePassX can be found under:")
 | 
						Edit_Translation->setHtml(AboutTr+tr("Information on how to translate KeePassX can be found under:")
 | 
				
			||||||
		+"<br>http://keepassx.sourceforge.net/");
 | 
							+"<br>http://www.keepassx.org/");
 | 
				
			||||||
	QString str;
 | 
						QString str;
 | 
				
			||||||
	str+="<b>"+tr("Team")+"</b><br>";
 | 
						str+="<b>"+tr("Team")+"</b><br>";
 | 
				
			||||||
	str+="<div style='margin-left:10px;'>";
 | 
						str+="<div style='margin-left:10px;'>";
 | 
				
			||||||
| 
						 | 
					@ -77,31 +77,26 @@ close();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AboutDialog::loadLicFromFile(){
 | 
					void AboutDialog::loadLicFromFile(){
 | 
				
			||||||
 | 
						QString filename;
 | 
				
			||||||
QFile gpl(AppDir+"/../share/keepass/license.html");
 | 
						filename = AppDir+"/../share/keepass/license.html";
 | 
				
			||||||
if(!gpl.exists()){
 | 
						if (!QFile::exists(filename)){
 | 
				
			||||||
 | 
							filename = AppDir+"/share/license.html";
 | 
				
			||||||
 | 
							if (!QFile::exists(filename)){
 | 
				
			||||||
 | 
								filename.clear();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						QFile gpl(filename);
 | 
				
			||||||
 | 
						if (filename.isEmpty() || !gpl.open(QIODevice::ReadOnly)){
 | 
				
			||||||
		QMessageBox::critical(this,tr("Error"),tr("File '%1' could not be found.")
 | 
							QMessageBox::critical(this,tr("Error"),tr("File '%1' could not be found.")
 | 
				
			||||||
			.arg("'license.html'")+"\n"+tr("Make sure that the program is installed correctly.")
 | 
								.arg("'license.html'")+"\n"+tr("Make sure that the program is installed correctly.")
 | 
				
			||||||
			,tr("OK"),0,0,2,1);
 | 
								,tr("OK"),0,0,2,1);
 | 
				
			||||||
return;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
if(!gpl.open(QIODevice::ReadOnly)){
 | 
						Edit_License->setHtml(QString::fromUtf8(gpl.readAll()));
 | 
				
			||||||
QMessageBox::critical(this,tr("Error"),tr("Could not open file '%1'")
 | 
					 | 
				
			||||||
			  .arg("'license.txt'")+"\n"+tr("The following error occured:")+"\n"+gpl.errorString()
 | 
					 | 
				
			||||||
			  ,tr("OK"),0,0,2,1);
 | 
					 | 
				
			||||||
return;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
char* buffer=new char[gpl.size()];
 | 
					 | 
				
			||||||
long l=gpl.read(buffer,gpl.size());
 | 
					 | 
				
			||||||
gpl.close();
 | 
					 | 
				
			||||||
Edit_License->setHtml(QString::fromUtf8(buffer,l));
 | 
					 | 
				
			||||||
delete buffer;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AboutDialog::OnHomepageClicked(){
 | 
					void AboutDialog::OnHomepageClicked(){
 | 
				
			||||||
openBrowser("http://keepassx.sf.net");
 | 
						openBrowser("http://www.keepassx.org/");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AboutDialog::OnEMailClicked(){
 | 
					void AboutDialog::OnEMailClicked(){
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,7 +65,7 @@
 | 
				
			||||||
   <item>
 | 
					   <item>
 | 
				
			||||||
    <widget class="QTabWidget" name="tabWidget" >
 | 
					    <widget class="QTabWidget" name="tabWidget" >
 | 
				
			||||||
     <property name="currentIndex" >
 | 
					     <property name="currentIndex" >
 | 
				
			||||||
      <number>3</number>
 | 
					      <number>0</number>
 | 
				
			||||||
     </property>
 | 
					     </property>
 | 
				
			||||||
     <widget class="QWidget" name="tab" >
 | 
					     <widget class="QWidget" name="tab" >
 | 
				
			||||||
      <attribute name="title" >
 | 
					      <attribute name="title" >
 | 
				
			||||||
| 
						 | 
					@ -184,9 +184,6 @@
 | 
				
			||||||
             <property name="text" >
 | 
					             <property name="text" >
 | 
				
			||||||
              <string>http://keepassx.sourceforge.net</string>
 | 
					              <string>http://keepassx.sourceforge.net</string>
 | 
				
			||||||
             </property>
 | 
					             </property>
 | 
				
			||||||
             <property name="buddy" >
 | 
					 | 
				
			||||||
              <cstring></cstring>
 | 
					 | 
				
			||||||
             </property>
 | 
					 | 
				
			||||||
            </widget>
 | 
					            </widget>
 | 
				
			||||||
           </item>
 | 
					           </item>
 | 
				
			||||||
           <item>
 | 
					           <item>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,11 +132,11 @@
 | 
				
			||||||
  </layout>
 | 
					  </layout>
 | 
				
			||||||
 </widget>
 | 
					 </widget>
 | 
				
			||||||
 <layoutdefault spacing="6" margin="11" />
 | 
					 <layoutdefault spacing="6" margin="11" />
 | 
				
			||||||
 <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
 | 
					 | 
				
			||||||
 <tabstops>
 | 
					 <tabstops>
 | 
				
			||||||
  <tabstop>EditTitle</tabstop>
 | 
					  <tabstop>EditTitle</tabstop>
 | 
				
			||||||
  <tabstop>ComboIconPicker</tabstop>
 | 
					  <tabstop>ComboIconPicker</tabstop>
 | 
				
			||||||
 </tabstops>
 | 
					 </tabstops>
 | 
				
			||||||
 | 
					 <includes/>
 | 
				
			||||||
 <resources/>
 | 
					 <resources/>
 | 
				
			||||||
 <connections/>
 | 
					 <connections/>
 | 
				
			||||||
</ui>
 | 
					</ui>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -125,7 +125,7 @@
 | 
				
			||||||
  </layout>
 | 
					  </layout>
 | 
				
			||||||
 </widget>
 | 
					 </widget>
 | 
				
			||||||
 <layoutdefault spacing="6" margin="11" />
 | 
					 <layoutdefault spacing="6" margin="11" />
 | 
				
			||||||
 <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
 | 
					 <includes/>
 | 
				
			||||||
 <resources/>
 | 
					 <resources/>
 | 
				
			||||||
 <connections/>
 | 
					 <connections/>
 | 
				
			||||||
</ui>
 | 
					</ui>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,12 +18,14 @@
 | 
				
			||||||
 ***************************************************************************/
 | 
					 ***************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "ShortcutWidget.h"
 | 
					#include "ShortcutWidget.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(GLOBAL_AUTOTYPE) && defined(Q_WS_X11)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QKeyEvent>
 | 
					#include <QKeyEvent>
 | 
				
			||||||
#include <QX11Info>
 | 
					#include <QX11Info>
 | 
				
			||||||
#include <QPalette>
 | 
					#include <QPalette>
 | 
				
			||||||
#include "HelperX11.h"
 | 
					#include "HelperX11.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(GLOBAL_AUTOTYPE) && defined(Q_WS_X11)
 | 
					 | 
				
			||||||
ShortcutWidget::ShortcutWidget(QWidget* parent) : QLineEdit(parent), lock(false), failed(false){
 | 
					ShortcutWidget::ShortcutWidget(QWidget* parent) : QLineEdit(parent), lock(false), failed(false){
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,7 +21,10 @@
 | 
				
			||||||
#define SHORTCUT_WIDGET_H
 | 
					#define SHORTCUT_WIDGET_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QLineEdit>
 | 
					#include <QLineEdit>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(GLOBAL_AUTOTYPE) && defined(Q_WS_X11)
 | 
				
			||||||
#include "lib/AutoType.h"
 | 
					#include "lib/AutoType.h"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ShortcutWidget : public QLineEdit{
 | 
					class ShortcutWidget : public QLineEdit{
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										68
									
								
								src/main.cpp
								
								
								
								
							
							
						
						
									
										68
									
								
								src/main.cpp
								
								
								
								
							| 
						 | 
					@ -52,6 +52,9 @@
 | 
				
			||||||
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE)
 | 
					#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE)
 | 
				
			||||||
#include "Application_X11.h"
 | 
					#include "Application_X11.h"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					#ifdef Q_WS_WIN
 | 
				
			||||||
 | 
					#include <windows.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using namespace std;
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -60,6 +63,7 @@ QHash<QString,QIcon*>IconCache;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
KpxConfig *config;
 | 
					KpxConfig *config;
 | 
				
			||||||
QString  AppDir;
 | 
					QString  AppDir;
 | 
				
			||||||
 | 
					QString HomeDir;
 | 
				
			||||||
QString PluginLoadError;
 | 
					QString PluginLoadError;
 | 
				
			||||||
bool TrActive;
 | 
					bool TrActive;
 | 
				
			||||||
QString DetailViewTemplate;
 | 
					QString DetailViewTemplate;
 | 
				
			||||||
| 
						 | 
					@ -78,6 +82,15 @@ int main(int argc, char **_argv)
 | 
				
			||||||
	QString ArgFile,ArgCfg,ArgLang,IniFilename;
 | 
						QString ArgFile,ArgCfg,ArgLang,IniFilename;
 | 
				
			||||||
	QApplication* app=NULL;
 | 
						QApplication* app=NULL;
 | 
				
			||||||
	AppDir=applicationDirPath();
 | 
						AppDir=applicationDirPath();
 | 
				
			||||||
 | 
					#if defined Q_WS_WIN
 | 
				
			||||||
 | 
						HomeDir = QString::fromLocal8Bit(qgetenv("APPDATA").constData());
 | 
				
			||||||
 | 
						if(!HomeDir.isEmpty() && QFile::exists(HomeDir))
 | 
				
			||||||
 | 
							HomeDir = QDir::fromNativeSeparators(HomeDir)+"/KeePassX";
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							HomeDir = QDir::homePath()+"/KeePassX";
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
						HomeDir = QDir::homePath()+"/.keepassx";
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	bool ArgMin = false;
 | 
						bool ArgMin = false;
 | 
				
			||||||
	bool ArgLock = false;
 | 
						bool ArgLock = false;
 | 
				
			||||||
	parseCmdLineArgs(argc,argv,ArgFile,ArgCfg,ArgLang,ArgMin,ArgLock);
 | 
						parseCmdLineArgs(argc,argv,ArgFile,ArgCfg,ArgLang,ArgMin,ArgLock);
 | 
				
			||||||
| 
						 | 
					@ -85,12 +98,12 @@ int main(int argc, char **_argv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//Load Config
 | 
						//Load Config
 | 
				
			||||||
	if(ArgCfg.isEmpty()){
 | 
						if(ArgCfg.isEmpty()){
 | 
				
			||||||
		if(!QDir(QDir::homePath()+"/.keepassx").exists()){
 | 
							if(!QDir(HomeDir).exists()){
 | 
				
			||||||
			QDir conf(QDir::homePath());
 | 
								QDir conf(QDir::homePath());
 | 
				
			||||||
			if(!conf.mkdir(".keepassx")){
 | 
								if(!QDir().mkpath(HomeDir))
 | 
				
			||||||
				cout << "Warning: Could not create directory '~/.keepassx'." << endl;}
 | 
									qDebug("Warning: Could not create directory '%s'", CSTR(HomeDir));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		IniFilename=QDir::homePath()+"/.keepassx/config";
 | 
							IniFilename=HomeDir+"/config";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		IniFilename=ArgCfg;
 | 
							IniFilename=ArgCfg;
 | 
				
			||||||
| 
						 | 
					@ -163,8 +176,9 @@ int main(int argc, char **_argv)
 | 
				
			||||||
	qtTranslator=new QTranslator;
 | 
						qtTranslator=new QTranslator;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
 | 
						if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
 | 
				
			||||||
						<< app->applicationDirPath()+"/../share/keepass/i18n/"
 | 
											<< AppDir+"/../share/keepass/i18n/"
 | 
				
			||||||
						<< QDir::homePath()+"/.keepassx/" ))
 | 
											<< AppDir+"/share/i18n/"
 | 
				
			||||||
 | 
											<< HomeDir))
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		app->installTranslator(translator);
 | 
							app->installTranslator(translator);
 | 
				
			||||||
		TrActive=true;
 | 
							TrActive=true;
 | 
				
			||||||
| 
						 | 
					@ -178,10 +192,12 @@ int main(int argc, char **_argv)
 | 
				
			||||||
		TrActive=false;
 | 
							TrActive=false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						if(TrActive){
 | 
				
			||||||
		if(loadTranslation(qtTranslator,"qt_",loc.name(),QStringList()
 | 
							if(loadTranslation(qtTranslator,"qt_",loc.name(),QStringList()
 | 
				
			||||||
							<< QLibraryInfo::location(QLibraryInfo::TranslationsPath)
 | 
												<< QLibraryInfo::location(QLibraryInfo::TranslationsPath)
 | 
				
			||||||
						<< app->applicationDirPath()+"/../share/keepass/i18n/"
 | 
												<< AppDir+"/../share/keepass/i18n/"
 | 
				
			||||||
						<< QDir::homePath()+"/.keepass/" ))
 | 
												<< AppDir+"/share/i18n/"
 | 
				
			||||||
 | 
												<< HomeDir))
 | 
				
			||||||
			app->installTranslator(qtTranslator);
 | 
								app->installTranslator(qtTranslator);
 | 
				
			||||||
		else{
 | 
							else{
 | 
				
			||||||
			if(loc.name()!="en_US")
 | 
								if(loc.name()!="en_US")
 | 
				
			||||||
| 
						 | 
					@ -190,6 +206,7 @@ int main(int argc, char **_argv)
 | 
				
			||||||
					.arg(QLocale::countryToString(loc.country())).toAscii());
 | 
										.arg(QLocale::countryToString(loc.country())).toAscii());
 | 
				
			||||||
			delete qtTranslator;
 | 
								delete qtTranslator;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	DetailViewTemplate=config->detailViewTemplate();
 | 
						DetailViewTemplate=config->detailViewTemplate();
 | 
				
			||||||
| 
						 | 
					@ -281,7 +298,7 @@ void openBrowser(const QString& UrlString){
 | 
				
			||||||
	QUrl url(UrlString);
 | 
						QUrl url(UrlString);
 | 
				
			||||||
	if(url.scheme().isEmpty())
 | 
						if(url.scheme().isEmpty())
 | 
				
			||||||
		url=QUrl("http://"+UrlString);
 | 
							url=QUrl("http://"+UrlString);
 | 
				
			||||||
	if(config->urlCmdDef()){
 | 
						if(config->urlCmdDef() || url.scheme()=="mailto"){
 | 
				
			||||||
		QDesktopServices::openUrl(url);
 | 
							QDesktopServices::openUrl(url);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	else{
 | 
						else{
 | 
				
			||||||
| 
						 | 
					@ -297,22 +314,22 @@ void openBrowser(const QString& UrlString){
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
///TODO 0.2.3 remove
 | 
					QString getImageFile(const QString& name){
 | 
				
			||||||
void loadImg(QString name,QPixmap& Img){
 | 
						if (QFile::exists(AppDir+"/../share/keepass/icons/"+name))
 | 
				
			||||||
	if(Img.load(AppDir+"/../share/keepass/icons/"+name)==false){
 | 
							return AppDir+"/../share/keepass/icons/"+name;
 | 
				
			||||||
		if(Img.load(AppDir+"/share/"+name)==false){
 | 
						else if (QFile::exists(AppDir+"/share/icons/"+name))
 | 
				
			||||||
 | 
							return AppDir+"/share/icons/"+name;
 | 
				
			||||||
 | 
						else{
 | 
				
			||||||
		QMessageBox::critical(0,QApplication::translate("Main","Error"),
 | 
							QMessageBox::critical(0,QApplication::translate("Main","Error"),
 | 
				
			||||||
			QApplication::translate("Main","File '%1' could not be found.")
 | 
								QApplication::translate("Main","File '%1' could not be found.")
 | 
				
			||||||
			.arg(name),QApplication::translate("Main","OK"),0,0,2,1);
 | 
								.arg(name),QApplication::translate("Main","OK"),0,0,2,1);
 | 
				
			||||||
		exit(1);
 | 
							exit(1);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
///TODO 0.2.3 remove
 | 
					///TODO 0.2.3 remove
 | 
				
			||||||
void loadImages(){
 | 
					void loadImages(){
 | 
				
			||||||
	QPixmap tmpImg;
 | 
						QPixmap tmpImg(getImageFile("clientic.png"));
 | 
				
			||||||
	loadImg("clientic.png",tmpImg);
 | 
					 | 
				
			||||||
	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);}
 | 
				
			||||||
| 
						 | 
					@ -336,12 +353,7 @@ const QIcon& getIcon(const QString& name){
 | 
				
			||||||
	}*/
 | 
						}*/
 | 
				
			||||||
	if(!NewIcon)
 | 
						if(!NewIcon)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		QFileInfo IconFile(AppDir+"/../share/keepass/icons/"+name+".png");
 | 
							NewIcon=new QIcon(getImageFile(name+".png"));
 | 
				
			||||||
		if(!IconFile.isFile() || !IconFile.exists() || !IconFile.isReadable()){
 | 
					 | 
				
			||||||
			///TODO 0.2.3 error handling
 | 
					 | 
				
			||||||
			qWarning("%s",CSTR(name));
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		NewIcon=new QIcon(AppDir+"/../share/keepass/icons/"+name+".png");
 | 
					 | 
				
			||||||
		IconCache.insert(name,NewIcon);
 | 
							IconCache.insert(name,NewIcon);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return *NewIcon;
 | 
						return *NewIcon;
 | 
				
			||||||
| 
						 | 
					@ -351,11 +363,7 @@ const QPixmap* getPixmap(const QString& name){
 | 
				
			||||||
	QPixmap* CachedPixmap=PixmapCache.value(name);
 | 
						QPixmap* CachedPixmap=PixmapCache.value(name);
 | 
				
			||||||
	if(CachedPixmap)
 | 
						if(CachedPixmap)
 | 
				
			||||||
		return CachedPixmap;
 | 
							return CachedPixmap;
 | 
				
			||||||
	QImage img;
 | 
						QImage img(getImageFile(name+".png"));
 | 
				
			||||||
	if(!img.load(AppDir+"/../share/keepass/icons/"+name+".png")){
 | 
					 | 
				
			||||||
		///TODO 0.2.3 error handling
 | 
					 | 
				
			||||||
		qWarning("%s",CSTR(name));
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	QPixmap* NewPixmap=new QPixmap(QPixmap::fromImage(img));
 | 
						QPixmap* NewPixmap=new QPixmap(QPixmap::fromImage(img));
 | 
				
			||||||
	PixmapCache.insert(name,NewPixmap);
 | 
						PixmapCache.insert(name,NewPixmap);
 | 
				
			||||||
	return NewPixmap;
 | 
						return NewPixmap;
 | 
				
			||||||
| 
						 | 
					@ -380,7 +388,7 @@ bool loadTranslation(QTranslator* tr,const QString& prefix,const QString& loc,co
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void printHelp(){
 | 
					void printHelp(){
 | 
				
			||||||
	cout << "KeePassX" << APP_VERSION << endl;
 | 
						cout << "KeePassX" << APP_VERSION << endl;
 | 
				
			||||||
	cout << "Usage: keepass [Filename] [Options]" << endl;
 | 
						cout << "Usage: keepassx  [Filename] [Options]" << endl;
 | 
				
			||||||
	cout << "  -help             This Help" << endl;
 | 
						cout << "  -help             This Help" << endl;
 | 
				
			||||||
	cout << "  -cfg <CONFIG>     Use specified file for loading/saving the configuration." << endl;
 | 
						cout << "  -cfg <CONFIG>     Use specified file for loading/saving the configuration." << endl;
 | 
				
			||||||
	cout << "  -min              Start minimized." << endl;
 | 
						cout << "  -min              Start minimized." << endl;
 | 
				
			||||||
| 
						 | 
					@ -437,6 +445,8 @@ void showErrMsg(const QString& msg,QWidget* parent){
 | 
				
			||||||
	QMessageBox::critical(parent,QApplication::translate("Main","Error"),msg,QApplication::translate("Main","OK"));
 | 
						QMessageBox::critical(parent,QApplication::translate("Main","Error"),msg,QApplication::translate("Main","OK"));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//TODO Plugins
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
QString findPlugin(const QString& filename){
 | 
					QString findPlugin(const QString& filename){
 | 
				
			||||||
	QFileInfo info;
 | 
						QFileInfo info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -446,7 +456,7 @@ QString findPlugin(const QString& filename){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return QString();
 | 
						return QString();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString makePathRelative(const QString& AbsDir,const QString& CurDir){
 | 
					QString makePathRelative(const QString& AbsDir,const QString& CurDir){
 | 
				
			||||||
	QStringList abs=AbsDir.split('/');
 | 
						QStringList abs=AbsDir.split('/');
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,12 +54,13 @@ QString applicationDirPath();
 | 
				
			||||||
const QIcon& getIcon(const QString& name);
 | 
					const QIcon& getIcon(const QString& name);
 | 
				
			||||||
const QPixmap* getPixmap(const QString& name);
 | 
					const QPixmap* getPixmap(const QString& name);
 | 
				
			||||||
QString decodeFileError(QFile::FileError Code);
 | 
					QString decodeFileError(QFile::FileError Code);
 | 
				
			||||||
QString findPlugin(const QString& filename);
 | 
					//QString findPlugin(const QString& filename); //TODO Plugins
 | 
				
			||||||
QString makePathRelative(const QString& Abs,const QString& Cur);
 | 
					QString makePathRelative(const QString& Abs,const QString& Cur);
 | 
				
			||||||
extern QString PluginLoadError;
 | 
					extern QString PluginLoadError;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern KpxConfig *config;
 | 
					extern KpxConfig *config;
 | 
				
			||||||
extern QString AppDir;
 | 
					extern QString AppDir;
 | 
				
			||||||
 | 
					extern QString HomeDir;
 | 
				
			||||||
extern bool TrActive;
 | 
					extern bool TrActive;
 | 
				
			||||||
extern QString DetailViewTemplate;
 | 
					extern QString DetailViewTemplate;
 | 
				
			||||||
extern QPixmap *EntryIcons;
 | 
					extern QPixmap *EntryIcons;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -78,7 +78,7 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,bool ArgMin,bool Arg
 | 
				
			||||||
	InUnLock=false;
 | 
						InUnLock=false;
 | 
				
			||||||
	unlockDlg=NULL;
 | 
						unlockDlg=NULL;
 | 
				
			||||||
    setupUi(this);
 | 
					    setupUi(this);
 | 
				
			||||||
#ifdef QT_WS_MAC
 | 
					#ifdef Q_WS_MAC
 | 
				
			||||||
	setUnifiedTitleAndToolBarOnMac(true);
 | 
						setUnifiedTitleAndToolBarOnMac(true);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#ifdef AUTOTYPE
 | 
					#ifdef AUTOTYPE
 | 
				
			||||||
| 
						 | 
					@ -218,6 +218,7 @@ void KeepassMainWindow::setupConnections(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void KeepassMainWindow::setupToolbar(){
 | 
					void KeepassMainWindow::setupToolbar(){
 | 
				
			||||||
	toolBar=new QToolBar(this);
 | 
						toolBar=new QToolBar(this);
 | 
				
			||||||
 | 
						toolBar->setMovable(false);
 | 
				
			||||||
	addToolBar(toolBar);
 | 
						addToolBar(toolBar);
 | 
				
			||||||
	toolBar->setIconSize(QSize(config->toolbarIconSize(),config->toolbarIconSize()));
 | 
						toolBar->setIconSize(QSize(config->toolbarIconSize(),config->toolbarIconSize()));
 | 
				
			||||||
	ViewShowToolbarAction=toolBar->toggleViewAction();
 | 
						ViewShowToolbarAction=toolBar->toggleViewAction();
 | 
				
			||||||
| 
						 | 
					@ -269,6 +270,8 @@ void KeepassMainWindow::setupIcons(){
 | 
				
			||||||
    ExtrasSettingsAction->setIcon(getIcon("appsettings"));
 | 
					    ExtrasSettingsAction->setIcon(getIcon("appsettings"));
 | 
				
			||||||
#ifdef AUTOTYPE
 | 
					#ifdef AUTOTYPE
 | 
				
			||||||
    EditAutoTypeAction->setIcon(getIcon("autotype"));
 | 
					    EditAutoTypeAction->setIcon(getIcon("autotype"));
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
						EditAutoTypeAction->setVisible(false);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	//HelpHandbookAction->setIcon(getIcon("manual")); //TODO Handbook
 | 
						//HelpHandbookAction->setIcon(getIcon("manual")); //TODO Handbook
 | 
				
			||||||
	HelpAboutAction->setIcon(getIcon("help"));
 | 
						HelpAboutAction->setIcon(getIcon("help"));
 | 
				
			||||||
| 
						 | 
					@ -982,7 +985,11 @@ void KeepassMainWindow::hideEvent(QHideEvent* event){
 | 
				
			||||||
		if (config->lockOnMinimize() && !IsLocked && FileOpen)
 | 
							if (config->lockOnMinimize() && !IsLocked && FileOpen)
 | 
				
			||||||
			OnUnLockWorkspace();
 | 
								OnUnLockWorkspace();
 | 
				
			||||||
		if (config->showSysTrayIcon() && config->minimizeTray()){
 | 
							if (config->showSysTrayIcon() && config->minimizeTray()){
 | 
				
			||||||
			setVisible(false);
 | 
					#ifdef Q_WS_WIN
 | 
				
			||||||
 | 
								QTimer::singleShot(100, this, SLOT(hide()));
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
								hide();
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
			event->accept();
 | 
								event->accept();
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -1091,12 +1098,21 @@ void KeepassMainWindow::OnSysTrayActivated(QSystemTrayIcon::ActivationReason rea
 | 
				
			||||||
			hide();
 | 
								hide();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		else{
 | 
							else{
 | 
				
			||||||
 | 
					#ifdef Q_WS_WIN
 | 
				
			||||||
 | 
								QTimer::singleShot(100, this, SLOT(restoreWindow()));
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
								restoreWindow();
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void KeepassMainWindow::restoreWindow(){
 | 
				
			||||||
	showNormal();
 | 
						showNormal();
 | 
				
			||||||
 | 
						activateWindow();
 | 
				
			||||||
	if (IsLocked)
 | 
						if (IsLocked)
 | 
				
			||||||
		OnUnLockWorkspace();
 | 
							OnUnLockWorkspace();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
void KeepassMainWindow::OnExtrasPasswordGen(){
 | 
					void KeepassMainWindow::OnExtrasPasswordGen(){
 | 
				
			||||||
	CGenPwDialog dlg(this,true);
 | 
						CGenPwDialog dlg(this,true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -92,6 +92,7 @@ class KeepassMainWindow : public QMainWindow, public Ui_MainWindow{
 | 
				
			||||||
		void OnShowSearchResults();
 | 
							void OnShowSearchResults();
 | 
				
			||||||
		void OnEntryChanged(SelectionState);
 | 
							void OnEntryChanged(SelectionState);
 | 
				
			||||||
		void OnSysTrayActivated(QSystemTrayIcon::ActivationReason);
 | 
							void OnSysTrayActivated(QSystemTrayIcon::ActivationReason);
 | 
				
			||||||
 | 
							void restoreWindow();
 | 
				
			||||||
		void OnImport(QAction*);
 | 
							void OnImport(QAction*);
 | 
				
			||||||
		void OnExport(QAction*);
 | 
							void OnExport(QAction*);
 | 
				
			||||||
		void OnDetailViewUrlClicked(const QUrl& url);
 | 
							void OnDetailViewUrlClicked(const QUrl& url);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										65
									
								
								src/src.pro
								
								
								
								
							
							
						
						
									
										65
									
								
								src/src.pro
								
								
								
								
							| 
						 | 
					@ -1,24 +1,27 @@
 | 
				
			||||||
######################################################################
 | 
					 | 
				
			||||||
# Automatically generated by qmake (2.01a) Mo Jan 29 18:17:19 2007
 | 
					 | 
				
			||||||
######################################################################
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
DEPENDPATH += "crypto \
 | 
					DEPENDPATH += crypto \
 | 
				
			||||||
              dialogs \
 | 
					              dialogs \
 | 
				
			||||||
              export \
 | 
					              export \
 | 
				
			||||||
              forms \
 | 
					              forms \
 | 
				
			||||||
              import \
 | 
					              import \
 | 
				
			||||||
              lib \
 | 
					              lib \
 | 
				
			||||||
              translations \
 | 
					              translations \
 | 
				
			||||||
	      res"
 | 
					              res
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					win32:QMAKE_WIN32 = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MOC_DIR = ../build/moc
 | 
				
			||||||
 | 
					UI_DIR = ../build/ui
 | 
				
			||||||
 | 
					OBJECTS_DIR = ../build
 | 
				
			||||||
 | 
					RCC_DIR = ../build/rcc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
INSTALLS += target data
 | 
					INSTALLS += target data
 | 
				
			||||||
data.files += ../share/keepass/*
 | 
					data.files += ../share/keepass/*
 | 
				
			||||||
TARGET = ../bin/keepassx
 | 
					TARGET = ../bin/keepassx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
isEmpty(PREFIX){
 | 
					unix : !macx : !isEqual(QMAKE_WIN32,1) {
 | 
				
			||||||
	PREFIX = /usr
 | 
					    isEmpty(PREFIX):PREFIX = /usr
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
unix : !macx {
 | 
					 | 
				
			||||||
    !isEqual(AUTOTYPE,0) {
 | 
					    !isEqual(AUTOTYPE,0) {
 | 
				
			||||||
        DEFINES += AUTOTYPE
 | 
					        DEFINES += AUTOTYPE
 | 
				
			||||||
        !isEqual(GLOBAL_AUTOTYPE,0) {
 | 
					        !isEqual(GLOBAL_AUTOTYPE,0) {
 | 
				
			||||||
| 
						 | 
					@ -43,23 +46,27 @@ unix : !macx {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					macx {
 | 
				
			||||||
 | 
					    isEmpty(PREFIX):PREFIX = /Applications
 | 
				
			||||||
 | 
					    target.path = $${PREFIX}
 | 
				
			||||||
 | 
					    data.path = $${PREFIX}/keepassx.app/Contents/share/keepass
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					isEqual(QMAKE_WIN32,1) {
 | 
				
			||||||
 | 
					    isEmpty(PREFIX):PREFIX = "C:/Program files/KeePassX"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    target.path = $${PREFIX}
 | 
				
			||||||
 | 
					    data.path = $${PREFIX}/share
 | 
				
			||||||
 | 
					    RC_FILE = ../share/ico/keepassx.rc
 | 
				
			||||||
 | 
					    QMAKE_LINK_OBJECT_SCRIPT = $${OBJECTS_DIR}/$${QMAKE_LINK_OBJECT_SCRIPT}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
contains(DEFINES,GLOBAL_AUTOTYPE) {
 | 
					contains(DEFINES,GLOBAL_AUTOTYPE) {
 | 
				
			||||||
    FORMS += forms/AutoTypeDlg.ui
 | 
					    FORMS += forms/AutoTypeDlg.ui
 | 
				
			||||||
    HEADERS += dialogs/AutoTypeDlg.h
 | 
					    HEADERS += dialogs/AutoTypeDlg.h
 | 
				
			||||||
    SOURCES += dialogs/AutoTypeDlg.cpp
 | 
					    SOURCES += dialogs/AutoTypeDlg.cpp
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
macx {
 | 
					 | 
				
			||||||
    target.path = /Applications
 | 
					 | 
				
			||||||
    data.path = /Applications/keepass.app/Contents/share/keepass
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
win32 {
 | 
					 | 
				
			||||||
    TARGET = ../$$TARGET
 | 
					 | 
				
			||||||
    QMAKE_LINK_OBJECT_SCRIPT = ../build/$$QMAKE_LINK_OBJECT_SCRIPT
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
FORMS += forms/EditGroupDlg.ui \
 | 
					FORMS += forms/EditGroupDlg.ui \
 | 
				
			||||||
         forms/SearchDlg.ui \
 | 
					         forms/SearchDlg.ui \
 | 
				
			||||||
         forms/AboutDlg.ui \
 | 
					         forms/AboutDlg.ui \
 | 
				
			||||||
| 
						 | 
					@ -79,14 +86,15 @@ FORMS += forms/EditGroupDlg.ui \
 | 
				
			||||||
         forms/WorkspaceLockedWidget.ui \
 | 
					         forms/WorkspaceLockedWidget.ui \
 | 
				
			||||||
         forms/AddBookmarkDlg.ui \
 | 
					         forms/AddBookmarkDlg.ui \
 | 
				
			||||||
         forms/ManageBookmarksDlg.ui
 | 
					         forms/ManageBookmarksDlg.ui
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TRANSLATIONS += translations/keepass-de_DE.ts \
 | 
					TRANSLATIONS += translations/keepass-de_DE.ts \
 | 
				
			||||||
                translations/keepass-ru_RU.ts \
 | 
					                translations/keepass-ru_RU.ts \
 | 
				
			||||||
                translations/keepass-es_ES.ts \
 | 
					                translations/keepass-es_ES.ts \
 | 
				
			||||||
                translations/keepass-fr_FR.ts \
 | 
					                translations/keepass-fr_FR.ts \
 | 
				
			||||||
                translations/keepass-cs_CS.ts \
 | 
					                translations/keepass-cs_CS.ts \
 | 
				
			||||||
                translations/keepass-xx_XX.ts
 | 
					                translations/keepass-xx_XX.ts
 | 
				
			||||||
HEADERS += lib/IniReader.h \
 | 
					
 | 
				
			||||||
           lib/UrlLabel.h \
 | 
					HEADERS += lib/UrlLabel.h \
 | 
				
			||||||
           mainwindow.h \
 | 
					           mainwindow.h \
 | 
				
			||||||
           Kdb3Database.h \
 | 
					           Kdb3Database.h \
 | 
				
			||||||
           lib/SecString.h \
 | 
					           lib/SecString.h \
 | 
				
			||||||
| 
						 | 
					@ -138,8 +146,8 @@ HEADERS += lib/IniReader.h \
 | 
				
			||||||
           crypto/sha1.h \
 | 
					           crypto/sha1.h \
 | 
				
			||||||
           lib/WaitAnimationWidget.h \
 | 
					           lib/WaitAnimationWidget.h \
 | 
				
			||||||
           plugins/interfaces/IFileDialog.h \
 | 
					           plugins/interfaces/IFileDialog.h \
 | 
				
			||||||
	   plugins/interfaces/IKdeInit.h \
 | 
					#           plugins/interfaces/IKdeInit.h \
 | 
				
			||||||
	   plugins/interfaces/IGnomeInit.h \
 | 
					#           plugins/interfaces/IGnomeInit.h \
 | 
				
			||||||
           plugins/interfaces/IIconTheme.h \
 | 
					           plugins/interfaces/IIconTheme.h \
 | 
				
			||||||
           KpxConfig.h \
 | 
					           KpxConfig.h \
 | 
				
			||||||
#          KpxFirefox.h \
 | 
					#          KpxFirefox.h \
 | 
				
			||||||
| 
						 | 
					@ -198,11 +206,8 @@ SOURCES += lib/UrlLabel.cpp \
 | 
				
			||||||
           dialogs/AddBookmarkDlg.cpp \
 | 
					           dialogs/AddBookmarkDlg.cpp \
 | 
				
			||||||
           lib/bookmarks.cpp \
 | 
					           lib/bookmarks.cpp \
 | 
				
			||||||
           dialogs/ManageBookmarksDlg.cpp
 | 
					           dialogs/ManageBookmarksDlg.cpp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RESOURCES += res/resources.qrc
 | 
					RESOURCES += res/resources.qrc
 | 
				
			||||||
MOC_DIR = ../build/moc
 | 
					 | 
				
			||||||
UI_DIR = ../build/ui
 | 
					 | 
				
			||||||
OBJECTS_DIR = ../build/
 | 
					 | 
				
			||||||
RCC_DIR = ../build/rcc
 | 
					 | 
				
			||||||
CONFIG = qt \
 | 
					CONFIG = qt \
 | 
				
			||||||
         uic \
 | 
					         uic \
 | 
				
			||||||
         resources \
 | 
					         resources \
 | 
				
			||||||
| 
						 | 
					@ -226,3 +231,7 @@ isEqual(RELEASE,1){
 | 
				
			||||||
else {
 | 
					else {
 | 
				
			||||||
  CONFIG += debug
 | 
					  CONFIG += debug
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					isEqual(QMAKE_WIN32,1) {
 | 
				
			||||||
 | 
					  CONFIG += windows
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue