From c3bf4f29f1dbe7d92455fdf3d094df2189371acf Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 22 Jul 2005 13:46:03 +0000 Subject: [PATCH] Various Qt UI tweaks. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10345 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 37 +++++++++++++++++++ src/frontends/qt2/QPrefsDialog.C | 4 +- src/frontends/qt2/QRef.C | 2 + src/frontends/qt2/QRefDialog.C | 11 +++++- src/frontends/qt2/ui/QAskForTextDialog.ui | 4 +- src/frontends/qt2/ui/QBibtexDialogBase.ui | 8 ++-- src/frontends/qt2/ui/QBranchDialogBase.ui | 6 +-- src/frontends/qt2/ui/QCharacterDialogBase.ui | 6 +-- src/frontends/qt2/ui/QERTDialogBase.ui | 10 ++--- src/frontends/qt2/ui/QGraphicsDialogBase.ui | 8 ++-- src/frontends/qt2/ui/QIndexDialogBase.ui | 6 +-- src/frontends/qt2/ui/QNoteDialogBase.ui | 10 ++--- src/frontends/qt2/ui/QParagraphDialogBase.ui | 8 ++-- src/frontends/qt2/ui/QPrefConvertersModule.ui | 6 +-- src/frontends/qt2/ui/QPrefLanguageModule.ui | 6 +-- src/frontends/qt2/ui/QPrefUIModule.ui | 6 +-- src/frontends/qt2/ui/QRefDialogBase.ui | 6 +-- src/frontends/qt2/ui/QSendtoDialogBase.ui | 6 +-- 18 files changed, 98 insertions(+), 52 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index eef17293ac..5223789dd0 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,40 @@ +2005-07-22 Angus Leeming + + * QRef.C (update_contents): disable the OK button when the dialog is + first shown. The user must first select a reference. + + * QRefDialog.C (changed_adaptor): only enable the OK button when + the "Label:" field is not empty. + (refHighlighted): set the text in the "Label:" field only when + an item is currently selected in the "Available refs" browser. (When + th signal connected to this slot is triggered.) + + * QBibtexDialogBase.ui: + * QCharacterDialogBase.ui: + * QERTDialogBase.ui: + * QNoteDialogBase.ui: remove the Alt-C shortcut from the Close button. + + * QAskForTextDialog.ui: + * QBibtexDialogBase.ui: + * QBranchDialogBase.ui: + * QERTDialogBase.ui: + * QGraphicsDialogBase.ui: + * QIndexDialogBase.ui: + * QNoteDialogBase.ui: + * QSendtoDialogBase.ui: connect the Alt-O shortcut to the OK button. + + * QBibtexDialogBase.ui: change the shortcut to the "Content" field. + * QERTDialogBase.ui: change the shortcut to the "Open" field. + * QGraphicsDialogBase.ui: change the shortcut to the "Origin" field. + * QNoteDialogBase.ui: change the shortcut to the "Comment" field. + * QParagraphDialogBase.ui: change the shortcut to the "Longest label" + field. + * QPrefConvertersModule.ui: change the shortcut to the "From" field. + * QPrefLanguageModule.ui: change the shortcut to the "Use babel" field. + * QPrefUIModule.ui: change the shortcut to the "Cursor follows + scrollbar" field. + * QRefDialogBase.ui: change the shortcut to the "Labels in:" field. + 2005-07-20 Jürgen Spitzmüller * QDocument.C: diff --git a/src/frontends/qt2/QPrefsDialog.C b/src/frontends/qt2/QPrefsDialog.C index f3283916e9..aaf7cbca9f 100644 --- a/src/frontends/qt2/QPrefsDialog.C +++ b/src/frontends/qt2/QPrefsDialog.C @@ -548,7 +548,7 @@ Format const * getFormat(std::string const & prettyname) } // namespace anon -void QPrefsDialog::switch_copierLB(int nr) +void QPrefsDialog::switch_copierLB(int) { std::string const browser_text = fromqstr(copiersModule->AllCopiersLB->currentText()); @@ -575,7 +575,7 @@ void QPrefsDialog::switch_copierLB(int nr) } -void QPrefsDialog::switch_copierCO(int nr) +void QPrefsDialog::switch_copierCO(int) { std::string const combo_text = fromqstr(copiersModule->copierFormatCO->currentText()); diff --git a/src/frontends/qt2/QRef.C b/src/frontends/qt2/QRef.C index 984c9d2d2f..fc8791cb59 100644 --- a/src/frontends/qt2/QRef.C +++ b/src/frontends/qt2/QRef.C @@ -16,6 +16,7 @@ #include "Qt2BC.h" #include "qt_helpers.h" +#include "controllers/ButtonController.h" #include "controllers/ControlRef.h" #include "insets/insetref.h" @@ -99,6 +100,7 @@ void QRef::update_contents() dialog_->bufferCO->setCurrentItem(controller().getBufferNum()); updateRefs(); + bc().valid(false); } diff --git a/src/frontends/qt2/QRefDialog.C b/src/frontends/qt2/QRefDialog.C index 66ecfa8ce2..619f5c5816 100644 --- a/src/frontends/qt2/QRefDialog.C +++ b/src/frontends/qt2/QRefDialog.C @@ -44,7 +44,8 @@ void QRefDialog::show() void QRefDialog::changed_adaptor() { - form_->changed(); + if (!referenceED->text().isEmpty()) + form_->changed(); } @@ -59,7 +60,13 @@ void QRefDialog::refHighlighted(const QString & sel) if (form_->readOnly()) return; - referenceED->setText(sel); + int const cur_item = refsLB->currentItem(); + bool const cur_item_selected = cur_item >= 0 ? + refsLB->isSelected(cur_item) : false; + + if (cur_item_selected) + referenceED->setText(sel); + if (form_->at_ref_) form_->gotoRef(); gotoPB->setEnabled(true); diff --git a/src/frontends/qt2/ui/QAskForTextDialog.ui b/src/frontends/qt2/ui/QAskForTextDialog.ui index 3d8891b30c..c57c3765e7 100644 --- a/src/frontends/qt2/ui/QAskForTextDialog.ui +++ b/src/frontends/qt2/ui/QAskForTextDialog.ui @@ -13,7 +13,7 @@ 0 0 - 273 + 269 116 @@ -121,7 +121,7 @@ text - OK + &OK default diff --git a/src/frontends/qt2/ui/QBibtexDialogBase.ui b/src/frontends/qt2/ui/QBibtexDialogBase.ui index a91335fdc4..1acc0d2bc7 100644 --- a/src/frontends/qt2/ui/QBibtexDialogBase.ui +++ b/src/frontends/qt2/ui/QBibtexDialogBase.ui @@ -13,13 +13,13 @@ 0 0 - 298 + 352 313 caption - + QBibtexDialogBase sizeGripEnabled @@ -104,7 +104,7 @@ text - OK + &OK autoDefault @@ -338,7 +338,7 @@ text - C&ontent: + &Content: buddy diff --git a/src/frontends/qt2/ui/QBranchDialogBase.ui b/src/frontends/qt2/ui/QBranchDialogBase.ui index 90bbeb0385..1335721ce3 100644 --- a/src/frontends/qt2/ui/QBranchDialogBase.ui +++ b/src/frontends/qt2/ui/QBranchDialogBase.ui @@ -14,12 +14,12 @@ 0 0 188 - 99 + 129 caption - + QBranchDialogBase sizeGripEnabled @@ -42,7 +42,7 @@ text - OK + &OK default diff --git a/src/frontends/qt2/ui/QCharacterDialogBase.ui b/src/frontends/qt2/ui/QCharacterDialogBase.ui index 9d9352f29e..0a92d9e942 100644 --- a/src/frontends/qt2/ui/QCharacterDialogBase.ui +++ b/src/frontends/qt2/ui/QCharacterDialogBase.ui @@ -13,13 +13,13 @@ 0 0 - 360 + 356 305 caption - + QCharacterDialogBase sizeGripEnabled @@ -537,7 +537,7 @@ text - &Close + Close autoDefault diff --git a/src/frontends/qt2/ui/QERTDialogBase.ui b/src/frontends/qt2/ui/QERTDialogBase.ui index 8b5d7bc6d6..a5bd708dea 100644 --- a/src/frontends/qt2/ui/QERTDialogBase.ui +++ b/src/frontends/qt2/ui/QERTDialogBase.ui @@ -14,12 +14,12 @@ 0 0 197 - 158 + 194 caption - + QERTDialogBase sizeGripEnabled @@ -91,7 +91,7 @@ text - &Open + O&pen toolTip @@ -144,7 +144,7 @@ text - OK + &OK default @@ -159,7 +159,7 @@ text - &Close + Close default diff --git a/src/frontends/qt2/ui/QGraphicsDialogBase.ui b/src/frontends/qt2/ui/QGraphicsDialogBase.ui index 75f569363c..470c9e801c 100644 --- a/src/frontends/qt2/ui/QGraphicsDialogBase.ui +++ b/src/frontends/qt2/ui/QGraphicsDialogBase.ui @@ -13,7 +13,7 @@ 0 0 - 455 + 451 549 @@ -26,7 +26,7 @@ caption - + QGraphicsDialogBase sizeGripEnabled @@ -104,7 +104,7 @@ text - OK + &OK autoDefault @@ -279,7 +279,7 @@ text - &Origin: + Or&igin: buddy diff --git a/src/frontends/qt2/ui/QIndexDialogBase.ui b/src/frontends/qt2/ui/QIndexDialogBase.ui index fdcd193d22..d2bf7d84bf 100644 --- a/src/frontends/qt2/ui/QIndexDialogBase.ui +++ b/src/frontends/qt2/ui/QIndexDialogBase.ui @@ -13,13 +13,13 @@ 0 0 - 197 + 203 82 caption - + QIndexDialogBase sizeGripEnabled @@ -125,7 +125,7 @@ text - OK + &OK default diff --git a/src/frontends/qt2/ui/QNoteDialogBase.ui b/src/frontends/qt2/ui/QNoteDialogBase.ui index 9609d0c60f..815a2948bb 100644 --- a/src/frontends/qt2/ui/QNoteDialogBase.ui +++ b/src/frontends/qt2/ui/QNoteDialogBase.ui @@ -14,12 +14,12 @@ 0 0 188 - 146 + 192 caption - + QNoteDialogBase sizeGripEnabled @@ -42,7 +42,7 @@ text - OK + &OK default @@ -57,7 +57,7 @@ text - &Close + Close default @@ -106,7 +106,7 @@ text - C&omment + &Comment toolTip diff --git a/src/frontends/qt2/ui/QParagraphDialogBase.ui b/src/frontends/qt2/ui/QParagraphDialogBase.ui index 9c5f980f0b..6b0fc6de4e 100644 --- a/src/frontends/qt2/ui/QParagraphDialogBase.ui +++ b/src/frontends/qt2/ui/QParagraphDialogBase.ui @@ -13,13 +13,13 @@ 0 0 - 400 - 214 + 396 + 254 caption - + QParagraphDialogBase sizeGripEnabled @@ -272,7 +272,7 @@ text - Lo&ngest label + &Longest label buddy diff --git a/src/frontends/qt2/ui/QPrefConvertersModule.ui b/src/frontends/qt2/ui/QPrefConvertersModule.ui index 9fa8fd4a13..53eb3f0624 100644 --- a/src/frontends/qt2/ui/QPrefConvertersModule.ui +++ b/src/frontends/qt2/ui/QPrefConvertersModule.ui @@ -13,13 +13,13 @@ 0 0 - 458 + 472 265 caption - + QPrefConvertersModule @@ -133,7 +133,7 @@ text - F&rom: + &From: buddy diff --git a/src/frontends/qt2/ui/QPrefLanguageModule.ui b/src/frontends/qt2/ui/QPrefLanguageModule.ui index f2482e9130..b3ae15310a 100644 --- a/src/frontends/qt2/ui/QPrefLanguageModule.ui +++ b/src/frontends/qt2/ui/QPrefLanguageModule.ui @@ -13,13 +13,13 @@ 0 0 - 333 + 360 323 caption - + QPrefLanguageModule @@ -137,7 +137,7 @@ text - Use &babel + Use b&abel diff --git a/src/frontends/qt2/ui/QPrefUIModule.ui b/src/frontends/qt2/ui/QPrefUIModule.ui index f65e7bcb8c..0fa365f90e 100644 --- a/src/frontends/qt2/ui/QPrefUIModule.ui +++ b/src/frontends/qt2/ui/QPrefUIModule.ui @@ -13,7 +13,7 @@ 0 0 - 420 + 416 441 @@ -26,7 +26,7 @@ caption - + QPrefUIModule @@ -374,7 +374,7 @@ text - Cursor follo&ws scrollbar + Cursor follows &scrollbar diff --git a/src/frontends/qt2/ui/QRefDialogBase.ui b/src/frontends/qt2/ui/QRefDialogBase.ui index 130cdd6476..53b1184833 100644 --- a/src/frontends/qt2/ui/QRefDialogBase.ui +++ b/src/frontends/qt2/ui/QRefDialogBase.ui @@ -13,13 +13,13 @@ 0 0 - 355 + 351 423 caption - + QRefDialogBase sizeGripEnabled @@ -361,7 +361,7 @@ text - L&abels in: + La&bels in: buddy diff --git a/src/frontends/qt2/ui/QSendtoDialogBase.ui b/src/frontends/qt2/ui/QSendtoDialogBase.ui index b3bd77492b..80b3bc9901 100644 --- a/src/frontends/qt2/ui/QSendtoDialogBase.ui +++ b/src/frontends/qt2/ui/QSendtoDialogBase.ui @@ -13,13 +13,13 @@ 0 0 - 276 + 282 262 caption - + QSendtoDialogBase sizeGripEnabled @@ -87,7 +87,7 @@ text - OK + &OK autoDefault