Add ability to show the weeknr in calendar extension

Bug #620159 reported by Olav Vitters
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Olav Vitters

Bug Description

I'd like to have the ability to show the week numbers in the calendar extension.

For the week numbers I prefer ISO week numbers. To simplify the user interface I made the patch so it takes the ISO week number in case the week start date is set to Monday. Else it just uses a simple way to show the week number.

This patch required a few simplifications done to the calendar extension. See bug 620122.

Not sure about the colours and the text in the UI + help. Patch has been tested.

Revision history for this message
Olav Vitters (ovitters) wrote :
su_v (suv-lp)
tags: added: extensions-plugins
Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
su_v (suv-lp) wrote :

Would it be possibly to add an option to set the font size for the week numbers relative to the size used for the days? Currently it is difficult to differentiate between week numbers and dates (even when using different colors IMHO). Alternatively one could add an option to increase the spacing between the week column and the day columns.

(Tested with Inkscape 0.48.0 (Python 2.5.1) and 0.48+devel r9716 (Python 2.6.2) on OS X 10.5.8)

Revision history for this message
Olav Vitters (ovitters) wrote : Re: [Bug 620159] Re: Add ability to show the weeknr in calendar extension

On Thu, Aug 19, 2010 at 06:07:51AM -0000, ~suv wrote:
> Would it be possibly to add an option to set the font size for the week
> numbers relative to the size used for the days? Currently it is

I've tried it with the same font size as used for the day names. Looks a
lot better with that change.

Change itself is the following addition:
        self.style_weeknr['font-size'] = str( self.day_w / 3 )

I'll provide an updated patch later.

--
Regards,
Olav

Revision history for this message
Olav Vitters (ovitters) wrote :

Use a smaller font size for the week numbers

Revision history for this message
su_v (suv-lp) wrote :

Inkscape 0.48.0 (Python 2.5.1)
Inkscape 0.48+devel r9716 (Python 2.6.2) on OS X 10.5.8

- Extension fails to create week numbers for 'Week start day: Sunday'
  (default settings except: Char encoding 'UTF-8 - All languages')
- Extension works correctly for 'Week start day: Monday'
  (default settings except: Char encoding 'UTF-8 - All languages')

Revision history for this message
Olav Vitters (ovitters) wrote :

Ah, seems OS X doesn't understand the strftime format which I used. I tested it on Linux and Windows and assumed wrongly this would work on OS X. I'll create a new patch.

Basically, %#U means: do not zero-pad the week number (1 stays a 1). By default, it shows it as 01, which doesn't look nice in Inkscape. I'll see if there is a nice way to strip off leading '0's.

Revision history for this message
jazzynico (jazzynico) wrote :

@Olav - Are you still working on this extension?

Changed in inkscape:
assignee: nobody → Olav Vitters (ovitters)
status: New → In Progress
Revision history for this message
Micool (micool-angers) wrote :

Could it be commited in main trunk soon ? ?

Revision history for this message
jazzynico (jazzynico) wrote :

Currently working on it.

Changed in inkscape:
milestone: none → 0.49
Revision history for this message
jazzynico (jazzynico) wrote :

New version attached.
I've tried to integrate most of Olaf's changes, but encountered some errors with strftime and isocalendar functions (both on Windows XP and Ubuntu 11.04). Thus I've tried a different approach to calculate the week number.
Please test and comment!

Revision history for this message
su_v (suv-lp) wrote :

New version tested in Inkscape 0.48.2 with
- Python 2.5.1 (32bit), Apple, Mac OS X 10.5.8
- Python 2.6.7 (32bit), MacPorts, Mac OS X 10.5.8
- Python 2.6.7 (32bit), Apple, OS X 10.7.2
- Python 2.7.2 (64bit), MacPorts, OS X 10.7.2

System locale: en_US.UTF-8
Char encoding in extension: UTF-8

Looks ok to me (issue reported in comment #5 no longer reproduced). Any other special combination of settings to watch out for?

Revision history for this message
jazzynico (jazzynico) wrote :

Thanks for your tests, ~suv.

> Any other special combination of settings to watch out for?

The modification shouldn't affect other parts of the extension, and since the included libs didn't change, we can safely guess that there will be no regression due to Python version or OS port.

Revision history for this message
jazzynico (jazzynico) wrote :

Committed in the trunk, revision 10907.
Thanks for your patch, Olav. I didn't integrate everything, but it was very helpful.

Changed in inkscape:
status: In Progress → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.