Merge tag 'upstream/0.0.7'
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 11 Oct 2014 08:53:49 +0000 (10:53 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 11 Oct 2014 08:53:49 +0000 (10:53 +0200)
Upstream version 0.0.7

13 files changed:
NEWS
configure
configure.ac
po/fr.gmo
po/fr.po
po/ptask.pot
src/glade/ptask.glade
src/main.c
src/ptask.1
src/tw.c
src/tw.h
src/ui_newtask_diag.c
src/ui_taskpanel.c

diff --git a/NEWS b/NEWS
index 7eac39b..a3db306 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,15 @@
 What's New
 ==========
 
+v0.0.7
+------
+ * added support of taskwarrior 2.3.0.
+ * added combo box for project in the new task dialog.
+ * disable the removal of recurrent tasks which is freezing ptask
+   because taskwarrior CLI is prompting a confirmation. That's the
+   consequence of the taskwarrior bug TW-638.
+ * display the tags of the selected task.
+
 v0.0.6
 ------
  * added contextal menu item in the task tree: task done.
@@ -16,7 +25,7 @@ v0.0.5
  * added urgency column.
  * implemented the cancel button of the task panel.
  * added menu.
- * restore position of vertical/horizaton spliters.
+ * restore position of vertical/horizontal spliters.
  * added creation date, due, id, uuid, urgency, and start date in the
    list of tasks.
  * popup menu to filter columns of the table of tasks.
index c84a3a3..2e8416c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ptask 0.0.6.
+# Generated by GNU Autoconf 2.69 for ptask 0.0.7.
 #
 # Report bugs to <jeanfi@gmail.com>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='ptask'
 PACKAGE_TARNAME='ptask'
-PACKAGE_VERSION='0.0.6'
-PACKAGE_STRING='ptask 0.0.6'
+PACKAGE_VERSION='0.0.7'
+PACKAGE_STRING='ptask 0.0.7'
 PACKAGE_BUGREPORT='jeanfi@gmail.com'
 PACKAGE_URL='http://wpitchoune.net/ptask'
 
@@ -1298,7 +1298,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ptask 0.0.6 to adapt to many kinds of systems.
+\`configure' configures ptask 0.0.7 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1372,7 +1372,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ptask 0.0.6:";;
+     short | recursive ) echo "Configuration of ptask 0.0.7:";;
    esac
   cat <<\_ACEOF
 
@@ -1492,7 +1492,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ptask configure 0.0.6
+ptask configure 0.0.7
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1672,7 +1672,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ptask $as_me 0.0.6, which was
+It was created by ptask $as_me 0.0.7, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2537,7 +2537,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='ptask'
- VERSION='0.0.6'
+ VERSION='0.0.7'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -7968,7 +7968,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ptask $as_me 0.0.6, which was
+This file was extended by ptask $as_me 0.0.7, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8035,7 +8035,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ptask config.status 0.0.6
+ptask config.status 0.0.7
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 9e8bb76..e4bea32 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.64])
-AC_INIT([ptask], [0.0.6],[jeanfi@gmail.com],[ptask],[http://wpitchoune.net/ptask])
+AC_INIT([ptask], [0.0.7],[jeanfi@gmail.com],[ptask],[http://wpitchoune.net/ptask])
 
 AM_INIT_AUTOMAKE([-Wall gnu])
 
index d3fddc8..f6b480c 100644 (file)
Binary files a/po/fr.gmo and b/po/fr.gmo differ
index 999d3e9..59560f0 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-04-18 11:13+0200\n"
+"POT-Creation-Date: 2014-09-29 14:57+0200\n"
 "PO-Revision-Date: 2012-05-13 18:15+0000\n"
 "Last-Translator: jeanfi <Unknown>\n"
 "Language-Team: French <>\n"
@@ -69,149 +69,162 @@ msgid ""
 "installed "
 msgstr ""
 
-#: src/main.c:180
+#: src/main.c:183
 msgid "Enables debug mode."
 msgstr ""
 
-#: src/main.c:189
+#: src/main.c:192
 #, c-format
 msgid "Try `%s --help' for more information.\n"
 msgstr ""
 
-#: src/glade/ptask.glade:11
-#, fuzzy
-msgid "Done"
-msgstr "Marquer fait"
+#: src/main.c:210
+#, c-format
+msgid "Failed to load UI: %s"
+msgstr ""
 
-#: src/glade/ptask.glade:27
-msgid "Start"
+#: src/glade/ptask.glade:62
+msgid "Notes directory: "
 msgstr ""
 
-#: src/glade/ptask.glade:34
-msgid "Stop"
+#: src/glade/ptask.glade:77
+msgid "Select a directory"
 msgstr ""
 
-#: src/glade/ptask.glade:100
-msgid "Notes directory: "
+#: src/glade/ptask.glade:107
+msgid "None"
+msgstr ""
+
+#: src/glade/ptask.glade:110
+msgid "Low"
+msgstr ""
+
+#: src/glade/ptask.glade:113
+msgid "Medium"
 msgstr ""
 
 #: src/glade/ptask.glade:116
-msgid "Select a directory"
+msgid "High"
 msgstr ""
 
-#: src/glade/ptask.glade:142
+#: src/glade/ptask.glade:123
 msgid "New Task"
 msgstr "Nouvelle Tache"
 
-#: src/glade/ptask.glade:201 src/glade/ptask.glade:916
+#: src/glade/ptask.glade:182 src/glade/ptask.glade:764
 msgid "Description:"
 msgstr "Description:"
 
-#: src/glade/ptask.glade:236 src/glade/ptask.glade:994
+#: src/glade/ptask.glade:218 src/glade/ptask.glade:841
 msgid "Project:"
 msgstr "Projet:"
 
-#: src/glade/ptask.glade:271 src/glade/ptask.glade:1028
+#: src/glade/ptask.glade:236 src/glade/ptask.glade:875
 msgid "Priority:"
 msgstr "Priorite:"
 
-#: 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
+#: src/glade/ptask.glade:322
 msgid "pending"
 msgstr ""
 
-#: src/glade/ptask.glade:356
+#: src/glade/ptask.glade:325
 msgid "completed"
 msgstr ""
 
-#: src/glade/ptask.glade:359
+#: src/glade/ptask.glade:328
 msgid "deleted"
 msgstr ""
 
-#: src/glade/ptask.glade:421 src/glade/ptask.glade:867
-msgid "Id"
+#: src/glade/ptask.glade:356 src/glade/ptask.glade:376
+msgid "ptask"
+msgstr "ptask"
+
+#: src/glade/ptask.glade:416
+msgid "_Help"
 msgstr ""
 
-#: src/glade/ptask.glade:431 src/glade/ptask.glade:712
-#: src/glade/ptask.glade:786
+#: src/glade/ptask.glade:499
+msgid "Status:"
+msgstr "Etat:"
+
+#: src/glade/ptask.glade:560 src/glade/ptask.glade:634
+#: src/glade/ptask.glade:1131
 msgid "Project"
 msgstr "Projet"
 
-#: src/glade/ptask.glade:441 src/glade/ptask.glade:878
-msgid "UUID"
+#: src/glade/ptask.glade:571
+msgid "Count"
 msgstr ""
 
-#: src/glade/ptask.glade:451 src/glade/ptask.glade:772
+#: src/glade/ptask.glade:620 src/glade/ptask.glade:1151
 msgid "Priority"
 msgstr "Priorite"
 
-#: src/glade/ptask.glade:461 src/glade/ptask.glade:801
+#: src/glade/ptask.glade:649 src/glade/ptask.glade:1161
 msgid "Urgency"
 msgstr ""
 
-#: src/glade/ptask.glade:471 src/glade/ptask.glade:813
+#: src/glade/ptask.glade:661 src/glade/ptask.glade:1171
 msgid "Creation date"
 msgstr ""
 
-#: src/glade/ptask.glade:481 src/glade/ptask.glade:825
+#: src/glade/ptask.glade:673 src/glade/ptask.glade:1181
 msgid "Due"
 msgstr ""
 
-#: src/glade/ptask.glade:491 src/glade/ptask.glade:837
+#: src/glade/ptask.glade:685 src/glade/ptask.glade:1191
 msgid "Start date"
 msgstr ""
 
-#: src/glade/ptask.glade:501 src/glade/ptask.glade:851
+#: src/glade/ptask.glade:699 src/glade/ptask.glade:1201
 msgid "Description"
 msgstr "Description"
 
-#: src/glade/ptask.glade:508 src/glade/ptask.glade:528
-msgid "ptask"
-msgstr "ptask"
-
-#: src/glade/ptask.glade:568
-msgid "_Help"
+#: src/glade/ptask.glade:715 src/glade/ptask.glade:1121
+msgid "Id"
 msgstr ""
 
-#: src/glade/ptask.glade:651
-msgid "Status:"
-msgstr "Etat:"
-
-#: src/glade/ptask.glade:723
-msgid "Count"
+#: src/glade/ptask.glade:726 src/glade/ptask.glade:1141
+msgid "UUID"
 msgstr ""
 
-#: src/glade/ptask.glade:934
+#: src/glade/ptask.glade:782
 msgid "Note:"
 msgstr "Note:"
 
-#: src/glade/ptask.glade:1068
+#: src/glade/ptask.glade:916
 msgid "Save"
 msgstr "Sauvegarder"
 
-#: src/glade/ptask.glade:1082
+#: src/glade/ptask.glade:930
 msgid "Cancel"
 msgstr "Annuler"
 
-#: src/glade/ptask.glade:1096
+#: src/glade/ptask.glade:944
 msgid "Mark Done"
 msgstr "Marquer fait"
 
-#: src/glade/ptask.glade:1110
+#: src/glade/ptask.glade:958
 msgid "Remove"
 msgstr ""
+
+#: src/glade/ptask.glade:987
+msgid "Tags:"
+msgstr ""
+
+#: src/glade/ptask.glade:1005
+msgid "label"
+msgstr ""
+
+#: src/glade/ptask.glade:1053
+#, fuzzy
+msgid "Done"
+msgstr "Marquer fait"
+
+#: src/glade/ptask.glade:1069
+msgid "Start"
+msgstr ""
+
+#: src/glade/ptask.glade:1076
+msgid "Stop"
+msgstr ""
index 7c34fa3..f0de96b 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-04-18 11:13+0200\n"
+"POT-Creation-Date: 2014-09-29 14:57+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"
@@ -66,148 +66,161 @@ msgid ""
 "installed "
 msgstr ""
 
-#: src/main.c:180
+#: src/main.c:183
 msgid "Enables debug mode."
 msgstr ""
 
-#: src/main.c:189
+#: src/main.c:192
 #, c-format
 msgid "Try `%s --help' for more information.\n"
 msgstr ""
 
-#: src/glade/ptask.glade:11
-msgid "Done"
-msgstr ""
-
-#: src/glade/ptask.glade:27
-msgid "Start"
-msgstr ""
-
-#: src/glade/ptask.glade:34
-msgid "Stop"
+#: src/main.c:210
+#, c-format
+msgid "Failed to load UI: %s"
 msgstr ""
 
-#: src/glade/ptask.glade:100
+#: src/glade/ptask.glade:62
 msgid "Notes directory: "
 msgstr ""
 
-#: src/glade/ptask.glade:116
+#: src/glade/ptask.glade:77
 msgid "Select a directory"
 msgstr ""
 
-#: src/glade/ptask.glade:142
-msgid "New Task"
+#: src/glade/ptask.glade:107
+msgid "None"
 msgstr ""
 
-#: src/glade/ptask.glade:201 src/glade/ptask.glade:916
-msgid "Description:"
+#: src/glade/ptask.glade:110
+msgid "Low"
 msgstr ""
 
-#: src/glade/ptask.glade:236 src/glade/ptask.glade:994
-msgid "Project:"
+#: src/glade/ptask.glade:113
+msgid "Medium"
 msgstr ""
 
-#: src/glade/ptask.glade:271 src/glade/ptask.glade:1028
-msgid "Priority:"
+#: src/glade/ptask.glade:116
+msgid "High"
 msgstr ""
 
-#: src/glade/ptask.glade:325
-msgid "None"
+#: src/glade/ptask.glade:123
+msgid "New Task"
 msgstr ""
 
-#: src/glade/ptask.glade:328
-msgid "Low"
+#: src/glade/ptask.glade:182 src/glade/ptask.glade:764
+msgid "Description:"
 msgstr ""
 
-#: src/glade/ptask.glade:331
-msgid "Medium"
+#: src/glade/ptask.glade:218 src/glade/ptask.glade:841
+msgid "Project:"
 msgstr ""
 
-#: src/glade/ptask.glade:334
-msgid "High"
+#: src/glade/ptask.glade:236 src/glade/ptask.glade:875
+msgid "Priority:"
 msgstr ""
 
-#: src/glade/ptask.glade:353
+#: src/glade/ptask.glade:322
 msgid "pending"
 msgstr ""
 
-#: src/glade/ptask.glade:356
+#: src/glade/ptask.glade:325
 msgid "completed"
 msgstr ""
 
-#: src/glade/ptask.glade:359
+#: src/glade/ptask.glade:328
 msgid "deleted"
 msgstr ""
 
-#: src/glade/ptask.glade:421 src/glade/ptask.glade:867
-msgid "Id"
+#: src/glade/ptask.glade:356 src/glade/ptask.glade:376
+msgid "ptask"
 msgstr ""
 
-#: src/glade/ptask.glade:431 src/glade/ptask.glade:712
-#: src/glade/ptask.glade:786
+#: src/glade/ptask.glade:416
+msgid "_Help"
+msgstr ""
+
+#: src/glade/ptask.glade:499
+msgid "Status:"
+msgstr ""
+
+#: src/glade/ptask.glade:560 src/glade/ptask.glade:634
+#: src/glade/ptask.glade:1131
 msgid "Project"
 msgstr ""
 
-#: src/glade/ptask.glade:441 src/glade/ptask.glade:878
-msgid "UUID"
+#: src/glade/ptask.glade:571
+msgid "Count"
 msgstr ""
 
-#: src/glade/ptask.glade:451 src/glade/ptask.glade:772
+#: src/glade/ptask.glade:620 src/glade/ptask.glade:1151
 msgid "Priority"
 msgstr ""
 
-#: src/glade/ptask.glade:461 src/glade/ptask.glade:801
+#: src/glade/ptask.glade:649 src/glade/ptask.glade:1161
 msgid "Urgency"
 msgstr ""
 
-#: src/glade/ptask.glade:471 src/glade/ptask.glade:813
+#: src/glade/ptask.glade:661 src/glade/ptask.glade:1171
 msgid "Creation date"
 msgstr ""
 
-#: src/glade/ptask.glade:481 src/glade/ptask.glade:825
+#: src/glade/ptask.glade:673 src/glade/ptask.glade:1181
 msgid "Due"
 msgstr ""
 
-#: src/glade/ptask.glade:491 src/glade/ptask.glade:837
+#: src/glade/ptask.glade:685 src/glade/ptask.glade:1191
 msgid "Start date"
 msgstr ""
 
-#: src/glade/ptask.glade:501 src/glade/ptask.glade:851
+#: src/glade/ptask.glade:699 src/glade/ptask.glade:1201
 msgid "Description"
 msgstr ""
 
-#: src/glade/ptask.glade:508 src/glade/ptask.glade:528
-msgid "ptask"
-msgstr ""
-
-#: src/glade/ptask.glade:568
-msgid "_Help"
-msgstr ""
-
-#: src/glade/ptask.glade:651
-msgid "Status:"
+#: src/glade/ptask.glade:715 src/glade/ptask.glade:1121
+msgid "Id"
 msgstr ""
 
-#: src/glade/ptask.glade:723
-msgid "Count"
+#: src/glade/ptask.glade:726 src/glade/ptask.glade:1141
+msgid "UUID"
 msgstr ""
 
-#: src/glade/ptask.glade:934
+#: src/glade/ptask.glade:782
 msgid "Note:"
 msgstr ""
 
-#: src/glade/ptask.glade:1068
+#: src/glade/ptask.glade:916
 msgid "Save"
 msgstr ""
 
-#: src/glade/ptask.glade:1082
+#: src/glade/ptask.glade:930
 msgid "Cancel"
 msgstr ""
 
-#: src/glade/ptask.glade:1096
+#: src/glade/ptask.glade:944
 msgid "Mark Done"
 msgstr ""
 
-#: src/glade/ptask.glade:1110
+#: src/glade/ptask.glade:958
 msgid "Remove"
 msgstr ""
+
+#: src/glade/ptask.glade:987
+msgid "Tags:"
+msgstr ""
+
+#: src/glade/ptask.glade:1005
+msgid "label"
+msgstr ""
+
+#: src/glade/ptask.glade:1053
+msgid "Done"
+msgstr ""
+
+#: src/glade/ptask.glade:1069
+msgid "Start"
+msgstr ""
+
+#: src/glade/ptask.glade:1076
+msgid "Stop"
+msgstr ""
index 984ee9b..1339f60 100644 (file)
@@ -1,45 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkAction" id="tasktree_creation_date_visible">
-    <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
-  </object>
-  <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_id_visible">
-    <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
-  </object>
-  <object class="GtkAction" id="tasktree_priority_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>
-  <object class="GtkAction" id="tasktree_uuid_visible">
-    <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
-  </object>
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkDialog" id="diag_preferences">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
-                <property name="orientation">vertical</property>
                 <property name="action">select-folder</property>
                 <property name="title" translatable="yes">Select a directory</property>
               </object>
       <action-widget response="0">button4</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkListStore" id="prioritystore">
+    <columns>
+      <!-- column-name priority -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">None</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Low</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Medium</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">High</col>
+      </row>
+    </data>
+  </object>
   <object class="GtkDialog" id="diag_tasknew">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
                 <property name="margin_top">4</property>
                 <property name="margin_bottom">4</property>
                 <property name="invisible_char">•</property>
-                <property name="invisible_char_set">True</property>
+                <property name="width_chars">60</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
               <object class="GtkLabel" id="label7">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="halign">start</property>
                 <property name="margin_left">4</property>
                 <property name="margin_right">4</property>
                 <property name="margin_top">4</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="diag_tasknew_project">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="margin_left">4</property>
-                <property name="margin_right">4</property>
-                <property name="margin_top">4</property>
-                <property name="margin_bottom">4</property>
-                <property name="invisible_char">•</property>
-                <property name="invisible_char_set">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">1</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkLabel" id="label8">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="halign">start</property>
                 <property name="margin_left">4</property>
                 <property name="margin_right">4</property>
                 <property name="margin_top">4</property>
               <object class="GtkComboBox" id="diag_tasknew_priority">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="halign">start</property>
                 <property name="margin_left">4</property>
                 <property name="margin_right">4</property>
                 <property name="margin_top">4</property>
                 <property name="height">1</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkComboBoxText" id="diag_tasknew_project">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">start</property>
+                <property name="margin_left">4</property>
+                <property name="margin_right">4</property>
+                <property name="margin_top">4</property>
+                <property name="margin_bottom">4</property>
+                <property name="has_entry">True</property>
+                <child internal-child="entry">
+                  <object class="GtkEntry" id="comboboxtext-entry">
+                    <property name="can_focus">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
       <action-widget response="0">button2</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkListStore" id="prioritystore">
-    <columns>
-      <!-- column-name priority -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">None</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Low</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Medium</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">High</col>
-      </row>
-    </data>
-  </object>
   <object class="GtkListStore" id="projectstore">
     <columns>
       <!-- column-name gchararray1 -->
       <column type="gchararray"/>
     </columns>
   </object>
-  <object class="GtkMenu" id="tasktree_menu">
-    <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>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Id</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_project_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_project_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Project</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_uuid_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_uuid_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">UUID</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_priority_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_priority_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Priority</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_urgency_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_urgency_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Urgency</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_creation_date_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_creation_date_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Creation date</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_due_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_due_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Due</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_start_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_start_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Start date</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkCheckMenuItem" id="menu_description_visible">
-        <property name="use_action_appearance">False</property>
-        <property name="related_action">tasktree_description_visible</property>
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Description</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-  </object>
   <object class="GtkWindow" id="window">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">ptask</property>
                         <property name="search_column">1</property>
                         <property name="enable_grid_lines">both</property>
                         <property name="enable_tree_lines">True</property>
-                        <signal name="cursor-changed" handler="tasktree_cursor_changed_cbk" swapped="no"/>
                         <signal name="button-press-event" handler="tasktree_button_press_event_cbk" swapped="no"/>
+                        <signal name="cursor-changed" handler="tasktree_cursor_changed_cbk" swapped="no"/>
                         <child internal-child="selection">
                           <object class="GtkTreeSelection" id="treeview-selection3"/>
                         </child>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
-                            <property name="top_attach">4</property>
+                            <property name="top_attach">5</property>
                             <property name="width">1</property>
                             <property name="height">1</property>
                           </packing>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
-                            <property name="top_attach">4</property>
+                            <property name="top_attach">5</property>
                             <property name="width">1</property>
                             <property name="height">1</property>
                           </packing>
                             <property name="margin_top">4</property>
                             <property name="margin_bottom">4</property>
                             <property name="invisible_char">•</property>
-                            <property name="invisible_char_set">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
                           <object class="GtkComboBox" id="taskpriority">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="halign">start</property>
                             <property name="margin_left">4</property>
                             <property name="margin_right">4</property>
                             <property name="margin_top">4</property>
                             <property name="height">1</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="GtkLabel" id="label10">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="halign">start</property>
+                            <property name="margin_left">4</property>
+                            <property name="margin_right">4</property>
+                            <property name="margin_top">4</property>
+                            <property name="margin_bottom">4</property>
+                            <property name="label" translatable="yes">Tags:</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">4</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="tasktags">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="halign">start</property>
+                            <property name="margin_left">4</property>
+                            <property name="margin_right">4</property>
+                            <property name="margin_top">4</property>
+                            <property name="margin_bottom">4</property>
+                            <property name="label" translatable="yes">label</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">4</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
                       </object>
                       <packing>
                         <property name="expand">True</property>
       </object>
     </child>
   </object>
+  <object class="GtkAction" id="tasktree_creation_date_visible">
+    <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
+  </object>
+  <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_id_visible">
+    <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
+  </object>
+  <object class="GtkAction" id="tasktree_priority_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>
+  <object class="GtkAction" id="tasktree_uuid_visible">
+    <signal name="activate" handler="tasktree_visible_activate_cbk" swapped="no"/>
+  </object>
+  <object class="GtkMenu" id="tasktree_menu">
+    <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>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Id</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_project_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_project_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Project</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_uuid_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_uuid_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">UUID</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_priority_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_priority_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Priority</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_urgency_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_urgency_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Urgency</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_creation_date_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_creation_date_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Creation date</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_due_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_due_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Due</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_start_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_start_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Start date</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkCheckMenuItem" id="menu_description_visible">
+        <property name="use_action_appearance">False</property>
+        <property name="related_action">tasktree_description_visible</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Description</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
 </interface>
index e692723..a0cf978 100644 (file)
@@ -154,7 +154,10 @@ int main(int argc, char **argv)
 {
        GtkWindow *window;
        GtkBuilder *builder;
-       int optc, cmdok, opti;
+       int optc, cmdok, opti, ret;
+       GError *err;
+       gchar *msg;
+       GtkMessageDialog *diag;
 
        program_name = argv[0];
 
@@ -198,10 +201,31 @@ int main(int argc, char **argv)
        settings_init();
 
        builder = gtk_builder_new();
-       gtk_builder_add_from_file
+       ret = gtk_builder_add_from_file
                (builder,
                 PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "ptask.glade",
-                NULL);
+                &err);
+
+       if (!ret) {
+               msg = g_strdup_printf(_("Failed to load UI: %s"),
+                                     err->message);
+               log_err(msg);
+
+               diag = GTK_MESSAGE_DIALOG(gtk_message_dialog_new
+                                         (NULL,
+                                          GTK_DIALOG_DESTROY_WITH_PARENT,
+                                          GTK_MESSAGE_ERROR,
+                                          GTK_BUTTONS_CLOSE,
+                                          msg,
+                                          NULL));
+
+               gtk_dialog_run(GTK_DIALOG(diag));
+
+               g_free(msg);
+
+               exit(EXIT_FAILURE);
+       }
+
        window = create_window(builder);
 
        gtk_builder_connect_signals(builder, NULL);
index c8e5f9c..68c4584 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.44.1.
-.TH PTASK "1" "April 2014" "ptask 0.0.6" "User Commands"
+.TH PTASK "1" "September 2014" "ptask 0.0.7" "User Commands"
 .SH NAME
 ptask \- GTk+ Task application
 .SH SYNOPSIS
index 5ec2bc4..d363e45 100644 (file)
--- a/src/tw.c
+++ b/src/tw.c
@@ -108,7 +108,9 @@ static int task_check_version()
 
        log_debug("task version: %s", ver);
 
-       if (!strcmp(ver, "2.2.0") || !strcmp(ver, "2.0.0"))
+       if (!strcmp(ver, "2.2.0")
+           || !strcmp(ver, "2.0.0")
+           || !strcmp(ver, "2.3.0"))
                return 1;
        else
                return 0;
@@ -159,13 +161,109 @@ static struct json_object *task_exec_json(const char *opts)
        return o;
 }
 
+char **json_to_tags(struct json_object *jtask)
+{
+       struct json_object *jtags, *jtag;
+       char **tags;
+       int n, i;
+
+       jtags = json_object_object_get(jtask, "tags");
+
+       if (!jtags)
+               return NULL;
+
+
+       n = json_object_array_length(jtags);
+
+       tags = malloc((n + 1) * sizeof(char *));
+
+       for (i = 0; i < n; i++) {
+               jtag = json_object_array_get_idx(jtags, i);
+               tags[i] = strdup(json_object_get_string(jtag));
+       }
+
+       tags[n] = NULL;
+
+       return tags;
+}
+
+struct task *json_to_task(struct json_object *jtask)
+{
+       struct task *task;
+       const char *urg;
+       struct json_object *json;
+
+       task = malloc(sizeof(struct task));
+
+       json = json_object_object_get(jtask, "id");
+       task->id = json_object_get_int(json);
+
+       json = json_object_object_get(jtask, "description");
+       task->description = strdup(json_object_get_string(json));
+
+       json = json_object_object_get(jtask, "status");
+       task->status = strdup(json_object_get_string(json));
+
+       json = json_object_object_get(jtask, "project");
+       if (json)
+               task->project
+                       = strdup(json_object_get_string(json));
+       else
+               task->project = strdup("");
+
+       json = json_object_object_get(jtask, "priority");
+       if (json)
+               task->priority
+                       = strdup(json_object_get_string(json));
+       else
+               task->priority = strdup("");
+
+       json = json_object_object_get(jtask, "uuid");
+       task->uuid = strdup(json_object_get_string(json));
+
+       json = json_object_object_get(jtask, "urgency");
+       urg = json_object_get_string(json);
+       if (urg)
+               task->urgency = strdup(urg);
+       else
+               task->urgency = NULL;
+
+       task->note = note_get(task->uuid);
+
+       json = json_object_object_get(jtask, "entry");
+       task->entry = parse_time(json_object_get_string(json));
+
+       json = json_object_object_get(jtask, "due");
+       if (json)
+               task->due
+                       = parse_time(json_object_get_string(json));
+       else
+               task->due = NULL;
+
+       json = json_object_object_get(jtask, "start");
+       if (json)
+               task->start
+                       = parse_time(json_object_get_string(json));
+       else
+               task->start = NULL;
+
+       json = json_object_object_get(jtask, "recur");
+       if (json)
+               task->recur = strdup(json_object_get_string(json));
+       else
+               task->recur = NULL;
+
+       task->tags = json_to_tags(jtask);
+
+       return task;
+}
+
 struct task **tw_get_all_tasks(const char *status)
 {
        int i, n;
-       struct json_object *jtasks, *jtask, *json;
+       struct json_object *jtasks, *jtask;
        struct task **tasks;
        char *opts;
-       const char *urg;
 
        opts = malloc(strlen("export status:") + strlen(status) + 1);
 
@@ -185,59 +283,7 @@ struct task **tw_get_all_tasks(const char *status)
        for (i = 0; i < n; i++) {
                jtask = json_object_array_get_idx(jtasks, i);
 
-               tasks[i] = malloc(sizeof(struct task));
-
-               json = json_object_object_get(jtask, "id");
-               tasks[i]->id = json_object_get_int(json);
-
-               json = json_object_object_get(jtask, "description");
-               tasks[i]->description = strdup(json_object_get_string(json));
-
-               json = json_object_object_get(jtask, "status");
-               tasks[i]->status = strdup(json_object_get_string(json));
-
-               json = json_object_object_get(jtask, "project");
-               if (json)
-                       tasks[i]->project
-                               = strdup(json_object_get_string(json));
-               else
-                       tasks[i]->project = strdup("");
-
-               json = json_object_object_get(jtask, "priority");
-               if (json)
-                       tasks[i]->priority
-                               = strdup(json_object_get_string(json));
-               else
-                       tasks[i]->priority = strdup("");
-
-               json = json_object_object_get(jtask, "uuid");
-               tasks[i]->uuid = strdup(json_object_get_string(json));
-
-               json = json_object_object_get(jtask, "urgency");
-               urg = json_object_get_string(json);
-               if (urg)
-                       tasks[i]->urgency = strdup(urg);
-               else
-                       tasks[i]->urgency = NULL;
-
-               tasks[i]->note = note_get(tasks[i]->uuid);
-
-               json = json_object_object_get(jtask, "entry");
-               tasks[i]->entry = parse_time(json_object_get_string(json));
-
-               json = json_object_object_get(jtask, "due");
-               if (json)
-                       tasks[i]->due
-                               = parse_time(json_object_get_string(json));
-               else
-                       tasks[i]->due = NULL;
-
-               json = json_object_object_get(jtask, "start");
-               if (json)
-                       tasks[i]->start
-                               = parse_time(json_object_get_string(json));
-               else
-                       tasks[i]->start = NULL;
+               tasks[i] = json_to_task(jtask);
        }
 
        tasks[n] = NULL;
@@ -446,6 +492,8 @@ void tw_task_remove(const char *uuid)
 
 static void task_free(struct task *task)
 {
+       char **tags;
+
        if (!task)
                return ;
 
@@ -459,6 +507,16 @@ static void task_free(struct task *task)
        free(task->entry);
        free(task->due);
        free(task->start);
+       free(task->recur);
+
+       tags = task->tags;
+       if (tags) {
+               while (*tags) {
+                       free(*tags);
+                       tags++;
+               }
+               free(tags);
+       }
 
        free(task);
 }
index 6790b96..684c56f 100644 (file)
--- a/src/tw.h
+++ b/src/tw.h
@@ -29,6 +29,8 @@ struct task {
        char *project;
        char *priority;
        char *urgency;
+       char *recur;
+       char **tags;
        struct tm *entry;
        struct tm *due;
        struct tm *start;
index fdfec87..9f07511 100644 (file)
@@ -17,6 +17,8 @@
  * 02110-1301 USA
  */
 
+#include <string.h>
+
 #include <gtk/gtk.h>
 
 #include <log.h>
@@ -41,6 +43,27 @@ static const char *ui_get_priority(GtkComboBox *combo)
        }
 }
 
+static void populate_project(GtkComboBoxText *w)
+{
+       struct task **tasks;
+       struct project **all_prjs, **prjs;
+
+       tasks = tw_get_all_tasks("pending");
+
+       all_prjs = tw_get_projects(tasks);
+
+       prjs = all_prjs;
+       while (*prjs) {
+               if (strcmp((*prjs)->name, "ALL"))
+                       gtk_combo_box_text_append_text(w, (*prjs)->name);
+
+               prjs++;
+       }
+
+       tw_task_list_free(tasks);
+       tw_project_list_free(all_prjs);
+}
+
 void ui_newtask()
 {
        gint result;
@@ -49,6 +72,7 @@ void ui_newtask()
        GtkEntry *entry;
        const char *desc, *prj, *prio;
        GtkComboBox *combo;
+       GtkComboBoxText *w_prj;
 
        log_debug("ui_newtask()");
 
@@ -60,6 +84,10 @@ void ui_newtask()
        diag = GTK_DIALOG(gtk_builder_get_object(builder, "diag_tasknew"));
        gtk_builder_connect_signals(builder, NULL);
 
+       w_prj = GTK_COMBO_BOX_TEXT(gtk_builder_get_object
+                                  (builder, "diag_tasknew_project"));
+       populate_project(w_prj);
+
        result = gtk_dialog_run(diag);
 
        if (result == GTK_RESPONSE_ACCEPT) {
@@ -69,9 +97,9 @@ void ui_newtask()
                                  (builder, "diag_tasknew_description"));
                desc = gtk_entry_get_text(entry);
 
-               entry = GTK_ENTRY(gtk_builder_get_object
-                                 (builder, "diag_tasknew_project"));
-               prj = gtk_entry_get_text(entry);
+               w_prj = GTK_COMBO_BOX_TEXT(gtk_builder_get_object
+                                          (builder, "diag_tasknew_project"));
+               prj = gtk_combo_box_text_get_active_text(w_prj);
 
                combo = GTK_COMBO_BOX(gtk_builder_get_object
                                      (builder, "diag_tasknew_priority"));
index 5edaa54..9787415 100644 (file)
@@ -32,6 +32,7 @@ static GtkButton *w_tasksave_btn;
 static GtkButton *w_taskremove_btn;
 static GtkButton *w_taskdone_btn;
 static GtkButton *w_taskcancel_btn;
+static GtkLabel *w_tasktags;
 
 static struct task *current_task;
 
@@ -41,7 +42,19 @@ static void enable(int enable)
 
        gtk_widget_set_sensitive(GTK_WIDGET(w_tasksave_btn), enable);
        gtk_widget_set_sensitive(GTK_WIDGET(w_taskdone_btn), enable);
-       gtk_widget_set_sensitive(GTK_WIDGET(w_taskremove_btn), enable);
+
+       if (current_task && current_task->recur) {
+               gtk_widget_set_sensitive(GTK_WIDGET(w_taskremove_btn), FALSE);
+               gtk_widget_set_tooltip_text
+                       (GTK_WIDGET(w_taskremove_btn),
+                        "The removal of recurrent tasks is not supported due "
+                        "to the taskwarrior bug TW-638");
+               gtk_widget_set_has_tooltip(GTK_WIDGET(w_taskremove_btn), TRUE);
+       } else {
+               gtk_widget_set_sensitive(GTK_WIDGET(w_taskremove_btn), enable);
+               gtk_widget_set_has_tooltip(GTK_WIDGET(w_taskremove_btn), FALSE);
+       }
+
        gtk_widget_set_sensitive(GTK_WIDGET(w_taskcancel_btn), enable);
 
        buf = gtk_text_view_get_buffer(w_note);
@@ -58,6 +71,9 @@ static void enable(int enable)
        gtk_widget_set_sensitive(GTK_WIDGET(w_project), enable);
 
        if (!enable)
+               gtk_label_set_label(w_tasktags, "");
+
+       if (!enable)
                gtk_combo_box_set_active(w_priority, 0);
        gtk_widget_set_sensitive(GTK_WIDGET(w_priority), enable);
 }
@@ -126,7 +142,7 @@ void ui_taskpanel_init(GtkBuilder *builder)
        log_fct("ENTER");
 
        w_note = GTK_TEXT_VIEW(gtk_builder_get_object(builder, "tasknote"));
-
+       w_tasktags = GTK_LABEL(gtk_builder_get_object(builder, "tasktags"));
        w_description = GTK_ENTRY(gtk_builder_get_object(builder,
                                                         "taskdescription"));
        w_project = GTK_ENTRY(gtk_builder_get_object(builder, "taskproject"));
@@ -171,6 +187,8 @@ void ui_taskpanel_update(struct task *task)
 {
        GtkTextBuffer *buf;
        int priority;
+       char **tags;
+       gchar *tmp, *gtags;
 
        if (task) {
                current_task = task;
@@ -193,6 +211,27 @@ void ui_taskpanel_update(struct task *task)
                priority = priority_to_int(task->priority);
                gtk_combo_box_set_active(w_priority, priority);
 
+               tags = task->tags;
+               gtags = NULL;
+               if (tags) {
+                       while (*tags) {
+                               if (gtags) {
+                                       tmp = g_strconcat(gtags,
+                                                         " ",
+                                                         *tags,
+                                                         NULL);
+                                       g_free(gtags);
+                                       gtags = tmp;
+                               } else {
+                                       gtags = g_strdup(*tags);
+                               }
+                               tags++;
+                       }
+                       gtk_label_set_label(w_tasktags, gtags);
+               } else {
+                       gtk_label_set_label(w_tasktags, "");
+               }
+
                enable(1);
        } else {
                current_task = NULL;