FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-30-2012, 07:55 PM
Vratislav Podzimek
 
Default Add time-setting buttons' callbacks

---
pyanaconda/ui/gui/spokes/datetime_spoke.py | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index acbaa9e..31634ad 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -99,6 +99,7 @@ class DatetimeSpoke(NormalSpoke):
self._citiesSort = self.builder.get_object("citiesSort")
self._citiesSort.set_sort_column_id(0, 0) #column 0, Ascending

+ self._mod_hours = 13 #TODO: change on timeformat RB change
self._tzmap.set_timezone("Europe/Prague")

@property
@@ -155,16 +156,29 @@ class DatetimeSpoke(NormalSpoke):
return city in self._regions_zones[region]

def on_up_hours_clicked(self, *args):
- pass
+ hours_label = self.builder.get_object("hoursLabel")
+ hours = int(hours_label.get_text())
+ hours_str = "%0.2d" % ((hours + 1) % self._mod_hours)
+ hours_label.set_text(hours_str)

def on_down_hours_clicked(self, *args):
- pass
+ hours_label = self.builder.get_object("hoursLabel")
+ hours = int(hours_label.get_text())
+ hours_str = "%0.2d" % ((hours - 1) % self._mod_hours)
+ hours_label.set_text(hours_str)

def on_up_minutes_clicked(self, *args):
+ minutes_label = self.builder.get_object("minutesLabel")
+ minutes = int(minutes_label.get_text())
+ minutes_str = "%0.2d" % ((minutes + 1) % 60)
+ minutes_label.set_text(minutes_str)
pass

def on_down_minutes_clicked(self, *args):
- pass
+ minutes_label = self.builder.get_object("minutesLabel")
+ minutes = int(minutes_label.get_text())
+ minutes_str = "%0.2d" % ((minutes - 1) % 60)
+ minutes_label.set_text(minutes_str)

def on_up_ampm_clicked(self, *args):
pass
--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-02-2012, 03:13 PM
Vratislav Podzimek
 
Default Add time-setting buttons' callbacks

---
pyanaconda/ui/gui/spokes/datetime_spoke.py | 32 +++++++++++++++++++++++----
1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 3eb9f90..c519571 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -98,6 +98,7 @@ class DatetimeSpoke(NormalSpoke):
self._citiesSort = self.builder.get_object("citiesSort")
self._citiesSort.set_sort_column_id(0, 0) #column 0, Ascending

+ self._mod_hours = 13 #TODO: change on timeformat RB change
self._tzmap.set_timezone("Europe/Prague")

@property
@@ -153,22 +154,43 @@ class DatetimeSpoke(NormalSpoke):
return city in self._regions_zones[region]

def on_up_hours_clicked(self, *args):
- pass
+ hours_label = self.builder.get_object("hoursLabel")
+ hours = int(hours_label.get_text())
+ hours_str = "%0.2d" % ((hours + 1) % self._mod_hours)
+ hours_label.set_text(hours_str)

def on_down_hours_clicked(self, *args):
- pass
+ hours_label = self.builder.get_object("hoursLabel")
+ hours = int(hours_label.get_text())
+ hours_str = "%0.2d" % ((hours - 1) % self._mod_hours)
+ hours_label.set_text(hours_str)

def on_up_minutes_clicked(self, *args):
+ minutes_label = self.builder.get_object("minutesLabel")
+ minutes = int(minutes_label.get_text())
+ minutes_str = "%0.2d" % ((minutes + 1) % 60)
+ minutes_label.set_text(minutes_str)
pass

def on_down_minutes_clicked(self, *args):
- pass
+ minutes_label = self.builder.get_object("minutesLabel")
+ minutes = int(minutes_label.get_text())
+ minutes_str = "%0.2d" % ((minutes - 1) % 60)
+ minutes_label.set_text(minutes_str)

def on_up_ampm_clicked(self, *args):
- pass
+ label = self.builder.get_object("amPmLabel")
+ if label.get_text() == "AM":
+ label.set_text("PM")
+ else:
+ label.set_text("AM")

def on_down_ampm_clicked(self, *args):
- pass
+ label = self.builder.get_object("amPmLabel")
+ if label.get_text() == "AM":
+ label.set_text("PM")
+ else:
+ label.set_text("AM")

def on_region_changed(self, *args):
self._citiesFilter.refilter()
--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-02-2012, 03:47 PM
Chris Lumens
 
Default Add time-setting buttons' callbacks

> def on_up_ampm_clicked(self, *args):
> - pass
> + label = self.builder.get_object("amPmLabel")
> + if label.get_text() == "AM":
> + label.set_text("PM")
> + else:
> + label.set_text("AM")
>
> def on_down_ampm_clicked(self, *args):
> - pass
> + label = self.builder.get_object("amPmLabel")
> + if label.get_text() == "AM":
> + label.set_text("PM")
> + else:
> + label.set_text("AM")
>
> def on_region_changed(self, *args):
> self._citiesFilter.refilter()

Are "AM" and "PM" translatable strings?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org