using support::createDirectory;
using support::createLyXTmpDir;
using support::destroyDir;
+using support::FileName;
using support::fileSearch;
using support::getEnv;
using support::i18nLibFileSearch;
if (!use_gui) {
// FIXME: create a ConsoleApplication
int exit_status = loadFiles(argc, argv, files);
- if (exit_status)
+ if (exit_status) {
+ prepareExit();
return exit_status;
- execBatchCommands();
- return EXIT_SUCCESS;
+ }
+
+ if (batch_command.empty() || pimpl_->buffer_list_.empty()) {
+ prepareExit();
+ return EXIT_SUCCESS;
+ }
+
+ BufferList::iterator begin = pimpl_->buffer_list_.begin();
+ BufferList::iterator end = pimpl_->buffer_list_.end();
+
+ bool final_success = false;
+ for (BufferList::iterator I = begin; I != end; ++I) {
+ Buffer * buf = *I;
+ bool success = false;
+ buf->dispatch(batch_command, &success);
+ final_success |= success;
+ }
+ prepareExit();
+ return !final_success;
}
// Force adding of font path _before_ Application is initialized
}
if (first_start)
- files.push_back(i18nLibFileSearch("examples", "splash.lyx"));
+ files.push_back(i18nLibFileSearch("examples", "splash.lyx").absFilename());
Buffer * last_loaded = 0;
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)
// 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 ) {
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
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;
}
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"
{
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;
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;
{
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;
{
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;