From 5342ee5aadefb73942e108f614f748bccf3c1496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 9 Oct 2007 21:21:01 +0000 Subject: [PATCH] finally merge Dialog and Controller git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20875 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/Dialog.cpp | 40 ++++++----------- src/frontends/Dialog.h | 64 ++++----------------------- src/frontends/Dialogs.cpp | 12 +++-- src/frontends/qt4/DockView.h | 5 +-- src/frontends/qt4/GuiCharacter.cpp | 18 ++------ src/frontends/qt4/GuiCharacter.h | 5 +-- src/frontends/qt4/GuiDialog.cpp | 6 +-- src/frontends/qt4/GuiDialog.h | 11 +---- src/frontends/qt4/GuiDocument.cpp | 7 ++- src/frontends/qt4/GuiExternal.cpp | 4 +- src/frontends/qt4/GuiGraphics.cpp | 5 +-- src/frontends/qt4/GuiParagraph.cpp | 6 +-- src/frontends/qt4/GuiParagraph.h | 6 +-- src/frontends/qt4/GuiPrefs.cpp | 3 +- src/frontends/qt4/GuiPrint.cpp | 2 +- src/frontends/qt4/GuiRef.cpp | 2 +- src/frontends/qt4/GuiSearch.cpp | 11 +++-- src/frontends/qt4/GuiSpellchecker.cpp | 10 ++--- src/frontends/qt4/GuiTabular.cpp | 5 ++- src/frontends/qt4/GuiVSpace.cpp | 7 ++- 20 files changed, 69 insertions(+), 160 deletions(-) diff --git a/src/frontends/Dialog.cpp b/src/frontends/Dialog.cpp index 88d2312ef4..364566eb0f 100644 --- a/src/frontends/Dialog.cpp +++ b/src/frontends/Dialog.cpp @@ -30,53 +30,39 @@ Dialog::~Dialog() {} -Controller::Controller(Dialog & parent) - : parent_(parent), lyxview_(0) -{} - - -Controller::Controller(Dialog * parent) - : parent_(*parent), lyxview_(0) -{} - - -Controller::~Controller() -{} - - -bool Controller::canApply() const +bool Dialog::canApply() const { - FuncRequest const fr(getLfun(), dialog().name()); + FuncRequest const fr(getLfun(), name()); FuncStatus const fs(getStatus(fr)); return fs.enabled(); } -void Controller::dispatch(FuncRequest const & fr) const +void Dialog::dispatch(FuncRequest const & fr) const { lyxview_->dispatch(fr); } -void Controller::updateDialog(std::string const & name) const +void Dialog::updateDialog(std::string const & name) const { dispatch(FuncRequest(LFUN_DIALOG_UPDATE, name)); } -void Controller::disconnect(std::string const & name) const +void Dialog::disconnect(std::string const & name) const { lyxview_->getDialogs().disconnect(name); } -bool Controller::isBufferAvailable() const +bool Dialog::isBufferAvailable() const { return lyxview_->buffer() != 0; } -bool Controller::isBufferReadonly() const +bool Dialog::isBufferReadonly() const { if (!lyxview_->buffer()) return true; @@ -84,13 +70,13 @@ bool Controller::isBufferReadonly() const } -std::string const Controller::bufferFilepath() const +std::string const Dialog::bufferFilepath() const { return buffer().filePath(); } -KernelDocType Controller::docType() const +KernelDocType Dialog::docType() const { if (buffer().isLatex()) return LATEX; @@ -101,26 +87,26 @@ KernelDocType Controller::docType() const } -BufferView * Controller::bufferview() +BufferView * Dialog::bufferview() { return lyxview_->view(); } -BufferView const * Controller::bufferview() const +BufferView const * Dialog::bufferview() const { return lyxview_->view(); } -Buffer & Controller::buffer() +Buffer & Dialog::buffer() { BOOST_ASSERT(lyxview_->buffer()); return *lyxview_->buffer(); } -Buffer const & Controller::buffer() const +Buffer const & Dialog::buffer() const { BOOST_ASSERT(lyxview_->buffer()); return *lyxview_->buffer(); diff --git a/src/frontends/Dialog.h b/src/frontends/Dialog.h index e7d56fc84d..49e036ec13 100644 --- a/src/frontends/Dialog.h +++ b/src/frontends/Dialog.h @@ -39,13 +39,6 @@ enum KernelDocType }; -/** Different dialogs will have different Controllers and Views. - * deriving from these base classes. - */ -//@{ -class Controller; -//@} - /** \c Dialog collects the different parts of a Model-Controller-View * split of a generic dialog together. */ @@ -55,7 +48,7 @@ public: /// \param lv is the access point for the dialog to the LyX kernel. /// \param name is the identifier given to the dialog by its parent /// container. - Dialog() {} + Dialog(LyXView & lv) : lyxview_(&lv) {} virtual ~Dialog(); /** \name Container Access @@ -93,13 +86,6 @@ public: */ virtual bool isClosing() const { return false; } - /** \name Dialog Specialization - * Methods to set the Controller and View and so specialise - * to a particular dialog. - */ - //@{ - virtual Controller & controller() = 0; - //@} /** \c Button controller part */ @@ -144,33 +130,6 @@ public: /// virtual std::string name() const = 0; -protected: - virtual void apply() {} - -private: - /// intentionally unimplemented, therefore uncopiable - Dialog(Dialog const &); - void operator=(Dialog const &); -}; - - -/** \c Controller is an abstract base class for the Controller - * of a Model-Controller-View split of a generic dialog. - */ -class Controller -{ -public: - /// \param parent Dialog owning this Controller. - Controller(Dialog & parent); - // the same. avoids ambiguity with the (non-existent) copy constructor - Controller(Dialog * parent); - virtual ~Controller(); - void setLyXView(LyXView & lv) { lyxview_ = &lv; } - - /** \name Generic Controller - * These few methods are all that a generic dialog needs of a - * controller. - */ //@{ /** Enable the controller to initialise its data structures. * \param data is a string encoding of the parameters to be displayed. @@ -229,14 +188,6 @@ public: */ virtual bool exitEarly() const { return false; } //@} -public: - /** \name Controller Access - * Enable the derived classes to access the other parts of the whole. - */ - //@{ - Dialog & dialog() { return parent_; } - Dialog const & dialog() const { return parent_; } - //@} /** \c Kernel part: a wrapper making the LyX kernel available to the dialog. * (Ie, it provides an interface to the Model part of the Model-Controller- @@ -295,14 +246,17 @@ public: BufferView const * bufferview() const; //@} -private: - /// intentionally unimplemented, therefore uncopiable - Controller(Controller const &); - void operator=(Controller const &); +protected: + virtual void apply() {} private: - Dialog & parent_; LyXView * lyxview_; + +private: + /// intentionally unimplemented, therefore uncopiable + Dialog(Dialog const &); + void operator=(Dialog const &); + }; diff --git a/src/frontends/Dialogs.cpp b/src/frontends/Dialogs.cpp index 1d04db58c7..3032f0d901 100644 --- a/src/frontends/Dialogs.cpp +++ b/src/frontends/Dialogs.cpp @@ -65,8 +65,7 @@ void Dialogs::show(string const & name, string const & data, Inset * inset) bool Dialogs::visible(string const & name) const { - std::map::const_iterator it = - dialogs_.find(name); + std::map::const_iterator it = dialogs_.find(name); if (it == dialogs_.end()) return false; return it->second.get()->isVisibleView(); @@ -75,8 +74,7 @@ bool Dialogs::visible(string const & name) const void Dialogs::update(string const & name, string const & data) { - std::map::const_iterator it = - dialogs_.find(name); + std::map::const_iterator it = dialogs_.find(name); if (it == dialogs_.end()) return; @@ -148,7 +146,7 @@ void Dialogs::hideBufferDependent() const for(; it != end; ++it) { Dialog * dialog = it->second.get(); - if (dialog->controller().isBufferDependent()) + if (dialog->isBufferDependent()) dialog->hide(); } } @@ -161,8 +159,8 @@ void Dialogs::updateBufferDependent(bool switched) const for(; it != end; ++it) { Dialog * dialog = it->second.get(); - if (switched && dialog->controller().isBufferDependent()) { - if (dialog->isVisibleView() && dialog->controller().initialiseParams("")) + if (switched && dialog->isBufferDependent()) { + if (dialog->isVisibleView() && dialog->initialiseParams("")) dialog->updateView(); else dialog->hide(); diff --git a/src/frontends/qt4/DockView.h b/src/frontends/qt4/DockView.h index c4db29f94e..821f3fc881 100644 --- a/src/frontends/qt4/DockView.h +++ b/src/frontends/qt4/DockView.h @@ -25,7 +25,7 @@ namespace frontend { /// Dock Widget container for LyX dialogs. /// This template class that encapsulates a given Widget inside a /// QDockWidget and presents a Dialog interface -class DockView : public QDockWidget, public Dialog, public Controller +class DockView : public QDockWidget, public Dialog { public: DockView( @@ -34,7 +34,7 @@ public: Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer) Qt::WindowFlags flags = 0 ) - : QDockWidget(&parent, flags), Controller(this, parent), name_(name) + : QDockWidget(&parent, flags), Dialog(parent), name_(name) { if (flags & Qt::Drawer) setFeatures(QDockWidget::NoDockWidgetFeatures); @@ -68,7 +68,6 @@ public: } bool isClosing() const { return false; } void partialUpdateView(int /*id*/) {} - Controller & controller() { return *this; } std::string name() const { return name_; } //@} private: diff --git a/src/frontends/qt4/GuiCharacter.cpp b/src/frontends/qt4/GuiCharacter.cpp index 4388095e4f..266880592e 100644 --- a/src/frontends/qt4/GuiCharacter.cpp +++ b/src/frontends/qt4/GuiCharacter.cpp @@ -406,7 +406,7 @@ void GuiCharacter::updateContents() colorCO->setCurrentIndex(findPos2nd(color, getColor())); langCO->setCurrentIndex(findPos2nd(language, getLanguage())); - toggleallCB->setChecked(getToggleAll()); + toggleallCB->setChecked(toggleall_); } @@ -420,7 +420,7 @@ void GuiCharacter::applyView() setColor(color[colorCO->currentIndex()].second); setLanguage(language[langCO->currentIndex()].second); - setToggleAll(toggleallCB->isChecked()); + toggleall_ = toggleallCB->isChecked(); } @@ -434,7 +434,7 @@ bool GuiCharacter::initialiseParams(string const &) || getBar() != IGNORE || getColor() != Color::ignore || font_.language() != ignore_language) - dialog().setButtonsValid(true); + setButtonsValid(true); return true; } @@ -596,18 +596,6 @@ void GuiCharacter::setLanguage(string const & val) } -bool GuiCharacter::getToggleAll() const -{ - return toggleall_; -} - - -void GuiCharacter::setToggleAll(bool t) -{ - toggleall_ = t; -} - - Dialog * createGuiCharacter(LyXView & lv) { return new GuiCharacter(lv); } diff --git a/src/frontends/qt4/GuiCharacter.h b/src/frontends/qt4/GuiCharacter.h index 81b06ab9ab..18473d0fef 100644 --- a/src/frontends/qt4/GuiCharacter.h +++ b/src/frontends/qt4/GuiCharacter.h @@ -98,8 +98,6 @@ private: void setColor(Color_color); /// void setLanguage(std::string const &); - /// - void setToggleAll(bool); /// Font::FONT_FAMILY getFamily() const; @@ -115,8 +113,7 @@ private: Color_color getColor() const; /// std::string getLanguage() const; - /// - bool getToggleAll() const; + private: /// Font font_; diff --git a/src/frontends/qt4/GuiDialog.cpp b/src/frontends/qt4/GuiDialog.cpp index 351ee5056a..b650cda38d 100644 --- a/src/frontends/qt4/GuiDialog.cpp +++ b/src/frontends/qt4/GuiDialog.cpp @@ -25,7 +25,7 @@ namespace lyx { namespace frontend { GuiDialog::GuiDialog(LyXView & lv, std::string const & name) - : Controller(this, lv), is_closing_(false), name_(name) + : Dialog(lv), is_closing_(false), name_(name) {} @@ -206,7 +206,7 @@ void GuiDialog::hide() clearParams(); hideView(); - Controller::disconnect(name_); + Dialog::disconnect(name_); } @@ -222,7 +222,7 @@ void GuiDialog::apply() dispatchParams(); if (disconnectOnApply() && !is_closing_) { - Controller::disconnect(name_); + Dialog::disconnect(name_); initialiseParams(string()); updateView(); } diff --git a/src/frontends/qt4/GuiDialog.h b/src/frontends/qt4/GuiDialog.h index 87748a7d37..7e8aa6c322 100644 --- a/src/frontends/qt4/GuiDialog.h +++ b/src/frontends/qt4/GuiDialog.h @@ -29,7 +29,7 @@ namespace frontend { /** \c Dialog collects the different parts of a Model-Controller-View * split of a generic dialog together. */ -class GuiDialog : public QDialog, public Dialog, public Controller +class GuiDialog : public QDialog, public Dialog { Q_OBJECT @@ -119,13 +119,6 @@ public: */ bool isClosing() const { return is_closing_; } - /** \name Dialog Components - * Methods to access the various components making up a dialog. - */ - //@{ - virtual Controller & controller() { return *this; } - //@} - /** Defaults to nothing. Can be used by the Controller, however, to * indicate to the View that something has changed and that the * dialog therefore needs updating. @@ -139,10 +132,10 @@ public: void apply(); void redrawView() {} -private: /// Update the display of the dialog whilst it is still visible. virtual void updateView(); +private: ButtonController bc_; /// are we updating ? bool updating_; diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 27e6e99144..26038d7371 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -1681,14 +1681,14 @@ TextClass const & GuiDocument::textClass() const } -static void dispatch_bufferparams(Controller const & controller, +static void dispatch_bufferparams(Dialog const & dialog, BufferParams const & bp, kb_action lfun) { ostringstream ss; ss << "\\begin_header\n"; bp.writeFile(ss); ss << "\\end_header\n"; - controller.dispatch(FuncRequest(lfun, ss.str())); + dialog.dispatch(FuncRequest(lfun, ss.str())); } @@ -1711,8 +1711,7 @@ void GuiDocument::dispatchParams() for (; it != end; ++it) { docstring const & current_branch = it->getBranch(); Branch const * branch = branchlist.find(current_branch); - string const x11hexname = - lyx::X11hexname(branch->getColor()); + string const x11hexname = X11hexname(branch->getColor()); // display the new color docstring const str = current_branch + ' ' + from_ascii(x11hexname); dispatch(FuncRequest(LFUN_SET_COLOR, str)); diff --git a/src/frontends/qt4/GuiExternal.cpp b/src/frontends/qt4/GuiExternal.cpp index f0e9ed8af3..f16d6ed8aa 100644 --- a/src/frontends/qt4/GuiExternal.cpp +++ b/src/frontends/qt4/GuiExternal.cpp @@ -653,7 +653,7 @@ void GuiExternal::updateTemplate() void GuiExternal::applyView() { params_.filename.set(internal_path(fromqstr(fileED->text())), - controller().bufferFilepath()); + bufferFilepath()); params_.settemplate(getTemplate(externalCO->currentIndex()).lyxName); @@ -725,7 +725,7 @@ void GuiExternal::dispatchParams() void GuiExternal::editExternal() { - dialog().applyView(); + applyView(); string const lfun = InsetExternalMailer::params2string(params_, buffer()); dispatch(FuncRequest(LFUN_EXTERNAL_EDIT, lfun)); } diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index fa71db87a8..0806413828 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -808,14 +808,13 @@ string const GuiGraphics::readBB(string const & file) bool GuiGraphics::isFilenameValid(string const & fname) const { // It may be that the filename is relative. - FileName const name(makeAbsPath(fname, bufferFilepath())); - return isFileReadable(name); + return isFileReadable(makeAbsPath(fname, bufferFilepath())); } void GuiGraphics::editGraphics() { - dialog().applyView(); + applyView(); string const lfun = InsetGraphicsMailer::params2string(params_, buffer()); dispatch(FuncRequest(LFUN_GRAPHICS_EDIT, lfun)); diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index afc9462d62..38b589cf13 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -20,8 +20,8 @@ #include "BufferView.h" #include "Cursor.h" #include "debug.h" -#include "DialogView.h" -#include "DockView.h" +//#include "DialogView.h" +//#include "DockView.h" #include "frontend_helpers.h" #include "FuncRequest.h" #include "gettext.h" @@ -50,7 +50,7 @@ namespace lyx { namespace frontend { GuiParagraph::GuiParagraph(LyXView & lv) - : Controller(this, lv) + : Dialog(lv) { setupUi(this); setWindowTitle(qt_("Paragraph Settings")); diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index f87f3d4a87..e66eea3d78 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -38,7 +38,7 @@ namespace lyx { namespace frontend { class GuiParagraph - : public QDialog, public Ui::ParagraphUi, public Controller, public Dialog + : public QDialog, public Ui::ParagraphUi, public Dialog { Q_OBJECT public: @@ -55,8 +55,6 @@ private: /// LyXAlignment getAlignmentFromDialog(); /// - Controller & controller() { return *this; } - /// typedef std::map RadioMap; RadioMap radioMap; @@ -112,7 +110,7 @@ private: std::string key = name_ + "/geometry"; settings.setValue(key.c_str(), QDialog::saveGeometry()); #endif - QDialog::closeEvent(e); + QDialog::closeEvent(e); } private Q_SLOTS: diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 1e4e8cf731..f17e9acd41 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1866,9 +1866,8 @@ void GuiPreferences::dispatchParams() } // The Save button has been pressed - if (dialog().isClosing()) { + if (isClosing()) dispatch(FuncRequest(LFUN_PREFERENCES_SAVE)); - } } diff --git a/src/frontends/qt4/GuiPrint.cpp b/src/frontends/qt4/GuiPrint.cpp index 496d1f2492..9fbf997459 100644 --- a/src/frontends/qt4/GuiPrint.cpp +++ b/src/frontends/qt4/GuiPrint.cpp @@ -191,7 +191,7 @@ bool GuiPrint::initialiseParams(std::string const &) lyxrc.print_file_extension); params_ = PrinterParams(PrinterParams::PRINTER, lyxrc.printer, name); - dialog().setButtonsValid(true); // so that the user can press Ok + setButtonsValid(true); // so that the user can press Ok return true; } diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 630256f6ae..4da6c34654 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -132,7 +132,7 @@ void GuiRef::selectionChanged() void GuiRef::refHighlighted(QListWidgetItem * sel) { - if (controller().isBufferReadonly()) + if (isBufferReadonly()) return; /* int const cur_item = refsLW->currentRow(); diff --git a/src/frontends/qt4/GuiSearch.cpp b/src/frontends/qt4/GuiSearch.cpp index cb5833d439..c622538565 100644 --- a/src/frontends/qt4/GuiSearch.cpp +++ b/src/frontends/qt4/GuiSearch.cpp @@ -30,10 +30,9 @@ namespace frontend { static void uniqueInsert(QComboBox * box, QString const & text) { - for (int i = 0; i < box->count(); ++i) { + for (int i = box->count(); --i >= 0; ) if (box->itemText(i) == text) return; - } box->addItem(text); } @@ -87,8 +86,8 @@ void GuiSearch::findChanged() replaceallPB->setEnabled(false); } else { findPB->setEnabled(true); - replacePB->setEnabled(!controller().isBufferReadonly()); - replaceallPB->setEnabled(!controller().isBufferReadonly()); + replacePB->setEnabled(!isBufferReadonly()); + replaceallPB->setEnabled(!isBufferReadonly()); } } @@ -127,8 +126,8 @@ void GuiSearch::replaceallClicked() void GuiSearch::find(docstring const & search, bool casesensitive, bool matchword, bool forward) { - docstring const data = find2string(search, casesensitive, - matchword, forward); + docstring const data = + find2string(search, casesensitive, matchword, forward); dispatch(FuncRequest(LFUN_WORD_FIND, data)); } diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index 4b0448c663..839e580711 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -357,7 +357,7 @@ void GuiSpellchecker::check() LYXERR(Debug::GUI) << "Updating spell progress." << endl; oldval_ = newvalue_; // set progress bar - dialog().partialUpdateView(SPELL_PROGRESSED); + partialUpdateView(SPELL_PROGRESSED); } // speller might be dead ... @@ -385,7 +385,7 @@ void GuiSpellchecker::check() // set suggestions if (res != SpellBase::OK && res != SpellBase::IGNORED_WORD) { LYXERR(Debug::GUI) << "Found a word needing checking." << endl; - dialog().partialUpdateView(SPELL_FOUND_WORD); + partialUpdateView(SPELL_FOUND_WORD); } } @@ -402,7 +402,7 @@ bool GuiSpellchecker::checkAlive() else message = _("The spellchecker has failed.\n") + speller_->error(); - dialog().slotClose(); + slotClose(); Alert::error(_("The spellchecker has failed"), message); return false; @@ -412,7 +412,7 @@ bool GuiSpellchecker::checkAlive() void GuiSpellchecker::showSummary() { if (!checkAlive() || count_ == 0) { - dialog().slotClose(); + slotClose(); return; } @@ -422,7 +422,7 @@ void GuiSpellchecker::showSummary() else message = _("One word checked."); - dialog().slotClose(); + slotClose(); Alert::information(_("Spelling check completed"), message); } diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp index 0e24dd1ec7..a02d407763 100644 --- a/src/frontends/qt4/GuiTabular.cpp +++ b/src/frontends/qt4/GuiTabular.cpp @@ -941,6 +941,7 @@ void GuiTabular::closeGUI() */ } + bool GuiTabular::initialiseParams(string const & data) { // try to get the current cell @@ -1049,14 +1050,14 @@ void GuiTabular::setWidth(string const & width) else set(Tabular::SET_PWIDTH, width); - dialog().updateView(); + updateView(); } void GuiTabular::toggleMultiColumn() { set(Tabular::MULTICOLUMN); - dialog().updateView(); + updateView(); } diff --git a/src/frontends/qt4/GuiVSpace.cpp b/src/frontends/qt4/GuiVSpace.cpp index 282fa23310..f691ff0080 100644 --- a/src/frontends/qt4/GuiVSpace.cpp +++ b/src/frontends/qt4/GuiVSpace.cpp @@ -50,9 +50,9 @@ GuiVSpace::GuiVSpace(LyXView & lv) connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); - connect(spacingCO, SIGNAL(highlighted(const QString &)), + connect(spacingCO, SIGNAL(highlighted(QString)), this, SLOT(change_adaptor())); - connect(valueLE, SIGNAL(textChanged(const QString &)), + connect(valueLE, SIGNAL(textChanged(QString)), this, SLOT(change_adaptor())); connect(spacingCO, SIGNAL(activated(int)), this, SLOT(enableCustom(int))); @@ -166,7 +166,6 @@ void GuiVSpace::applyView() params_ = setVSpaceFromWidgets(spacingCO->currentIndex(), valueLE, unitCO, keepCB->isChecked()); - } @@ -179,7 +178,7 @@ void GuiVSpace::updateContents() bool GuiVSpace::initialiseParams(string const & data) { InsetVSpaceMailer::string2params(data, params_); - dialog().setButtonsValid(true); + setButtonsValid(true); return true; }