fixed potential issue about void* arithmetic
authorJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 18 Apr 2014 09:47:40 +0000 (11:47 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 18 Apr 2014 09:47:40 +0000 (11:47 +0200)
added start/stop task support

14 files changed:
NEWS
NEWS.html
po/fr.gmo
po/fr.po
po/ptask.pot
src/Makefile.am
src/Makefile.in
src/glade/ptask.glade
src/list.c [deleted file]
src/list.h [deleted file]
src/tw.c
src/tw.h
src/ui_taskpanel.c
src/ui_tasktree.c

diff --git a/NEWS b/NEWS
index a52764b..d8aed7b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,11 @@
 What's New
 ==========
 
+v0.0.6
+------
+ * added contextal menu item in the task tree: task done.
+ * added start/stop task.
+
 v0.0.5
 ------
 
index 8e363b9..8b68f68 100644 (file)
--- a/NEWS.html
+++ b/NEWS.html
@@ -320,6 +320,23 @@ asciidoc.install();
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_v0_0_6">v0.0.6</h2>\r
+<div class="sectionbody">\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+added contextal menu item in the task tree: task done.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+added start/stop task.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_v0_0_5">v0.0.5</h2>\r
 <div class="sectionbody">\r
 <div class="ulist"><ul>\r
@@ -524,7 +541,7 @@ Initial release.
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 2014-04-18 11:02:21 CEST\r
+Last updated 2014-04-18 11:13:02 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 0ed88e7..d3fddc8 100644 (file)
Binary files a/po/fr.gmo and b/po/fr.gmo differ
index 40ef5fe..999d3e9 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ptask\n"
 "Report-Msgid-Bugs-To: jeanfi@gmail.com\n"
-"POT-Creation-Date: 2014-01-17 08:56+0100\n"
+"POT-Creation-Date: 2014-04-18 11:13+0200\n"
 "PO-Revision-Date: 2012-05-13 18:15+0000\n"
 "Last-Translator: jeanfi <Unknown>\n"
 "Language-Team: French <>\n"
@@ -78,99 +78,140 @@ msgstr ""
 msgid "Try `%s --help' for more information.\n"
 msgstr ""
 
-#: src/glade/ptask.glade:88
+#: src/glade/ptask.glade:11
+#, fuzzy
+msgid "Done"
+msgstr "Marquer fait"
+
+#: src/glade/ptask.glade:27
+msgid "Start"
+msgstr ""
+
+#: src/glade/ptask.glade:34
+msgid "Stop"
+msgstr ""
+
+#: src/glade/ptask.glade:100
 msgid "Notes directory: "
 msgstr ""
 
-#: src/glade/ptask.glade:104
+#: src/glade/ptask.glade:116
 msgid "Select a directory"
 msgstr ""
 
-#: src/glade/ptask.glade:130
+#: src/glade/ptask.glade:142
 msgid "New Task"
 msgstr "Nouvelle Tache"
 
-#: src/glade/ptask.glade:189 src/glade/ptask.glade:877
+#: src/glade/ptask.glade:201 src/glade/ptask.glade:916
 msgid "Description:"
 msgstr "Description:"
 
-#: src/glade/ptask.glade:224 src/glade/ptask.glade:955
+#: src/glade/ptask.glade:236 src/glade/ptask.glade:994
 msgid "Project:"
 msgstr "Projet:"
 
-#: src/glade/ptask.glade:259 src/glade/ptask.glade:989
+#: src/glade/ptask.glade:271 src/glade/ptask.glade:1028
 msgid "Priority:"
 msgstr "Priorite:"
 
-#: src/glade/ptask.glade:382 src/glade/ptask.glade:828
+#: src/glade/ptask.glade:325
+msgid "None"
+msgstr ""
+
+#: src/glade/ptask.glade:328
+msgid "Low"
+msgstr ""
+
+#: src/glade/ptask.glade:331
+msgid "Medium"
+msgstr ""
+
+#: src/glade/ptask.glade:334
+msgid "High"
+msgstr ""
+
+#: src/glade/ptask.glade:353
+msgid "pending"
+msgstr ""
+
+#: src/glade/ptask.glade:356
+msgid "completed"
+msgstr ""
+
+#: src/glade/ptask.glade:359
+msgid "deleted"
+msgstr ""
+
+#: src/glade/ptask.glade:421 src/glade/ptask.glade:867
 msgid "Id"
 msgstr ""
 
-#: src/glade/ptask.glade:392 src/glade/ptask.glade:673
-#: src/glade/ptask.glade:747
+#: src/glade/ptask.glade:431 src/glade/ptask.glade:712
+#: src/glade/ptask.glade:786
 msgid "Project"
 msgstr "Projet"
 
-#: src/glade/ptask.glade:402 src/glade/ptask.glade:839
+#: src/glade/ptask.glade:441 src/glade/ptask.glade:878
 msgid "UUID"
 msgstr ""
 
-#: src/glade/ptask.glade:412 src/glade/ptask.glade:733
+#: src/glade/ptask.glade:451 src/glade/ptask.glade:772
 msgid "Priority"
 msgstr "Priorite"
 
-#: src/glade/ptask.glade:422 src/glade/ptask.glade:762
+#: src/glade/ptask.glade:461 src/glade/ptask.glade:801
 msgid "Urgency"
 msgstr ""
 
-#: src/glade/ptask.glade:432 src/glade/ptask.glade:774
+#: src/glade/ptask.glade:471 src/glade/ptask.glade:813
 msgid "Creation date"
 msgstr ""
 
-#: src/glade/ptask.glade:442 src/glade/ptask.glade:786
+#: src/glade/ptask.glade:481 src/glade/ptask.glade:825
 msgid "Due"
 msgstr ""
 
-#: src/glade/ptask.glade:452 src/glade/ptask.glade:798
+#: src/glade/ptask.glade:491 src/glade/ptask.glade:837
 msgid "Start date"
 msgstr ""
 
-#: src/glade/ptask.glade:462 src/glade/ptask.glade:812
+#: src/glade/ptask.glade:501 src/glade/ptask.glade:851
 msgid "Description"
 msgstr "Description"
 
-#: src/glade/ptask.glade:469 src/glade/ptask.glade:489
+#: src/glade/ptask.glade:508 src/glade/ptask.glade:528
 msgid "ptask"
 msgstr "ptask"
 
-#: src/glade/ptask.glade:529
+#: src/glade/ptask.glade:568
 msgid "_Help"
 msgstr ""
 
-#: src/glade/ptask.glade:612
+#: src/glade/ptask.glade:651
 msgid "Status:"
 msgstr "Etat:"
 
-#: src/glade/ptask.glade:684
+#: src/glade/ptask.glade:723
 msgid "Count"
 msgstr ""
 
-#: src/glade/ptask.glade:895
+#: src/glade/ptask.glade:934
 msgid "Note:"
 msgstr "Note:"
 
-#: src/glade/ptask.glade:1029
+#: src/glade/ptask.glade:1068
 msgid "Save"
 msgstr "Sauvegarder"
 
-#: src/glade/ptask.glade:1043
+#: src/glade/ptask.glade:1082
 msgid "Cancel"
 msgstr "Annuler"
 
-#: src/glade/ptask.glade:1057
+#: src/glade/ptask.glade:1096
 msgid "Mark Done"
 msgstr "Marquer fait"
 
-#: src/glade/ptask.glade:1071
+#: src/glade/ptask.glade:1110
 msgid "Remove"
 msgstr ""
index 713befb..7c34fa3 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: jeanfi@gmail.com\n"
-"POT-Creation-Date: 2014-01-17 08:56+0100\n"
+"POT-Creation-Date: 2014-04-18 11:13+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -75,99 +75,139 @@ msgstr ""
 msgid "Try `%s --help' for more information.\n"
 msgstr ""
 
-#: src/glade/ptask.glade:88
+#: src/glade/ptask.glade:11
+msgid "Done"
+msgstr ""
+
+#: src/glade/ptask.glade:27
+msgid "Start"
+msgstr ""
+
+#: src/glade/ptask.glade:34
+msgid "Stop"
+msgstr ""
+
+#: src/glade/ptask.glade:100
 msgid "Notes directory: "
 msgstr ""
 
-#: src/glade/ptask.glade:104
+#: src/glade/ptask.glade:116
 msgid "Select a directory"
 msgstr ""
 
-#: src/glade/ptask.glade:130
+#: src/glade/ptask.glade:142
 msgid "New Task"
 msgstr ""
 
-#: src/glade/ptask.glade:189 src/glade/ptask.glade:877
+#: src/glade/ptask.glade:201 src/glade/ptask.glade:916
 msgid "Description:"
 msgstr ""
 
-#: src/glade/ptask.glade:224 src/glade/ptask.glade:955
+#: src/glade/ptask.glade:236 src/glade/ptask.glade:994
 msgid "Project:"
 msgstr ""
 
-#: src/glade/ptask.glade:259 src/glade/ptask.glade:989
+#: src/glade/ptask.glade:271 src/glade/ptask.glade:1028
 msgid "Priority:"
 msgstr ""
 
-#: src/glade/ptask.glade:382 src/glade/ptask.glade:828
+#: src/glade/ptask.glade:325
+msgid "None"
+msgstr ""
+
+#: src/glade/ptask.glade:328
+msgid "Low"
+msgstr ""
+
+#: src/glade/ptask.glade:331
+msgid "Medium"
+msgstr ""
+
+#: src/glade/ptask.glade:334
+msgid "High"
+msgstr ""
+
+#: src/glade/ptask.glade:353
+msgid "pending"
+msgstr ""
+
+#: src/glade/ptask.glade:356
+msgid "completed"
+msgstr ""
+
+#: src/glade/ptask.glade:359
+msgid "deleted"
+msgstr ""
+
+#: src/glade/ptask.glade:421 src/glade/ptask.glade:867
 msgid "Id"
 msgstr ""
 
-#: src/glade/ptask.glade:392 src/glade/ptask.glade:673
-#: src/glade/ptask.glade:747
+#: src/glade/ptask.glade:431 src/glade/ptask.glade:712
+#: src/glade/ptask.glade:786
 msgid "Project"
 msgstr ""
 
-#: src/glade/ptask.glade:402 src/glade/ptask.glade:839
+#: src/glade/ptask.glade:441 src/glade/ptask.glade:878
 msgid "UUID"
 msgstr ""
 
-#: src/glade/ptask.glade:412 src/glade/ptask.glade:733
+#: src/glade/ptask.glade:451 src/glade/ptask.glade:772
 msgid "Priority"
 msgstr ""
 
-#: src/glade/ptask.glade:422 src/glade/ptask.glade:762
+#: src/glade/ptask.glade:461 src/glade/ptask.glade:801
 msgid "Urgency"
 msgstr ""
 
-#: src/glade/ptask.glade:432 src/glade/ptask.glade:774
+#: src/glade/ptask.glade:471 src/glade/ptask.glade:813
 msgid "Creation date"
 msgstr ""
 
-#: src/glade/ptask.glade:442 src/glade/ptask.glade:786
+#: src/glade/ptask.glade:481 src/glade/ptask.glade:825
 msgid "Due"
 msgstr ""
 
-#: src/glade/ptask.glade:452 src/glade/ptask.glade:798
+#: src/glade/ptask.glade:491 src/glade/ptask.glade:837
 msgid "Start date"
 msgstr ""
 
-#: src/glade/ptask.glade:462 src/glade/ptask.glade:812
+#: src/glade/ptask.glade:501 src/glade/ptask.glade:851
 msgid "Description"
 msgstr ""
 
-#: src/glade/ptask.glade:469 src/glade/ptask.glade:489
+#: src/glade/ptask.glade:508 src/glade/ptask.glade:528
 msgid "ptask"
 msgstr ""
 
-#: src/glade/ptask.glade:529
+#: src/glade/ptask.glade:568
 msgid "_Help"
 msgstr ""
 
-#: src/glade/ptask.glade:612
+#: src/glade/ptask.glade:651
 msgid "Status:"
 msgstr ""
 
-#: src/glade/ptask.glade:684
+#: src/glade/ptask.glade:723
 msgid "Count"
 msgstr ""
 
-#: src/glade/ptask.glade:895
+#: src/glade/ptask.glade:934
 msgid "Note:"
 msgstr ""
 
-#: src/glade/ptask.glade:1029
+#: src/glade/ptask.glade:1068
 msgid "Save"
 msgstr ""
 
-#: src/glade/ptask.glade:1043
+#: src/glade/ptask.glade:1082
 msgid "Cancel"
 msgstr ""
 
-#: src/glade/ptask.glade:1057
+#: src/glade/ptask.glade:1096
 msgid "Mark Done"
 msgstr ""
 
-#: src/glade/ptask.glade:1071
+#: src/glade/ptask.glade:1110
 msgid "Remove"
 msgstr ""
index e89e1fb..8523ed9 100644 (file)
@@ -11,8 +11,7 @@ LIBS = $(JSON_LIBS) $(GTK_LIBS)
 
 bin_PROGRAMS = ptask
 
-ptask_SOURCES = list.c list.h \
-       log.c log.h \
+ptask_SOURCES = log.c log.h \
        main.c \
        note.c note.h \
        pio.c pio.h \
index f2427ce..c2a9adc 100644 (file)
@@ -92,8 +92,8 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_ptask_OBJECTS = list.$(OBJEXT) log.$(OBJEXT) main.$(OBJEXT) \
-       note.$(OBJEXT) pio.$(OBJEXT) pstr.$(OBJEXT) ptime.$(OBJEXT) \
+am_ptask_OBJECTS = log.$(OBJEXT) main.$(OBJEXT) note.$(OBJEXT) \
+       pio.$(OBJEXT) pstr.$(OBJEXT) ptime.$(OBJEXT) \
        settings.$(OBJEXT) tw.$(OBJEXT) ui.$(OBJEXT) \
        ui_newtask_diag.$(OBJEXT) ui_projecttree.$(OBJEXT) \
        ui_taskpanel.$(OBJEXT) ui_tasktree.$(OBJEXT)
@@ -361,8 +361,7 @@ SUBDIRS = glade
 # -export-dynamic is need for defining handlers in the glade file.
 AM_LDFLAGS = -Wl,--as-needed  -export-dynamic
 AM_CPPFLAGS = -Wall $(GTK_CFLAGS) $(JSON_CFLAGS)
-ptask_SOURCES = list.c list.h \
-       log.c log.h \
+ptask_SOURCES = log.c log.h \
        main.c \
        note.c note.h \
        pio.c pio.h \
@@ -466,7 +465,6 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/note.Po@am__quote@
index a4fc97b..984ee9b 100644 (file)
@@ -7,6 +7,10 @@
   <object class="GtkAction" id="tasktree_description_visible">
     <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
   </object>
+  <object class="GtkAction" id="tasktree_done">
+    <property name="label" translatable="yes">Done</property>
+    <signal name="activate" handler="tasktree_done_activate_cbk" swapped="no"/>
+  </object>
   <object class="GtkAction" id="tasktree_due_visible">
     <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
   </object>
   <object class="GtkAction" id="tasktree_project_visible">
     <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
   </object>
+  <object class="GtkAction" id="tasktree_start">
+    <property name="label" translatable="yes">Start</property>
+    <signal name="activate" handler="tasktree_start_activate_cbk" swapped="no"/>
+  </object>
   <object class="GtkAction" id="tasktree_start_visible">
     <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
   </object>
+  <object class="GtkAction" id="tasktree_stop">
+    <property name="label" translatable="yes">Stop</property>
+    <signal name="activate" handler="tasktree_stop_activate_cbk" swapped="no"/>
+  </object>
   <object class="GtkAction" id="tasktree_urgency_visible">
     <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
   </object>
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
+      <object class="GtkMenuItem" id="menu_start">
+        <property name="related_action">tasktree_start</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="menu_stop">
+        <property name="related_action">tasktree_stop</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="menu_done">
+        <property name="related_action">tasktree_done</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparatorMenuItem" id="menuitem5">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
       <object class="GtkCheckMenuItem" id="menu_id_visible">
         <property name="use_action_appearance">False</property>
         <property name="related_action">tasktree_id_visible</property>
diff --git a/src/list.c b/src/list.c
deleted file mode 100644 (file)
index 0b6eb5d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "list.h"
-
-int list_length(void **list)
-{
-       int n;
-
-       if (!list)
-               return 0;
-
-       n = 0;
-       while (*list) {
-               n++;
-               list++;
-       }
-
-       return n;
-}
-
-void **list_add(void **list, void *item)
-{
-       int n;
-       void **result;
-
-       n = list_length(list);
-
-       result = malloc((n + 1 + 1) * sizeof(void *));
-
-       if (list)
-               memcpy(result, list, n * sizeof(void *));
-
-       result[n] = item;
-       result[n + 1] = NULL;
-
-       return result;
-}
diff --git a/src/list.h b/src/list.h
deleted file mode 100644 (file)
index 39fcb29..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#ifndef _P_LIST_H_
-#define _P_LIST_H_
-
-int list_length(void **list);
-void **list_add(void **list, void *item);
-
-#endif
index 8c68592..df73030 100644 (file)
--- a/src/tw.c
+++ b/src/tw.c
@@ -26,7 +26,6 @@
 
 #include <json.h>
 
-#include <list.h>
 #include <log.h>
 #include "note.h"
 #include <pstr.h>
@@ -382,7 +381,7 @@ void tw_add(const char *newdesc, const char *prj, const char *prio)
        log_fct_exit();
 }
 
-void tw_done(const char *uuid)
+void tw_task_done(const char *uuid)
 {
        char *opts;
 
@@ -397,6 +396,36 @@ void tw_done(const char *uuid)
        free(opts);
 }
 
+void tw_task_start(const char *uuid)
+{
+       char *opts;
+
+       opts = malloc(1
+                     + strlen(uuid)
+                     + strlen(" start")
+                     + 1);
+       sprintf(opts, " %s start", uuid);
+
+       tw_exec(opts);
+
+       free(opts);
+}
+
+void tw_task_stop(const char *uuid)
+{
+       char *opts;
+
+       opts = malloc(1
+                     + strlen(uuid)
+                     + strlen(" stop")
+                     + 1);
+       sprintf(opts, " %s stop", uuid);
+
+       tw_exec(opts);
+
+       free(opts);
+}
+
 void tw_task_remove(const char *uuid)
 {
        char *opts;
@@ -489,6 +518,41 @@ static struct project *project_new(const char *name, int count)
        return prj;
 }
 
+static int projects_length(struct project **list)
+{
+       int n;
+
+       if (!list)
+               return 0;
+
+       n = 0;
+       while (*list) {
+               n++;
+               list++;
+       }
+
+       return n;
+}
+
+static struct project **projects_add(struct project **list, void *item)
+{
+       int n;
+       struct project **result;
+
+       n = projects_length(list);
+
+       result = (struct project **)malloc
+               ((n + 1 + 1) * sizeof(struct project *));
+
+       if (list)
+               memcpy(result, list, n * sizeof(struct project *));
+
+       result[n] = item;
+       result[n + 1] = NULL;
+
+       return result;
+}
+
 struct project **tw_get_projects(struct task **tasks)
 {
        struct task **t_cur;
@@ -509,7 +573,7 @@ struct project **tw_get_projects(struct task **tasks)
                } else {
                        prj = project_new(prj_name, 1);
 
-                       tmp = (struct project **)list_add((void **)prjs, prj);
+                       tmp = projects_add(prjs, prj);
 
                        free(prjs);
                        prjs = tmp;
index 6f3c177..6790b96 100644 (file)
--- a/src/tw.h
+++ b/src/tw.h
@@ -43,7 +43,9 @@ struct task **tw_get_all_tasks(const char *status);
 void tw_modify_description(const char *uuid, const char *newdesc);
 void tw_modify_project(const char *uuid, const char *newproj);
 void tw_modify_priority(const char *uuid, const char *priority);
-void tw_done(const char *uuid);
+void tw_task_done(const char *uuid);
+void tw_task_start(const char *uuid);
+void tw_task_stop(const char *uuid);
 void tw_task_remove(const char *);
 void tw_add(const char *newdesc, const char *prj, const char *prio);
 void tw_task_list_free(struct task **tasks);
index 6380268..5edaa54 100644 (file)
@@ -203,7 +203,7 @@ void ui_taskpanel_update(struct task *task)
 int taskdone_clicked_cbk(GtkButton *btn, gpointer data)
 {
        if (current_task) {
-               tw_done(current_task->uuid);
+               tw_task_done(current_task->uuid);
                refresh();
        }
 
index 6ca61a0..506e8f9 100644 (file)
@@ -27,6 +27,7 @@
 #include <log.h>
 #include <ptime.h>
 #include <settings.h>
+#include <ui.h>
 #include <ui_projecttree.h>
 #include <ui_taskpanel.h>
 #include <ui_tasktree.h>
@@ -428,3 +429,51 @@ void tasktree_visible_activate_cbk(GtkAction *action, gpointer data)
                gtk_tree_view_column_set_visible(w_cols[id], !b);
        }
 }
+
+void tasktree_done_activate_cbk(GtkAction *action, gpointer data)
+{
+       struct task *t;
+
+       log_fct_enter();
+
+       t = ui_tasktree_get_selected_task();
+
+       if (t) {
+               tw_task_done(t->uuid);
+               refresh();
+       }
+
+       log_fct_exit();
+}
+
+void tasktree_start_activate_cbk(GtkAction *action, gpointer data)
+{
+       struct task *t;
+
+       log_fct_enter();
+
+       t = ui_tasktree_get_selected_task();
+
+       if (t) {
+               tw_task_start(t->uuid);
+               refresh();
+       }
+
+       log_fct_exit();
+}
+
+void tasktree_stop_activate_cbk(GtkAction *action, gpointer data)
+{
+       struct task *t;
+
+       log_fct_enter();
+
+       t = ui_tasktree_get_selected_task();
+
+       if (t) {
+               tw_task_stop(t->uuid);
+               refresh();
+       }
+
+       log_fct_exit();
+}