]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
Remove unused font variable which caused a warning.
[lyx.git] / src / lyx_main.C
index 2a8c8456657d347bb523f92531cb82144cb70a50..8b2b75bf7d747f8eb7f63d9b389cfd25d14a622b 100644 (file)
 #include "converter.h"
 #include "language.h"
 #include "support/os.h"
+// for NO_LATEX
+#if 1
+#include "lyxfont.h"
+#endif
 
 using std::endl;
 
@@ -153,7 +157,7 @@ LyX::LyX(int * argc, char * argv[])
                        last_loaded = bufferlist.newFile("tmpfile", string());
 
                // try to dispatch to last loaded buffer first
-               bool dispatched = last_loaded->Dispatch(batch_command);
+               bool dispatched = last_loaded->dispatch(batch_command);
 
                // if this was successful, return. 
                // Maybe we could do something more clever than aborting...
@@ -165,7 +169,7 @@ LyX::LyX(int * argc, char * argv[])
 
                // otherwise, let the GUI handle the batch command
                lyxGUI->regBuf(last_loaded);
-               lyxGUI->getLyXView()->getLyXFunc()->Dispatch(batch_command);
+               lyxGUI->getLyXView()->getLyXFunc()->dispatch(batch_command);
 
                // fall through...
        }
@@ -311,12 +315,19 @@ void LyX::init(bool gui)
                       <<_("set the environment variable LYX_DIR_11x to the "
                           "LyX system directory ")
                       << _("containing the file `chkconfig.ltx'.") << endl;
-               if (!path_shown)
+               if (!path_shown) {
+                       FileInfo fi(LYX_DIR);
+                       if (!fi.exist()) {
+                               lyxerr << "Couldn't even find the default LYX_DIR." << endl
+                                       << "Giving up." << endl;
+                               exit(1);
+                       }
                        lyxerr << _("Using built-in default ") 
                               << LYX_DIR << _(" but expect problems.")
                               << endl;
-               else
+               } else {
                        lyxerr << _("Expect problems.") << endl;
+               }
                system_lyxdir = LYX_DIR;
                path_shown = true;
        }
@@ -390,7 +401,7 @@ void LyX::init(bool gui)
        // Read configuration files
        //
 
-       ReadRcFile("lyxrc.defaults");
+       readRcFile("lyxrc.defaults");
        system_lyxrc = lyxrc;
        system_formats = formats;
        system_converters = converters;
@@ -398,13 +409,13 @@ void LyX::init(bool gui)
 
        // If there is a preferences file we read that instead
        // of the old lyxrc file.
-       if (!ReadRcFile("preferences"))
-           ReadRcFile("lyxrc");
+       if (!readRcFile("preferences"))
+           readRcFile("lyxrc");
 
        // Read encodings
-       ReadEncodingsFile("encodings");
+       readEncodingsFile("encodings");
        // Read languages
-       ReadLanguagesFile("languages");
+       readLanguagesFile("languages");
 
        // Load the layouts
        lyxerr[Debug::INIT] << "Reading layouts..." << endl;
@@ -415,7 +426,7 @@ void LyX::init(bool gui)
        lyxrc.readBindFileIfNeeded();
 
        // Read menus
-       ReadUIFile(lyxrc.ui_file);
+       readUIFile(lyxrc.ui_file);
 
        // Bind the X dead keys to the corresponding LyX functions if
        // necessary. 
@@ -539,15 +550,13 @@ void LyX::queryUserLyXDir(bool explicit_userdir)
                first_start = false;
                return;
        } else {
-               first_start = true;
+               first_start = !explicit_userdir;
        }
        
-       // Nope
-       // Different wording if the user specifically requested a directory
-       if (!AskQuestion( explicit_userdir
-                        ? _("You have specified an invalid LyX directory.")
-                        : _("You don't have a personal LyX directory.") ,
-
+       // If the user specified explicitely a directory, ask whether
+       // to create it (otherwise, always create it)
+       if (explicit_userdir &&
+           !AskQuestion(_("You have specified an invalid LyX directory."),
                         _("It is needed to keep your own configuration."),
                         _("Should I try to set it up for you (recommended)?"))) {
                lyxerr << _("Running without personal LyX directory.") << endl;
@@ -577,7 +586,7 @@ void LyX::queryUserLyXDir(bool explicit_userdir)
 
 
 // Read the rc file `name'
-bool LyX::ReadRcFile(string const & name)
+bool LyX::readRcFile(string const & name)
 {
        lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
        
@@ -587,7 +596,7 @@ bool LyX::ReadRcFile(string const & name)
                                    << " in " << lyxrc_path << endl;
                if (lyxrc.read(lyxrc_path) < 0) { 
                        WriteAlert(_("LyX Warning!"), 
-                                  _("Error while reading ")+lyxrc_path+".",
+                                  _("Error while reading ") + lyxrc_path + ".",
                                   _("Using built-in defaults."));
                        return false;
                }
@@ -599,7 +608,7 @@ bool LyX::ReadRcFile(string const & name)
 
 
 // Read the ui file `name'
-void LyX::ReadUIFile(string const & name)
+void LyX::readUIFile(string const & name)
 {
        enum Uitags {
                ui_menuset = 1,
@@ -655,7 +664,7 @@ void LyX::ReadUIFile(string const & name)
 
 
 // Read the languages file `name'
-void LyX::ReadLanguagesFile(string const & name)
+void LyX::readLanguagesFile(string const & name)
 {
        lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
 
@@ -670,7 +679,7 @@ void LyX::ReadLanguagesFile(string const & name)
 
 
 // Read the encodings file `name'
-void LyX::ReadEncodingsFile(string const & name)
+void LyX::readEncodingsFile(string const & name)
 {
        lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;