~ubuntu-branches/ubuntu/precise/gtimer/precise-proposed

« back to all changes in this revision

Viewing changes to debian/patches/27_307634-week-start.patch

  • Committer: Bazaar Package Importer
  • Author(s): Taylor LeMasurier-Wren
  • Date: 2011-08-06 03:07:30 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110806030730-9wtxfpgsf1h4ulac
Tags: 2.0.0-1
* Update watch file
* Update debhelper compatibilty to V7 (significantly clean up packaging)
* New Upstream Release (Closes: #575666: RFP: GTimer -- GTK-based tool for
  timing tasks)
* Initial release. (Closes: #636822: ITP: gtimer -- GTK-based X11 task
  timer)
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -Nru3 ./gtimer-1.1.6/gtimer.1 ../build-tree.new/gtimer-1.1.6/gtimer.1
2
 
--- ./gtimer-1.1.6/gtimer.1     2003-03-21 09:45:07.000000000 -0800
3
 
+++ ../build-tree.new/gtimer-1.1.6/gtimer.1     2005-07-15 23:39:34.000000000 -0700
4
 
@@ -24,7 +24,7 @@
5
 
 
6
 
 .SH SYNOPSIS
7
 
 .B gtimer
8
 
-[\f3\-midnight \f2offset\f1] [\f3\-nosplash] [\f3\-resume] [\f3\-start \f2task\f1]
9
 
+[\f3\-midnight \f2offset\f1] [\f3\-weekstart \f2day\f1] [\f3\-nosplash] [\f3\-resume] [\f3\-start \f2task\f1]
10
 
 
11
 
 .SH DESCRIPTION
12
 
 
13
 
@@ -45,6 +45,17 @@
14
 
 will not consider everything 3:59AM the previous day.
15
 
 
16
 
 .TP 8
17
 
+.B \-weekstart \f2day\f3
18
 
+Specify which day of the week should be considered the beginning of the
19
 
+week when generating reports.  \f2day\f3 should be a number between 0 and
20
 
+6, where 0 is Sunday.  For example, the command
21
 
+
22
 
+.B gtimer -weekstart 1
23
 
+
24
 
+will use Monday as the first day of the week for all weekly reports.  The
25
 
+default is 0 (Sunday).
26
 
+
27
 
+.TP 8
28
 
 .B \-resume
29
 
 Start timing any tasks that were still be timed when
30
 
 GTimer last exited.
31
 
diff -Nru3 ./gtimer-1.1.6/main.c ../build-tree.new/gtimer-1.1.6/main.c
32
 
--- ./gtimer-1.1.6/main.c       2005-07-15 23:39:40.000000000 -0700
33
 
+++ ../build-tree.new/gtimer-1.1.6/main.c       2005-07-15 23:32:09.000000000 -0700
34
 
@@ -30,6 +30,8 @@
35
 
  *     http://www.cknudsen.com/gtimer/
36
 
  *
37
 
  * History:
38
 
+ *     15-Jul-2005     Add -weekstart to configure the first day of the
39
 
+ *                     week.  (Russ Allbery)
40
 
  *     31-May-2005     When exiting, only change the window size
41
 
  *                     configuration if gdk_window_get_size succeeds.
42
 
  *                     (Russ Allbery)
43
 
@@ -255,6 +257,7 @@
44
 
 int config_toolbar_enabled = 1;
45
 
 int config_animate_enabled = 1;
46
 
 int config_autosave_interval = (60*15); /* 15 minutes */
47
 
+int config_start_of_week = 0;
48
 
 
49
 
 char *taskdir = NULL;
50
 
 char *config_file = NULL;
51
 
@@ -2902,6 +2905,8 @@
52
 
     gettext ( "specify the midnight offset" ) );
53
 
   printf ( "%-20s %s\n", "-start taskname",
54
 
     gettext ( "start timing the specified task" ) );
55
 
+  printf ( "%-20s %s\n", "-weekstart N",
56
 
+    gettext ( "use N as the first day of weeks" ) );
57
 
 }
58
 
 
59
 
 
60
 
@@ -3046,6 +3051,26 @@
61
 
       config_midnight_offset = ( offset / 100 * 3600 ) + ( offset % 100 * 60 );
62
 
       if ( *ptr == '-' )
63
 
         config_midnight_offset *= -1;
64
 
+    } else if ( strcmp ( argv[loop], "-weekstart" ) == 0 ) {
65
 
+      if ( ! argv[loop+1] ) {
66
 
+        fprintf ( stderr, "%s: -weekstart %s.\n",
67
 
+          gettext("Error"), gettext("requires an argument") );
68
 
+        exit ( 1 );
69
 
+      }
70
 
+      for ( ptr = argv[++loop]; *ptr != '\0'; ptr++ ) {
71
 
+        if ( ! isdigit ( *ptr ) ) {
72
 
+          fprintf ( stderr, "%s: -weekstart %s (%s %s)\n",
73
 
+            gettext("Error"), gettext("requires a number"),
74
 
+            gettext("not"), argv[loop] );
75
 
+          exit ( 1 );
76
 
+        }
77
 
+      }
78
 
+      config_start_of_week = atoi ( argv[loop] );
79
 
+      if ( config_start_of_week > 6 ) {
80
 
+        fprintf ( stderr, "%s -weekstart: %s\n",
81
 
+          gettext("Invalid day of week number for"), argv[loop] );
82
 
+        exit ( 1 );
83
 
+      }
84
 
     } else if ( strcmp ( argv[loop], "-start" ) == 0 ) {
85
 
       if ( nmatches < 99 )
86
 
         matches[nmatches++] = argv[++loop];
87
 
diff -Nru3 ./gtimer-1.1.6/report.c ../build-tree.new/gtimer-1.1.6/report.c
88
 
--- ./gtimer-1.1.6/report.c     2005-07-15 23:39:40.000000000 -0700
89
 
+++ ../build-tree.new/gtimer-1.1.6/report.c     2005-07-15 23:26:40.000000000 -0700
90
 
@@ -30,6 +30,8 @@
91
 
  *     http://www.cknudsen.com/gtimer/
92
 
  *
93
 
  * History:
94
 
+ *     15-Jul-2005     Allow the start of the week to be configured.
95
 
+ *                     (Russ Allbery)
96
 
  *     15-Jul-2005     Honor the user's locale for weekday names.
97
 
  *     17-Apr-2005     Added configurability of the browser. (Russ Allbery)
98
 
  *     02-Jan-2004     Honor the user's locale for date display.  (Colin
99
 
@@ -144,6 +146,7 @@
100
 
 extern TaskData **visible_tasks;
101
 
 extern int num_visible_tasks;
102
 
 extern int config_midnight_offset;
103
 
+extern int config_start_of_week;
104
 
 extern GtkWidget *main_window;
105
 
 extern GdkPixmap *appicon2;
106
 
 extern GdkPixmap *appicon2_mask;
107
 
@@ -664,7 +667,8 @@
108
 
   strftime ( daystring, sizeof(daystring), "%x %a", tm );
109
 
 
110
 
   for ( loop = 0; loop < num_seltasks; loop++ ) {
111
 
-    if ( seltasks[loop]->week_start[0] == '\0' || tm->tm_wday == 0 )
112
 
+    if ( ( seltasks[loop]->week_start[0] == '\0' ) ||
113
 
+      ( tm->tm_wday == config_start_of_week ) )
114
 
       strcpy ( seltasks[loop]->week_start, daystring );
115
 
     if ( include_hours )
116
 
       entry = taskGetTimeEntry ( seltasks[loop]->taskdata->task,
117
 
@@ -796,7 +800,7 @@
118
 
   }
119
 
 
120
 
   if ( ( type == REPORT_TYPE_WEEKLY ) && 
121
 
-    ( wday == 6 || is_last ) ) {
122
 
+    ( wday == ( ( config_start_of_week + 6 ) % 7 ) || is_last ) ) {
123
 
     found = 0;
124
 
     for ( loop = 0; loop < num_seltasks; loop++ ) {
125
 
       if ( seltasks[loop]->weekly_total ||