+2000-03-20 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * src/LColor.C: made the command inset background a bit lighter.
+
+2000-03-20 Hartmut Goebel <goebel@noris.net>
+
+ * lib/layouts/stdstruct.inc: split into stdtitle.inc and
+ stdstruct.inc. Koma-Script added some title elements which
+ otherwise have been listed below "bibliography". This split allows
+ adding title elements to where they belong.
+
+ * lib/layouts/scrclass.inc: changed to include stdtitle.inc, then
+ define the additional tilte elements and then include
+ stdstruct.inc.
+
+ * many other layout files: changed to include stdtitle.inc just
+ before stdstruct.inc.
+
+2000-03-18 Dekel Tsur <dekel@math.tau.ac.il>
+
+ * src/buffer.C: (save) Added the option to store all backup files
+ in a single directory
+
+ * src/lyxrc.[Ch]: Added variable \backupdir_path
+
+ * lib/lyxrc.example: Added descriptions of recently added variables
+
+ * src/insets/insetbib.[Ch]: Fixed few bugs (crash when editing a
+ bibtex inset, not closing the bibtex popup when deleting the inset)
+
+2000-03-17 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * src/lyx_cb.C: add a couple using directives.
+
2000-03-17 José Abílio Matos <jamatos@lyx.org>
* src/lyx_cb.C (RunLinuxDoc) Removed the flag==-1 option for linuxdoc
import based on the filename.
##
## stdstruct
##
+Input stdtitle.inc
Input stdstruct.inc
Style Abstract
Input stdlists.inc
Input stdlayouts.inc
Input stdsections.inc
+Input stdtitle.inc
Input stdstruct.inc
# Remove unwanted Styles
# First, the standard includes
Input stdsections.inc
+Input stdtitle.inc
Input stdstruct.inc
Input stdlists.inc
AlignPossible Left, Right
End
+Input stdtitle.inc
Input stdstruct.inc
# Input lyxmacros.inc
NoStyle Abstract
End
# Then the Titles stuff.
+Input stdtitle.inc
Input stdstruct.inc
# Title style definition.
End
+Input stdtitle.inc
Input stdstruct.inc
# Input lyxmacros.inc
NoStyle Abstract
NoStyle Chapter*
# Some standard layouts
+Input stdtitle.inc
Input stdstruct.inc
Input lyxmacros.inc
Input stdlayouts.inc
Input stdlists.inc
################ STRUCTURE OF THE DOCUMENT
+Input stdtitle.inc
Input stdstruct.inc
# Title style definition
Input stdlists.inc
################ STRUCTURE OF THE DOCUMENT
+Input stdtitle.inc
Input stdstruct.inc
# Preprint style
EndFont
End
-Input stdstruct.inc
+Input stdtitle.inc
# Modify Title
Style Title
EndFont
End
-# Modify Abstract
-Style Abstract
- LabelFont
- Family Sans
- EndFont
-End
-
-# Modify Bibliography
-Style Bibliography
- LabelFont
- Family Sans
- EndFont
-End
-
# Subject style definition
Style Subject
CopyStyle Author
LatexName extratitle
End
+Input stdstruct.inc
+
+# Modify Abstract
+Style Abstract
+ LabelFont
+ Family Sans
+ EndFont
+End
+
+# Modify Bibliography
+Style Bibliography
+ LabelFont
+ Family Sans
+ EndFont
+End
+
Input stdlayouts.inc
Input lyxmacros.inc
Input scrmacros.inc
Input stdlists.inc
Input stdsections.inc
Input stdstarsections.inc
+Input stdtitle.inc
Input stdstruct.inc
Input lyxmacros.inc
Input stdlayouts.inc
# Author : Matthias Ettrich <ettrich@informatik.uni-tuebingen.de>
# Transposed by Pascal André <andre@via.ecp.fr>
# Heavily modifed and enhanced by several developers.
+# Title definitions moved to stdtitle.inc by HArtmut Goebel <harmut@noris.net>
# This include files contains all layouts that handle the structure of
-# a document, like titles and such.
+# a document, like abstract, bibliography and such.
-# Title style definition
-Style Title
- Margin Static
- LatexType Command
- InTitle 1
- LatexName title
- ParSkip 0.4
- ItemSep 0
- TopSep 0
- BottomSep 1
- ParSep 1
- Align Center
- AlignPossible Center
- LabelType No_Label
-
- # standard font definition
- Font
- Size Largest
- EndFont
-
-End
-
-# Author style definition
-Style Author
- Margin Static
- LatexType Command
- InTitle 1
- LatexName author
- LabelSep xxx
- ParSkip 0.4
- TopSep 1.3
- BottomSep 0.7
- ParSep 0.7
- Align Center
- AlignPossible Center
- LabelType No_Label
-
- # standard font definition
- Font
- Size Large
- EndFont
-
-End
-
-# Date style definition
-Style Date
- Margin Dynamic
- LatexType Command
- InTitle 1
- LatexName date
- LabelSep xxx
- ParSkip 0.4
- TopSep 0.9
- BottomSep 0.5
- ParSep 1
- Align Center
- AlignPossible Center
- LabelType No_Label
-
-
- # standard font definition
- Font
- Size Large
- EndFont
-
-End
# Abstract style definition
Style Abstract
--- /dev/null
+# Standard textclass definition file. Taken from initial LyX source code
+# Author : Matthias Ettrich <ettrich@informatik.uni-tuebingen.de>
+# Transposed by Pascal André <andre@via.ecp.fr>
+# Heavily modifed and enhanced by several developers.
+# Split from stdstruct.inc by Hartmut Goebel <hartmut@noris.net>
+
+# This include files contains all layouts that handle the title area
+# a document, like title, author and such.
+
+# Title style definition
+Style Title
+ Margin Static
+ LatexType Command
+ InTitle 1
+ LatexName title
+ ParSkip 0.4
+ ItemSep 0
+ TopSep 0
+ BottomSep 1
+ ParSep 1
+ Align Center
+ AlignPossible Center
+ LabelType No_Label
+
+ # standard font definition
+ Font
+ Size Largest
+ EndFont
+
+End
+
+# Author style definition
+Style Author
+ Margin Static
+ LatexType Command
+ InTitle 1
+ LatexName author
+ LabelSep xxx
+ ParSkip 0.4
+ TopSep 1.3
+ BottomSep 0.7
+ ParSep 0.7
+ Align Center
+ AlignPossible Center
+ LabelType No_Label
+
+ # standard font definition
+ Font
+ Size Large
+ EndFont
+
+End
+
+# Date style definition
+Style Date
+ Margin Dynamic
+ LatexType Command
+ InTitle 1
+ LatexName date
+ LabelSep xxx
+ ParSkip 0.4
+ TopSep 0.9
+ BottomSep 0.5
+ ParSep 1
+ Align Center
+ AlignPossible Center
+ LabelType No_Label
+
+
+ # standard font definition
+ Font
+ Size Large
+ EndFont
+
+End
# SGML or plain text). Default is 75.
#\ascii_linelen 80
+# Set to false if you don't want LyX to create backup files.
+# Default is true.
+#\make_backup true
+
+# The path for storing backup files. If it is the empty string, LyX will
+# store the backup file in the same directory of the original file.
+# Default is "".
+#\backupdir_path "~/Desktop/Trash/"
+
#
# FAX SECTION #############################################################
#
#\date_insert_format "%A, %e. %B %Y"
+#
+# LANGUAGE SUPPORT SECTION ####################################################
+#
+
+# Set to true to enable support of right-to-left languages (e.g. Hebrew,
+# Arabic). Default is false.
+#\rtl true
+
+# If auto_mathmode is set to "true", each time a digit key is pressed,
+# LyX will automatically enter into math-mode.
+# If auto_mathmode is set to "rtl", the above behavior will take place
+# only when editing right-to-left text.
+# Default is false.
+#\auto_mathmode true
+
+# The latex command for loading the language package.
+# Default is \usepackage{babel}.
+#\language_package "\usepackage{omega}"
+
+# The latex command for changing the from the language of the document
+# to another language. $$lang is substituted by the name of the second
+# language. Default is \selectlanguage{$$lang}.
+#\language_command_begin "\begin{otherlanguage}{$$lang}"
+
+# The latex command for changing back the language to the language of
+# the document. Default is \selectlanguage{$$lang}.
+#\language_command_end "\end{otherlanguage}"
+
+# Set to false if a language switching command is needed at the beginning of
+# the document. Default is true.
+#\language_auto_begin false
+
+# Set to false if a language switching command is needed at the end of
+# the document. Default is true.
+#\language_auto_end false
+
#
# HEBREW SUPPORT SECTION ####################################################
#
src/insets/form_graphics.C
src/insets/form_url.C
src/insets/insetbib.C
-src/insets/inseteditor.C
src/insets/inseterror.C
src/insets/inseterror.h
src/insets/insetert.C
fill(notebg, _("note background"), "notebg", "yellow", "notebg");
fill(noteframe, _("note frame"), "noteframe", "black", "noteframe");
fill(command, _("command-inset"), "command", "black", "command");
- fill(commandbg, _("command-inset background"), "commandbg", "grey50", "commandbg");
+ fill(commandbg, _("command-inset background"), "commandbg", "grey80", "commandbg");
fill(commandframe, _("inset frame"), "commandframe", "black", "commandframe");
fill(accent, _("accent"), "accent", "black", "accent");
fill(accentbg, _("accent background"), "accentbg", "offwhite", "accentbg");
// Should probably be moved to somewhere else: BufferView? LyXView?
-bool Buffer::save(bool makeBackup) const
+bool Buffer::save() const
{
// We don't need autosaves in the immediate future. (Asger)
resetAutosaveTimers();
// make a backup
- if (makeBackup) {
- string s = fileName() + '~';
+ string s;
+ if (lyxrc.make_backup) {
+ s = fileName() + '~';
+ if (!lyxrc.backupdir_path.empty())
+ s = AddName(lyxrc.backupdir_path,
+ subst(CleanupPath(s),'/','!'));
+
// Rename is the wrong way of making a backup,
// this is the correct way.
/* truss cp fil fil2:
}
} else {
// Saving failed, so backup is not backup
- if (makeBackup) {
- string s = fileName() + '~';
+ if (lyxrc.make_backup) {
::rename(s.c_str(), fileName().c_str());
}
return false;
Takes care of auto-save files and backup file if requested.
Returns true if the save is successful, false otherwise.
*/
- bool save(bool makeBackup) const;
+ bool save() const;
/// Write file. Returns false if unsuccesful.
bool writeFile(string const &, bool) const;
MakeDisplayPath(buf->fileName(), 50),
_("Save document?"))){
case 1: // Yes
- if (buf->save(lyxrc.make_backup)) {
+ if (buf->save()) {
lastfiles->newFile(buf->fileName());
} else {
AllowInput();
InsetBibKey::~InsetBibKey()
{
if(bibitem_form && bibitem_form->bibitem_form
- && bibitem_form->bibitem_form->visible)
+ && bibitem_form->bibitem_form->visible
+ && bibitem_form->bibitem_form->u_vdata == &holder)
fl_hide_form(bibitem_form->bibitem_form);
}
{
}
+InsetBibtex::~InsetBibtex()
+{
+ if(bibitem_form && bibitem_form->bibitem_form
+ && bibitem_form->bibitem_form->visible
+ && bibitem_form->bibitem_form->u_vdata == &holder)
+ fl_hide_form(bibitem_form->bibitem_form);
+}
+
string InsetBibtex::getScreenLabel() const
{
// BibTeX should have its own dialog. This is provisional.
-void InsetBibtex::Edit(BufferView *, int, int, unsigned int)
+void InsetBibtex::Edit(BufferView * bv, int, int, unsigned int)
{
if (!bibitem_form) {
bibitem_form = create_form_bibitem_form();
CancelCloseBoxCB, 0);
}
- bibitem_form->bibitem_form->u_vdata = this;
+ holder.inset = this;
+ holder.view = bv;
+ bibitem_form->bibitem_form->u_vdata = &holder;
+
fl_set_object_label(bibitem_form->key, _("Database:"));
fl_set_object_label(bibitem_form->label, _("Style: "));
fl_set_input(bibitem_form->key, getContents().c_str());
///
InsetBibtex(string const & dbase, string const & style,
Buffer *);
+ ///
+ ~InsetBibtex();
+
///
Inset * Clone() const {
return new InsetBibtex(contents, options, 0);
///
bool delDatabase(string const &);
///
- bool display() const { return true; }
+ bool display() const { return true; }
+
+ struct Holder {
+ InsetBibtex * inset;
+ BufferView * view;
+ };
+
private:
///
mutable Buffer * owner;
+
+ ///
+ Holder holder;
};
#endif
#include <fstream>
using std::ifstream;
+using std::copy;
+using std::back_inserter;
#include "LString.h"
#include "support/lstrings.h"
void MenuWrite(Buffer * buffer)
{
XFlush(fl_display);
- if (!buffer->save(lyxrc.make_backup)) {
+ if (!buffer->save()) {
string fname = buffer->fileName();
string s = MakeAbsPath(fname);
if (AskQuestion(_("Save failed. Rename and try again?"),
RC_RELYX_COMMAND,
RC_HTML_COMMAND,
RC_MAKE_BACKUP,
+ RC_BACKUPDIR_PATH,
RC_RTL_SUPPORT,
RC_AUTO_MATHMODE,
RC_LANGUAGE_PACKAGE,
{ "\\auto_region_delete", RC_AUTOREGIONDELETE },
{ "\\autosave", RC_AUTOSAVE },
{ "\\background_color", RC_BACKGROUND_COLOR },
+ { "\\backupdir_path", RC_BACKUPDIR_PATH },
{ "\\begin_toolbar", RC_BEGINTOOLBAR },
{ "\\bind", RC_BIND },
{ "\\bind_file", RC_BINDFILE },
num_lastfiles = 4;
check_lastfiles = true;
make_backup = true;
+ backupdir_path = "";
exit_confirmation = true;
display_shortcuts = true;
// Spellchecker settings:
if (lexrc.next())
make_backup = lexrc.GetBool();
break;
+ case RC_BACKUPDIR_PATH:
+ if (lexrc.next())
+ backupdir_path = ExpandPath(lexrc.GetString());
+ break;
case RC_DATE_INSERT_FORMAT:
if (lexrc.next())
date_insert_format = lexrc.GetString();
<< "\"\n";
case RC_MAKE_BACKUP:
os << "\\make_backup " << tostr(make_backup) << "\n";
+ case RC_BACKUPDIR_PATH:
+ os << "\\backupdir_path" << backupdir_path << "\n";
case RC_DATE_INSERT_FORMAT:
os << "\\date_insert_format \"" << date_insert_format
<< "\"\n";
unsigned int num_lastfiles;
/// shall a backup file be created
bool make_backup;
+ /// A directory for storing backup files
+ string backupdir_path;
/// Zoom factor for screen fonts
unsigned int zoom;
/// Screen font sizes in points for each font size