Allow EditEntry Dialog to be smaller

Fixed: Line breaks are ignored in Entry Detail View

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@206 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 17 years ago
parent 0c7ad0dcaa
commit bc8ec1b520
  1. 34
      src/forms/EditEntryDlg.ui
  2. 171
      src/mainwindow.cpp

@ -20,18 +20,12 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>6</number>
</property>
<item rowspan="2" row="5" column="1" >
<layout class="QGridLayout" >
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="1" >
@ -240,6 +234,12 @@
</item>
<item row="8" column="1" >
<widget class="QTextEdit" name="Edit_Comment" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="tabChangesFocus" >
<bool>true</bool>
</property>
@ -282,7 +282,9 @@
<string/>
</property>
<property name="icon" >
<iconset/>
<iconset>
<normaloff/>
</iconset>
</property>
<property name="iconSize" >
<size>
@ -298,7 +300,9 @@
<string/>
</property>
<property name="icon" >
<iconset/>
<iconset>
<normaloff/>
</iconset>
</property>
<property name="iconSize" >
<size>
@ -314,7 +318,9 @@
<string/>
</property>
<property name="icon" >
<iconset/>
<iconset>
<normaloff/>
</iconset>
</property>
<property name="iconSize" >
<size>
@ -424,7 +430,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>100</width>
<height>20</height>
@ -460,7 +466,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
@ -472,7 +478,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>50</height>

@ -660,7 +660,7 @@ void KeepassMainWindow::updateDetailView(){
templ.replace("%lastmod%",entry->lastMod().toString(Qt::DefaultLocaleShortDate));
templ.replace("%lastaccess%",entry->lastAccess().toString(Qt::DefaultLocaleShortDate));
templ.replace("%expire%",entry->expire().toString(Qt::DefaultLocaleShortDate));
templ.replace("%comment%",entry->comment());
templ.replace("%comment%",entry->comment().replace("\n","<br/>"));
templ.replace("%attachment%",entry->binaryDesc());
if(entry->expire()!=Date_Never){
@ -715,100 +715,105 @@ void KeepassMainWindow::updateDetailView(){
void KeepassMainWindow::setStateEntrySelected(SelectionState s){
EntrySelection=s;
if(GroupSelection == NONE || GroupSelection == SINGLE)
switch(EntrySelection){
case NONE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(false);
EditDeleteEntryAction->setText(tr("Delete Entry"));
EntrySelection = s;
if (GroupSelection == NONE || GroupSelection == SINGLE){
switch (EntrySelection){
case NONE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(false);
EditDeleteEntryAction->setText(tr("Delete Entry"));
#ifdef AUTOTYPE
EditAutoTypeAction->setEnabled(false);
EditAutoTypeAction->setEnabled(false);
#endif
break;
case SINGLE:
EditPasswordToClipboardAction->setEnabled(true);
EditUsernameToClipboardAction->setEnabled(true);
EditOpenUrlAction->setEnabled(true);
EditSaveAttachmentAction->setEnabled(((EntryViewItem*)(EntryView->selectedItems()[0]))->EntryHandle->binarySize() > 0);
EditEditEntryAction->setEnabled(true);
EditCloneEntryAction->setEnabled(true);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entry"));
break;
case SINGLE:
EditPasswordToClipboardAction->setEnabled(true);
EditUsernameToClipboardAction->setEnabled(true);
EditOpenUrlAction->setEnabled(true);
EditSaveAttachmentAction->setEnabled(((EntryViewItem*)(EntryView->selectedItems()[0]))->EntryHandle->binarySize() > 0);
EditEditEntryAction->setEnabled(true);
EditCloneEntryAction->setEnabled(true);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entry"));
#ifdef AUTOTYPE
EditAutoTypeAction->setEnabled(true);
EditAutoTypeAction->setEnabled(true);
#endif
break;
case MULTIPLE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(true);
EditCloneEntryAction->setText(tr("Clone Entries"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entries"));
break;
case MULTIPLE:
EditPasswordToClipboardAction->setEnabled(false);
EditUsernameToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(true);
EditCloneEntryAction->setText(tr("Clone Entries"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entries"));
#ifdef AUTOTYPE
EditAutoTypeAction->setEnabled(false);
EditAutoTypeAction->setEnabled(false);
#endif
break;
default: Q_ASSERT(false);
}
else if(GroupSelection == SEARCHGROUP)
switch(EntrySelection){
case NONE:
EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(false);
EditDeleteEntryAction->setText(tr("Delete Entry"));
break;
default:
Q_ASSERT(false);
}
}
else if (GroupSelection == SEARCHGROUP){
switch(EntrySelection){
case NONE:
EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(false);
EditDeleteEntryAction->setText(tr("Delete Entry"));
#ifdef AUTOTYPE
EditAutoTypeAction->setEnabled(false);
EditAutoTypeAction->setEnabled(false);
#endif
break;
case SINGLE:
EditUsernameToClipboardAction->setEnabled(true);
EditPasswordToClipboardAction->setEnabled(true);
EditOpenUrlAction->setEnabled(true);
EditSaveAttachmentAction->setEnabled(((EntryViewItem*)(EntryView->selectedItems()[0]))->EntryHandle->binarySize() > 0);
EditEditEntryAction->setEnabled(true);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entry"));
break;
case SINGLE:
EditUsernameToClipboardAction->setEnabled(true);
EditPasswordToClipboardAction->setEnabled(true);
EditOpenUrlAction->setEnabled(true);
EditSaveAttachmentAction->setEnabled(((EntryViewItem*)(EntryView->selectedItems()[0]))->EntryHandle->binarySize() > 0);
EditEditEntryAction->setEnabled(true);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entry"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entry"));
#ifdef AUTOTYPE
EditAutoTypeAction->setEnabled(true);
EditAutoTypeAction->setEnabled(true);
#endif
break;
case MULTIPLE:
EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entries"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entries"));
break;
case MULTIPLE:
EditUsernameToClipboardAction->setEnabled(false);
EditPasswordToClipboardAction->setEnabled(false);
EditOpenUrlAction->setEnabled(false);
EditSaveAttachmentAction->setEnabled(false);
EditEditEntryAction->setEnabled(false);
EditCloneEntryAction->setEnabled(false);
EditCloneEntryAction->setText(tr("Clone Entries"));
EditDeleteEntryAction->setEnabled(true);
EditDeleteEntryAction->setText(tr("Delete Entries"));
#ifdef AUTOTYPE
EditAutoTypeAction->setEnabled(false);
EditAutoTypeAction->setEnabled(false);
#endif
break;
default: Q_ASSERT(false);
}
else Q_ASSERT(false);
break;
default:
Q_ASSERT(false);
}
}
else
Q_ASSERT(false);
}