]> git.lyx.org Git - features.git/commitdiff
cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Sat, 20 Sep 2008 12:07:18 +0000 (12:07 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 20 Sep 2008 12:07:18 +0000 (12:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26464 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h

index b8e56d73cf65b8022c2d5ef3d901cc3a452ec032..4fc4c75c315e109aa6558e49e8307bfcc9e8df06 100644 (file)
@@ -559,9 +559,9 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(textLayoutModule->bypassCB, SIGNAL(clicked()), 
                this, SLOT(change_adaptor()));
        connect(textLayoutModule->bypassCB, SIGNAL(clicked()), 
-               this, SLOT(set_listings_msg()));
+               this, SLOT(setListingsMessage()));
        connect(textLayoutModule->listingsED, SIGNAL(textChanged()),
-               this, SLOT(set_listings_msg()));
+               this, SLOT(setListingsMessage()));
        textLayoutModule->listingsTB->setPlainText(
                qt_("Input listings parameters on the right. Enter ? for a list of parameters."));
        textLayoutModule->lspacingLE->setValidator(new QDoubleValidator(
@@ -1023,40 +1023,41 @@ void GuiDocument::change_adaptor()
 }
 
 
-docstring GuiDocument::validate_listings_params()
+QString GuiDocument::validateListingsParameters()
 {
        // use a cache here to avoid repeated validation
        // of the same parameters
-       static string param_cache = string();
-       static docstring msg_cache = docstring();
+       static string param_cache;
+       static QString msg_cache;
        
        if (textLayoutModule->bypassCB->isChecked())
-               return docstring();
+               return QString();
 
        string params = fromqstr(textLayoutModule->listingsED->toPlainText());
        if (params != param_cache) {
                param_cache = params;
-               msg_cache = InsetListingsParams(params).validate();
+               msg_cache = toqstr(InsetListingsParams(params).validate());
        }
        return msg_cache;
 }
 
 
-void GuiDocument::set_listings_msg()
+void GuiDocument::setListingsMessage()
 {
        static bool isOK = true;
-       docstring msg = validate_listings_params();
-       if (msg.empty()) {
+       QString msg = validateListingsParameters();
+       if (msg.isEmpty()) {
                if (isOK)
                        return;
                isOK = true;
                // listingsTB->setTextColor("black");
                textLayoutModule->listingsTB->setPlainText(
-                       qt_("Input listings parameters on the right. Enter ? for a list of parameters."));
+                       qt_("Input listings parameters on the right. "
+                "Enter ? for a list of parameters."));
        } else {
                isOK = false;
                // listingsTB->setTextColor("red");
-               textLayoutModule->listingsTB->setPlainText(toqstr(msg));
+               textLayoutModule->listingsTB->setPlainText(msg);
        }
 }
 
@@ -2178,7 +2179,7 @@ void GuiDocument::setLayoutComboByIDString(std::string const & idString)
 
 bool GuiDocument::isValid()
 {
-       return validate_listings_params().empty()
+       return validateListingsParameters().isEmpty()
                && (textLayoutModule->skipCO->currentIndex() != 3
                        || !textLayoutModule->skipLE->text().isEmpty());
 }
index 5ce411e3a8dffa3b5d7f01c975776b10c947be58..47d854127db13dc167d510ebb3ec46fe7b38bad1 100644 (file)
@@ -111,13 +111,11 @@ public:
        void updatePagestyle(std::string const &, std::string const &);
 
        void showPreamble();
-       /// validate listings parameters and return an error message, if any
-       docstring validate_listings_params();
 
 private Q_SLOTS:
        void updateNumbering();
        void change_adaptor();
-       void set_listings_msg();
+       void setListingsMessage();
        void saveDefaultClicked();
        void useDefaultsClicked();
        void setLSpacing(int);
@@ -137,6 +135,9 @@ private Q_SLOTS:
        void updateModuleInfo();
 
 private:
+       /// validate listings parameters and return an error message, if any
+       QString validateListingsParameters();
+
        UiWidget<Ui::TextLayoutUi> *textLayoutModule;
        UiWidget<Ui::FontUi> *fontModule;
        UiWidget<Ui::PageLayoutUi> *pageLayoutModule;
@@ -184,7 +185,6 @@ private:
        /// current buffer
        BufferId current_id_;
 
-protected:
        /// return false if validate_listings_params returns error
        bool isValid();