mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
* GuiBranches.cpp:
* GuiIndices.{cpp,h}: more UI polishment. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30462 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5166030174
commit
eab8801afe
@ -112,6 +112,8 @@ void GuiBranches::updateView()
|
|||||||
!branchesTW->selectedItems().isEmpty();
|
!branchesTW->selectedItems().isEmpty();
|
||||||
removePB->setEnabled(have_sel);
|
removePB->setEnabled(have_sel);
|
||||||
renamePB->setEnabled(have_sel);
|
renamePB->setEnabled(have_sel);
|
||||||
|
colorPB->setEnabled(have_sel);
|
||||||
|
activatePB->setEnabled(have_sel);
|
||||||
// emit signal
|
// emit signal
|
||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
@ -205,6 +207,8 @@ void GuiBranches::on_branchesTW_itemSelectionChanged()
|
|||||||
!branchesTW->selectedItems().isEmpty();
|
!branchesTW->selectedItems().isEmpty();
|
||||||
removePB->setEnabled(have_sel);
|
removePB->setEnabled(have_sel);
|
||||||
renamePB->setEnabled(have_sel);
|
renamePB->setEnabled(have_sel);
|
||||||
|
colorPB->setEnabled(have_sel);
|
||||||
|
activatePB->setEnabled(have_sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -123,6 +123,11 @@ void GuiIndices::updateView()
|
|||||||
indicesTW->setItemSelected(newItem, true);
|
indicesTW->setItemSelected(newItem, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool const have_sel =
|
||||||
|
!indicesTW->selectedItems().isEmpty();
|
||||||
|
removePB->setEnabled(have_sel);
|
||||||
|
renamePB->setEnabled(have_sel);
|
||||||
|
colorPB->setEnabled(have_sel);
|
||||||
// emit signal
|
// emit signal
|
||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
@ -196,8 +201,11 @@ void GuiIndices::on_renamePB_clicked()
|
|||||||
sel_index = selItem->text(0);
|
sel_index = selItem->text(0);
|
||||||
if (!sel_index.isEmpty()) {
|
if (!sel_index.isEmpty()) {
|
||||||
docstring newname;
|
docstring newname;
|
||||||
|
docstring const oldname = qstring_to_ucs4(sel_index);
|
||||||
bool success = false;
|
bool success = false;
|
||||||
if (Alert::askForText(newname, _("Enter new index name"))) {
|
if (Alert::askForText(newname, _("Enter new index name"), oldname)) {
|
||||||
|
if (newname.empty() || oldname == newname)
|
||||||
|
return;
|
||||||
success = indiceslist_.rename(qstring_to_ucs4(sel_index), newname);
|
success = indiceslist_.rename(qstring_to_ucs4(sel_index), newname);
|
||||||
newIndexLE->clear();
|
newIndexLE->clear();
|
||||||
updateView();
|
updateView();
|
||||||
@ -216,6 +224,16 @@ void GuiIndices::on_indicesTW_itemDoubleClicked(QTreeWidgetItem * item, int /*co
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiIndices::on_indicesTW_itemSelectionChanged()
|
||||||
|
{
|
||||||
|
bool const have_sel =
|
||||||
|
!indicesTW->selectedItems().isEmpty();
|
||||||
|
removePB->setEnabled(have_sel);
|
||||||
|
renamePB->setEnabled(have_sel);
|
||||||
|
colorPB->setEnabled(have_sel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiIndices::on_colorPB_clicked()
|
void GuiIndices::on_colorPB_clicked()
|
||||||
{
|
{
|
||||||
toggleColor(indicesTW->currentItem());
|
toggleColor(indicesTW->currentItem());
|
||||||
@ -224,13 +242,16 @@ void GuiIndices::on_colorPB_clicked()
|
|||||||
|
|
||||||
void GuiIndices::on_multipleIndicesCB_toggled(bool const state)
|
void GuiIndices::on_multipleIndicesCB_toggled(bool const state)
|
||||||
{
|
{
|
||||||
|
bool const have_sel =
|
||||||
|
!indicesTW->selectedItems().isEmpty();
|
||||||
indicesTW->setEnabled(state);
|
indicesTW->setEnabled(state);
|
||||||
newIndexLE->setEnabled(state);
|
newIndexLE->setEnabled(state);
|
||||||
newIndexLA->setEnabled(state);
|
newIndexLA->setEnabled(state);
|
||||||
addIndexPB->setEnabled(state);
|
addIndexPB->setEnabled(state);
|
||||||
availableLA->setEnabled(state);
|
availableLA->setEnabled(state);
|
||||||
removePB->setEnabled(state);
|
removePB->setEnabled(state && have_sel);
|
||||||
colorPB->setEnabled(state);
|
colorPB->setEnabled(state && have_sel);
|
||||||
|
renamePB->setEnabled(state && have_sel);
|
||||||
// emit signal
|
// emit signal
|
||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ protected Q_SLOTS:
|
|||||||
void on_renamePB_clicked();
|
void on_renamePB_clicked();
|
||||||
void on_removePB_pressed();
|
void on_removePB_pressed();
|
||||||
void on_indicesTW_itemDoubleClicked(QTreeWidgetItem *, int);
|
void on_indicesTW_itemDoubleClicked(QTreeWidgetItem *, int);
|
||||||
|
void on_indicesTW_itemSelectionChanged();
|
||||||
void on_colorPB_clicked();
|
void on_colorPB_clicked();
|
||||||
void on_multipleIndicesCB_toggled(bool);
|
void on_multipleIndicesCB_toggled(bool);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user