Added and modified the patch for date-insert command.

Updated the it.po file (a bit)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@517 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-02-01 11:32:33 +00:00
parent 1940a824b9
commit 96be8c8193
8 changed files with 101 additions and 24 deletions

View File

@ -1,3 +1,17 @@
2000-02-01 Juergen Vigna <jug@sad.it>
* po/it.po: updated a bit the italian po file and also changed the
'file nuovo' for newfile to 'filenuovo' without a space, this did
annoy me a lot :)
* src/lyxrc.C (LyXRC): added support for a default insert_date_format
for the new insert_date command.
* src/lyxfunc.C (Dispatch): added support for a insert_date function
from jdblair, to insert a date into the current text conforming to
a strftime format (for now only considering the locale-set and not
the document-language).
2000-01-28 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2000-01-28 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/lyxfont.C (textWidth): hopefully better fix for the Array * src/lyxfont.C (textWidth): hopefully better fix for the Array

View File

@ -564,3 +564,10 @@
# words with international letters in them. There have been reports that this # words with international letters in them. There have been reports that this
# does not work with all dictionaries, so this is disabled by default. # does not work with all dictionaries, so this is disabled by default.
#\use_input_encoding true #\use_input_encoding true
# DEFAULT FORMAT STRING FOR THE date-insert COMMAND
#
# This accepts the normal strftime formats have a look at man strftime
# for nowing exactly what the formats are for and how to use them.
#
#\insert_date_format "%A, %B %d %Y"

View File

@ -22,7 +22,7 @@ msgstr "Errore!"
#: src/buffer.C:222 #: src/buffer.C:222
msgid "Specified file is unreadable: " msgid "Specified file is unreadable: "
msgstr "" msgstr "File specificato non puo essere letto: "
#: src/buffer.C:232 #: src/buffer.C:232
#, fuzzy #, fuzzy
@ -861,7 +861,7 @@ msgstr "Chiave:|#h"
#: src/insets/insetbib.C:96 src/insets/insetbib.C:97 #: src/insets/insetbib.C:96 src/insets/insetbib.C:97
msgid "Remark:|#R" msgid "Remark:|#R"
msgstr "" msgstr "Osservazione:|#O"
#. InsetBibtex uses the same form, with different labels #. InsetBibtex uses the same form, with different labels
#: src/insets/insetbib.C:114 src/insets/insetbib.C:115 #: src/insets/insetbib.C:114 src/insets/insetbib.C:115
@ -917,7 +917,7 @@ msgstr "Cerca|#e"
#: src/insets/insetinclude.C:44 src/insets/insetinclude.C:45 #: src/insets/insetinclude.C:44 src/insets/insetinclude.C:45
msgid "Don't typeset|#D" msgid "Don't typeset|#D"
msgstr "" msgstr "Non componi|#N"
#: src/insets/insetinclude.C:54 src/insets/insetinclude.C:55 #: src/insets/insetinclude.C:54 src/insets/insetinclude.C:55
msgid "Load|#L" msgid "Load|#L"
@ -937,11 +937,11 @@ msgstr ""
#: src/insets/insetinclude.C:71 src/insets/insetinclude.C:72 #: src/insets/insetinclude.C:71 src/insets/insetinclude.C:72
msgid "Use input|#i" msgid "Use input|#i"
msgstr "" msgstr "Usa input|#i"
#: src/insets/insetinclude.C:75 src/insets/insetinclude.C:76 #: src/insets/insetinclude.C:75 src/insets/insetinclude.C:76
msgid "Use include|#U" msgid "Use include|#U"
msgstr "" msgstr "Usa include|#U"
#. launches dialog #. launches dialog
#: src/insets/insetinclude.C:111 src/lyx_cb.C:314 src/lyxfunc.C:2459 #: src/insets/insetinclude.C:111 src/lyx_cb.C:314 src/lyxfunc.C:2459
@ -961,27 +961,27 @@ msgstr "Includi"
#: src/insets/insetinclude.C:289 #: src/insets/insetinclude.C:289
msgid "Input" msgid "Input"
msgstr "" msgstr "Includi"
#: src/insets/insetinclude.C:291 #: src/insets/insetinclude.C:291
msgid "Verbatim Input" msgid "Verbatim Input"
msgstr "" msgstr "Includi verbatim"
#: src/insets/insetindex.C:53 src/insets/insetindex.C:54 #: src/insets/insetindex.C:53 src/insets/insetindex.C:54
msgid "Keyword:|#K" msgid "Keyword:|#K"
msgstr "" msgstr "Parola chiave:|#P"
#: src/insets/insetindex.C:104 #: src/insets/insetindex.C:104
msgid "Index" msgid "Index"
msgstr "" msgstr "Indice"
#: src/insets/insetindex.C:111 #: src/insets/insetindex.C:111
msgid "Idx" msgid "Idx"
msgstr "" msgstr "Ind"
#: src/insets/insetindex.C:139 #: src/insets/insetindex.C:139
msgid "PrintIndex" msgid "PrintIndex"
msgstr "" msgstr "StampaIndice"
#: src/insets/insetinfo.C:70 src/insets/insetinfo.C:89 #: src/insets/insetinfo.C:70 src/insets/insetinfo.C:89
#: src/insets/insetinfo.C:209 #: src/insets/insetinfo.C:209
@ -2015,7 +2015,7 @@ msgstr "Annulla l'ultima operazione"
#: src/LyXAction.C:351 #: src/LyXAction.C:351
msgid "Register document under version control" msgid "Register document under version control"
msgstr "" msgstr "Restria il documento con version control"
#: src/LyXAction.C:575 #: src/LyXAction.C:575
msgid "No description available!" msgid "No description available!"
@ -2212,7 +2212,7 @@ msgstr "Annullato"
#: src/lyx_cb.C:793 #: src/lyx_cb.C:793
msgid "DocBook does not have a latex backend" msgid "DocBook does not have a latex backend"
msgstr "" msgstr "DocBook non ha un backend latex"
#: src/lyx_cb.C:800 #: src/lyx_cb.C:800
msgid "Nice LaTeX file saved as" msgid "Nice LaTeX file saved as"
@ -2251,7 +2251,7 @@ msgstr "Il file ASCII
#: src/lyx_cb.C:937 #: src/lyx_cb.C:937
msgid "Document exported as HTML to file `" msgid "Document exported as HTML to file `"
msgstr "" msgstr "Documento esportato in HTML sul file `"
#: src/lyx_cb.C:940 #: src/lyx_cb.C:940
#, fuzzy #, fuzzy
@ -2276,7 +2276,7 @@ msgstr "File da inserire"
#: src/lyx_cb.C:1148 #: src/lyx_cb.C:1148
msgid "Error! Specified file is unreadable: " msgid "Error! Specified file is unreadable: "
msgstr "" msgstr "Errore! Il file specificato non puo essere letto: "
#: src/lyx_cb.C:1155 #: src/lyx_cb.C:1155
#, fuzzy #, fuzzy
@ -2776,7 +2776,7 @@ msgstr "Spiacente."
#: src/lyxfr1.C:149 src/lyxfr1.C:186 #: src/lyxfr1.C:149 src/lyxfr1.C:186
msgid "You cannot replace a single space, nor an empty character." msgid "You cannot replace a single space, nor an empty character."
msgstr "" msgstr "Non si puo sostituire uno spazio singolo o un carattere vuoto"
#: src/lyxfr1.C:217 src/lyxfr1.C:265 #: src/lyxfr1.C:217 src/lyxfr1.C:265
#, fuzzy #, fuzzy
@ -2790,7 +2790,7 @@ msgstr "Il sistema
#: src/lyxfr1.C:224 #: src/lyxfr1.C:224
msgid " strings have been replaced." msgid " strings have been replaced."
msgstr "" msgstr "le stringhe sono state sostituite."
#: src/lyxfr1.C:261 #: src/lyxfr1.C:261
#, fuzzy #, fuzzy
@ -3098,7 +3098,7 @@ msgstr ""
#: src/lyx_gui_misc.C:356 #: src/lyx_gui_misc.C:356
msgid "Dismiss" msgid "Dismiss"
msgstr "" msgstr "Chiudi"
#: src/lyx_gui_misc.C:373 src/lyx_gui_misc.C:386 src/lyx_gui_misc.C:391 #: src/lyx_gui_misc.C:373 src/lyx_gui_misc.C:386 src/lyx_gui_misc.C:391
#: src/lyx_gui_misc.C:397 #: src/lyx_gui_misc.C:397
@ -3243,10 +3243,26 @@ msgid ""
"\n" "\n"
"Check the LyX man page for more options." "Check the LyX man page for more options."
msgstr "" msgstr ""
"Uso: lyx [ opzioni di commando ] [ nome.lyx ...]\n"
"Opzioni di comando (sensibile alle maiuscole):\n"
"\t-help visuzlizza messaggio di aiuto\n"
"\t-sysdir x prova a settare il direttorio base a x\n"
"\t-width x setta la largezza della finestra principale\n"
"\t-height y setta l'altezza della finestra principale\n"
"\t-xpos x setta la posizione x della finestra principale\n"
"\t-ypos y setta la posizione y della finestra principale\n"
"\t-dbg caratteristica[,carateristica]...\n"
" setta le carateristiche da debuggare.\n"
" Digita `lyx -dbg' per vedere una lista di carateristiche\n"
"\t-Reverse inverte i colori di sfondo e di primo piano\n"
"\t-Mono fa partire LyX in modo bianco e nero\n"
"\t-FastSelection usa una procedura veloce per fare selezioni\n"
"\n"
"Guarda anche le LyX man pagine per più opzioni."
#: src/lyx_main.C:492 #: src/lyx_main.C:492
msgid "List of supported debug flags:" msgid "List of supported debug flags:"
msgstr "" msgstr "Lista delle opzioni di debug:"
#: src/lyx_main.C:511 #: src/lyx_main.C:511
msgid "Missing directory for -sysdir switch!" msgid "Missing directory for -sysdir switch!"
@ -3264,15 +3280,15 @@ msgstr "Tipo per l'esportazione sconosciuto: "
#: src/lyx_main.C:564 #: src/lyx_main.C:564
msgid "' after " msgid "' after "
msgstr "" msgstr "' dopo "
#: src/lyx_main.C:565 src/lyx_main.C:570 #: src/lyx_main.C:565 src/lyx_main.C:570
msgid " switch!" msgid " switch!"
msgstr "" msgstr " opzione!"
#: src/lyx_main.C:568 #: src/lyx_main.C:568
msgid "Missing file type [eg latex, ps...] after " msgid "Missing file type [eg latex, ps...] after "
msgstr "" msgstr "Manca il tipo di file [p.e. latex, ps...] dopo "
#: src/lyx_sendfax.C:21 #: src/lyx_sendfax.C:21
msgid "Fax no.:|#F" msgid "Fax no.:|#F"
@ -3377,7 +3393,7 @@ msgstr "LyX VC: Messaggio di log"
#: src/lyxvc.C:140 #: src/lyxvc.C:140
msgid "(no log message)" msgid "(no log message)"
msgstr "" msgstr "(nessun messaggio di log)"
#: src/lyxvc.C:155 #: src/lyxvc.C:155
msgid "Ignore changes and proceed with check out?" msgid "Ignore changes and proceed with check out?"

View File

@ -363,6 +363,7 @@ void LyXAction::init()
{ LFUN_WORDRIGHTSEL, "word-forward-select", "", ReadOnly }, { LFUN_WORDRIGHTSEL, "word-forward-select", "", ReadOnly },
{ LFUN_LOWCASE_WORD, "word-lowcase", "", Noop }, { LFUN_LOWCASE_WORD, "word-lowcase", "", Noop },
{ LFUN_UPCASE_WORD, "word-upcase", "", Noop }, { LFUN_UPCASE_WORD, "word-upcase", "", Noop },
{ LFUN_INSERT_DATE, "insert-date", "", Noop },
{ LFUN_NOACTION, "", "", Noop } { LFUN_NOACTION, "", "", Noop }
}; };

View File

@ -242,6 +242,7 @@ enum kb_action {
LFUN_MENU_SEPARATOR, // Asger 990220 LFUN_MENU_SEPARATOR, // Asger 990220
LFUN_SEQUENCE, // Andre' 991111 LFUN_SEQUENCE, // Andre' 991111
LFUN_SAVEPREFERENCES, // Lgb 991127 LFUN_SAVEPREFERENCES, // Lgb 991127
LFUN_INSERT_DATE, // jdblair 20000131
LFUN_LASTACTION /* this marks the end of the table */ LFUN_LASTACTION /* this marks the end of the table */
}; };

View File

@ -9,6 +9,8 @@
* ====================================================== */ * ====================================================== */
#include <config.h> #include <config.h>
#include <time.h>
#include <locale.h>
#include <cstdlib> #include <cstdlib>
#include <cctype> #include <cctype>
@ -2348,6 +2350,32 @@ string LyXFunc::Dispatch(int ac,
} }
break; break;
case LFUN_INSERT_DATE: // jdblair: insert-date cmd
{
char datetmp[32];
int datetmp_len;
time_t now_time_t;
struct tm *now_tm;
static string arg;
now_time_t = time(NULL);
now_tm = localtime(&now_time_t);
(void)setlocale(LC_TIME, "");
if (!argument.empty())
arg = argument;
else if (arg.empty())
arg = lyxrc->insert_date_format;
datetmp_len = (int) strftime(datetmp, 32, arg.c_str(), now_tm);
for (int i = 0; i < datetmp_len; i++) {
owner->view()->text->InsertChar(datetmp[i]);
owner->view()->smallUpdate(1);
}
SetUpdateTimer();
owner->view()->text->sel_cursor = owner->view()->text->cursor;
moveCursorUpdate(false);
}
break;
case LFUN_SAVEPREFERENCES: case LFUN_SAVEPREFERENCES:
{ {
Path p(user_lyxdir); Path p(user_lyxdir);

View File

@ -133,6 +133,7 @@ enum LyXRCTags {
RC_VIEWPDF_COMMAND, RC_VIEWPDF_COMMAND,
RC_PDF_TO_PS_COMMAND, RC_PDF_TO_PS_COMMAND,
RC_DVI_TO_PS_COMMAND, RC_DVI_TO_PS_COMMAND,
RC_INSERT_DATE_FORMAT,
RC_LAST RC_LAST
}; };
@ -167,6 +168,7 @@ static keyword_item lyxrcTags[] = {
{ "\\font_encoding", RC_FONT_ENCODING }, { "\\font_encoding", RC_FONT_ENCODING },
{ "\\html_command", RC_HTML_COMMAND }, { "\\html_command", RC_HTML_COMMAND },
{ "\\input", RC_INPUT }, { "\\input", RC_INPUT },
{ "\\insert_date_format", RC_INSERT_DATE_FORMAT },
{ "\\kbmap", RC_KBMAP }, { "\\kbmap", RC_KBMAP },
{ "\\kbmap_primary", RC_KBMAP_PRIMARY }, { "\\kbmap_primary", RC_KBMAP_PRIMARY },
{ "\\kbmap_secondary", RC_KBMAP_SECONDARY }, { "\\kbmap_secondary", RC_KBMAP_SECONDARY },
@ -322,6 +324,8 @@ LyXRC::LyXRC()
use_kbmap = false; use_kbmap = false;
hasBindFile = false; hasBindFile = false;
defaultKeyBindings(); defaultKeyBindings();
///
insert_date_format = "%A, %B %d %Y";
} }
@ -903,6 +907,10 @@ int LyXRC::read(string const & filename)
if (lexrc.next()) if (lexrc.next())
make_backup = lexrc.GetBool(); make_backup = lexrc.GetBool();
break; break;
case RC_INSERT_DATE_FORMAT:
if (lexrc.next())
insert_date_format = lexrc.GetString();
break;
case RC_LAST: break; // this is just a dummy case RC_LAST: break; // this is just a dummy
} }
} }

View File

@ -197,6 +197,8 @@ public:
string secondary_kbmap; string secondary_kbmap;
/// ///
string lyxpipes; string lyxpipes;
///
string insert_date_format;
private: private:
/// ///