From 7cc57c202977e9867938e37c1294acd819b24496 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Mon, 4 Aug 2008 20:46:46 +0000 Subject: [PATCH] Added arrow gifs, and made some changes to WebCal to deal with this arrow gif. * src/plugins/WebCal.py * src/images/Makefile.am svn: r10963 --- src/images/Makefile.am | 6 ++++-- src/plugins/WebCal.py | 39 +++++++++++++++++---------------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/images/Makefile.am b/src/images/Makefile.am index 5aabdc2c5..e46514cc6 100644 --- a/src/images/Makefile.am +++ b/src/images/Makefile.am @@ -60,7 +60,7 @@ dist_pkgdata_DATA = \ logo.png\ splash.jpg\ gramps-export.png\ - gramps-import.png\ + gramps-import.png\ gramps-url.png\ stock_new-html.png\ gramps-undo-history.png\ @@ -73,7 +73,9 @@ dist_pkgdata_DATA = \ NWeb_Mainz_Bkgd.png\ NWeb_Mainz_Header.png\ NWeb_Mainz_MidLight.png\ - NWeb_Mainz_Mid.png + NWeb_Mainz_Mid.png\ + arrow102.gif\ + arrow231.gif EXTRA_DIST = gramps.svg diff --git a/src/plugins/WebCal.py b/src/plugins/WebCal.py index 8f43ba9b3..ee0c62411 100644 --- a/src/plugins/WebCal.py +++ b/src/plugins/WebCal.py @@ -96,6 +96,7 @@ from DateHandler import parser as _dp #------------------------------------------------------------------------ _CALENDARSCREEN = "calendar-screen.css" _CALENDARPRINT = "calendar-print.css" +_ARROW_GIF = "arrow102.gif" # This information defines the list of styles in the Web calendar # options dialog as well as the location of the corresponding SCREEN @@ -229,16 +230,8 @@ class WebCalReport(Report): menu.get_option_by_name('note_nov').get_value(), menu.get_option_by_name('note_dec').get_value()] - self.warn_dir = True # Only give warning once. - - # Set first weekday according to Locale - xmllang = Utils.xml_lang() - if xmllang == "en-US": - # USA calendar starts on a Sunday - calendar.setfirstweekday(calendar.SUNDAY) - else: - # European calendar starts on Monday, default - calendar.setfirstweekday(calendar.MONDAY) + self.warn_dir = True # Only give warning once. + self.has_arrow_gif = False # Set to True after copying to destination def copy_file(self, from_fname, to_fname, to_dir=''): """ @@ -345,9 +338,10 @@ class WebCalReport(Report): # Copy arrow image if "Year At A Glance" is requested, # and if the file exists if self.fullyear: - from_file = os.path.join(const.IMAGE_DIR, "arrow102.gif") + from_file = os.path.join(const.IMAGE_DIR, _ARROW_GIF) if os.path.exists(from_file): - self.copy_file(from_file, "arrow102.gif", "images") + self.copy_file(from_file, _ARROW_GIF, "images") + self.has_arrow_gif = True def display_nav_links(self, of, currentsection, nr_up): """ @@ -640,6 +634,7 @@ class WebCalReport(Report): 'day_list' - lines of text to display at this day """ + nr_up = 2 # Number of directory levels up to get to root year = self.year # Create names for long and short month names, in LOcale @@ -650,17 +645,19 @@ class WebCalReport(Report): cal_fname = '%s%d%s' % (shrt_month, day_num, self.ext) of = self.create_file(cal_fname, os.path.join(str(year), lng_month)) - arrow = os.path.join(self.html_dir, "images", "arrow102.gif") mystyle = """