* GuiBibtex.cpp:

- yet another tweak to button enabling.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22512 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-01-12 11:49:49 +00:00
parent f78f28f4fc
commit 709960ff66

View File

@ -109,6 +109,8 @@ GuiBibtex::GuiBibtex(GuiView & lv)
bc().addReadOnly(deletePB);
bc().addReadOnly(upPB);
bc().addReadOnly(downPB);
// Delete/Up/Down are handled with more conditions in
// databaseChanged().
// Make sure the delete/up/down buttons are disabled if necessary.
databaseChanged();
@ -265,8 +267,10 @@ void GuiBibtex::downPressed()
void GuiBibtex::databaseChanged()
{
deletePB->setEnabled(!isBufferReadonly() && databaseLW->currentRow() != -1);
upPB->setEnabled(!isBufferReadonly() && databaseLW->count() > 1 && databaseLW->currentRow() > 0);
downPB->setEnabled(!isBufferReadonly() && databaseLW->count() > 1 && databaseLW->currentRow() < databaseLW->count() - 1);
upPB->setEnabled(!isBufferReadonly() && databaseLW->count() > 1 &&
databaseLW->currentRow() > 0);
downPB->setEnabled(!isBufferReadonly() && databaseLW->count() > 1 &&
databaseLW->currentRow() < databaseLW->count() - 1);
}