From 6790221b2b83b19520ffcf2cb32c1accd6922f31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sat, 19 Apr 2008 16:56:40 +0000 Subject: [PATCH] Fix bug 4656 (OK and Cancel buttons for Paragraph dialog). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24364 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiParagraph.cpp | 37 ++++- src/frontends/qt4/GuiParagraph.h | 5 + src/frontends/qt4/ui/ParagraphUi.ui | 246 +++++++++++++++------------- 3 files changed, 167 insertions(+), 121 deletions(-) diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index 4966894208..b73a5f53ae 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -64,6 +64,7 @@ GuiParagraph::GuiParagraph(GuiView & lv) // foreground and are hidden when the main window is not focused. setWindowFlags(Qt::Tool); synchronizedViewCB->setChecked(true); + closePB->setText(qt_("&Cancel")); #else synchronizedViewCB->setChecked(false); #endif @@ -151,6 +152,11 @@ void GuiParagraph::on_synchronizedViewCB_toggled() bool in_sync = synchronizedViewCB->isChecked(); restorePB->setEnabled(!in_sync); applyPB->setEnabled(!in_sync); + okPB->setEnabled(!in_sync); + if (!in_sync) + closePB->setText(qt_("&Cancel")); + else + closePB->setText(qt_("&Close")); } @@ -162,6 +168,31 @@ void GuiParagraph::changed() void GuiParagraph::on_applyPB_clicked() +{ + applyView(); +} + + +void GuiParagraph::on_okPB_clicked() +{ + applyView(); + hide(); +} + + +void GuiParagraph::on_closePB_clicked() +{ + hide(); +} + + +void GuiParagraph::on_restorePB_clicked() +{ + updateView(); +} + + +void GuiParagraph::applyView() { ParagraphParameters & pp = params(); @@ -201,12 +232,6 @@ void GuiParagraph::on_applyPB_clicked() } -void GuiParagraph::on_restorePB_clicked() -{ - updateView(); -} - - void GuiParagraph::updateView() { on_synchronizedViewCB_toggled(); diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index 949fcc868b..328acfe547 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -41,6 +41,7 @@ public: /// Dialog inherited methods //@{ + void applyView(); void updateView(); void dispatchParams(); void enableView(bool enable); @@ -79,6 +80,10 @@ private Q_SLOTS: void on_linespacing_activated(int); /// Apply changes void on_applyPB_clicked(); + /// Apply changes and close + void on_okPB_clicked(); + /// Close/Cancel dialog + void on_closePB_clicked(); private: /// diff --git a/src/frontends/qt4/ui/ParagraphUi.ui b/src/frontends/qt4/ui/ParagraphUi.ui index eeb03e5dd9..5916f36aa0 100644 --- a/src/frontends/qt4/ui/ParagraphUi.ui +++ b/src/frontends/qt4/ui/ParagraphUi.ui @@ -5,8 +5,8 @@ 0 0 - 310 - 201 + 375 + 241 @@ -22,20 +22,90 @@ 6 - - + + + + Qt::Horizontal + + + + 231 + 20 + + + + + + + + Qt::RightToLeft + - &Indent Paragraph + I&mmediate Apply - - - - false + + + + 0 + + + 6 + + + + &Restore + + + false + + + + + + + Qt::Horizontal + + + + 31 + 27 + + + + + + + + &OK + + + + + + + &Apply + + + false + + + + + + + &Close + + + + + + + - Label Width + Alignment true @@ -47,33 +117,61 @@ 6 - - + + - This text defines the width of the paragraph label + Use the default alignment for this paragraph, whatever it is. + + + Paragraph's &Default - - - - This text defines the width of the paragraph label + + + + Ri&ght + + + + - Lo&ngest label + C&enter - - labelWidth + + + + + + &Left + + + + + + + &Justified - - + + + + &Indent Paragraph + + + + + + + false + - Alignment + Label Width true @@ -85,52 +183,23 @@ 6 - - - - - MS Shell Dlg 2 - 8 - 50 - false - false - false - false - - + + - Use the default alignment for this paragraph, whatever it is. - - - Paragraph's &Default - - - - - - - &Justified + This text defines the width of the paragraph label - - - - &Left + + + + This text defines the width of the paragraph label - - - - - &Center + Lo&ngest label - - - - - - Ri&ght + + labelWidth @@ -191,59 +260,6 @@ - - - - 0 - - - 6 - - - - - &Restore - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - I&mmediate Apply - - - - - - - &Apply - - - false - - - - - -- 2.39.2