Package: gtimer
Version: 1.1.6-9
Severity: wishlist
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've added a "Last Year" report option.
This patch applies to original 1.1.6 source code:

- --- gtimer-1.1.6/report.c.orig  2003-03-21 18:58:27.000000000 +0000
+++ gtimer-1.1.6/report.c       2006-02-15 18:38:57.000000000 +0000
@@ -30,6 +30,7 @@
  *     http://www.cknudsen.com/gtimer/
  *
  * History:
+ *     15-Feb-2006     Added "Last Year" report option. (Bruno Gravato)
  *     03-Mar-2003     Added support for rounding.
  *     28-Feb-2003     Include project name or "none" in reports
  *     09-Mar-2000     Updated calls to create_confirm_window()
@@ -149,9 +150,10 @@
 #define REPORT_RANGE_THIS_MONTH         5
 #define REPORT_RANGE_LAST_MONTH         6
 #define REPORT_RANGE_THIS_YEAR          7
+#define REPORT_RANGE_LAST_YEAR          8
 static char *time_options[] = { "Today", "This Week", "Last Week",
   "This Week & Last Week", "Last Two Weeks",
- -  "This Month", "Last Month", "This Year", NULL };
+  "This Month", "Last Month", "This Year", "Last Year", NULL };

 /* Output types */
 #define REPORT_OUTPUT_TEXT             0
@@ -199,7 +201,7 @@
 typedef struct {
   GtkWidget *window;
   GtkWidget *time_menu;
- -  GtkWidget *time_menu_items[8];
+  GtkWidget *time_menu_items[9];
   GtkWidget *output_menu;
   GtkWidget *output_menu_items[2];
   GtkWidget *data_menu;
@@ -1336,6 +1338,13 @@
       time_start = now - ONE_DAY * tm->tm_yday;
       time_end = now;
       break;
+    case REPORT_RANGE_LAST_YEAR:
+      if ( (tm->tm_year - 1) % 4 == 0 )
+        time_start = now - ONE_DAY * ( tm->tm_yday + 366 );
+      else
+        time_start = now - ONE_DAY * ( tm->tm_yday + 365 );
+      time_end = now - ONE_DAY * ( tm->tm_yday + 1 );
+      break;
     default:
     case REPORT_RANGE_THIS_WEEK:
       time_start = now - ONE_DAY * tm->tm_wday;



Any corrections/suggestions are welcome  :-) 

Best regards,
Bruno Gravato.



- -- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) (ignored: 
LC_ALL set to [EMAIL PROTECTED])

Versions of packages gtimer depends on:
ii  libc6              2.3.5-13              GNU C Library: Shared libraries an
ii  libglib1.2         1.2.10-9              The GLib library of C routines
ii  libgtk1.2          1.2.10-17             The GIMP Toolkit set of widgets fo
ii  libx11-6           4.3.0.dfsg.1-14sarge1 X Window System protocol client li
ii  libxext6           4.3.0.dfsg.1-14sarge1 X Window System miscellaneous exte
ii  libxi6             4.3.0.dfsg.1-14sarge1 X Window System Input extension li
ii  libxss1            6.8.2.dfsg.1-7        X Screen Saver client-side library

gtimer recommends no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFD85VFNspDXqTLfgcRApkiAJ98YkteiEQ2qszbnaVTUyrt//MX0wCfVB++
6k6eR8RQb4ibCWI2v07oRZ0=
=MqIp
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to