]> git.lyx.org Git - lyx.git/commitdiff
Update the toolbars when the GuiView is shown
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 17 Sep 2011 10:58:01 +0000 (10:58 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 17 Sep 2011 10:58:01 +0000 (10:58 +0000)
This will disable the layout box if no document is open, and it will set the correct state of the toolbar toggling buttons.

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

src/frontends/qt4/GuiView.cpp

index 225033b10a332ceb3f9a832fee6db4ee2185d37f..00334dc2a8e62bf80c23547f9d16b83608032260 100644 (file)
@@ -801,6 +801,7 @@ void GuiView::showEvent(QShowEvent * e)
                // No work area, switch to the background widget.
                d.setBackground();
 
+       updateToolbars();
        QMainWindow::showEvent(e);
 }
 
@@ -897,7 +898,7 @@ void GuiView::dropEvent(QDropEvent * event)
                        = theConverters().importableFormats();
                vector<const Format *>::const_iterator it = import_formats.begin();
                for (; it != import_formats.end(); ++it)
-                       if ((*it)->hasExtension(ext))
+                       if ((*it)->extension() == ext)
                                found_formats.push_back(*it);
 
                FuncRequest cmd;
@@ -2066,10 +2067,10 @@ void GuiView::importDocument(string const & argument)
                        toqstr(addPath(package().system_support().absFileName(), "examples")));
 
                docstring filter = formats.prettyName(format);
-               filter += " (*.{";
+               filter += " (*.";
                // FIXME UNICODE
-               filter += from_utf8(formats.extensions(format));
-               filter += "})";
+               filter += from_utf8(formats.extension(format));
+               filter += ')';
 
                FileDialog::Result result =
                        dlg.open(toqstr(initpath), fileFilters(toqstr(filter)));