diff options
author | pnfisher <pnfisher> | 1999-09-24 03:03:16 +0000 |
---|---|---|
committer | pnfisher <pnfisher> | 1999-09-24 03:03:16 +0000 |
commit | 5c307dd1c9209f228c87117d60c3345a921c717e (patch) | |
tree | 9f88671446b76f3390cfba8d3f220c1f9558c2d3 | |
parent | 581e239731878059afd3fa0b6dafc094340518c4 (diff) | |
download | anaconda-5c307dd1c9209f228c87117d60c3345a921c717e.tar.gz anaconda-5c307dd1c9209f228c87117d60c3345a921c717e.tar.xz anaconda-5c307dd1c9209f228c87117d60c3345a921c717e.zip |
Relayout and add comments to zones in clist.
-rw-r--r-- | gnome-map/timezonemapmodule.c | 28 | ||||
-rw-r--r-- | iw/timezone.py | 62 |
2 files changed, 76 insertions, 14 deletions
diff --git a/gnome-map/timezonemapmodule.c b/gnome-map/timezonemapmodule.c index fd1bfbaf2..ca18a78c3 100644 --- a/gnome-map/timezonemapmodule.c +++ b/gnome-map/timezonemapmodule.c @@ -5,6 +5,7 @@ #include <stdlib.h> #include <unistd.h> #include <math.h> +#include <string.h> #include <Python.h> @@ -343,10 +344,23 @@ set_hilited (MapData *mapdata, gint index, double item_x, double item_y) /* keep status bar from flickering */ gtk_label_get (GTK_LABEL (GTK_STATUSBAR (mapdata->statusbar)->label), &status_text); - if (strcmp (status_text, loc->zone) != 0) + if (strncmp (status_text, loc->zone, strlen (loc->zone)) != 0) { + char *newstr; + char *sep = " - "; + gtk_statusbar_pop (GTK_STATUSBAR (mapdata->statusbar), 1); - gtk_statusbar_push (GTK_STATUSBAR (mapdata->statusbar), 1, loc->zone); + newstr = (char *) malloc (strlen (loc->zone) + strlen (sep) + + ((loc->comment) ? strlen (loc->comment) : 0) + 1); + strcpy (newstr, loc->zone); + if (loc->comment) + { + strcat (newstr, sep); + strcat (newstr, loc->comment); + } + + gtk_statusbar_push (GTK_STATUSBAR (mapdata->statusbar), 1, newstr); + free (newstr); } gnome_canvas_points_free (points); @@ -607,7 +621,7 @@ create_location_list (MapData *mapdata) TimeZoneLocation *loc; GtkWidget *scrolledwin; /* gchar *titles[] = { "Current Selection", NULL }; */ - gchar *row[1]; + gchar *row[2]; gint i; ignore_locationlist_selectevents = TRUE; @@ -616,11 +630,11 @@ create_location_list (MapData *mapdata) scrolledwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwin), - GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_show (scrolledwin); - mapdata->locationlist = gtk_clist_new (1); + mapdata->locationlist = gtk_clist_new (2); gtk_clist_set_selection_mode (GTK_CLIST(mapdata->locationlist), GTK_SELECTION_BROWSE); @@ -643,6 +657,7 @@ create_location_list (MapData *mapdata) continue; row[0] = loc->zone; + row[1] = loc->comment; newrow = gtk_clist_append (GTK_CLIST (mapdata->locationlist), row); gtk_clist_set_row_data (GTK_CLIST (mapdata->locationlist), newrow, GINT_TO_POINTER (i)); @@ -703,6 +718,7 @@ main (int argc, char **argv) GtkWidget *aframe; GtkWidget *mainwindow; MapData *mapdata; + GtkWidget *cbutton; gnome_init ("gglobe", "0.1", argc, argv); @@ -730,6 +746,8 @@ main (int argc, char **argv) gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new ("View: "), FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox2), viewcombo, FALSE, FALSE, 2); + cbutton = gtk_check_button_new_with_label ("System clock uses UTC"); + gtk_box_pack_start (GTK_BOX (hbox2), cbutton, FALSE, FALSE, 5); /* put cities on the world map */ diff --git a/iw/timezone.py b/iw/timezone.py index 8f8b6673f..35b287dee 100644 --- a/iw/timezone.py +++ b/iw/timezone.py @@ -78,6 +78,23 @@ class TimezoneWindow (InstallWindow): def fixUp (self): pass + def copy_toggled (self, cb1, cb2): + if cb1.get_data ("toggling"): return + + cb2.set_data ("toggling", 1) + cb2.set_active (cb1.get_active ()) + cb2.set_data ("toggling", 0) + + def switchPage (self, nb, page, page_num, *args): + if page_num == 1: + self.systemUTC.reparent (self.p2_align) +# self.p1_align.remove (self.systemUTC) +# self.p2_align.add (self.systemUTC) + elif self.systemUTC["parent"] == self.p2_align: + self.systemUTC.reparent (self.p1_align) +# self.p2_align.remove (self.systemUTC) +# self.p1_align.add (self.systemUTC) + def getScreen (self): try: f = open ("/usr/share/anaconda/map480.png") @@ -113,7 +130,26 @@ class TimezoneWindow (InstallWindow): label = GtkLabel (_("View:")) hbox = GtkHBox (FALSE, 5) hbox.pack_start (label, FALSE) - hbox.pack_start (views, FALSE) + align = GtkAlignment (0.5, 0.5) + align.add (views) + hbox.pack_start (align, FALSE) + self.p1_align = align + + systemUTCCopy = GtkCheckButton (_("System clock uses UTC")) + systemUTCCopy.toggling = 0 + + self.systemUTC = GtkCheckButton (_("System clock uses UTC")) + self.systemUTC.toggling = 0 + + systemUTCCopy.connect ("toggled", self.copy_toggled, self.systemUTC) + self.systemUTC.connect ("toggled", self.copy_toggled, systemUTCCopy) + + self.systemUTC.set_active (asUTC) + + align = GtkAlignment (0.5, 0.5) + align.add (self.systemUTC) + hbox.pack_start (align, FALSE) + im = self.ics.readPixmap ("timezone.png") if im: im.render () @@ -147,12 +183,19 @@ class TimezoneWindow (InstallWindow): list.select_row (15, 0) sw.add (list) tzBox.pack_start (sw) - align = GtkAlignment (0, 0) + box = GtkHBox (FALSE) + align = GtkAlignment (0.5, 0.5) daylightCB = GtkCheckButton (_("Use Daylight Saving Time")) align.add (daylightCB) - tzBox.pack_start (align, FALSE) + box.pack_start (align, FALSE) + + align = GtkAlignment (1.0, 0.5) + align.add (systemUTCCopy) + + box.pack_start (align, TRUE) + tzBox.pack_start (box, FALSE) tzBox.set_border_width (5) - + self.tzBox = tzBox mainBox.set_border_width (5) nb.append_page (mainBox, GtkLabel (_("Location"))) @@ -160,11 +203,12 @@ class TimezoneWindow (InstallWindow): box = GtkVBox (FALSE, 5) box.pack_start (nb) - self.systemUTC = GtkCheckButton (_("System clock uses UTC")) - self.systemUTC.set_active (asUTC) - align = GtkAlignment (0, 0) - align.add (self.systemUTC) - box.pack_start (align, FALSE) +# self.systemUTC = GtkCheckButton (_("System clock uses UTC")) +# self.systemUTC.set_active (asUTC) +# align = GtkAlignment (0, 0) +# align.add (self.systemUTC) +# box.pack_start (align, FALSE) box.set_border_width (5) + return box |