]> git.lyx.org Git - lyx.git/commitdiff
Added and modified the patch for date-insert command.
authorJürgen Vigna <jug@sad.it>
Tue, 1 Feb 2000 11:32:33 +0000 (11:32 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 1 Feb 2000 11:32:33 +0000 (11:32 +0000)
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
lib/lyxrc.example
po/it.po
src/LyXAction.C
src/commandtags.h
src/lyxfunc.C
src/lyxrc.C
src/lyxrc.h

index bd351c8fcb8c8becf9df645eda8171f8849350bd..d58c04b7144cb7c0f003f8daee0b1023d43a81f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * src/lyxfont.C (textWidth): hopefully better fix for the Array
index 9fbe8de96a01132b7aa5d62f7a1e5143f788cbca..4382dfbb4dc6abbb3e0acd07405db322893c13be 100644 (file)
 # 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"
index 8bba2bbef48fe0fb4a7d1525bef7ea4b188d8d1c..86744b293d50b074dea8357e44a42911d5a61604 100644 (file)
--- 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?"
index e2abaa1dcf2c29cbd2b301f00622e7f56a2f7c69..5e3b6dbfda92b3cc8fd39102d1e60e51a59e520b 100644 (file)
@@ -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 }
        };
 
index 5cbe5a0350cfb89caaf256e0024cecc9c4f41dc3..3e86f9739d457666c2cc2a050dbba346a94caf40 100644 (file)
@@ -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 */
 };
 
index a2a6b00f9a623f03db03a43c3453dec9d4cbfb46..184b243151f9c4d5430a3a2b25c320de853f899a 100644 (file)
@@ -9,6 +9,8 @@
  * ====================================================== */
 
 #include <config.h>
+#include <time.h>
+#include <locale.h>
 
 #include <cstdlib>
 #include <cctype>
@@ -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);
index 6dbaa190fba3814da50c0a69da78d2b8da34f9be..6ef598ff5bc773b0fde36bd3fb3d622447caf229 100644 (file)
@@ -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
                }
        }
index 39ec35024c18ae03b4c0dd76757441985816d85c..d485ae51afce24ce0963a6fe80049572e90a86c4 100644 (file)
@@ -197,6 +197,8 @@ public:
        string secondary_kbmap;
        ///
        string lyxpipes;
+       ///
+       string insert_date_format;
 
 private:
        ///