From: John Spray Date: Sat, 28 Jan 2006 18:32:38 +0000 (+0000) Subject: preamble editing in GTK document dialog X-Git-Tag: 1.6.10~13656 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=555db1ce35f472ce9092d8fc7e15a7a6dcc9c848;p=features.git preamble editing in GTK document dialog git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10789 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index 87c01e8bb9..265ebeda61 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -2,6 +2,9 @@ * GtkLengthEntry.[Ch]: implement signal_changed, setup spin limits * GWrap.[Ch], glade/wrap.glade: Add Wrap dialog + * GDocument.[Ch], Dialogs.C: Implemented preamble editing in + document dialog. "dialog-show preamble" will now violate + an assertion in Dialogs.C. 2006-01-27 Bernhard Reiter diff --git a/src/frontends/gtk/Dialogs.C b/src/frontends/gtk/Dialogs.C index 27da3849ee..25d3f3ae4f 100644 --- a/src/frontends/gtk/Dialogs.C +++ b/src/frontends/gtk/Dialogs.C @@ -40,7 +40,6 @@ #include "ControlMath.h" #include "ControlNote.h" #include "ControlParagraph.h" -#include "ControlPreamble.h" #include "ControlPrefs.h" #include "ControlPrint.h" #include "ControlRef.h" @@ -80,7 +79,6 @@ //#include "FormMathsStyle.h" #include "GNote.h" #include "GParagraph.h" -//#include "FormPreamble.h" //#include "FormPreferences.h" #include "GPrint.h" #include "GRef.h" @@ -143,7 +141,7 @@ char const * const dialognames[] = { "mathgreek", "mathmisc", "mathdots", "mathbigoperators", "mathamsmisc", "mathamsarrows", "mathamsrelations", "mathamsnegatedrelations", "mathamsoperators", "mathdelimiter", "mathmatrix", "mathspace", "mathstyle", -"note", "paragraph", "preamble", "prefs", "print", "ref", "sendto", +"note", "paragraph", "prefs", "print", "ref", "sendto", "spellchecker", "tabular", "tabularcreate", "texinfo", #ifdef HAVE_LIBAIKSAURUS @@ -492,11 +490,6 @@ Dialogs::DialogPtr Dialogs::build(string const & name) dialog->setController(new ControlParagraph(*dialog)); dialog->setView(new GParagraph(*dialog)); dialog->bc().bp(new OkApplyCancelReadOnlyPolicy); - } else if (name == "preamble") { -// dialog->bc().view(new xformsBC(dialog->bc())); - dialog->setController(new ControlPreamble(*dialog)); -// dialog->setView(new FormPreamble(*dialog)); - dialog->bc().bp(new OkApplyCancelPolicy); } else if (name == "prefs") { // dialog->bc().view(new xformsBC(dialog->bc())); dialog->setController(new ControlPrefs(*dialog)); diff --git a/src/frontends/gtk/GDocument.C b/src/frontends/gtk/GDocument.C index 8b090a276d..b5cce5ff76 100644 --- a/src/frontends/gtk/GDocument.C +++ b/src/frontends/gtk/GDocument.C @@ -362,6 +362,12 @@ void GDocument::doBuild() (*row)[branchColName_] = "Hunch"; (*row)[branchColActivated_] = true; // *** End "Branches" Page *** + + // *** Begin "Preamble" Page *** + Gtk::TextView *view; + xml_->get_widget ("Preamble", view); + preamblebuffer_ = view->get_buffer(); + // *** End "Preamble" Page *** } @@ -587,6 +593,10 @@ void GDocument::update() } // *** End "Branches" Page *** + // *** Begin "Preamble" Page *** + preamblebuffer_->set_text(params.preamble); + // *** End "Preamble" Page *** + // Be a cheesy bastard, for the moment bc().valid(); } @@ -797,6 +807,10 @@ void GDocument::apply() params.branchlist() = branchlist; // *** End "Branches" Page *** + + // *** Begin "Preamble" Page *** + params.preamble = preamblebuffer_->get_text(); + // *** End "Preamble" Page *** } diff --git a/src/frontends/gtk/GDocument.h b/src/frontends/gtk/GDocument.h index ad53c424a2..1039245b48 100644 --- a/src/frontends/gtk/GDocument.h +++ b/src/frontends/gtk/GDocument.h @@ -159,6 +159,10 @@ private: void addBranch(); void branchSelChanged(); // *** End "Branches" Page *** + + // *** Begin "Preamble" Page *** + Glib::RefPtr preamblebuffer_; + // *** End "Preamble" Page *** }; } // namespace frontend diff --git a/src/frontends/gtk/glade/document.glade b/src/frontends/gtk/glade/document.glade index fc151be3fc..c504c68d03 100644 --- a/src/frontends/gtk/glade/document.glade +++ b/src/frontends/gtk/glade/document.glade @@ -3502,6 +3502,65 @@ tab + + + + 12 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 3 + 0 + 0 + 6 + 0 + 0 + You should not see this. + + + + + False + True + + + + + + True + P_reamble + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + 0