// Prints out the buffer info into the .lyx file given by file
// the document directory
- os << "\\origin " << buf->filePath() << '\n';
+ os << "\\origin "
+ << (lyxrc.save_origin ? buf->filePath() : "unavailable") << '\n';
// the textclass
os << "\\textclass " << buf->includedFilePath(addName(buf->layoutPos(),
{ "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
{ "\\printer", LyXRC::RC_PRINTER },
{ "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
+ { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
{ "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
{ "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
{ "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
load_session = false;
make_backup = true;
save_compressed = false;
+ save_origin = false;
backupdir_path.erase();
display_graphics = true;
// Spellchecker settings:
case RC_SAVE_COMPRESSED:
lexrc >> save_compressed;
break;
+ case RC_SAVE_ORIGIN:
+ lexrc >> save_origin;
+ break;
case RC_BACKUPDIR_PATH:
if (lexrc.next()) {
backupdir_path = os::internal_path(lexrc.getString());
}
if (tag != RC_LAST)
break;
+ case RC_SAVE_ORIGIN:
+ if (ignore_system_lyxrc ||
+ save_origin != system_lyxrc.save_origin) {
+ os << "\\save_origin " << convert<string>(save_origin) << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
case RC_BACKUPDIR_PATH:
if (ignore_system_lyxrc ||
backupdir_path != system_lyxrc.backupdir_path) {
case LyXRC::RC_PRINT_ADAPTOUTPUT:
case LyXRC::RC_PRINT_COMMAND:
case LyXRC::RC_SAVE_COMPRESSED:
+ case LyXRC::RC_SAVE_ORIGIN:
case LyXRC::RC_SCREEN_DPI:
case LyXRC::RC_SCREEN_FONT_ROMAN:
case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
RC_PRINT_ADAPTOUTPUT,
RC_PRINT_COMMAND,
RC_SAVE_COMPRESSED,
+ RC_SAVE_ORIGIN,
RC_SCREEN_DPI,
RC_SCREEN_FONT_ROMAN,
RC_SCREEN_FONT_ROMAN_FOUNDRY,
bool load_session;
/// do we save new documents as compressed by default
bool save_compressed;
+ /// whether or not to save the document dir in the file
+ bool save_origin;
/// shall a backup file be created
bool make_backup;
/// A directory for storing backup files
this, SIGNAL(changed()));
connect(saveCompressedCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
+ connect(saveOriginCB, SIGNAL(clicked()),
+ this, SIGNAL(changed()));
}
rc.autosave = autoSaveCB->isChecked() ? autoSaveSB->value() * 60 : 0;
rc.make_backup = backupCB->isChecked();
rc.save_compressed = saveCompressedCB->isChecked();
+ rc.save_origin = saveOriginCB->isChecked();
rc.open_buffers_in_tabs = openDocumentsInTabsCB->isChecked();
rc.single_instance = singleInstanceCB->isChecked();
rc.single_close_tab_button = singleCloseTabButtonCB->isChecked();
autoSaveSB->setEnabled(autosave);
backupCB->setChecked(rc.make_backup);
saveCompressedCB->setChecked(rc.save_compressed);
+ saveOriginCB->setChecked(rc.save_origin);
openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs);
singleInstanceCB->setChecked(rc.single_instance && !rc.lyxpipes.empty());
singleInstanceCB->setEnabled(!rc.lyxpipes.empty());
</property>
</widget>
</item>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="saveOriginCB">
+ <property name="toolTip">
+ <string>If this is checked, the document directory path will be saved in the document.
This allows moving the document elsewhere and still finding the included files.</string>
+ </property>
+ <property name="text">
+ <string>Save the &document directory path</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<tabstop>autoSaveCB</tabstop>
<tabstop>autoSaveSB</tabstop>
<tabstop>saveCompressedCB</tabstop>
+ <tabstop>saveOriginCB</tabstop>
</tabstops>
<includes>
<include location="local">qt_i18n.h</include>