|
From: <pa...@us...> - 2008-07-30 23:14:50
|
Revision: 536
http://osmo-pim.svn.sourceforge.net/osmo-pim/?rev=536&view=rev
Author: pasp
Date: 2008-07-30 23:14:55 +0000 (Wed, 30 Jul 2008)
Log Message:
-----------
* Added possibility to insert current date and time in notes editor
Modified Paths:
--------------
trunk/src/notes.c
trunk/src/stock_icons.c
trunk/src/stock_icons.h
trunk/src/stock_icons_data.h
Modified: trunk/src/notes.c
===================================================================
--- trunk/src/notes.c 2008-07-30 21:20:56 UTC (rev 535)
+++ trunk/src/notes.c 2008-07-30 23:14:55 UTC (rev 536)
@@ -319,6 +319,24 @@
/*------------------------------------------------------------------------------*/
+void
+insert_current_date_and_time_cb (GtkWidget *widget, gpointer data) {
+
+GtkTextBuffer *buffer;
+GtkTextIter titer;
+time_t tmm;
+
+ GUI *appGUI = (GUI *)data;
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (appGUI->nte->editor_textview));
+ gtk_text_buffer_get_iter_at_offset(GTK_TEXT_BUFFER(buffer), &titer, -1);
+ tmm = time(NULL);
+ gtk_text_buffer_insert (buffer, &titer, asctime (localtime (&tmm)), -1);
+
+}
+
+/*------------------------------------------------------------------------------*/
+
gint
notes_list_dbclick_cb(GtkWidget * widget, GdkEventButton * event, gpointer func_data) {
@@ -722,6 +740,8 @@
" <toolitem name=\"mark_color\" action=\"mark_color\" />\n"
" <toolitem name=\"clear\" action=\"clear\" />\n"
" <separator name=\"sep2\" />\n"
+" <toolitem name=\"insert_date_time\" action=\"insert_date_time\" />\n"
+" <separator name=\"sep3\" />\n"
" <toolitem name=\"close\" action=\"close\" />\n"
" </toolbar>\n";
@@ -734,6 +754,7 @@
{ "mark_color", OSMO_STOCK_EDITOR_HIGHLIGHT, _("Highlight"), NULL, _("Highlight"), NULL },
{ "clear", OSMO_STOCK_EDITOR_CLEAR, _("Clear attributes"), NULL, _("Clear attributes"), NULL },
{ "save", OSMO_STOCK_EDITOR_SAVE, _("Save note"), NULL, _("Save note"), NULL },
+ { "insert_date_time", OSMO_STOCK_EDITOR_INSERT_DATE_TIME, _("Insert current date and time"), NULL, _("Insert current date and time"), NULL },
{ "close", OSMO_STOCK_CLOSE, _("Close editor"), NULL, _("Close editor"), NULL },
};
@@ -1050,6 +1071,8 @@
g_signal_connect (G_OBJECT (gtk_ui_manager_get_widget (appGUI->nte->notes_uim_editor_widget, "/toolbar/mark_color")),
"clicked", G_CALLBACK (set_text_attribute_cb), appGUI);
+ g_signal_connect (G_OBJECT(gtk_ui_manager_get_widget (appGUI->nte->notes_uim_editor_widget, "/toolbar/insert_date_time")),
+ "clicked", G_CALLBACK(insert_current_date_and_time_cb), appGUI);
g_signal_connect (G_OBJECT (gtk_ui_manager_get_widget (appGUI->nte->notes_uim_editor_widget, "/toolbar/clear")),
"clicked", G_CALLBACK (clear_text_attributes_cb), appGUI);
g_signal_connect (G_OBJECT (gtk_ui_manager_get_widget (appGUI->nte->notes_uim_editor_widget, "/toolbar/close")),
Modified: trunk/src/stock_icons.c
===================================================================
--- trunk/src/stock_icons.c 2008-07-30 21:20:56 UTC (rev 535)
+++ trunk/src/stock_icons.c 2008-07-30 23:14:55 UTC (rev 536)
@@ -78,6 +78,7 @@
{ (gchar*) OSMO_STOCK_EDITOR_CLEAR, (gchar*) N_("Clear"), 0, 0, TRANSLATION_DOMAIN },
{ (gchar*) OSMO_STOCK_EDITOR_FIND, (gchar*) N_("Find"), 0, 0, TRANSLATION_DOMAIN },
{ (gchar*) OSMO_STOCK_EDITOR_HIGHLIGHT, (gchar*) N_("Highlight"), 0, 0, TRANSLATION_DOMAIN },
+ { (gchar*) OSMO_STOCK_EDITOR_INSERT_DATE_TIME, (gchar*) N_("Insert current date and time"), 0, 0, TRANSLATION_DOMAIN },
{ (gchar*) OSMO_STOCK_EDITOR_ITALIC, (gchar*) N_("Italic"), 0, 0, TRANSLATION_DOMAIN },
{ (gchar*) OSMO_STOCK_EDITOR_SAVE, (gchar*) N_("Save"), 0, 0, TRANSLATION_DOMAIN },
{ (gchar*) OSMO_STOCK_EDITOR_STRIKETHROUGH, (gchar*) N_("Strikethrough"), 0, 0, TRANSLATION_DOMAIN },
@@ -154,6 +155,7 @@
(const guint8*) osmo_stock_editor_clear,
(const guint8*) osmo_stock_editor_find,
(const guint8*) osmo_stock_editor_highlight,
+ (const guint8*) osmo_stock_editor_insert_date_time,
(const guint8*) osmo_stock_editor_italic,
(const guint8*) osmo_stock_editor_save,
(const guint8*) osmo_stock_editor_strikethrough,
Modified: trunk/src/stock_icons.h
===================================================================
--- trunk/src/stock_icons.h 2008-07-30 21:20:56 UTC (rev 535)
+++ trunk/src/stock_icons.h 2008-07-30 23:14:55 UTC (rev 536)
@@ -66,6 +66,7 @@
#define OSMO_STOCK_EDITOR_CLEAR "osmo-editor-clear"
#define OSMO_STOCK_EDITOR_FIND "osmo-editor-find"
#define OSMO_STOCK_EDITOR_HIGHLIGHT "osmo-editor-highlight"
+#define OSMO_STOCK_EDITOR_INSERT_DATE_TIME "osmo-editor-insert_date_time"
#define OSMO_STOCK_EDITOR_ITALIC "osmo-editor-italic"
#define OSMO_STOCK_EDITOR_SAVE "osmo-editor-save"
#define OSMO_STOCK_EDITOR_STRIKETHROUGH "osmo-editor-strikethrough"
Modified: trunk/src/stock_icons_data.h
===================================================================
--- trunk/src/stock_icons_data.h 2008-07-30 21:20:56 UTC (rev 535)
+++ trunk/src/stock_icons_data.h 2008-07-30 23:14:55 UTC (rev 536)
@@ -2355,6 +2355,99 @@
/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */
#ifdef __SUNPRO_C
+#pragma align 4 (osmo_stock_editor_insert_date_time)
+#endif
+#ifdef __GNUC__
+const guint8 osmo_stock_editor_insert_date_time[] __attribute__ ((__aligned__ (4))) =
+#else
+const guint8 osmo_stock_editor_insert_date_time[] =
+#endif
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (1484) */
+ "\0\0\5\344"
+ /* pixdata_type (0x2010002) */
+ "\2\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\1OOM\252\215JII\377\2LKK\336HGG\10\210\377\377\377\0\5JHI\377\244\243"
+ "\243\377\323\323\323\377\312\312\312\377\253\253\253\377\210\251\251"
+ "\251\377\3\225\224\224\377DBC\377LLKN\210\377\377\377\0\5JHH\377\277"
+ "\277\277\377\345\345\345\377\336\335\336\377\274\274\274\377\210\270"
+ "\267\270\377\3\251\250\251\377DBC\377MMKP\210\377\377\377\0\2NNM\377"
+ "KIJ\377\213UST\377\3JHI\377KIJ\375RSP<\210\377\377\377\0\2^`\\\377\363"
+ "\364\363\377\213\373\373\373\377\3\370\370\367\377vwt\364VZT1\210\377"
+ "\377\377\0\3VXT\377\374\374\374\377\345\345\342\377\203\344\344\341\377"
+ "\5\271\271\267\377\227\227\226\377\215\215\213\377\236\236\233\377\324"
+ "\324\321\377\202\344\344\341\377\3\373\373\372\377vxu\361UWS0\210\377"
+ "\377\377\0\3UWS\377\374\374\374\377\346\346\343\377\202\345\345\342\377"
+ "\6\204\204\202\377QQP\377bba\377\205\205\204\377qqp\377\266\266\263\377"
+ "\202\345\345\342\377\3\373\373\372\377vxu\361UWS0\210\377\377\377\0\10"
+ "UWS\377\374\374\374\377\346\346\343\377\345\345\342\377\266\266\263\377"
+ "QQP\377vvt\377\344\344\341\377\205\345\345\342\377\3\373\373\372\377"
+ "vxu\361UWS0\210\377\377\377\0\24UWS\377\374\374\374\377\346\346\343\377"
+ "\345\345\342\377\217\217\215\377QQP\377ggf\377XXW\377bbb\377\222\222"
+ "\220\377\335\335\332\377\333\337\326\377\223\257x\377h\231:\377K\210"
+ "\16\376J\213\6\376G\205\12\362A|\14\3056o\5s5o\4\16\204\377\377\377\0"
+ "\25UWS\377\374\374\374\377\346\346\343\377\345\345\342\377\203\203\202"
+ "\377QQP\377bba\377\272\272\270\377\207\207\205\377QQP\377{\216g\377M"
+ "\214\15\377Q\225\7\377V\227\20\377n\2445\377\200\255P\377b\234$\377R"
+ "\225\12\377Q\224\10\377B\177\11\3655o\4U\203\377\377\377\0\26UWS\377"
+ "\374\374\374\377\346\346\343\377\345\345\342\377\230\230\226\377QQP\377"
+ "\205\205\203\377\345\345\342\377\300\300\276\377Fp\37\377P\224\10\377"
+ "`\234\37\377\343\354\331\377\375\375\374\377\330\330\332\377\227\227"
+ "\234\377\356\356\356\377\351\351\351\377\245\277\211\377R\225\11\377"
+ "M\216\11\3757m\12\242\202\377\377\377\0\17UWS\377\374\374\374\377\346"
+ "\346\343\377\345\345\342\377\324\324\321\377VVU\377^^\\\377\255\255\253"
+ "\377eyP\377P\223\10\377\213\264`\377\375\375\375\377\370\370\367\377"
+ "\367\367\366\377\363\363\362\377\203\356\356\354\377\11\345\345\344\377"
+ "\321\325\313\377W\226\24\377J\210\12\3745o\5[\377\377\377\0UWS\377\374"
+ "\374\374\377\346\346\343\377\202\345\345\342\377\10\314\314\313\377\201"
+ "\201\177\377ahY\377L\214\11\377`\234\40\377\375\375\375\377\367\367\366"
+ "\377\363\363\362\377\206\356\356\354\377\21\344\344\343\377\276\307\264"
+ "\377Q\225\10\377\77z\7\3705o\4\40UWS\377\374\374\374\377\346\346\344"
+ "\377\351\351\347\377\354\354\352\377\357\357\356\377\361\361\360\377"
+ "\224\262y\377Q\225\7\377\352\361\342\377\366\366\366\377\364\364\362"
+ "\377\210\356\356\354\377\6\324\324\324\377{\237T\377N\215\13\3765n\5"
+ "~VXT\375\364\364\363\377\202\375\375\375\377\1\376\376\375\377\202\376"
+ "\376\376\377\4a\2231\377T\226\15\377\372\372\372\377\360\360\356\377"
+ "\203\356\356\354\377\14\343\343\341\377\301\301\300\377\340\340\336\377"
+ "\262\262\261\377\204\204\202\377TTS\377nnm\377\247\265\231\377Q\223\10"
+ "\3777l\12\301Z\\XwVXT\375\205UWS\377\3I\210\11\377j\2410\377[[b\377\204"
+ "\356\356\354\377\12""887\377\12\12\12\377\21\21\21\377888\377ffe\377"
+ "\223\223\221\377\242\242\243\377ffk\377Q\225\7\3778q\7\364\207\377\377"
+ "\377\0\3H\210\10\372h\237.\377\355\355\355\377\203\356\356\354\377\4"
+ "\332\332\331\377%%%\377\10\10\10\377\260\260\257\377\203\356\356\354"
+ "\377\4\352\352\350\377\261\263\260\377Q\225\7\3778q\7\364\207\377\377"
+ "\377\0\3C\177\13\327S\225\14\377\350\350\347\377\203\356\356\354\377"
+ "\3YYX\377\7\7\7\377\311\311\310\377\204\356\356\354\377\4\335\335\333"
+ "\377\232\250\214\377Q\223\10\3777l\12\301\207\377\377\377\0\10""8q\6"
+ "\202Q\225\7\377\316\326\305\377\350\350\347\377\356\356\354\377\270\270"
+ "\266\377\1\1\1\377vvu\377\205\356\356\354\377\4\275\275\274\377o\224"
+ "F\377N\215\13\3765n\5~\207\377\377\377\0\10""5o\4\40J\213\10\374Z\227"
+ "\30\377\327\330\327\377\352\352\351\377666\377\37\37\37\377\346\346\344"
+ "\377\204\356\356\354\377\5\322\322\321\377\232\245\216\377Q\224\10\377"
+ ">x\7\3675o\4\40\210\377\377\377\0\6""7q\5]P\223\10\376u\240G\377\315"
+ "\315\314\377~~}\377\271\271\267\377\203\356\356\354\377\6\352\352\350"
+ "\377\302\302\301\377\236\245\230\377S\223\17\377I\206\12\3735o\5[\212"
+ "\377\377\377\0\15>x\12\265P\223\7\376X\225\25\377\255\271\241\377\275"
+ "\275\275\377\302\302\301\377DDL\377\265\265\265\377\251\251\251\377}"
+ "\232]\377Q\225\10\377L\214\10\3756l\11\242\214\377\377\377\0\13""5o\4"
+ "WH\210\10\371Q\225\7\377S\225\13\377\\\225\36\377d\225.\377W\223\25\377"
+ "Q\225\10\377P\223\10\377A}\10\3655o\4U\216\377\377\377\0\11""5o\4\16"
+ "5q\5s@{\11\307G\205\10\363I\212\6\376D\202\10\360=t\13\2765o\5q5o\4\16"
+ "\204\377\377\377\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */
+
+#ifdef __SUNPRO_C
#pragma align 4 (osmo_stock_editor_italic)
#endif
#ifdef __GNUC__
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|