From 96be8c8193ccdc74cb3f4fea555d858ad4bf71f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Tue, 1 Feb 2000 11:32:33 +0000 Subject: [PATCH] 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 --- ChangeLog | 14 +++++++++++ lib/lyxrc.example | 7 ++++++ po/it.po | 64 +++++++++++++++++++++++++++++------------------ src/LyXAction.C | 1 + src/commandtags.h | 1 + src/lyxfunc.C | 28 +++++++++++++++++++++ src/lyxrc.C | 8 ++++++ src/lyxrc.h | 2 ++ 8 files changed, 101 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd351c8fcb..d58c04b714 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2000-02-01 Juergen Vigna + + * 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 * src/lyxfont.C (textWidth): hopefully better fix for the Array diff --git a/lib/lyxrc.example b/lib/lyxrc.example index 9fbe8de96a..4382dfbb4d 100644 --- a/lib/lyxrc.example +++ b/lib/lyxrc.example @@ -564,3 +564,10 @@ # words with international letters in them. There have been reports that this # does not work with all dictionaries, so this is disabled by default. #\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" diff --git a/po/it.po b/po/it.po index 8bba2bbef4..86744b293d 100644 --- a/po/it.po +++ b/po/it.po @@ -22,7 +22,7 @@ msgstr "Errore!" #: src/buffer.C:222 msgid "Specified file is unreadable: " -msgstr "" +msgstr "File specificato non puo essere letto: " #: src/buffer.C:232 #, fuzzy @@ -861,7 +861,7 @@ msgstr "Chiave:|#h" #: src/insets/insetbib.C:96 src/insets/insetbib.C:97 msgid "Remark:|#R" -msgstr "" +msgstr "Osservazione:|#O" #. InsetBibtex uses the same form, with different labels #: 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 msgid "Don't typeset|#D" -msgstr "" +msgstr "Non componi|#N" #: src/insets/insetinclude.C:54 src/insets/insetinclude.C:55 msgid "Load|#L" @@ -937,11 +937,11 @@ msgstr "" #: src/insets/insetinclude.C:71 src/insets/insetinclude.C:72 msgid "Use input|#i" -msgstr "" +msgstr "Usa input|#i" #: src/insets/insetinclude.C:75 src/insets/insetinclude.C:76 msgid "Use include|#U" -msgstr "" +msgstr "Usa include|#U" #. launches dialog #: 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 msgid "Input" -msgstr "" +msgstr "Includi" #: src/insets/insetinclude.C:291 msgid "Verbatim Input" -msgstr "" +msgstr "Includi verbatim" #: src/insets/insetindex.C:53 src/insets/insetindex.C:54 msgid "Keyword:|#K" -msgstr "" +msgstr "Parola chiave:|#P" #: src/insets/insetindex.C:104 msgid "Index" -msgstr "" +msgstr "Indice" #: src/insets/insetindex.C:111 msgid "Idx" -msgstr "" +msgstr "Ind" #: src/insets/insetindex.C:139 msgid "PrintIndex" -msgstr "" +msgstr "StampaIndice" #: src/insets/insetinfo.C:70 src/insets/insetinfo.C:89 #: src/insets/insetinfo.C:209 @@ -2015,7 +2015,7 @@ msgstr "Annulla l'ultima operazione" #: src/LyXAction.C:351 msgid "Register document under version control" -msgstr "" +msgstr "Restria il documento con version control" #: src/LyXAction.C:575 msgid "No description available!" @@ -2212,7 +2212,7 @@ msgstr "Annullato" #: src/lyx_cb.C:793 msgid "DocBook does not have a latex backend" -msgstr "" +msgstr "DocBook non ha un backend latex" #: src/lyx_cb.C:800 msgid "Nice LaTeX file saved as" @@ -2251,7 +2251,7 @@ msgstr "Il file ASCII #: src/lyx_cb.C:937 msgid "Document exported as HTML to file `" -msgstr "" +msgstr "Documento esportato in HTML sul file `" #: src/lyx_cb.C:940 #, fuzzy @@ -2276,7 +2276,7 @@ msgstr "File da inserire" #: src/lyx_cb.C:1148 msgid "Error! Specified file is unreadable: " -msgstr "" +msgstr "Errore! Il file specificato non puo essere letto: " #: src/lyx_cb.C:1155 #, fuzzy @@ -2776,7 +2776,7 @@ msgstr "Spiacente." #: src/lyxfr1.C:149 src/lyxfr1.C:186 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 #, fuzzy @@ -2790,7 +2790,7 @@ msgstr "Il sistema #: src/lyxfr1.C:224 msgid " strings have been replaced." -msgstr "" +msgstr "le stringhe sono state sostituite." #: src/lyxfr1.C:261 #, fuzzy @@ -2907,7 +2907,7 @@ msgstr "Inserisci il nome del file per il nuovo documento" #: src/lyxfunc.C:2462 msgid "newfile" -msgstr "file nuovo" +msgstr "filenuovo" #: src/lyxfunc.C:2481 src/lyxfunc.C:2620 src/lyxfunc.C:2699 msgid "" @@ -3098,7 +3098,7 @@ msgstr "" #: src/lyx_gui_misc.C:356 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:397 @@ -3243,10 +3243,26 @@ msgid "" "\n" "Check the LyX man page for more options." 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 msgid "List of supported debug flags:" -msgstr "" +msgstr "Lista delle opzioni di debug:" #: src/lyx_main.C:511 msgid "Missing directory for -sysdir switch!" @@ -3264,15 +3280,15 @@ msgstr "Tipo per l'esportazione sconosciuto: " #: src/lyx_main.C:564 msgid "' after " -msgstr "" +msgstr "' dopo " #: src/lyx_main.C:565 src/lyx_main.C:570 msgid " switch!" -msgstr "" +msgstr " opzione!" #: src/lyx_main.C:568 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 msgid "Fax no.:|#F" @@ -3377,7 +3393,7 @@ msgstr "LyX VC: Messaggio di log" #: src/lyxvc.C:140 msgid "(no log message)" -msgstr "" +msgstr "(nessun messaggio di log)" #: src/lyxvc.C:155 msgid "Ignore changes and proceed with check out?" diff --git a/src/LyXAction.C b/src/LyXAction.C index e2abaa1dcf..5e3b6dbfda 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -363,6 +363,7 @@ void LyXAction::init() { LFUN_WORDRIGHTSEL, "word-forward-select", "", ReadOnly }, { LFUN_LOWCASE_WORD, "word-lowcase", "", Noop }, { LFUN_UPCASE_WORD, "word-upcase", "", Noop }, + { LFUN_INSERT_DATE, "insert-date", "", Noop }, { LFUN_NOACTION, "", "", Noop } }; diff --git a/src/commandtags.h b/src/commandtags.h index 5cbe5a0350..3e86f9739d 100644 --- a/src/commandtags.h +++ b/src/commandtags.h @@ -242,6 +242,7 @@ enum kb_action { LFUN_MENU_SEPARATOR, // Asger 990220 LFUN_SEQUENCE, // Andre' 991111 LFUN_SAVEPREFERENCES, // Lgb 991127 + LFUN_INSERT_DATE, // jdblair 20000131 LFUN_LASTACTION /* this marks the end of the table */ }; diff --git a/src/lyxfunc.C b/src/lyxfunc.C index a2a6b00f9a..184b243151 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -9,6 +9,8 @@ * ====================================================== */ #include +#include +#include #include #include @@ -2348,6 +2350,32 @@ string LyXFunc::Dispatch(int ac, } 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: { Path p(user_lyxdir); diff --git a/src/lyxrc.C b/src/lyxrc.C index 6dbaa190fb..6ef598ff5b 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -133,6 +133,7 @@ enum LyXRCTags { RC_VIEWPDF_COMMAND, RC_PDF_TO_PS_COMMAND, RC_DVI_TO_PS_COMMAND, + RC_INSERT_DATE_FORMAT, RC_LAST }; @@ -167,6 +168,7 @@ static keyword_item lyxrcTags[] = { { "\\font_encoding", RC_FONT_ENCODING }, { "\\html_command", RC_HTML_COMMAND }, { "\\input", RC_INPUT }, + { "\\insert_date_format", RC_INSERT_DATE_FORMAT }, { "\\kbmap", RC_KBMAP }, { "\\kbmap_primary", RC_KBMAP_PRIMARY }, { "\\kbmap_secondary", RC_KBMAP_SECONDARY }, @@ -322,6 +324,8 @@ LyXRC::LyXRC() use_kbmap = false; hasBindFile = false; defaultKeyBindings(); + /// + insert_date_format = "%A, %B %d %Y"; } @@ -903,6 +907,10 @@ int LyXRC::read(string const & filename) if (lexrc.next()) make_backup = lexrc.GetBool(); break; + case RC_INSERT_DATE_FORMAT: + if (lexrc.next()) + insert_date_format = lexrc.GetString(); + break; case RC_LAST: break; // this is just a dummy } } diff --git a/src/lyxrc.h b/src/lyxrc.h index 39ec35024c..d485ae51af 100644 --- a/src/lyxrc.h +++ b/src/lyxrc.h @@ -197,6 +197,8 @@ public: string secondary_kbmap; /// string lyxpipes; + /// + string insert_date_format; private: /// -- 2.39.5