work on view-menu

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@38 b624d157-de02-0410-bad0-e51aec6abb33
master
tariq 19 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" > <property name="title" >
<string>Spalten</string> <string>Spalten</string>
</property> </property>
<addaction name="ViewColumnTitleAction" /> <addaction name="ViewColumnsTitleAction" />
<addaction name="ViewColumnUsernameAction" /> <addaction name="ViewColumnsUsernameAction" />
<addaction name="ViewColumnUrlAction" /> <addaction name="ViewColumnsUrlAction" />
<addaction name="ViewColumnPasswordAction" /> <addaction name="ViewColumnsPasswordAction" />
<addaction name="ViewColumnCommentAction" /> <addaction name="ViewColumnsCommentAction" />
<addaction name="separator" /> <addaction name="separator" />
<addaction name="ViewColumnExpireAction" /> <addaction name="ViewColumnsExpireAction" />
<addaction name="ViewColumnCreationAction" /> <addaction name="ViewColumnsCreationAction" />
<addaction name="ViewColumnLastChangeAction" /> <addaction name="ViewColumnsLastChangeAction" />
<addaction name="ViewColumnLastAccessAction" /> <addaction name="ViewColumnsLastAccessAction" />
<addaction name="ViewColumnAttachmentAction" /> <addaction name="ViewColumnsAttachmentAction" />
</widget> </widget>
<addaction name="ViewShowToolbarAction" /> <addaction name="ViewShowToolbarAction" />
<addaction name="ViewShowEntryDetailsAction" /> <addaction name="ViewShowEntryDetailsAction" />
@ -379,7 +379,7 @@
<string>Passwörter verbergen</string> <string>Passwörter verbergen</string>
</property> </property>
</action> </action>
<action name="ViewColumnTitleAction" > <action name="ViewColumnsTitleAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -387,7 +387,7 @@
<string>Titel</string> <string>Titel</string>
</property> </property>
</action> </action>
<action name="ViewColumnUsernameAction" > <action name="ViewColumnsUsernameAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -395,7 +395,7 @@
<string>Benutzername</string> <string>Benutzername</string>
</property> </property>
</action> </action>
<action name="ViewColumnUrlAction" > <action name="ViewColumnsUrlAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -403,7 +403,7 @@
<string>URL</string> <string>URL</string>
</property> </property>
</action> </action>
<action name="ViewColumnPasswordAction" > <action name="ViewColumnsPasswordAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -411,7 +411,7 @@
<string>Passwort</string> <string>Passwort</string>
</property> </property>
</action> </action>
<action name="ViewColumnCommentAction" > <action name="ViewColumnsCommentAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -419,7 +419,7 @@
<string>Kommentar</string> <string>Kommentar</string>
</property> </property>
</action> </action>
<action name="ViewColumnExpireAction" > <action name="ViewColumnsExpireAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -427,7 +427,7 @@
<string>Ablaufdatum</string> <string>Ablaufdatum</string>
</property> </property>
</action> </action>
<action name="ViewColumnCreationAction" > <action name="ViewColumnsCreationAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -435,7 +435,7 @@
<string>Erstellungsdatum</string> <string>Erstellungsdatum</string>
</property> </property>
</action> </action>
<action name="ViewColumnLastChangeAction" > <action name="ViewColumnsLastChangeAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -443,7 +443,7 @@
<string>Letzte Änderung</string> <string>Letzte Änderung</string>
</property> </property>
</action> </action>
<action name="ViewColumnLastAccessAction" > <action name="ViewColumnsLastAccessAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -451,7 +451,7 @@
<string>Letzter Zugriff</string> <string>Letzter Zugriff</string>
</property> </property>
</action> </action>
<action name="ViewColumnAttachmentAction" > <action name="ViewColumnsAttachmentAction" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>

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

@ -73,13 +73,24 @@ KeepassMainWindow::KeepassMainWindow(QWidget *parent, Qt::WFlags flags):QMainWin
EditDeleteEntryAction->setShortcut(tr("Ctrl+D")); EditDeleteEntryAction->setShortcut(tr("Ctrl+D"));
EditCloneEntryAction->setShortcut(tr("Ctrl+K")); EditCloneEntryAction->setShortcut(tr("Ctrl+K"));
EditSearchAction->setShortcut(tr("Ctrl+F")); EditSearchAction->setShortcut(tr("Ctrl+F"));
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
FileCloseAction->setShortcut(tr("Ctrl+W")); FileCloseAction->setShortcut(tr("Ctrl+W"));
FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S")); FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S"));
EditGroupSearchAction->setShortcut(tr("Shift+Ctrl+F")); EditGroupSearchAction->setShortcut(tr("Shift+Ctrl+F"));
#endif #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=new QLineEdit(toolBar);
QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
@ -116,6 +127,19 @@ void KeepassMainWindow::setupConnections(){
connect(EditSaveAttachmentAction, SIGNAL(triggered()), this, SLOT(OnEditSaveAttachment())); connect(EditSaveAttachmentAction, SIGNAL(triggered()), this, SLOT(OnEditSaveAttachment()));
connect(EditSearchAction, SIGNAL(triggered()), this, SLOT(OnEditSearch())); connect(EditSearchAction, SIGNAL(triggered()), this, SLOT(OnEditSearch()));
connect(EditGroupSearchAction, SIGNAL(triggered()), this, SLOT(OnEditGroupSearch())); 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(&ClipboardTimer, SIGNAL(timeout()), this, SLOT(OnClipboardTimeOut()));
connect(GroupView,SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),this, connect(GroupView,SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),this,
@ -648,3 +672,28 @@ CEntry* KeepassMainWindow::currentEntry(){
Q_ASSERT(EntryView->selectedItems().size()==1); Q_ASSERT(EntryView->selectedItems().size()==1);
return static_cast<EntryViewItem*>(EntryView->selectedItems()[0])->pEntry; 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 OnGroupSelectionChanged();
void OnClipboardTimeOut(); void OnClipboardTimeOut();
void OnQuickSearch(); void OnQuickSearch();
void OnColumnVisibilityChanged(bool show);
void OnUsernPasswVisibilityChanged(bool hide);
void OnFileModified();
private: private:
enum SelectionState{NONE,SINGLE,MULTIPLE,SEARCHGROUP}; enum SelectionState{NONE,SINGLE,MULTIPLE,SEARCHGROUP};
@ -93,6 +96,7 @@ private:
inline void setupToolbar(); inline void setupToolbar();
inline void setupIcons(); inline void setupIcons();
inline void setupConnections(); inline void setupConnections();
inline void setupMenus();
void setStateFileOpen(bool); void setStateFileOpen(bool);
void setStateFileModified(bool); void setStateFileModified(bool);
void setStateGroupSelected(SelectionState s); void setStateGroupSelected(SelectionState s);