What's New
==========
+v0.0.6
+------
+ * added contextal menu item in the task tree: task done.
+ * added start/stop task.
+
v0.0.5
------
</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
<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
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"
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 ""
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"
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 ""
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 \
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)
# -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 \
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@
<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>
+++ /dev/null
-/*
- * 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;
-}
+++ /dev/null
-/*
- * 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
#include <json.h>
-#include <list.h>
#include <log.h>
#include "note.h"
#include <pstr.h>
log_fct_exit();
}
-void tw_done(const char *uuid)
+void tw_task_done(const char *uuid)
{
char *opts;
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;
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;
} else {
prj = project_new(prj_name, 1);
- tmp = (struct project **)list_add((void **)prjs, prj);
+ tmp = projects_add(prjs, prj);
free(prjs);
prjs = tmp;
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);
int taskdone_clicked_cbk(GtkButton *btn, gpointer data)
{
if (current_task) {
- tw_done(current_task->uuid);
+ tw_task_done(current_task->uuid);
refresh();
}
#include <log.h>
#include <ptime.h>
#include <settings.h>
+#include <ui.h>
#include <ui_projecttree.h>
#include <ui_taskpanel.h>
#include <ui_tasktree.h>
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();
+}