work on view-menu

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@38 b624d157-de02-0410-bad0-e51aec6abb33
master
tariq 18 years ago
parent e304c11c57
commit 61d445475a
  1. 40
      src/forms/MainWindow.ui
  2. 3
      src/lib/EntryView.cpp
  3. 51
      src/mainwindow.cpp
  4. 4
      src/mainwindow.h

@ -172,17 +172,17 @@
<property name="title" >
<string>Spalten</string>
</property>
<addaction name="ViewColumnTitleAction" />
<addaction name="ViewColumnUsernameAction" />
<addaction name="ViewColumnUrlAction" />
<addaction name="ViewColumnPasswordAction" />
<addaction name="ViewColumnCommentAction" />
<addaction name="ViewColumnsTitleAction" />
<addaction name="ViewColumnsUsernameAction" />
<addaction name="ViewColumnsUrlAction" />
<addaction name="ViewColumnsPasswordAction" />
<addaction name="ViewColumnsCommentAction" />
<addaction name="separator" />
<addaction name="ViewColumnExpireAction" />
<addaction name="ViewColumnCreationAction" />
<addaction name="ViewColumnLastChangeAction" />
<addaction name="ViewColumnLastAccessAction" />
<addaction name="ViewColumnAttachmentAction" />
<addaction name="ViewColumnsExpireAction" />
<addaction name="ViewColumnsCreationAction" />
<addaction name="ViewColumnsLastChangeAction" />
<addaction name="ViewColumnsLastAccessAction" />
<addaction name="ViewColumnsAttachmentAction" />
</widget>
<addaction name="ViewShowToolbarAction" />
<addaction name="ViewShowEntryDetailsAction" />
@ -379,7 +379,7 @@
<string>Passwörter verbergen</string>
</property>
</action>
<action name="ViewColumnTitleAction" >
<action name="ViewColumnsTitleAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -387,7 +387,7 @@
<string>Titel</string>
</property>
</action>
<action name="ViewColumnUsernameAction" >
<action name="ViewColumnsUsernameAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -395,7 +395,7 @@
<string>Benutzername</string>
</property>
</action>
<action name="ViewColumnUrlAction" >
<action name="ViewColumnsUrlAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -403,7 +403,7 @@
<string>URL</string>
</property>
</action>
<action name="ViewColumnPasswordAction" >
<action name="ViewColumnsPasswordAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -411,7 +411,7 @@
<string>Passwort</string>
</property>
</action>
<action name="ViewColumnCommentAction" >
<action name="ViewColumnsCommentAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -419,7 +419,7 @@
<string>Kommentar</string>
</property>
</action>
<action name="ViewColumnExpireAction" >
<action name="ViewColumnsExpireAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -427,7 +427,7 @@
<string>Ablaufdatum</string>
</property>
</action>
<action name="ViewColumnCreationAction" >
<action name="ViewColumnsCreationAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -435,7 +435,7 @@
<string>Erstellungsdatum</string>
</property>
</action>
<action name="ViewColumnLastChangeAction" >
<action name="ViewColumnsLastChangeAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -443,7 +443,7 @@
<string>Letzte Änderung</string>
</property>
</action>
<action name="ViewColumnLastAccessAction" >
<action name="ViewColumnsLastAccessAction" >
<property name="checkable" >
<bool>true</bool>
</property>
@ -451,7 +451,7 @@
<string>Letzter Zugriff</string>
</property>
</action>
<action name="ViewColumnAttachmentAction" >
<action name="ViewColumnsAttachmentAction" >
<property name="checkable" >
<bool>true</bool>
</property>

@ -135,6 +135,7 @@ if(entry->GroupID==CurrentGroup){
void KeepassEntryView::updateColumns(){
setColumnCount(0);
QStringList cols;
if(config.Columns[0]){
cols << trUtf8("Titel");}
@ -151,7 +152,7 @@ if(config.Columns[5]){
if(config.Columns[6]){
cols << trUtf8("Erstellung");}
if(config.Columns[7]){
cols << trUtf8("letzte Änderung");}
cols << trUtf8("letzte Ãnderung");}
if(config.Columns[8]){
cols << trUtf8("letzter Zugriff");}
if(config.Columns[9]){

@ -73,13 +73,24 @@ KeepassMainWindow::KeepassMainWindow(QWidget *parent, Qt::WFlags flags):QMainWin
EditDeleteEntryAction->setShortcut(tr("Ctrl+D"));
EditCloneEntryAction->setShortcut(tr("Ctrl+K"));
EditSearchAction->setShortcut(tr("Ctrl+F"));
#ifdef Q_WS_MAC
FileCloseAction->setShortcut(tr("Ctrl+W"));
FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S"));
EditGroupSearchAction->setShortcut(tr("Shift+Ctrl+F"));
#endif
ViewHidePasswordsAction->setChecked(config.ListView_HidePasswords);
ViewHideUsernamesAction->setChecked(config.ListView_HideUsernames);
ViewColumnsTitleAction->setChecked(config.Columns[0]);
ViewColumnsUsernameAction->setChecked(config.Columns[1]);
ViewColumnsUrlAction->setChecked(config.Columns[2]);
ViewColumnsPasswordAction->setChecked(config.Columns[3]);
ViewColumnsCommentAction->setChecked(config.Columns[4]);
ViewColumnsExpireAction->setChecked(config.Columns[5]);
ViewColumnsCreationAction->setChecked(config.Columns[6]);
ViewColumnsLastChangeAction->setChecked(config.Columns[7]);
ViewColumnsLastAccessAction->setChecked(config.Columns[8]);
ViewColumnsAttachmentAction->setChecked(config.Columns[9]);
QuickSearchEdit=new QLineEdit(toolBar);
QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
@ -116,6 +127,19 @@ void KeepassMainWindow::setupConnections(){
connect(EditSaveAttachmentAction, SIGNAL(triggered()), this, SLOT(OnEditSaveAttachment()));
connect(EditSearchAction, SIGNAL(triggered()), this, SLOT(OnEditSearch()));
connect(EditGroupSearchAction, SIGNAL(triggered()), this, SLOT(OnEditGroupSearch()));
connect(ViewHidePasswordsAction,SIGNAL(toggled(bool)), this, SLOT(OnUsernPasswVisibilityChanged(bool)));
connect(ViewHideUsernamesAction,SIGNAL(toggled(bool)), this, SLOT(OnUsernPasswVisibilityChanged(bool)));
connect(ViewColumnsTitleAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsUsernameAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsUrlAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsPasswordAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsCommentAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsExpireAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsCreationAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsLastChangeAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsLastAccessAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(ViewColumnsAttachmentAction,SIGNAL(toggled(bool)), this, SLOT(OnColumnVisibilityChanged(bool)));
connect(&ClipboardTimer, SIGNAL(timeout()), this, SLOT(OnClipboardTimeOut()));
connect(GroupView,SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),this,
@ -648,3 +672,28 @@ CEntry* KeepassMainWindow::currentEntry(){
Q_ASSERT(EntryView->selectedItems().size()==1);
return static_cast<EntryViewItem*>(EntryView->selectedItems()[0])->pEntry;
}
void KeepassMainWindow::OnColumnVisibilityChanged(bool value){
config.Columns[0]=ViewColumnsTitleAction->isChecked();
config.Columns[1]=ViewColumnsUsernameAction->isChecked();
config.Columns[2]=ViewColumnsUrlAction->isChecked();
config.Columns[3]=ViewColumnsPasswordAction->isChecked();
config.Columns[4]=ViewColumnsCommentAction->isChecked();
config.Columns[5]=ViewColumnsExpireAction->isChecked();
config.Columns[6]=ViewColumnsCreationAction->isChecked();
config.Columns[7]=ViewColumnsLastChangeAction->isChecked();
config.Columns[8]=ViewColumnsLastAccessAction->isChecked();
config.Columns[9]=ViewColumnsAttachmentAction->isChecked();
EntryView->updateColumns();
EntryView->updateItems();
}
void KeepassMainWindow::OnUsernPasswVisibilityChanged(bool value){
config.ListView_HidePasswords=ViewHidePasswordsAction->isChecked();
config.ListView_HideUsernames=ViewHideUsernamesAction->isChecked();
EntryView->updateItems();
}
void KeepassMainWindow::OnFileModified(){
setStateFileModified(true);
}

@ -81,6 +81,9 @@ private slots:
void OnGroupSelectionChanged();
void OnClipboardTimeOut();
void OnQuickSearch();
void OnColumnVisibilityChanged(bool show);
void OnUsernPasswVisibilityChanged(bool hide);
void OnFileModified();
private:
enum SelectionState{NONE,SINGLE,MULTIPLE,SEARCHGROUP};
@ -93,6 +96,7 @@ private:
inline void setupToolbar();
inline void setupIcons();
inline void setupConnections();
inline void setupMenus();
void setStateFileOpen(bool);
void setStateFileModified(bool);
void setStateGroupSelected(SelectionState s);