]> git.lyx.org Git - features.git/commitdiff
Simplify dialogs updating.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 2 May 2008 20:58:25 +0000 (20:58 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 2 May 2008 20:58:25 +0000 (20:58 +0000)
* GuiView::updateDialogs(): merge with GuiView::checkStatus()

* LyXFunc::processKeySym(): remove call to GuiView::restartCursor(), this has already been called in the call to dispatch() at the end of the methof.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24588 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h
src/frontends/qt4/GuiWorkArea.cpp

index a2689cee3415533bbddfd59faf77d9d5d008314e..c5d376686aeaaef58a6f1fdc7f37644516dcf0cb 100644 (file)
@@ -377,9 +377,6 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
                if (!lyx_view_)
                        return;
        }
-
-       if (lyx_view_)
-               lyx_view_->restartCursor();
 }
 
 
index 398d80475f7ed97dccda6c4c13833843ef505677..46b0a83f9d75f6ba8906773bcd9a38ee23938fc2 100644 (file)
@@ -433,7 +433,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
        // Save toolbars configuration
        if (isFullScreen()) {
                d.toolbars_->toggleFullScreen(!isFullScreen());
-               updateToolbars();
+               updateDialogs();
        }
 
        // Make sure the timer time out will not trigger a statusbar update.
@@ -849,9 +849,6 @@ void GuiView::updateToolbars()
                d.toolbars_->update(math, table, review, mathmacrotemplate);
        } else
                d.toolbars_->update(false, false, false, false);
-
-       // update read-only status of open dialogs.
-       checkStatus();
 }
 
 
@@ -1993,9 +1990,7 @@ void GuiView::restartCursor()
                d.current_work_area_->startBlinkingCursor();
 
        // Take this occasion to update the other GUI elements.
-       updateLayoutList();
-       updateToolbars();
-       updateStatusBar();
+       updateDialogs();
 }
 
 
@@ -2160,19 +2155,8 @@ void GuiView::updateDialogs()
 
        for(; it != end; ++it) {
                Dialog * dialog = it->second.get();
-               if (!dialog->isVisibleView())
-                       continue;
-               if (dialog->isBufferDependent()) {
-                       if (buffer())
-                               dialog->updateView();
-                       else
-                               dialog->enableView(false);
-               } else {
-                       // A bit clunky, but the dialog will request
-                       // that the kernel provides it with the necessary
-                       // data.
-                       dialog->updateDialog();
-               }
+               if (dialog && dialog->isVisibleView())
+                       dialog->checkStatus();
        }
        updateToolbars();
        updateLayoutList();
@@ -2180,20 +2164,6 @@ void GuiView::updateDialogs()
 }
 
 
-void GuiView::checkStatus()
-{
-       map<string, DialogPtr>::const_iterator it  = d.dialogs_.begin();
-       map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
-
-       for(; it != end; ++it) {
-               Dialog * const dialog = it->second.get();
-               if (dialog && dialog->isVisibleView())
-                       dialog->checkStatus();
-       }
-}
-
-
-
 // will be replaced by a proper factory...
 Dialog * createGuiAbout(GuiView & lv);
 Dialog * createGuiBibitem(GuiView & lv);
index ad95e4d677b4248d0d4b159b5b902e92f0382076..d3e041f3d57c835059483ee0710cd2efb93d17ca 100644 (file)
@@ -198,19 +198,18 @@ public:
        ///
        void resetDialogs();
 
-       /** Check the status of all visible dialogs and disable or reenable
+       /// Hide all visible dialogs
+       void hideAll() const;
+
+       /// Update all visible dialogs.
+       /** 
+        *  Check the status of all visible dialogs and disable or reenable
         *  them as appropriate.
         *
         *  Disabling is needed for example when a dialog is open and the
         *  cursor moves to a position where the corresponding inset is not
         *  allowed.
         */
-       void checkStatus();
-
-       /// Hide all visible dialogs
-       void hideAll() const;
-
-       // Update all visible dialogs.
        void updateDialogs();
 
        /** \param name == "bibtex", "citation" etc; an identifier used to
index 1feef594d9ccd593a7248a262c4a357894dc7b4b..c116bbb599494a6bd54e04505b4ea06bd5498ee5 100644 (file)
@@ -452,8 +452,7 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod)
        // Skip these when selecting
        if (cmd.action != LFUN_MOUSE_MOTION) {
                completer_->updateVisibility(false, false);
-               lyx_view_->updateLayoutList();
-               lyx_view_->updateToolbars();
+               lyx_view_->updateDialogs();
        }
 
        // GUI tweaks except with mouse motion with no button pressed.