diff --git a/share/keepass/icons/nuvola/32x32/filesystems/desktop.png b/share/keepass/icons/nuvola/32x32/filesystems/desktop.png new file mode 100644 index 0000000..9b993a5 Binary files /dev/null and b/share/keepass/icons/nuvola/32x32/filesystems/desktop.png differ diff --git a/share/keepass/icons/nuvola/32x32/filesystems/folder.png b/share/keepass/icons/nuvola/32x32/filesystems/folder.png new file mode 100644 index 0000000..bd433f4 Binary files /dev/null and b/share/keepass/icons/nuvola/32x32/filesystems/folder.png differ diff --git a/share/keepass/icons/nuvola/32x32/filesystems/folder_home.png b/share/keepass/icons/nuvola/32x32/filesystems/folder_home.png new file mode 100644 index 0000000..0094f83 Binary files /dev/null and b/share/keepass/icons/nuvola/32x32/filesystems/folder_home.png differ diff --git a/share/keepass/icons/nuvola/32x32/filesystems/network_local.png b/share/keepass/icons/nuvola/32x32/filesystems/network_local.png new file mode 100644 index 0000000..68afcb4 Binary files /dev/null and b/share/keepass/icons/nuvola/32x32/filesystems/network_local.png differ diff --git a/share/keepass/icons/nuvola/32x32/filesystems/trashcan_full.png b/share/keepass/icons/nuvola/32x32/filesystems/trashcan_full.png new file mode 100644 index 0000000..f19899d Binary files /dev/null and b/share/keepass/icons/nuvola/32x32/filesystems/trashcan_full.png differ diff --git a/src/PwmConfig.cpp b/src/PwmConfig.cpp index bd5dbe1..3adba6c 100755 --- a/src/PwmConfig.cpp +++ b/src/PwmConfig.cpp @@ -25,7 +25,7 @@ using namespace std; bool CConfig::loadFromIni(QString filename){ -CIniFile ini((char*)filename.data()); +ini.SetPath((const char*)filename); ini.ReadFile(); ClipboardTimeOut=ini.GetValueI("Options","ClipboardTimeOut",20); Toolbar=ini.GetValueB("UI","ShowToolbar",true); @@ -47,12 +47,15 @@ PwGenLength=ini.GetValueI("Options","PwGenLength",25); PwGenCharList=ini.GetValue("Options","PwGenCharList","").c_str(); ExpandGroupTree=ini.GetValueB("Options","ExpandGroupTree",true); EnableKdePlugin=ini.GetValueB("KDE Plugin","Enabled",false); +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(ini.GetValue("UI","ColumnSizes","15,10,10,10,10,10,10,10,10,10").c_str(),ColumnSizes,10); return true; } bool CConfig::saveToIni(QString filename){ -CIniFile ini((const char*)filename); -ini.ReadFile(); ini.SetValueI("Options","ClipboardTimeOut",ClipboardTimeOut); ini.SetValueB("UI","ShowToolbar",Toolbar); ini.SetValueB("UI","ShowEntryDetails",EntryDetails); @@ -73,6 +76,11 @@ ini.SetValueI("Options","PwGenLength",PwGenLength,true); ini.SetValue("Options","PwGenCharList",(const char*)PwGenCharList,true); ini.SetValueB("Options","ExpandGroupTree",ExpandGroupTree,true); ini.SetValueB("KDE Plugin","Enabled",EnableKdePlugin,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),true); if(!ini.WriteFile())return false; else return true; } @@ -135,4 +143,35 @@ if(src[i])str+="1"; else str+="0"; } return str; +} + +#define DEFAULT_INT_VAL 20 + +void CConfig::ParseIntString(const QString &str,int* dst, int count){ +QStringList lst=str.split(","); +if(lst.size()!=count) + qWarning("Warnig: CConfig::ParseIntString(): unexpected item count.\n"); +int* values=new int[count]; +bool err; +for(int i=0;i lst.size()){ + for(int i=lst.size(); i 7 - 7 + 4 0 10 + + + 16777215 + 60 + + @@ -105,7 +111,7 @@ 0 0 724 - 30 + 29 @@ -469,16 +475,16 @@ - KeepassEntryView + KeepassGroupView QTreeWidget -
../../src/lib/EntryView.h
+
../../src/lib/GroupView.h
0
- KeepassGroupView + KeepassEntryView QTreeWidget -
../../src/lib/GroupView.h
+
../../src/lib/EntryView.h
0
diff --git a/src/forms/SettingsDlg.ui b/src/forms/SettingsDlg.ui index 7694e14..cf4a9e5 100644 --- a/src/forms/SettingsDlg.ui +++ b/src/forms/SettingsDlg.ui @@ -27,38 +27,6 @@ Einstellungen - - - - 470 - 310 - 90 - 23 - - - - Abbre&chen - - - Alt+C - - - - - - 380 - 310 - 80 - 23 - - - - O&K - - - Alt+K - - @@ -79,9 +47,9 @@ 10 - 59 + 60 550 - 251 + 241 @@ -355,6 +323,38 @@
+ + + + 380 + 310 + 80 + 23 + + + + O&K + + + Alt+K + + + + + + 470 + 310 + 90 + 23 + + + + Abbre&chen + + + Alt+C + + diff --git a/src/lib/EntryView.cpp b/src/lib/EntryView.cpp index 914f85c..640cd4b 100644 --- a/src/lib/EntryView.cpp +++ b/src/lib/EntryView.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005 by Tarek Saidi * + * Copyright (C) 2005-2006 by Tarek Saidi * * tarek.saidi@arcor.de * * * * This program is free software; you can redistribute it and/or modify * @@ -34,8 +34,10 @@ KeepassEntryView::KeepassEntryView(QWidget* parent):QTreeWidget(parent){ CurrentGroup=0; updateColumns(); -header()->setResizeMode(QHeaderView::Stretch); +header()->setResizeMode(QHeaderView::Interactive); +header()->setStretchLastSection(false); ContextMenu=new QMenu(this); + } @@ -66,6 +68,10 @@ e->accept(); ContextMenu->popup(e->globalPos()); } +void KeepassEntryView::resizeEvent(QResizeEvent* e){ + +e->accept(); +} void KeepassEntryView::updateItems(unsigned int GroupID){ diff --git a/src/lib/EntryView.h b/src/lib/EntryView.h index aebd5b5..b8f704b 100644 --- a/src/lib/EntryView.h +++ b/src/lib/EntryView.h @@ -40,9 +40,11 @@ public: private: void setEntry(CEntry* entry); int CurrentGroup; + QListColumnSizes; protected: virtual void contextMenuEvent(QContextMenuEvent *event); - virtual void paintEvent ( QPaintEvent * event ); + virtual void paintEvent(QPaintEvent* event); + virtual void resizeEvent(QResizeEvent* event); }; diff --git a/src/lib/KpFileIconProvider.cpp b/src/lib/KpFileIconProvider.cpp new file mode 100644 index 0000000..1572fd9 --- /dev/null +++ b/src/lib/KpFileIconProvider.cpp @@ -0,0 +1,19 @@ +/*************************************************************************** + * 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; 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. * + ***************************************************************************/ diff --git a/src/lib/KpFileIconProvider.h b/src/lib/KpFileIconProvider.h new file mode 100644 index 0000000..f0625aa --- /dev/null +++ b/src/lib/KpFileIconProvider.h @@ -0,0 +1,28 @@ +/*************************************************************************** + * 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; 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 +#include + +class KpFileIconProvider : public QFileIconProvider{ +public: + virtual QIcon icon(IconType type) const; + virtual QIcon icon(const QFileInfo& info) const; +}; \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 22fa2b1..bff4557 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -88,6 +88,7 @@ else{ config.loadFromIni(IniFilename);} + //Internationalization QLocale loc=QLocale::system(); QTranslator* translator = 0; @@ -207,15 +208,21 @@ if(Img.load(AppDir+"/../share/keepass/icons/"+name)==false){ } +#define _loadIcon(_VAR,_NAME)\ + _VAR=new QIcon(ThemeDir+_NAME); + void loadImages(){ -QString ThemeDir="nuvola/32x32"; +bool small=true; +QString ThemeDir=AppDir+"/../share/keepass/icons/nuvola/32x32"; QPixmap tmpImg; + //----------------------- loadImg("clientic.png",tmpImg); EntryIcons=new QPixmap[NUM_CLIENT_ICONS]; for(int i=0;isetSizes(QList() << config.MainWinSplit1 << config.MainWinSplit2); QuickSearchEdit=new QLineEdit(toolBar); QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); setupIcons(); @@ -530,8 +531,6 @@ if(dlg.exec()) setStateFileModified(true); } void KeepassMainWindow::OnFileExit(){ -if(FileOpen) - if(!closeDatabase())return; close(); } @@ -765,6 +764,11 @@ setStateFileModified(true); } void KeepassMainWindow::closeEvent(QCloseEvent* e){ +config.MainWinHeight=geometry().height(); +config.MainWinWidth=geometry().width(); +config.MainWinSplit1=splitter->sizes()[0]; +config.MainWinSplit2=splitter->sizes()[1]; + if(FileOpen){ if(!closeDatabase()) e->ignore(); diff --git a/src/src.pro b/src/src.pro index 3c86847..738f0cd 100755 --- a/src/src.pro +++ b/src/src.pro @@ -51,7 +51,8 @@ HEADERS += lib/IniReader.h \ main.h \ lib/GroupView.h \ lib/EntryView.h \ - crypto/arcfour.h + crypto/arcfour.h \ + lib/KpFileIconProvider.h SOURCES += lib/IniReader.cpp \ lib/UrlLabel.cpp \ main.cpp \ @@ -83,7 +84,8 @@ SOURCES += lib/IniReader.cpp \ lib/KdePlugin.cpp \ lib/GroupView.cpp \ lib/EntryView.cpp \ - crypto/arcfour.cpp + crypto/arcfour.cpp \ + lib/KpFileIconProvider.cpp QT += xml \ qt3support MOC_DIR = ../build/moc @@ -99,10 +101,10 @@ exceptions \ stl TEMPLATE = app unix{ - target.path = /usr/local/bin + target.path = /usr/local/bin Share.path = /usr/local/share/keepass } macx{ - target.path = /Applications + target.path = /Applications Share.path = /Applications/keepass.app/Contents/share/keepass }