]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
Updates from Bennett and myself.
[lyx.git] / src / lyx_main.C
index 90d98fd03d9f965ac36e2a2ea111922c48f459ac..6833bc16c0c1a3e43853416510868c1b07cea200 100644 (file)
@@ -74,6 +74,7 @@ using support::bformat;
 using support::createDirectory;
 using support::createLyXTmpDir;
 using support::destroyDir;
+using support::FileName;
 using support::fileSearch;
 using support::getEnv;
 using support::i18nLibFileSearch;
@@ -480,7 +481,7 @@ int LyX::loadFiles(int & argc, char * argv[],
        }
 
        if (first_start)
-               files.push_back(i18nLibFileSearch("examples", "splash.lyx"));
+               files.push_back(i18nLibFileSearch("examples", "splash.lyx").absFilename());
 
        Buffer * last_loaded = 0;
 
@@ -490,7 +491,7 @@ int LyX::loadFiles(int & argc, char * argv[],
        for (; it != end; ++it) {
                // get absolute path of file and add ".lyx" to
                // the filename if necessary
-               string s = fileSearch(string(), *it, "lyx");
+               string s = fileSearch(string(), *it, "lyx").absFilename();
                if (s.empty()) {
                        Buffer * const b = newFile(*it, string(), true);
                        if (b)
@@ -559,6 +560,8 @@ LyXView * LyX::newLyXView()
        // initial geometry
        unsigned int width = 690;
        unsigned int height = 510;
+       // default icon size, will be overwritten by  stored session value
+       unsigned int iconSizeXY = 26;
        bool maximize = false;
        // first try lyxrc
        if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
@@ -575,6 +578,9 @@ LyXView * LyX::newLyXView()
                        height = convert<unsigned int>(val);
                if (session().sessionInfo().load("WindowIsMaximized") == "yes")
                        maximize = true;
+               val = session().sessionInfo().load("IconSizeXY");
+               if (!val.empty())
+                       iconSizeXY = convert<unsigned int>(val);
        }
 
        // if user wants to restore window position
@@ -594,7 +600,7 @@ LyXView * LyX::newLyXView()
                height = 0;
        }
        // create the main window
-       LyXView * view = &pimpl_->application_->createView(width, height, posx, posy, maximize);
+       LyXView * view = &pimpl_->application_->createView(width, height, posx, posy, maximize, iconSizeXY);
 
        return view;
 }
@@ -820,7 +826,7 @@ bool LyX::init()
            fs::is_directory(lyxrc.document_path))
                package().document_dir() = lyxrc.document_path;
 
-       package().temp_dir() = createLyXTmpDir(lyxrc.tempdir_path);
+       package().temp_dir() = createLyXTmpDir(FileName(lyxrc.tempdir_path)).absFilename();
        if (package().temp_dir().empty()) {
                Alert::error(_("Could not create temporary directory"),
                             bformat(_("Could not create a temporary directory in\n"
@@ -1011,7 +1017,7 @@ bool LyX::readRcFile(string const & name)
 {
        lyxerr[Debug::INIT] << "About to read " << name << "... ";
 
-       string const lyxrc_path = libFileSearch(string(), name);
+       FileName const lyxrc_path = libFileSearch(string(), name);
        if (!lyxrc_path.empty()) {
 
                lyxerr[Debug::INIT] << "Found in " << lyxrc_path << endl;
@@ -1060,7 +1066,7 @@ bool LyX::readUIFile(string const & name)
 
        lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
 
-       string const ui_path = libFileSearch("ui", name, "ui");
+       FileName const ui_path = libFileSearch("ui", name, "ui");
 
        if (ui_path.empty()) {
                lyxerr[Debug::INIT] << "Could not find " << name << endl;
@@ -1118,7 +1124,7 @@ bool LyX::readLanguagesFile(string const & name)
 {
        lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
 
-       string const lang_path = libFileSearch(string(), name);
+       FileName const lang_path = libFileSearch(string(), name);
        if (lang_path.empty()) {
                showFileError(name);
                return false;
@@ -1133,7 +1139,7 @@ bool LyX::readEncodingsFile(string const & name)
 {
        lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
 
-       string const enc_path = libFileSearch(string(), name);
+       FileName const enc_path = libFileSearch(string(), name);
        if (enc_path.empty()) {
                showFileError(name);
                return false;