From 267b2098698ce0919f697104906f214f77ec1332 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 25 Jul 2005 13:45:17 +0000 Subject: [PATCH] remove paperpackage stuff (fixes bug 1929) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10352 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/gtk/ChangeLog | 5 +++ src/frontends/gtk/GDocument.C | 50 ++++---------------------- src/frontends/gtk/GDocument.h | 3 +- src/frontends/gtk/glade/document.glade | 36 ++++--------------- src/frontends/gtk/lyx_gui.C | 1 - 5 files changed, 19 insertions(+), 76 deletions(-) diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index 68b703d64e..1b095fde43 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -1,3 +1,8 @@ +2005-07-24 Georg Baum + + * GDocument.[Ch], glade/document.glade: remove remaining + paperpackage bits + 2005-07-18 José Matos * GDocument.C: new file format, remove support for a4.sty, diff --git a/src/frontends/gtk/GDocument.C b/src/frontends/gtk/GDocument.C index 9141348ca7..424e6348c3 100644 --- a/src/frontends/gtk/GDocument.C +++ b/src/frontends/gtk/GDocument.C @@ -207,13 +207,9 @@ void GDocument::doBuild() // *** End "Page" Page *** // *** Begin "Margins" Page *** - xml_->get_widget("Margins", box); - box->pack_start(marginscombo_, true, true, 0); - box->show_all(); - marginscombo_.signal_changed().connect( + xml_->get_widget("DefaultMargins", defaultmargins_); + defaultmargins_->signal_clicked().connect( sigc::mem_fun(*this, &GDocument::marginsChanged)); - pagesizecombo_.signal_changed().connect( - sigc::mem_fun(*this, &GDocument::populateMargins)); xml_->get_widget("MarginTop", mtopspin_); xml_->get_widget("MarginBottom", mbottomspin_); @@ -347,7 +343,7 @@ void GDocument::update() comboBoxTextSet(pagestylecombo_, params.pagestyle); // *** End "Page" Page *** - marginscombo_.set_active(0); + defaultmargins_->set_active(!params.use_geometry); setWidgetsFromLength( *(mtopspin_->get_adjustment()), @@ -377,6 +373,7 @@ void GDocument::update() *(mfootskipspin_->get_adjustment()), mfootskipunitcombo_, LyXLength(params.footskip)); + marginsChanged(); // *** End "Margins" Page *** @@ -498,15 +495,7 @@ void GDocument::apply() // *** End "Page" Page *** // *** Begin "Margins" Page *** - int psize = pagesizecombo_.get_active_row_number(); - bool geom_papersize = (psize == 1 || psize == 5 || psize == 8 || psize == 9); - params.use_geometry = - (marginscombo_.get_active_row_number() == 1 || geom_papersize); - - int margin = marginscombo_.get_active_row_number(); - if (margin > 0) { - margin = margin - 1; - } + params.use_geometry = !defaultmargins_->get_active(); params.topmargin = getLengthFromWidgets( *(mtopspin_->get_adjustment()), @@ -643,36 +632,9 @@ void GDocument::pageSizeChanged() } -void GDocument::populateMargins() -{ - int olditem = marginscombo_.get_active_row_number(); - - marginscombo_.clear(); - // Magic order - marginscombo_.append_text(_("Default")); - marginscombo_.append_text(_("Custom")); - - int papersize = pagesizecombo_.get_active_row_number(); - if (papersize < 0) - papersize = 0; - - bool const a4size = (papersize == 6 || papersize == 0 - && lyxrc.default_papersize == PAPER_A4); - if (a4size && portraitradio_->get_active()) { - marginscombo_.append_text(_("Small margins")); - marginscombo_.append_text(_("Very small margins")); - marginscombo_.append_text(_("Very wide margins")); - } else if (olditem > 1) { - olditem = 0; - } - marginscombo_.set_active(olditem); -} - - void GDocument::marginsChanged() { - bool const custom = - marginscombo_.get_active_row_number() == 1; + bool const custom = !defaultmargins_->get_active(); mtopspin_->set_sensitive(custom); mbottomspin_->set_sensitive(custom); diff --git a/src/frontends/gtk/GDocument.h b/src/frontends/gtk/GDocument.h index 3e186e4ef4..d19365d413 100644 --- a/src/frontends/gtk/GDocument.h +++ b/src/frontends/gtk/GDocument.h @@ -74,7 +74,7 @@ private: // *** End "Page" Page *** // *** Begin "Margins" Page *** - Gtk::ComboBoxText marginscombo_; + Gtk::CheckButton * defaultmargins_; Gtk::SpinButton * mtopspin_; Gtk::SpinButton * mbottomspin_; Gtk::SpinButton * minnerspin_; @@ -89,7 +89,6 @@ private: Gtk::ComboBoxText mheadsepunitcombo_; Gtk::ComboBoxText mheadheightunitcombo_; Gtk::ComboBoxText mfootskipunitcombo_; - void populateMargins(); void marginsChanged(); // *** End "Margins" Page *** diff --git a/src/frontends/gtk/glade/document.glade b/src/frontends/gtk/glade/document.glade index 03ad70bf6b..4b548c771e 100644 --- a/src/frontends/gtk/glade/document.glade +++ b/src/frontends/gtk/glade/document.glade @@ -1746,18 +1746,16 @@ - + True + True Ma_rgins: True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 + GTK_RELIEF_NORMAL + True + True + False + True 0 @@ -1769,26 +1767,6 @@ - - - True - False - 0 - - - - - - - 1 - 3 - 0 - 1 - fill - fill - - - True diff --git a/src/frontends/gtk/lyx_gui.C b/src/frontends/gtk/lyx_gui.C index dce37c8b81..6ae85905a7 100644 --- a/src/frontends/gtk/lyx_gui.C +++ b/src/frontends/gtk/lyx_gui.C @@ -37,7 +37,6 @@ // FIXME: move this stuff out again #include "bufferlist.h" -#include "buffer_funcs.h" #include "lyxfunc.h" #include "lyxserver.h" #include "lyxsocket.h"