[hamster-applet] translating title part in the report, fixes bug 618540
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] translating title part in the report, fixes bug 618540
- Date: Fri, 14 May 2010 13:30:45 +0000 (UTC)
commit 7f4a4695b2217ca602de525cdceeb17393779451
Author: Toms Bauģis <toms baugis gmail com>
Date: Fri May 14 14:30:31 2010 +0100
translating title part in the report, fixes bug 618540
src/hamster/widgets/reportchooserdialog.py | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/hamster/widgets/reportchooserdialog.py b/src/hamster/widgets/reportchooserdialog.py
index 3872a85..8ac4b42 100644
--- a/src/hamster/widgets/reportchooserdialog.py
+++ b/src/hamster/widgets/reportchooserdialog.py
@@ -83,10 +83,18 @@ class ReportChooserDialog(gtk.Dialog):
def show(self, start_date, end_date):
- #set suggested name to something readable, replace backslashes with dots
- #so the name is valid in linux
- filename = "Time track %s - %s.html" % (start_date.strftime("%x").replace("/", "."),
- end_date.strftime("%x").replace("/", "."))
+ """setting suggested name to something readable, replace backslashes
+ with dots so the name is valid in linux"""
+
+ # title in the report file name
+ vars = {"title": _("Time track"),
+ "start": start_date.strftime("%x").replace("/", "."),
+ "end": end_date.strftime("%x").replace("/", ".")}
+ if start_date != end_date:
+ filename = "%(title)s, %(start)s - %(end)s.html" % vars
+ else:
+ filename = "%(title)s, %(start)s.html" % vars
+
self.dialog.set_current_name(filename)
response = self.dialog.run()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]