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 Development

 
 
LinkBack Thread Tools
 
Old 10-22-2010, 02:53 PM
Ales Kozumplik
 
Default timezones: use more of s-c-date (#520631).

This patch removes our version of timezone selection and uses the entire
widget set from s-c-date instead.
---
pyanaconda/iw/timezone_gui.py | 76 ++---------------------------------------
pyanaconda/timezone.py | 1 +
2 files changed, 4 insertions(+), 73 deletions(-)

diff --git a/pyanaconda/iw/timezone_gui.py b/pyanaconda/iw/timezone_gui.py
index ca237bc..dcc7720 100644
--- a/pyanaconda/iw/timezone_gui.py
+++ b/pyanaconda/iw/timezone_gui.py
@@ -27,7 +27,7 @@ from scdate.core import zonetab
import pango
import sys

-from timezone_map_gui import TimezoneMap, Enum
+from timezone_map_gui import TimezoneMap
from iw_gui import *
from pyanaconda.booty.bootloaderInfo import dosFilesystems
from pyanaconda.bootloader import hasWindows
@@ -75,8 +75,8 @@ class TimezoneWindow(InstallWindow):
def timezone_widget_create (self, str1, str2, int1, int2):
mappath = "/usr/share/system-config-date/pixmaps/map1440.png"

- self.tz = AnacondaTZMap(self.zonetab, self.default, map=mappath,
- viewportWidth=480)
+ self.tz = TimezoneMap(self.zonetab, self.default, map=mappath,
+ viewportWidth=480)
self.tz.show_all()
return self.tz

@@ -109,73 +109,3 @@ class TimezoneWindow(InstallWindow):

self.notebook.remove(self.vbox)
return self.vbox
-
-class AnacondaTZMap(TimezoneMap):
- def __init__(self, zonetab, default, map="", viewportWidth=480):
- TimezoneMap.__init__(self, zonetab, default, map=map, viewportWidth=viewportWidth)
- self.columns = Enum("TRANSLATED", "TZ", "ENTRY")
-
- def status_bar_init(self):
- self.status = None
-
- def load_entries (self, root):
- iter = self.tzStore.get_iter_first()
-
- for entry in self.zonetab.getEntries():
- if entry.lat is not None and entry.long is not None:
- x, y = self.map2canvas(entry.lat, entry.long)
- marker = root.add(gnomecanvas.CanvasText, x=x, y=y,
- text=u'u00B7', fill_color='yellow',
- anchor=gtk.ANCHOR_CENTER,
- weight=pango.WEIGHT_BOLD)
- self.markers[entry.tz] = marker
-
- if entry.tz == "America/New York":
- # In case the /etc/sysconfig/clock is messed up, use New
- # York as the default.
- self.fallbackEntry = entry
-
- iter = self.tzStore.insert_after(iter, [entry.translated_tz, entry.tz, entry])
-
- def timezone_list_init (self, default):
- self.hbox = gtk.HBox()
- self.tzStore = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,
- gobject.TYPE_PYOBJECT)
-
- root = self.canvas.root()
-
- self.load_entries(root)
-
- # Add the ListStore to the sorted model after the list has been
- # populated, since otherwise we end up resorting on every addition.
- self.tzSorted = gtk.TreeModelSort(self.tzStore)
- self.tzSorted.set_sort_column_id(0, gtk.SORT_ASCENDING)
- self.tzCombo = gtk.ComboBox(model=self.tzSorted)
- cell = gtk.CellRendererText()
- self.tzCombo.pack_start(cell, True)
- self.tzCombo.add_attribute(cell, 'text', 0)
- self.tzCombo.connect("changed", self.selectionChanged)
- self.hbox.pack_start(self.tzCombo, False, False)
-
- self.pack_start(self.hbox, False, False)
-
- def selectionChanged(self, widget, *args):
- iter = widget.get_active_iter()
- if iter is None:
- return
- entry = widget.get_model().get_value(iter, self.columns.ENTRY)
- if entry:
- self.setCurrent (entry, skipList=1)
- if entry.long != None and entry.lat != None:
- self.move_to (entry.long, entry.lat)
-
- def updateTimezoneList(self):
- # Find the currently selected item in the combo box and update both
- # the combo and the comment label.
- iter = self.tzCombo.get_model().get_iter_first()
- while iter:
- if self.tzCombo.get_model().get_value(iter, 1) == self.currentEntry.tz:
- self.tzCombo.set_active_iter(iter)
- break
-
- iter = self.tzCombo.get_model().iter_next(iter)
diff --git a/pyanaconda/timezone.py b/pyanaconda/timezone.py
index 74d66db..0f90aac 100644
--- a/pyanaconda/timezone.py
+++ b/pyanaconda/timezone.py
@@ -68,6 +68,7 @@ class Timezone:
return (self.tz, self.utc)

def setTimezoneInfo(self, timezone, asUtc = 0):
+ log.info("set timezone: %s, utc: %d" % (timezone, asUtc))
self.tz = timezone
self.utc = asUtc

--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 10-22-2010, 03:51 PM
Chris Lumens
 
Default timezones: use more of s-c-date (#520631).

> This patch removes our version of timezone selection and uses the entire
> widget set from s-c-date instead.

Big time ACKs to this.

For the future, I suggest you also talk to mizmo about what she may have
in mind for the overall user experience. Her ideas may require
completely different time setting stuff.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 10-22-2010, 03:58 PM
"Brian C. Lane"
 
Default timezones: use more of s-c-date (#520631).

On Fri, Oct 22, 2010 at 04:53:11PM +0200, Ales Kozumplik wrote:
> This patch removes our version of timezone selection and uses the entire
> widget set from s-c-date instead.
> ---
> pyanaconda/iw/timezone_gui.py | 76 ++---------------------------------------
> pyanaconda/timezone.py | 1 +
> 2 files changed, 4 insertions(+), 73 deletions(-)

Oh, wow! That sure seems to clean things up nicely.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
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 08:04 AM.

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