From 8446ef1f75b61808b4fd50cda8e09bf37d35e096 Mon Sep 17 00:00:00 2001 From: tarek_saidi Date: Tue, 11 Mar 2008 17:40:31 +0000 Subject: [PATCH] removed some unused files, made file dialog wrapper use native dialogs again, fixed password dialog not remembering last key location/type, disabled precompiled headers when buidling universal binaries, updated changelog, fixed size problems of some dialogs git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@179 b624d157-de02-0410-bad0-e51aec6abb33 --- changelog | 9 +- src/PwmConfig.cpp | 246 ---------------------------- src/PwmConfig.h | 86 ---------- src/dialogs/DatabaseSettingsDlg.cpp | 3 + src/dialogs/EditGroupDlg.cpp | 3 + src/dialogs/PasswordDlg.cpp | 15 ++ src/dialogs/PasswordGenDlg.cpp | 7 +- src/dialogs/SearchDlg.cpp | 5 +- src/forms/DatabaseSettingsDlg.ui | 8 +- src/forms/EditGroupDlg.ui | 14 +- src/forms/PasswordGenDlg.ui | 8 +- src/forms/SearchDlg.ui | 18 +- src/lib/FileDialogs.cpp | 76 +++++---- src/lib/FileDialogs.h | 63 +++---- src/lib/KdePlugin.cpp | 8 - src/lib/KdePlugin.h | 13 -- src/lib/KpFileIconProvider.cpp | 19 --- src/lib/KpFileIconProvider.h | 28 ---- src/src.pro | 13 +- 19 files changed, 123 insertions(+), 519 deletions(-) delete mode 100644 src/PwmConfig.cpp delete mode 100644 src/PwmConfig.h delete mode 100644 src/lib/KdePlugin.cpp delete mode 100644 src/lib/KdePlugin.h delete mode 100644 src/lib/KpFileIconProvider.cpp delete mode 100644 src/lib/KpFileIconProvider.h diff --git a/changelog b/changelog index 93dd7d4..5e7f26b 100644 --- a/changelog +++ b/changelog @@ -2,7 +2,14 @@ 0.3.1 --------------- - made key/password dialog more user friendly +- added option for automatic database locking on inactivity +- native file dialogs are used again under MacOS X and Windows - program accepts Qt command line switches like "-style" again +- parameter "-cfg" now accepts relative paths (Bug #1825446) +- fixed invalid entries in .desktop file (Bug #1906875) +- fixed potential compilation problem in AES implementation (Bug #1905810) +- fixed crash when re-arranging groups (Bug #1754998) +- fixed size problems of some dialogs --------------- 0.3.0a @@ -17,7 +24,7 @@ - global Auto-Type - fully customizable HTML based detail view - better structured settings dialog -- secure random number generator based on ‘Yarrow‘ including an optional entropy collector +- secure random number generator based on 'Yarrow' including an optional entropy collector - new dialog to view expiered entries - calendar widget to edit expiration dates in a more confortable way - restructured password generator diff --git a/src/PwmConfig.cpp b/src/PwmConfig.cpp deleted file mode 100644 index ffe53e6..0000000 --- a/src/PwmConfig.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by Tarek Saidi * - * mail@tarek-saidi.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "PwmConfig.h" -#include -#include -#include -using namespace std; - -#ifdef Q_WS_MAC - #define DEFAULT_MOUNT_DIR "/Volumes/" -#endif -#ifdef Q_WS_X11 - #define DEFAULT_MOUNT_DIR "/media/" -#endif -#ifdef Q_WS_WIN - #define DEFAULT_MOUNT_DIR "/" -#endif - -#define CSTR(x)((const char*)x.toUtf8()) -#define QSTR(x)(QString::fromUtf8((x).c_str())) - -bool CConfig::loadFromIni(QString filename){ - QString defaultSearchOptions = "001101111"; - QString defaultPwGenOptions = "1111100001"; - ini.SetPath((const char*)filename.toUtf8()); - ini.ReadFile(); - ClipboardTimeOut=ini.GetValueI("Options","ClipboardTimeOut",20); - Toolbar=ini.GetValueB("UI","ShowToolbar",true); - EntryDetails=ini.GetValueB("UI","ShowEntryDetails",true); - OpenLast=ini.GetValueB("Options","RememberLastFile",true); - LastFile=QSTR(ini.GetValue("Options","LastFile","")); - ParseColumnString(QSTR(ini.GetValue("UI","Columns","1111100000")),Columns); - BannerColor1=ParseColorString(QSTR(ini.GetValue("Options","BannerColor1","0,85,127"))); - BannerColor2=ParseColorString(QSTR(ini.GetValue("Options","BannerColor2","0,117,175"))); - BannerTextColor=ParseColorString(QSTR(ini.GetValue("Options","BannerTextColor","222,222,222"))); - ShowPasswords=ini.GetValueB("Options","ShowPasswords",false); - ShowPasswordsPasswordDlg=ini.GetValueB("Options","ShowPasswordsPasswordDlg",false); - OpenUrlCommand=QSTR(ini.GetValue("Options","UrlCmd","kfmclient openURL %1")); - Language=QSTR(ini.GetValue("Options","LangFile","")); - ParseBoolString(QSTR(ini.GetValue("Options","SearchOptions",(const char*)defaultSearchOptions.toUtf8())),defaultSearchOptions,SearchOptions,9); - ListView_HidePasswords=ini.GetValueB("UI","HidePasswords",true); - ListView_HideUsernames=ini.GetValueB("UI","HideUsernames",false); - ParseBoolString(QSTR(ini.GetValue("Options","PwGenOptions",(const char*)defaultPwGenOptions.toUtf8())),defaultPwGenOptions,PwGenOptions,10); - PwGenLength=ini.GetValueI("Options","PwGenLength",25); - PwGenCharList=QSTR(ini.GetValue("Options","PwGenCharList","")); - ExpandGroupTree=ini.GetValueB("Options","ExpandGroupTree",true); - MainWinHeight=ini.GetValueI("UI","MainWinHeight",550); - MainWinWidth=ini.GetValueI("UI","MainWinWidth",900); - MainWinSplit1=ini.GetValueI("UI","MainWinSplit1",100); - MainWinSplit2=ini.GetValueI("UI","MainWinSplit2",300); - ParseIntString(QSTR(ini.GetValue("UI","ColumnSizes","15,10,10,10,10,10,10,10,10,10")),ColumnSizes,10); - ShowStatusbar=ini.GetValueB("UI","ShowStatusbar",true); - AlternatingRowColors=ini.GetValueB("Options","AlternatingRowColors",true); - MountDir=QSTR(ini.GetValue("Options","MountDir",DEFAULT_MOUNT_DIR)); - RememberLastKey=ini.GetValueB("Options","RememberLastKey",true); - LastKeyLocation=QSTR(ini.GetValue("Options","LastKeyLocation","")); - LastKeyType=(tKeyType)ini.GetValueI("Options","LastKeyType",(int)PASSWORD); - if(!OpenLast)RememberLastKey=false; - ToolbarIconSize=ini.GetValueI("UI","ToolbarIconSize",16); - ShowSysTrayIcon=ini.GetValueB("Options","ShowSysTrayIcon",false); - MinimizeToTray=ini.GetValueB("Options","MinimizeToTray",false); - SaveFileDlgHistory=ini.GetValueB("Options","SaveFileDlgHistory",true); - EnableBookmarkMenu=ini.GetValueB("Options","EnableBookmarkMenu",true); - GroupTreeRestore=ini.GetValueI("Options","GroupTreeRestore",1); - QString IntegrPluginVal=QSTR(ini.GetValue("Options","IntegrPlugin","None")); - if(IntegrPluginVal=="None") - IntegrPlugin=NONE; - else if(IntegrPluginVal=="Gnome") - IntegrPlugin=GNOME; - else if(IntegrPluginVal=="KDE") - IntegrPlugin=KDE; - else - IntegrPlugin=NONE; - - return true; -} - -bool CConfig::saveToIni(QString filename){ - ini.SetValueI("Options","ClipboardTimeOut",ClipboardTimeOut); - ini.SetValueB("UI","ShowToolbar",Toolbar); - ini.SetValueB("UI","ShowEntryDetails",EntryDetails); - ini.SetValueB("Options","RememberLastFile",OpenLast); - if(OpenLast)ini.SetValue("Options","LastFile",(const char*)LastFile.toUtf8()); - else ini.SetValue("Options","LastFile",""); - ini.SetValue("UI","Columns",(const char*)CreateColumnString().toUtf8(),true); - ini.SetValue("Options","BannerColor1",(const char*)CreateColorString(BannerColor1).toUtf8(),true); - ini.SetValue("Options","BannerColor2",(const char*)CreateColorString(BannerColor2).toUtf8(),true); - ini.SetValue("Options","BannerTextColor",(const char*)CreateColorString(BannerTextColor).toUtf8(),true); - ini.SetValueB("Options","ShowPasswords",ShowPasswords,true); - ini.SetValueB("Options","ShowPasswordsPasswordDlg",ShowPasswordsPasswordDlg,true); - ini.SetValue("Options","UrlCmd",(const char*)OpenUrlCommand.toUtf8(),true); - ini.SetValue("Options","LangFile",(const char*)Language.toUtf8(),true); - ini.SetValue("Options","SearchOptions",(const char*)CreateBoolString(SearchOptions,9).toUtf8(),true); - ini.SetValueB("UI","HidePasswords",ListView_HidePasswords); - ini.SetValueB("UI","HideUsernames",ListView_HideUsernames); - ini.SetValue("Options","PwGenOptions",(const char*)CreateBoolString(PwGenOptions,10).toUtf8(),true); - ini.SetValueI("Options","PwGenLength",PwGenLength,true); - ini.SetValue("Options","PwGenCharList",(const char*)PwGenCharList.toUtf8(),true); - ini.SetValueB("Options","ExpandGroupTree",ExpandGroupTree,true); - ini.SetValueI("UI","MainWinHeight",MainWinHeight); - ini.SetValueI("UI","MainWinWidth",MainWinWidth); - ini.SetValueI("UI","MainWinSplit1",MainWinSplit1); - ini.SetValueI("UI","MainWinSplit2",MainWinSplit2); - ini.SetValue("UI","ColumnSizes",(const char*)CreateIntString(ColumnSizes,10).toUtf8(),true); - ini.SetValueB("UI","ShowStatusbar",ShowStatusbar); - ini.SetValueB("Options","AlternatingRowColors",AlternatingRowColors); - ini.SetValue("Options","MountDir",(const char*)MountDir.toUtf8()); - ini.SetValueB("Options","RememberLastKey",RememberLastKey); - ini.SetValueB("Options","ShowSysTrayIcon",ShowSysTrayIcon); - ini.SetValueB("Options","MinimizeToTray",MinimizeToTray); - ini.SetValueB("Options","SaveFileDlgHistory",SaveFileDlgHistory); - ini.SetValueB("Options","EnableBookmarkMenu",EnableBookmarkMenu); - ini.SetValueI("Options","GroupTreeRestore",GroupTreeRestore); - - if(RememberLastKey){ - ini.SetValue("Options","LastKeyLocation",(const char*)LastKeyLocation.toUtf8()); - ini.SetValueI("Options","LastKeyType",LastKeyType);} - else{ - ini.SetValue("Options","LastKeyLocation",""); - ini.SetValueI("Options","LastKeyType",0);} - ini.SetValueI("UI","ToolbarIconSize",ToolbarIconSize,true); - - if(IntegrPlugin==NONE) - ini.SetValue("Options","IntegrPlugin","None"); - if(IntegrPlugin==GNOME) - ini.SetValue("Options","IntegrPlugin","Gnome"); - if(IntegrPlugin==KDE) - ini.SetValue("Options","IntegrPlugin","KDE"); - - if(!ini.WriteFile())return false; - else return true; -} - -void CConfig::ParseColumnString(QString str, bool* dst){ -if(str.length()<10){ -bool _default[]={true,true,true,true,true,false,false,false,false,false}; -memcpy((char*)_default,(char*)dst,10*sizeof(bool));} -for(int i=0; i<10; i++){ -if(str[i]==QChar('0')) - *(dst+i)=false; -else - *(dst+i)=true; - -} - -} - -QString CConfig::CreateColumnString(){ -QString str=""; -for(int i=0;i<10;i++){ -if(Columns[i])str+="1"; -else str+="0"; -} -return str; -} - -QColor CConfig::ParseColorString(QString str){ -QStringList lst=str.split(','); -if(lst.size()!=3){ - qWarning((QObject::tr("Warning:")+" CConfig::ParseColorString(QString):"+QObject::tr("Invalid RGB color value.\n")).toUtf8()); - return QColor(0,0,0);} -bool err[3]; -int r=lst[0].toUInt(err); -int g=lst[1].toUInt(err+1); -int b=lst[2].toUInt(err+2); -if(!err[0] || !err[1] || !err[2]){ - qWarning((QObject::tr("Warning:")+" CConfig::ParseColorString(QString):"+QObject::tr("Invalid RGB color value.\n")).toUtf8()); - return QColor(0,0,0);} -return QColor(r,g,b); -} - -QString CConfig::CreateColorString(QColor c){ -return (QString::number(c.red())+","+QString::number(c.green())+","+QString::number(c.blue())); -} - -void CConfig::ParseBoolString(const QString &str,const QString &defaults,bool* dst, int count){ -Q_ASSERT(defaults.count() == count); -for(int i=0; i lst.size()){ - for(int i=lst.size(); i -#include "main.h" -#include "lib/IniReader.h" - -class CConfig{ - public: - enum IntegrPluginType{NONE,KDE,GNOME}; - int TimeFormat; - int ClipboardTimeOut; - int MainWinHeight; - int MainWinWidth; - int MainWinSplit1; - int MainWinSplit2; - int ToolbarIconSize; - int PwGenLength; - int GroupTreeRestore; // 0:Restore Last; 1:Expand All; 2:Don't Expand - int ColumnSizes[10]; - bool Toolbar; - bool EntryDetails; - bool OpenLast; - bool ListView_HidePasswords; - bool ListView_HideUsernames; - bool SearchOptions[9]; - bool PwGenOptions[10]; - bool Columns[10]; - bool ShowPasswords; - bool ShowPasswordsPasswordDlg; - bool ExpandGroupTree; - bool EnableKdePlugin; - bool ShowStatusbar; - bool AlternatingRowColors; - bool RememberLastKey; - bool ShowSysTrayIcon; - bool MinimizeToTray; - bool SaveFileDlgHistory; - bool EnableBookmarkMenu; - QString PwGenCharList; - QString MountDir; - QString LastKeyLocation; - QString OpenUrlCommand; - QString Language; - QString LastFile; - QColor BannerColor1; - QColor BannerColor2; - QColor BannerTextColor; - IntegrPluginType IntegrPlugin; - tKeyType LastKeyType; - - bool loadFromIni(QString filename); - bool saveToIni(QString filename); - - private: - CIniFile ini; - void ParseColumnString(QString str, bool* dst); - void ParseBoolString(const QString &str,const QString &defaults,bool* dst, int count); - void ParseIntString(const QString &str,int* dst, int count); - QString CreateBoolString(bool* src, int count); - QColor ParseColorString(QString str); - QString CreateColumnString(); - QString CreateColorString(QColor); - QString CreateIntString(int* src, int count); -}; - -#endif diff --git a/src/dialogs/DatabaseSettingsDlg.cpp b/src/dialogs/DatabaseSettingsDlg.cpp index 61f4ebb..5c85fb4 100644 --- a/src/dialogs/DatabaseSettingsDlg.cpp +++ b/src/dialogs/DatabaseSettingsDlg.cpp @@ -27,6 +27,9 @@ CDbSettingsDlg::CDbSettingsDlg(QWidget* parent,IDatabase* db, bool modal, Qt::W { setupUi(this); database=dynamic_cast(db); + adjustSize(); + setMaximumSize(size()); + setMinimumSize(size()); createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width()); ComboAlgo->insertItem(0,tr("AES(Rijndael): 256 Bit (default)")); ComboAlgo->insertItem(1,tr("Twofish: 256 Bit")); diff --git a/src/dialogs/EditGroupDlg.cpp b/src/dialogs/EditGroupDlg.cpp index 8555db7..d293e62 100644 --- a/src/dialogs/EditGroupDlg.cpp +++ b/src/dialogs/EditGroupDlg.cpp @@ -34,6 +34,9 @@ CEditGroupDialog::CEditGroupDialog(IDatabase* database,IGroupHandle* Handle,QWid connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) ); connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) ); connect( Button_Icon, SIGNAL( clicked() ), this, SLOT( OnIconDlg() )); + adjustSize(); + setMaximumSize(size()); + setMinimumSize(size()); } diff --git a/src/dialogs/PasswordDlg.cpp b/src/dialogs/PasswordDlg.cpp index 524f849..2690ed0 100644 --- a/src/dialogs/PasswordDlg.cpp +++ b/src/dialogs/PasswordDlg.cpp @@ -265,6 +265,21 @@ void PasswordDialog::OnOK(){ return; } + if((Mode==Mode_Ask || Mode==Mode_Set) && config->rememberLastKey()){ + if(Check_Password->isChecked() && Check_KeyFile->isChecked()){ + config->setLastKeyType(BOTH); + config->setLastKeyLocation(Combo_KeyFile->currentText()); + } + else if(Check_Password->isChecked()){ + config->setLastKeyType(PASSWORD); + config->setLastKeyLocation(QString()); + } + else if(Check_KeyFile->isChecked()){ + config->setLastKeyType(PASSWORD); + config->setLastKeyLocation(Combo_KeyFile->currentText()); + } + } + done(Exit_Ok); } diff --git a/src/dialogs/PasswordGenDlg.cpp b/src/dialogs/PasswordGenDlg.cpp index 13d5838..7234d06 100644 --- a/src/dialogs/PasswordGenDlg.cpp +++ b/src/dialogs/PasswordGenDlg.cpp @@ -29,9 +29,6 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl) : QDialog(parent,fl) { setupUi(this); - setMinimumSize(size()); - setMaximumSize(size()); - createBanner(&BannerPixmap,getPixmap("dice"),tr("Password Generator"),width()); connect(ButtonGenerate,SIGNAL(clicked()),this,SLOT(OnGeneratePw())); connect(Radio_1,SIGNAL(toggled(bool)),this,SLOT(OnRadio1StateChanged(bool))); connect(Radio_2,SIGNAL(toggled(bool)),this,SLOT(OnRadio2StateChanged(bool))); @@ -74,6 +71,10 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl) OnRadio1StateChanged(pwGenOptions.at(0)); OnRadio2StateChanged(!pwGenOptions.at(0)); Spin_Num->setValue(config->pwGenLength()); + adjustSize(); + setMaximumSize(size()); + setMinimumSize(size()); + createBanner(&BannerPixmap,getPixmap("dice"),tr("Password Generator"),width()); } CGenPwDialog::~CGenPwDialog(){ diff --git a/src/dialogs/SearchDlg.cpp b/src/dialogs/SearchDlg.cpp index e9472d1..b7dbd10 100644 --- a/src/dialogs/SearchDlg.cpp +++ b/src/dialogs/SearchDlg.cpp @@ -30,7 +30,6 @@ SearchDialog::SearchDialog(IDatabase* database,IGroupHandle* Group,QWidget* pare connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnClose() ) ); db=database; group=Group; - createBanner(&BannerPixmap,getPixmap("search"),tr("Search"),width()); QBitArray searchOptions=config->searchOptions(); checkBox_Cs->setChecked(searchOptions.at(0)); checkBox_regExp->setChecked(searchOptions.at(1)); @@ -46,6 +45,10 @@ SearchDialog::SearchDialog(IDatabase* database,IGroupHandle* Group,QWidget* pare checkBox_Recursive->setChecked(false); checkBox_Recursive->setEnabled(false); } + adjustSize(); + setMaximumSize(size()); + setMinimumSize(size()); + createBanner(&BannerPixmap,getPixmap("search"),tr("Search"),width()); } SearchDialog::~SearchDialog() diff --git a/src/forms/DatabaseSettingsDlg.ui b/src/forms/DatabaseSettingsDlg.ui index 34bc259..5471f7f 100644 --- a/src/forms/DatabaseSettingsDlg.ui +++ b/src/forms/DatabaseSettingsDlg.ui @@ -18,13 +18,7 @@ 440 - 213 - - - - - 440 - 213 + 0 diff --git a/src/forms/EditGroupDlg.ui b/src/forms/EditGroupDlg.ui index f5f85e5..5a5fc47 100644 --- a/src/forms/EditGroupDlg.ui +++ b/src/forms/EditGroupDlg.ui @@ -10,22 +10,10 @@ 120 - - - 0 - 0 - - 350 - 120 - - - - - 350 - 120 + 0 diff --git a/src/forms/PasswordGenDlg.ui b/src/forms/PasswordGenDlg.ui index 93e125a..0cf32dd 100644 --- a/src/forms/PasswordGenDlg.ui +++ b/src/forms/PasswordGenDlg.ui @@ -6,15 +6,9 @@ 0 0 462 - 458 + 466 - - - 0 - 0 - - Password Generator diff --git a/src/forms/SearchDlg.ui b/src/forms/SearchDlg.ui index 76a4248..c3834a9 100644 --- a/src/forms/SearchDlg.ui +++ b/src/forms/SearchDlg.ui @@ -5,26 +5,14 @@ 0 0 - 390 - 280 + 458 + 306 - - - 0 - 0 - - 390 - 280 - - - - - 390 - 280 + 0 diff --git a/src/lib/FileDialogs.cpp b/src/lib/FileDialogs.cpp index 32aff6b..9e2924a 100644 --- a/src/lib/FileDialogs.cpp +++ b/src/lib/FileDialogs.cpp @@ -5,7 +5,6 @@ * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; version 2 of the License. * - * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -70,40 +69,51 @@ QString KpxFileDialogs::saveFile(QWidget* Parent, const QString& Name, const QSt return result; } -QString QtStandardFileDialogs::openExistingFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter){ - if(SelectedFilter >= Filters.size()) - SelectedFilter=0; - QFileDialog FileDlg(parent,title,dir); - FileDlg.setFilters(Filters); - FileDlg.setFileMode(QFileDialog::ExistingFile); - FileDlg.selectFilter(Filters[SelectedFilter]); - if(!FileDlg.exec())return QString(); - if(!FileDlg.selectedFiles().size())return QString(); - LastFilter=FileDlg.filters().indexOf(FileDlg.selectedFilter()); - return FileDlg.selectedFiles()[0]; -} -QStringList QtStandardFileDialogs::openExistingFilesDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter){ - QFileDialog FileDlg(parent,title,dir); - FileDlg.setFilters(Filters); - FileDlg.setFileMode(QFileDialog::ExistingFiles); - if(!FileDlg.exec())return QStringList(); - LastFilter=FileDlg.filters().indexOf(FileDlg.selectedFilter()); - return FileDlg.selectedFiles(); + +QString QtStandardFileDialogs::toSingleStringFilter(const QStringList& filterList){ + if(!filterList.size()) + return QString(); + QString SingleString; + for(int i=0;iHistory; @@ -50,42 +54,39 @@ class FileDlgHistory:public QObject{ class KpxFileDialogs{ public: - static void setPlugin(IFileDialog* FileDlgPlugin); - static QString openExistingFile(QWidget* parent, const QString& Name, - const QString& Title, - const QStringList& Filters, - QString Dir=QString(), - int SelectedFilter=-1); - static QStringList openExistingFiles(QWidget* parent, const QString& Name, - const QString& Title, - const QStringList& Filters, - const QString Dir=QString(), - int SelectedFilter=-1); - static QString saveFile(QWidget* parent, const QString& Name, - const QString& Title, - const QStringList& Filters, - bool ShowOverwriteWarning=true, - QString Dir=QString(), - int SelectedFilter=-1); + static void setPlugin(IFileDialog* FileDlgPlugin); + static QString openExistingFile(QWidget* parent, const QString& Name, + const QString& Title, + const QStringList& Filters, + QString Dir=QString(), + int SelectedFilter=-1); + static QStringList openExistingFiles(QWidget* parent, const QString& Name, + const QString& Title, + const QStringList& Filters, + const QString Dir=QString(), + int SelectedFilter=-1); + static QString saveFile(QWidget* parent, const QString& Name, + const QString& Title, + const QStringList& Filters, + bool ShowOverwriteWarning=true, + QString Dir=QString(), + int SelectedFilter=-1); private: - static IFileDialog* iFileDialog; - - - + static IFileDialog* iFileDialog; }; class QtStandardFileDialogs:public QObject,public IFileDialog{ Q_OBJECT Q_INTERFACES(IFileDialog); - public: - QString openExistingFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter); - QStringList openExistingFilesDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter); - QString saveFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter,bool ShowOverwriteWarning); - int getLastFilter(); - private: - int LastFilter; - + public: + QString openExistingFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter); + QStringList openExistingFilesDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter); + QString saveFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter,bool ShowOverwriteWarning); + int getLastFilter(); + private: + static QString toSingleStringFilter(const QStringList& filterList); + int LastFilter; }; extern FileDlgHistory fileDlgHistory; diff --git a/src/lib/KdePlugin.cpp b/src/lib/KdePlugin.cpp deleted file mode 100644 index 05f8365..0000000 --- a/src/lib/KdePlugin.cpp +++ /dev/null @@ -1,8 +0,0 @@ - -#include "KdePlugin.h" - -bool CKdePlugin::resolveSymbols(QLibrary& lib){ -getAppObj=(QApplication*(*)(int,char**))lib.resolve("getAppObj"); -if(getAppObj == NULL) return false; -return true; -} \ No newline at end of file diff --git a/src/lib/KdePlugin.h b/src/lib/KdePlugin.h deleted file mode 100644 index 5c6ed54..0000000 --- a/src/lib/KdePlugin.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _KDEPLUGIN_H_ -#define _KDEPLUGIN_H_ -#include -#include - -class CKdePlugin{ -public: - bool resolveSymbols(QLibrary& lib); - QApplication*(*getAppObj)(int,char**); -}; - - -#endif \ No newline at end of file diff --git a/src/lib/KpFileIconProvider.cpp b/src/lib/KpFileIconProvider.cpp deleted file mode 100644 index a68802c..0000000 --- a/src/lib/KpFileIconProvider.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2006 by Tarek Saidi * - * tarek.saidi@arcor.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; version 2 of the License. * - - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ diff --git a/src/lib/KpFileIconProvider.h b/src/lib/KpFileIconProvider.h deleted file mode 100644 index 7449407..0000000 --- a/src/lib/KpFileIconProvider.h +++ /dev/null @@ -1,28 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2006 by Tarek Saidi * - * tarek.saidi@arcor.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; version 2 of the License. * - - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include - -class KpFileIconProvider : public QFileIconProvider{ -public: - virtual QIcon icon(IconType type) const; - virtual QIcon icon(const QFileInfo& info) const; -}; diff --git a/src/src.pro b/src/src.pro index 5aa3758..806db3c 100644 --- a/src/src.pro +++ b/src/src.pro @@ -76,7 +76,10 @@ macx { QMAKE_BUNDLE_DATA += data ICON = ../share/macx_bundle/icon.icns CONFIG += app_bundle - isEqual(ARCH,UNIVERSAL): CONFIG += x86 ppc + isEqual(ARCH,UNIVERSAL) { + CONFIG += x86 ppc + CONFIG -= precompile_header + } isEqual(ARCH,INTEL): CONFIG += x86 isEqual(ARCH,PPC): CONFIG += ppc SOURCES += main_macx.cpp @@ -170,7 +173,6 @@ HEADERS += lib/UrlLabel.h \ # dialogs/TrashCanDlg.h \ lib/random.h \ Database.h \ -# lib/KdePlugin.h \ lib/AutoType.h \ lib/FileDialogs.h \ lib/ShortcutWidget.h \ @@ -192,11 +194,10 @@ HEADERS += lib/UrlLabel.h \ crypto/sha1.h \ lib/WaitAnimationWidget.h \ plugins/interfaces/IFileDialog.h \ -# plugins/interfaces/IKdeInit.h \ -# plugins/interfaces/IGnomeInit.h \ + plugins/interfaces/IKdeInit.h \ + plugins/interfaces/IGnomeInit.h \ plugins/interfaces/IIconTheme.h \ KpxConfig.h \ -# KpxFirefox.h \ dialogs/AddBookmarkDlg.h \ lib/bookmarks.h \ dialogs/ManageBookmarksDlg.h @@ -235,7 +236,6 @@ SOURCES += lib/UrlLabel.cpp \ lib/random.cpp \ Database.cpp \ lib/tools.cpp \ -# lib/KdePlugin.cpp \ lib/GroupView.cpp \ lib/EntryView.cpp \ lib/FileDialogs.cpp \ @@ -245,7 +245,6 @@ SOURCES += lib/UrlLabel.cpp \ crypto/yarrow.cpp \ lib/WaitAnimationWidget.cpp \ KpxConfig.cpp \ -# KpxFirefox.cpp \ dialogs/AddBookmarkDlg.cpp \ lib/bookmarks.cpp \ dialogs/ManageBookmarksDlg.cpp \