Commit Graph

2845 Commits

Author SHA1 Message Date
Jürgen Spitzmüller
54acb900ad The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).

        * lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).

        * lib/chkconfig.ltx: Test for newly supported font packages

        * lib/doc/LaTeXConfig.lyx.in: document newly supported font packages

        * lib/doc/UserGuide.lyx: document new UI.

        * lib/doc/Extended.lyx: update PostScript font documentation

        * development/FORMAT: document file format change 246->247.

        * src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans, 
           tex_fonts_monospaced (with GUI equivalents).

        * src/buffer.C: Format up to 247.

        * src/bufferparams.C:
        new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,    
        fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
        (LyXFont const BufferParams::getFont): consider switch of default family.
        (string const BufferParams::loadFonts): new method to get all the LaTeX 
        font stuff done.

        * src/paragraph.C
        (LyXFont const Paragraph::getFont):
        (LyXFont const Paragraph::getLabelFont):
        (LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's 
        default font

        * src/text.C
        (int LyXText::leftMargin):
        (int LyXText::rightMargin): user buffer's not textclass's default font

        * src/text2.C
        (LyXFont LyXText::getFont):
        (LyXFont LyXText::getLayoutFont):
        (LyXFont LyXText::getLabelFont): check if the family of the default document 
        font has been customized.

        * src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).

        * src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM). 

        * src/frontends/qt3/Makefile.dialogs: add new FontModuleBase

        * src/frontends/qt3/ui/FontModuleBase.ui: new File

        * src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets

        * src/frontends/qt3/QDocument.C
        * src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui

        * src/frontends/qt4/Makefile.dialogs: add new FontUi

        * src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui

        * src/frontends/qt4/ui/FontUi.ui: new File

        * src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets

        * src/frontends/qt4/ui/compile_uic.sh: add new FontUi

        * src/frontends/xforms/FormDocument.[Ch]: implement new font ui

        * src/frontends/xforms/forms/form_document.fd: add new font tab.

        * src/frontends/controllers/ControlDocument.[Ch]
        (char ControlDocument::fontfamilies):
        (char ControlDocument::fontfamilies_gui):
        (bool ControlDocument::isFontAvailable):
        (bool ControlDocument::providesSC):
        (bool ControlDocument::providesOSF):
        (bool ControlDocument::providesScale): new methods, providing font info.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
Peter Kümmel
1ec4d26038 restore (14087) save/load geometry logic of qt3
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14140 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-18 09:05:41 +00:00
Abdelrazak Younes
30649ec3b6 Those classes (and their associated [Ch] files) are renamed :
QLAction -> Action
lcolorcache -> ColorCache
qfont_loader.C -> FontLoader




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14136 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-17 09:14:58 +00:00
Jean-Marc Lasgouttes
2b8d396ef2 use our own font width cache with Qt/Mac
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14128 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-16 14:39:52 +00:00
Peter Kümmel
e97a9f1043 don't break the geometry option
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14122 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-15 16:01:55 +00:00
Georg Baum
20802b7c9b remove references to deleted file QtLyXView.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14112 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 19:26:23 +00:00
Georg Baum
9cbcb8a39e * src/frontends/qt3/lyx_gui.C: compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14109 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 15:49:36 +00:00
Peter Kümmel
fcdbd2357d load and restore correct windows postion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14104 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 14:42:24 +00:00
Peter Kümmel
f6c5d0d63a load and restore correct windows postion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14103 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 14:34:50 +00:00
Peter Kümmel
cd53c67f79 load and restore correct windows postion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14102 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 14:32:39 +00:00
Peter Kümmel
c02f6409ec Fix Qt4 resize bug.
Don't use  multiple QPainter::begin on the same QPaintDevice.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14101 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 14:23:25 +00:00
Peter Kümmel
bbc587ee9a coding style and readability corrections
Index: frontends/qt3/lyx_gui.C
===================================================================
--- frontends/qt3/lyx_gui.C     (revision 14088)
+++ frontends/qt3/lyx_gui.C     (working copy)
@@ -222,12 +222,12 @@


 void start(string const & batch, vector<string> const & files,
-          unsigned int width, unsigned int height, int posx, int posy, bool isMax)
+          unsigned int width, unsigned int height, int posx, int posy, bool maximize)
 {
        // this can't be done before because it needs the Languages object
        initEncodings();

-       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
+       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, maximize));
        LyX::ref().addLyXView(view_ptr);

        QtView & view = *view_ptr.get();
Index: frontends/qt3/QtView.C
===================================================================
--- frontends/qt3/QtView.C      (revision 14088)
+++ frontends/qt3/QtView.C      (working copy)
@@ -55,12 +55,12 @@



-QtView::QtView(unsigned int width, unsigned int height, bool isMax)
+QtView::QtView(unsigned int width, unsigned int height, bool maximize)
        : QMainWindow(), LyXView(), commandbuffer_(0)
 {
        resize(width, height);

-       if(isMax)
+       if (maximize)
                this->setWindowState(WindowMaximized);

        qApp->setMainWidget(this);
@@ -164,7 +164,7 @@
 void QtView::closeEvent(QCloseEvent *)
 {
        LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no"));
-       //don't save maximized values
+       // don't save maximized values
        this->showNormal();
        // save windows size and position
        LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
Index: frontends/qt3/QtView.h
===================================================================
--- frontends/qt3/QtView.h      (revision 14088)
+++ frontends/qt3/QtView.h      (working copy)
@@ -37,7 +37,7 @@
        Q_OBJECT
 public:
        /// create a main window of the given dimensions
-       QtView(unsigned int w, unsigned int h, bool isMax);
+       QtView(unsigned int w, unsigned int h, bool maximize);

        ~QtView();

Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C     (revision 14088)
+++ frontends/qt4/lyx_gui.C     (working copy)
@@ -228,12 +228,12 @@


 void start(string const & batch, vector<string> const & files,
-          unsigned int width, unsigned int height, int posx, int posy, bool isMax)
+          unsigned int width, unsigned int height, int posx, int posy, bool maximize)
 {
        // this can't be done before because it needs the Languages object
        initEncodings();

-       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
+       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, maximize));
        LyX::ref().addLyXView(view_ptr);

        QtView & view = *view_ptr.get();
Index: frontends/qt4/QtView.C
===================================================================
--- frontends/qt4/QtView.C      (revision 14088)
+++ frontends/qt4/QtView.C      (working copy)
@@ -70,12 +70,12 @@
 } // namespace anon


-QtView::QtView(unsigned int width, unsigned int height, bool isMax)
+QtView::QtView(unsigned int width, unsigned int height, bool maximize)
        : QMainWindow(), LyXView(), commandbuffer_(0)
 {
        resize(width, height);

-       if(isMax)
+       if (maximize)
                this->setWindowState(Qt::WindowMaximized);

        mainWidget_ = this;
Index: frontends/qt4/QtView.h
===================================================================
--- frontends/qt4/QtView.h      (revision 14088)
+++ frontends/qt4/QtView.h      (working copy)
@@ -47,7 +47,7 @@
        Q_OBJECT
 public:
        /// create a main window of the given dimensions
-       QtView(unsigned int w, unsigned int h, bool isMax);
+       QtView(unsigned int w, unsigned int h, bool maximize);

        ~QtView();

Index: frontends/lyx_gui.h
===================================================================
--- frontends/lyx_gui.h (revision 14088)
+++ frontends/lyx_gui.h (working copy)
@@ -57,7 +57,7 @@
  * batch commands, and loading the given documents
  */
 void start(std::string const & batch, std::vector<std::string> const & files,
-           unsigned int width, unsigned int height, int posx, int posy, bool isMax);
+           unsigned int width, unsigned int height, int posx, int posy, bool maximize);

 /**
  * Enter the main event loop (\sa LyX::exec2)
Index: lyx_main.C
===================================================================
--- lyx_main.C  (revision 14088)
+++ lyx_main.C  (working copy)
@@ -307,7 +307,7 @@
                // initial geometry
                unsigned int width = 690;
                unsigned int height = 510;
-               bool isMax = false;
+               bool maximize = false;
                // first try lyxrc
                if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
                        width = lyxrc.geometry_width;
@@ -322,7 +322,7 @@
                        if (!val.empty())
                                height = convert<unsigned int>(val);
                        if (session().loadSessionInfo("WindowIsMaximized") == "yes")
-                               isMax = true;
+                               maximize = true;
                }
                // if user wants to restore window position
                int posx = -1;
@@ -335,7 +335,7 @@
                        if (!val.empty())
                                posy = convert<int>(val);
                }
-               lyx_gui::start(batch_command, files, width, height, posx, posy, isMax);
+               lyx_gui::start(batch_command, files, width, height, posx, posy, maximize);
        } else {
                // Something went wrong above
                quitLyX(false);



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14089 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-13 08:24:43 +00:00
Peter Kümmel
226acfcbab Qt3/Qt4:
- don't save geometry values of the maximized lyx window
   - save/restore the maximized property of the lyx window

- fix changed lyx_gui::start interface for xform and gtk


Index: frontends/gtk/lyx_gui.C
===================================================================
--- frontends/gtk/lyx_gui.C	(revision 14083)
+++ frontends/gtk/lyx_gui.C	(working copy)
@@ -123,7 +123,7 @@
 
 
 void lyx_gui::start(string const & batch, std::vector<string> const & files,
-		    unsigned int width, unsigned int height, int posx, int posy)
+		    unsigned int width, unsigned int height, int posx, int posy, bool)
 {
 	boost::shared_ptr<GView> view_ptr(new GView);
 	LyX::ref().addLyXView(view_ptr);
Index: frontends/qt3/lyx_gui.C
===================================================================
--- frontends/qt3/lyx_gui.C	(revision 14083)
+++ frontends/qt3/lyx_gui.C	(working copy)
@@ -222,12 +222,12 @@
 
 
 void start(string const & batch, vector<string> const & files,
-	   unsigned int width, unsigned int height, int posx, int posy)
+	   unsigned int width, unsigned int height, int posx, int posy, bool isMax)
 {
 	// this can't be done before because it needs the Languages object
 	initEncodings();
 
-	boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
+	boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
 	LyX::ref().addLyXView(view_ptr);
 
 	QtView & view = *view_ptr.get();
Index: frontends/qt3/QtView.C
===================================================================
--- frontends/qt3/QtView.C	(revision 14083)
+++ frontends/qt3/QtView.C	(working copy)
@@ -55,10 +55,13 @@
 
 
 
-QtView::QtView(unsigned int width, unsigned int height)
+QtView::QtView(unsigned int width, unsigned int height, bool isMax)
 	: QMainWindow(), LyXView(), commandbuffer_(0)
 {
 	resize(width, height);
+	
+	if(isMax)
+		this->setWindowState(WindowMaximized);
 
 	qApp->setMainWidget(this);
 
@@ -160,6 +163,9 @@
 
 void QtView::closeEvent(QCloseEvent *)
 {
+	LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no"));
+	//don't save maximized values
+	this->showNormal();
 	// save windows size and position
 	LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
 	LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(height()));
Index: frontends/qt3/QtView.h
===================================================================
--- frontends/qt3/QtView.h	(revision 14083)
+++ frontends/qt3/QtView.h	(working copy)
@@ -37,7 +37,7 @@
 	Q_OBJECT
 public:
 	/// create a main window of the given dimensions
-	QtView(unsigned int w, unsigned int h);
+	QtView(unsigned int w, unsigned int h, bool isMax);
 
 	~QtView();
 
Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C	(revision 14083)
+++ frontends/qt4/lyx_gui.C	(working copy)
@@ -228,12 +228,12 @@
 
 
 void start(string const & batch, vector<string> const & files,
-	   unsigned int width, unsigned int height, int posx, int posy)
+	   unsigned int width, unsigned int height, int posx, int posy, bool isMax)
 {
 	// this can't be done before because it needs the Languages object
 	initEncodings();
 
-	boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
+	boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
 	LyX::ref().addLyXView(view_ptr);
 
 	QtView & view = *view_ptr.get();
Index: frontends/qt4/QtView.C
===================================================================
--- frontends/qt4/QtView.C	(revision 14083)
+++ frontends/qt4/QtView.C	(working copy)
@@ -70,11 +70,14 @@
 } // namespace anon
 
 
-QtView::QtView(unsigned int width, unsigned int height)
+QtView::QtView(unsigned int width, unsigned int height, bool isMax)
 	: QMainWindow(), LyXView(), commandbuffer_(0)
 {
 	resize(width, height);
 
+	if(isMax)
+		this->setWindowState(Qt::WindowMaximized);
+
 	mainWidget_ = this;
 
 //	setToolButtonStyle(Qt::ToolButtonIconOnly);
@@ -182,11 +185,12 @@
 void QtView::closeEvent(QCloseEvent *)
 {
 	// save windows size and position
-	LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
-	LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(height()));
+	LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(this->normalGeometry().width()));
+	LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(this->normalGeometry().height()));
+	LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no"));
 	if (lyxrc.geometry_xysaved) {
-		LyX::ref().session().saveSessionInfo("WindowPosX", convert<string>(x()));
-		LyX::ref().session().saveSessionInfo("WindowPosY", convert<string>(y()));
+		LyX::ref().session().saveSessionInfo("WindowPosX", convert<string>(this->normalGeometry().x()));
+		LyX::ref().session().saveSessionInfo("WindowPosY", convert<string>(this->normalGeometry().y()));
 	}
 	// trigger LFUN_LYX_QUIT instead of quit directly
 	// since LFUN_LYX_QUIT may have more cleanup stuff
Index: frontends/qt4/QtView.h
===================================================================
--- frontends/qt4/QtView.h	(revision 14083)
+++ frontends/qt4/QtView.h	(working copy)
@@ -47,7 +47,7 @@
 	Q_OBJECT
 public:
 	/// create a main window of the given dimensions
-	QtView(unsigned int w, unsigned int h);
+	QtView(unsigned int w, unsigned int h, bool isMax);
 
 	~QtView();
 
Index: frontends/xforms/lyx_gui.C
===================================================================
--- frontends/xforms/lyx_gui.C	(revision 14083)
+++ frontends/xforms/lyx_gui.C	(working copy)
@@ -256,7 +256,7 @@
 
 
 void start(string const & batch, vector<string> const & files,
-	   unsigned int width, unsigned int height, int posx, int posy)
+	   unsigned int width, unsigned int height, int posx, int posy, bool)
 {
 	int const geometryBitmask =
 		XParseGeometry(geometry, &posx, &posy, &width, &height);
Index: frontends/lyx_gui.h
===================================================================
--- frontends/lyx_gui.h	(revision 14083)
+++ frontends/lyx_gui.h	(working copy)
@@ -57,7 +57,7 @@
  * batch commands, and loading the given documents
  */
 void start(std::string const & batch, std::vector<std::string> const & files,
-           unsigned int width, unsigned int height, int posx, int posy);
+           unsigned int width, unsigned int height, int posx, int posy, bool isMax);
 
 /**
  * Enter the main event loop (\sa LyX::exec2)
Index: lyx_main.C
===================================================================
--- lyx_main.C	(revision 14083)
+++ lyx_main.C	(working copy)
@@ -307,6 +307,7 @@
 		// initial geometry
 		unsigned int width = 690;
 		unsigned int height = 510;
+		bool isMax = false;
 		// first try lyxrc
 		if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
 			width = lyxrc.geometry_width;
@@ -320,6 +321,8 @@
 			val = session().loadSessionInfo("WindowHeight");
 			if (!val.empty())
 				height = convert<unsigned int>(val);
+			if (session().loadSessionInfo("WindowIsMaximized") == "yes")
+				isMax = true;
 		}
 		// if user wants to restore window position
 		int posx = -1;
@@ -332,7 +335,7 @@
 			if (!val.empty())
 				posy = convert<int>(val);
 		}
-		lyx_gui::start(batch_command, files, width, height, posx, posy);
+		lyx_gui::start(batch_command, files, width, height, posx, posy, isMax);
 	} else {
 		// Something went wrong above
 		quitLyX(false);



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14088 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-13 08:05:00 +00:00
Abdelrazak Younes
7efc6e9e0a Deleted because not used anywhere.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14079 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-11 21:45:01 +00:00
Abdelrazak Younes
5c4d89d816 Simple optimisation: reuse current QPainter if no there's no change in settings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14078 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-11 21:22:36 +00:00
Edwin Leuven
73a4be7143 more cleanup: some formatting and handle mouse events in their event handlers (and not in event())
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14072 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-11 14:28:10 +00:00
Abdelrazak Younes
a9390a6b8d Fix Windows crash on exit with "static LQApplication"
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14055 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-09 09:37:51 +00:00
Peter Kümmel
8a552374b9 - remove usage of qt3 support functions.
- undef QT3_SUPPORT until the QT3_SUPPORT-logic will be inverted.
- QLocale::system().name() returns e.g de_DE but the Qt file name is 
  qt_de.


Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C     (revision 14043)
+++ frontends/qt4/lyx_gui.C     (working copy)
@@ -9,6 +9,8 @@
  * Full author contact details are available in file CREDITS.
  */

+#undef QT3_SUPPORT
+
 #include <config.h>

 #include "lyx_gui.h"
@@ -55,6 +57,8 @@
 #include <QEventLoop>
 #include <QTranslator>
 #include <QTextCodec>
+#include <QLocale>
+#include <QLibraryInfo>

 using lyx::support::ltrim;
 using lyx::support::package;
@@ -167,19 +171,22 @@

        // install translation file for Qt built-in dialogs
        // These are only installed since Qt 3.2.x
-       QTranslator qt_trans(0);
-       if (qt_trans.load(QString("qt_") + QTextCodec::locale(),
-                         qInstallPathTranslations())) {
+       QTranslator qt_trans;
+       QString language_name = QString("qt_") + QLocale::system().name();
+       language_name.truncate(5);
+       if (qt_trans.load(language_name,
+               QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+       {
                qApp->installTranslator(&qt_trans);
                // even if the language calls for RtL, don't do that
-               qApp->setReverseLayout(false);
+               qApp->setLayoutDirection(Qt::LeftToRight);
                lyxerr[Debug::GUI]
                        << "Successfully installed Qt translations for locale "
-                       << QTextCodec::locale() << std::endl;
+                       << fromqstr(language_name) << std::endl;
        } else
                lyxerr[Debug::GUI]
                        << "Could not find  Qt translations for locale "
-                       << QTextCodec::locale() << std::endl;
+                       << fromqstr(language_name) << std::endl;

 /*#ifdef Q_WS_MACX
        // These translations are meant to break Qt/Mac menu merging
@@ -260,9 +267,7 @@
        // During screen update/ redraw, this method is disabled to
        // prevent keyboard events being handed to the LyX core, where
        // they could cause re-entrant calls to screen update.
-#if QT_VERSION >= 0x030100
-       qApp->processEvents(QEventLoop::ExcludeUserInput);
-#endif
+       qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
 }



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14046 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-08 14:27:44 +00:00
Georg Baum
716626aa0b app -> qApp, forgot this with the last patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14038 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-08 06:53:11 +00:00
Georg Baum
042d5a0242 Fix crash on exit (bug 2549) by correct usage of QApplication
* src/lyx_cb.C
	(quitLyX): lyx_gui::exit takes now an argument

	* src/frontends/{gtk,xforms}/lyx_gui.C
	(lyx_gui::parse_init): rename to lyx_gui::exec and call LyX::exec2
	(void lyx_gui::exit): add exit status argument

	* src/frontends/qt{3,4}/lyx_gui.C
	(cleanup): new function for pointer cleanup
	(lyx_gui::parse_init): rename to lyx_gui::exec and call LyX::exec2,
	turn static variables into automatic variables
	(void lyx_gui::exit): add exit status argument
	(start): Use cleanup()
	(exit): ditto

	* src/frontends/lyx_gui.h
	(parse_init): remove
	(exec): new
	(exit): Take exist status argument

	* src/lyx_main.[Ch]
	(LyX::priv_exec): split into LyX::priv_exec and LyX::exec2

	* src/lyx_main.C
	(lyx_exit): New, choose the right exit function
	(showFileError): call lyx_exit
	(LyX::queryUserLyXDir): ditto
	(LyX::init): ditto
	(LyX::priv_exec): ditto
	(LyX::priv_exec): Replace want_gui by lyx_gui::use_gui
	(LyX::priv_exec): replace lyx_gui::parse_init by lyx_gui::exec and
	exec2
	(LyX::init): Replace gui argument by lyx_gui::use_gui


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14036 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-07 20:08:37 +00:00
John Spray
84d0c509b4 Text encoding hack and removal of cited-keys searching
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14023 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-06 17:47:28 +00:00
John Spray
87ce9b7647 escape special characters in strings passed to gtk as markup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14022 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-06 16:49:23 +00:00
Georg Baum
56cd160c39 compile fix for OS X
* src/frontends/qt4/QRef.C: s/ControlRef/lyx::frontend::ControlRef/

	* src/frontends/qt4/QRef.h: ditto

	* src/frontends/qt4/Dialogs.C:
	(Dialogs::build): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14020 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-06 10:10:11 +00:00
Georg Baum
d98eaedac7 * src/frontends/qt4/QCitation.h: Fix compiler warning about /*
inside a comment


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14009 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-05 16:09:56 +00:00
Abdelrazak Younes
4f9ddcbcb4 remove QT3_SUPPORT macro dependency by Peter Kummel (syntheticpp@gmx.net)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14001 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-04 21:15:33 +00:00
Abdelrazak Younes
52557ce331 remove QT3_SUPPORT macro dependency by Peter Kummel (syntheticpp@gmx.net)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14000 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-04 20:50:41 +00:00
Abdelrazak Younes
f9f72cfa0c remove QT3_SUPPORT macro dependency by Peter Kummel (syntheticpp@gmx.net)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13999 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-04 20:49:09 +00:00
Martin Vermeer
1a77233c5f Add support for framed.sty
* src/LaTeXFeatures.C: add framed.sty

	(const * simplefeatures[]: add framed.sty
	(const LaTeXFeatures::getPackages): define shadecolor

	* src/insets/insetnote.h

	* src/insets/insetnote.C
	(const init_notetranslator):
	(InsetNote::setButtonLabel): add Framed and Shaded
	(InsetNote::latex): add output
	(InsetNote::validate): require framed.sty

	* src/buffer.C
	(BufferList bufferlist): new LyX version 246

	* src/frontends/qt3/ui/QNoteDialogBase.ui: add

	* src/frontends/qt3/QNoteDialog.C: add

	* src/frontends/qt3/QNote.C
	(QNote::update_contents): add framed, shaded
	(QNote::apply): add framed, shaded

	* src/LColor.[Ch]: add background colour for shaded

	* lib/lyx2lyx/LyX.py: New version support

	* lib/lyx2lyx/lyx_1_5.py: convert/revert

	* lib/chkconfig.ltx: add framed.sty

	* src/frontends/xforms/FormNote.C
	(FormNote::build):
	(FormNote::update): add FIXME

	* src/frontends/gtk/GNote.C
	(GNote::doBuild):
	(GNote::update):
	(GNote::apply): add FIXME

	* development/FORMAT: document format increase



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13993 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-03 16:46:27 +00:00
Georg Baum
e8bb11969d * src/frontends/qt3/lyx_gui.C
(LQApplication): remove empty destructor

	* src/frontends/qt4/lyx_gui.C
	(LQApplication): remove empty destructor


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13992 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-03 14:18:33 +00:00
Abdelrazak Younes
6a742b7aa0 This patch removes qscreen.[Ch] and simplify the cursor drawing on screen. Basically, we paint now only if needed. So there's no need anymore to handle the "no cursor" pixmap saving.
SConscript: removed qscreen.C
frontends/qt4/Makefile.am: removed qscreen.C
frontends/screen.h: remove workarea() constness
frontends/qt3/qscreen.[Ch]: ditto
frontends/gtk/GScreen.[Ch]: ditto
frontends/xforms/xscreen.[Ch]: ditto
frontends/qt4/LyXScreenFactory.C: now return the QWorkarea directly
frontends/qt4/QWorkArea.[Ch]: inherits LyXScreen, handle the cursor painting
frontends/qt4/qscreen.[Ch]: removed 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13981 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-02 12:01:28 +00:00
Edwin Leuven
924d8f471c small cleanup: we don't need to store the funcrequest
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13980 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-01 20:34:22 +00:00
Edwin Leuven
40783d2ebb don't crash: apply values before closing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13979 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-01 20:33:37 +00:00
Edwin Leuven
98a75b6456 replace if/else with switch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13974 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-31 14:46:01 +00:00
Edwin Leuven
5c8f40106a Add new tableinsertwidget
+ Remove table widget from inserttable dialog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13972 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-31 12:53:05 +00:00
Abdelrazak Younes
c4edb019f5 fix "posx, posx" typo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13968 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-30 13:39:34 +00:00
Jean-Marc Lasgouttes
0fbd5c2588 * src/frontends/*/lyx_gui.C:
* src/frontends/lyx_gui.h: change width and height parameters to unsigned int.

* src/frontends/xforms/lyx_gui.C: compilation fix.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13967 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-30 10:20:35 +00:00
Bo Peng
f9c7473ed3 Move window width/height/posx/posy from frontends to lyx_main.C, from Bo Peng (ben.bob@gmail.com)
* src/frontends/ALLFRONTENDS/lyx_gui.C: use passed width/height/posx/posy in lyx_gui::start
	* src/frontends/lyx_gui.h: prototype change for lyx_gui::start
	* src/lyx_main.C: determine windows size and position from lyxrc or session.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13953 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-29 15:11:19 +00:00
Bo Peng
a21c78f25b Some MSVC2003/2005 compatibility fixes, from Bo Peng (ben.bob@gmail.com)
* src/support/lyxsum.C: fix HAVE_DECL_ISTREAMBUF_ITERATOR
	* src/support/mkdir.C: add direct.h for windows
	* src/support/forkedcall.C: add cerrno under windows
	* src/support/tempname.C: define S_IRUSR and S_IWUSR
	* src/support/package.C.in: define PATH_MAX=256



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13951 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-29 14:56:08 +00:00
Abdelrazak Younes
2485efbf75 additional comments related to rev 13948
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13949 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-29 07:38:09 +00:00
Abdelrazak Younes
d1d896e23c Fix hang on exit under Windows.
TODO: reorganize this code. In particular make sure that this advise from Qt documentation is respected:

Since the QApplication object does so much initialization, it must be created before any other objects related to the user interface are created.

Right now this is not the case. For example, "FontLoader::initFontPath()" is called before the QApplication creation. Moreover, I suspect that a number of global variables contains Qt object that are initialized before the passage through parse_init(). This might also explain the message displayed by Qt that caused the hanging:

QObject::killTimer: timers cannot be stopped from another thread



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13948 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-28 22:10:33 +00:00
Abdelrazak Younes
9614a1d698 Fix for Qt4 crash on exit under linux by Georg Baum and myself.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13943 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-27 19:58:02 +00:00
Georg Baum
cf7e4e5e03 * src/frontends/qt4/ui/pch.h: remove
* src/frontends/qt4/ui/Makefile.am: remove unused rules


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13942 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-27 14:38:34 +00:00
Abdelrazak Younes
a7c2820c49 Enable Font width caching.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13931 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-25 22:37:01 +00:00
Georg Baum
d544373734 Change the semantics of 'none' and 'auto' viewers/editors: 'none' means now
"Don't view/edit this format", and 'auto' means "Use the default viewer/editor".
	* src/format.C
	(fixCommand): Change semantics: "none" is equal to "", and "auto"
	is removed if canAutoOpenFile returns false.

	* src/frontends/xforms/FormPreferences.C
	(FormPreferences::SpellOptions::apply): "none" -> ""

	* src/lyxrc.C
	(LyXRC::read): "none" -> ""

	* lib/doc/Customization.lyx: Document the autoopen feature

	* lib/configure.py
	(checkProg): add optional not_found argument, defaulting to 'none'
	(checkViewer): new, equivalent to checkProg with not_found = 'auto'
	(checkFormatEntries): call checkViewer instead of checkProg for
	viewers and editors


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13929 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-25 11:57:22 +00:00
Abdelrazak Younes
04e8d1e65b qt3/qfont_loader.h: added comment about pointer reference.
qt4/qfont_loader.h: reverted to last version and added comment about pointer reference.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13927 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-25 10:02:01 +00:00
Abdelrazak Younes
3efac59557 qt4 optimisation:
* qfont_loader.h: enable the font caching
* QWorkArea: disable intermediate QImage caching, use QPixmap directly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13893 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-21 08:49:02 +00:00
Georg Baum
5b83287abe * src/format.[Ch]
(document_): new flag, telling whether this is a document format and
	we want to show this format in the export and view menus
	(documentFormat): accessor for document_

	* src/format.h: Add some documentation

	* src/frontends/qt3/QPrefsDialog.C
	(QPrefsDialog::QPrefsDialog): handle new documentCB checkbox
	(QPrefsDialog::switch_format): ditto
	(QPrefsDialog::updateFormatsButtons): ditto
	(QPrefsDialog::new_format): ditto
	(QPrefsDialog::modify_format): ditto

	* src/frontends/qt3/ui/QPrefFileformatsModule.ui: Add documentCB checkbox

	* src/frontends/qt4/QPrefsDialog.C
	(QPrefsDialog::QPrefsDialog): handle new documentCB checkbox
	(QPrefsDialog::switch_format): ditto
	(QPrefsDialog::updateFormatsButtons): ditto
	(QPrefsDialog::new_format): ditto
	(QPrefsDialog::modify_format): ditto

	* src/frontends/qt4/ui/QPrefFileformatsUi.ui: Add documentCB checkbox

	* src/frontends/xforms/FormPreferences.C
	(FormPreferences::Formats::build): handle new check_document checkbox
	(FormPreferences::Formats::input): ditto
	(FormPreferences::Formats::Add): ditto
	(FormPreferences::Formats::Browser): ditto

	* src/frontends/xforms/forms/form_preferences.fd: Add check_document
	checkbox

	* src/lyxrc.C
	(LyXRC::read): Remove compatibility code for 1.3 \format entries.
	Read the new format flags (but don't require them for 1.4
	compatibility)
	(LyXRC::write): Write the new format flags

	* src/MenuBackend.C
	(expandFormats): Remove the hardcoded exception for image formats
	and use Format::isDocument() instead

	* lib/doc/Customization.lyx: Document auto viever/editor and the
	"document format" flag


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13887 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-20 12:03:40 +00:00
Abdelrazak Younes
f8918b0859 * QPrefsDialog.[Ch]: Split up of QPrefsDialog into different modules (one per .ui file)
* panelstack.C: automatic creation of parent category if not already created.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13886 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-20 11:49:53 +00:00
Jean-Marc Lasgouttes
b5987c69a1 * src/frontends/qt3/qfontloader.C (initFontPath, ~FontLoader):
* src/frontends/qt4/qfontloader.C (initFontPath, ~FontLoader): add fonts in
lyxdir/fonts to system fonts in windows; remove them in destructor.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13877 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-20 08:21:58 +00:00
Edwin Leuven
cd457e07c8 make the formats/converters panels in the pref dialog set the correct parameters.
atm this does not work because it depends on the order in which these entries were added.

now the order is alphabetical and things are messed up.

the attached patch adds the nr of the format/converter to the listwidgetitem as a type and uses that to get to the right details


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13864 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-18 11:14:10 +00:00