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 Rename because of the clashing names of datetime module and the spoke

---
pyanaconda/ui/gui/spokes/datetime.py | 100 -----
pyanaconda/ui/gui/spokes/datetime.ui | 619 ----------------------------
pyanaconda/ui/gui/spokes/datetime_spoke.py | 100 +++++
pyanaconda/ui/gui/spokes/datetime_spoke.ui | 619 ++++++++++++++++++++++++++++
4 files changed, 719 insertions(+), 719 deletions(-)
delete mode 100644 pyanaconda/ui/gui/spokes/datetime.py
delete mode 100644 pyanaconda/ui/gui/spokes/datetime.ui
create mode 100644 pyanaconda/ui/gui/spokes/datetime_spoke.py
create mode 100644 pyanaconda/ui/gui/spokes/datetime_spoke.ui

diff --git a/pyanaconda/ui/gui/spokes/datetime.py b/pyanaconda/ui/gui/spokes/datetime.py
deleted file mode 100644
index aed63f2..0000000
--- a/pyanaconda/ui/gui/spokes/datetime.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# Datetime configuration spoke class
-#
-# Copyright (C) 2012 Red Hat, Inc.
-#
-# This copyrighted material is made available to anyone wishing to use,
-# modify, copy, or redistribute it subject to the terms and conditions of
-# the GNU General Public License v.2, or (at your option) any later version.
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY expressed or implied, including the implied warranties of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details. You should have received a copy of the
-# GNU General Public License along with this program; if not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
-# source code or documentation are not subject to the GNU General Public
-# License and may only be used or replicated with the express permission of
-# Red Hat, Inc.
-#
-# Red Hat Author(s): Vratislav Podzimek <vpodzime@redhat.com>
-#
-
-import gettext
-_ = lambda x: gettext.ldgettext("anaconda", x)
-N_ = lambda x: x
-
-from gi.repository import AnacondaWidgets, GLib
-
-from pyanaconda.ui.gui import UIObject
-from pyanaconda.ui.gui.spokes import NormalSpoke
-from pyanaconda.ui.gui.categories.localization import LocalizationCategory
-
-from pyanaconda import localization
-import datetime
-
-__all__ = ["DatetimeSpoke"]
-
-class DatetimeSpoke(NormalSpoke):
- builderObjects = ["datetimeWindow", "days", "months", "years", "regions",
- "cities"]
- mainWidgetName = "datetimeWindow"
- uiFile = "spokes/datetime.ui"
-
- category = LocalizationCategory
-
- icon = "preferences-system-date-and-time-symbolic"
- title = N_("DATE & TIME")
-
- def __init__(self, *args):
- NormalSpoke.__init__(self, *args)
-
- def initialize(self, cb=None):
- NormalSpoke.initialize(self, cb)
- self._daysStore = self.builder.get_object("days")
- self._monthsStore = self.builder.get_object("months")
- self._yearsStore = self.builder.get_object("years")
- self._regionsStore = self.builder.get_object("regions")
- self._citiesStore = self.builder.get_object("cities")
- self._tzmap = self.builder.get_object("tzmap")
-
- self._regions_zones = localization.get_all_regions_and_timezones()
-
- for day in xrange(1, 32):
- self.add_to_store(self._daysStore, day)
-
- self._months_nums = dict()
- for i in xrange(1, 13):
- #a bit hacky way, but should return the translated string
- #TODO: how to handle language change? Clear and populate again?
- month = datetime.date(2000, i, 1).strftime('%B')
- self.add_to_store(self._monthsStore, month)
- self._months_nums[month] = i
-
- for year in xrange(1990, 2051):
- self.add_to_store(self._yearsStore, year)
-
- for region in self._regions_zones.keys():
- self.add_to_store(self._regionsStore, region)
- for city in self._regions_zones[region]:
- self.add_to_store(self._citiesStore, city)
-
- self._tzmap.set_timezone("Europe/Prague")
-
- @property
- def status(self):
- return _("Something selected")
-
- def apply(self):
- pass
-
- @property
- def completed(self):
- #Always completed -- some date, time and timezone are always set
- return True
-
- def refresh(self):
- #TODO: setup timer here!
- pass
-
- def add_to_store(self, store, item):
- store.append([item])
diff --git a/pyanaconda/ui/gui/spokes/datetime.ui b/pyanaconda/ui/gui/spokes/datetime.ui
deleted file mode 100644
index 8ca1876..0000000
--- a/pyanaconda/ui/gui/spokes/datetime.ui
+++ /dev/null
@@ -1,619 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <!-- interface-requires gtk+ 3.0 -->
- <!-- interface-requires AnacondaWidgets 1.0 -->
- <object class="GtkListStore" id="cities">
- <columns>
- <!-- column-name name -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkTreeModelFilter" id="citiesFilter">
- <property name="child_model">cities</property>
- </object>
- <object class="GtkTreeModelSort" id="citiesSort">
- <property name="model">citiesFilter</property>
- </object>
- <object class="AnacondaSpokeWindow" id="datetimeWindow">
- <property name="startup_id">filler</property>
- <property name="can_focus">False</property>
- <property name="startup_id">filler</property>
- <child internal-child="main_box">
- <object class="GtkBox" id="AnacondaSpokeWindow-main_box1">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child internal-child="nav_area">
- <object class="GtkGrid" id="AnacondaSpokeWindow-nav_area1">
- <property name="can_focus">False</property>
- <property name="margin_left">6</property>
- <property name="margin_right">6</property>
- <property name="margin_top">6</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child internal-child="alignment">
- <object class="GtkAlignment" id="AnacondaSpokeWindow-alignment1">
- <property name="can_focus">False</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <child internal-child="action_area">
- <object class="GtkBox" id="AnacondaSpokeWindow-action_area1">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkBox" id="box1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkAlignment" id="headerAlignment">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="xscale">0.94999998807907104</property>
- <child>
- <object class="GtkBox" id="headerBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="regionLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Region:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">3</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="regionCombobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">regionsFilter</property>
- <child>
- <object class="GtkCellRendererText" id="regionsComboRenderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">2</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="cityLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">City:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">5</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="cityCombobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">citiesFilter</property>
- <child>
- <object class="GtkCellRendererText" id="citiesComboRenderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="xscale">0.20000000298023224</property>
- <child>
- <object class="GtkBox" id="box6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="networkTimeLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Network Time</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">3</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSwitch" id="networkTimeSwitch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">end</property>
- <property name="valign">start</property>
- <property name="use_action_appearance">False</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="AnacondaTimezoneMap" id="tzmap">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="padding">6</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="footerAlignment">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="xscale">0.94999998807907104</property>
- <child>
- <object class="GtkBox" id="footerBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkGrid" id="grid2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="n_columns">5</property>
- <child>
- <object class="GtkLabel" id="hoursLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">00</property>
- <attributes>
- <attribute name="scale" value="2"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="colonLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">:</property>
- <attributes>
- <attribute name="scale" value="2"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="minutesLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">00</property>
- <attributes>
- <attribute name="scale" value="2"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="hoursUpButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="image">upImage</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="hoursDownButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="image">downImage</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="amPmUpButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="image">upImage1</property>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="minutesUpButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="image">upImage2</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="amPmDownButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="image">downImage1</property>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="minutesDownButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="image">downImage2</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="spaceLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes"> </property>
- <attributes>
- <attribute name="scale" value="2"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="amPmLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">PM</property>
- <attributes>
- <attribute name="scale" value="1.5"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="yalign">1</property>
- <property name="yscale">0.5</property>
- <child>
- <object class="GtkBox" id="box4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkRadioButton" id="timeFormatRB">
- <property name="label" translatable="yes">24-hour</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="timeFormatRB2">
- <property name="label" translatable="yes">AM/PM</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">timeFormatRB</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="xscale">0.30000001192092896</property>
- <property name="yscale">0.20000000298023224</property>
- <child>
- <object class="GtkBox" id="box5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkComboBox" id="monthCombobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">months</property>
- <child>
- <object class="GtkCellRendererText" id="monthsComboRenderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="dayCombobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">daysFilter</property>
- <child>
- <object class="GtkCellRendererText" id="daysComboRenderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="yearCombobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">years</property>
- <child>
- <object class="GtkCellRendererText" id="yearsComboRenderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkListStore" id="days">
- <columns>
- <!-- column-name number -->
- <column type="guint"/>
- </columns>
- </object>
- <object class="GtkTreeModelFilter" id="daysFilter">
- <property name="child_model">days</property>
- </object>
- <object class="GtkImage" id="downImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-down-symbolic</property>
- </object>
- <object class="GtkImage" id="downImage1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-down-symbolic</property>
- </object>
- <object class="GtkImage" id="downImage2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-down-symbolic</property>
- </object>
- <object class="GtkListStore" id="months">
- <columns>
- <!-- column-name name -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkListStore" id="regions">
- <columns>
- <!-- column-name name -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkTreeModelFilter" id="regionsFilter">
- <property name="child_model">regions</property>
- </object>
- <object class="GtkTreeModelSort" id="regionsSort">
- <property name="model">regionsFilter</property>
- </object>
- <object class="GtkImage" id="upImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-up-symbolic</property>
- </object>
- <object class="GtkImage" id="upImage1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-up-symbolic</property>
- </object>
- <object class="GtkImage" id="upImage2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-up-symbolic</property>
- </object>
- <object class="GtkListStore" id="years">
- <columns>
- <!-- column-name number -->
- <column type="guint"/>
- </columns>
- </object>
-</interface>
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
new file mode 100644
index 0000000..3f559e5
--- /dev/null
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -0,0 +1,100 @@
+# Datetime configuration spoke class
+#
+# Copyright (C) 2012 Red Hat, Inc.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# the GNU General Public License v.2, or (at your option) any later version.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY expressed or implied, including the implied warranties of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details. You should have received a copy of the
+# GNU General Public License along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
+# source code or documentation are not subject to the GNU General Public
+# License and may only be used or replicated with the express permission of
+# Red Hat, Inc.
+#
+# Red Hat Author(s): Vratislav Podzimek <vpodzime@redhat.com>
+#
+
+import gettext
+_ = lambda x: gettext.ldgettext("anaconda", x)
+N_ = lambda x: x
+
+from gi.repository import AnacondaWidgets, GLib
+
+from pyanaconda.ui.gui import UIObject
+from pyanaconda.ui.gui.spokes import NormalSpoke
+from pyanaconda.ui.gui.categories.localization import LocalizationCategory
+
+from pyanaconda import localization
+import datetime
+
+__all__ = ["DatetimeSpoke"]
+
+class DatetimeSpoke(NormalSpoke):
+ builderObjects = ["datetimeWindow", "days", "months", "years", "regions",
+ "cities"]
+ mainWidgetName = "datetimeWindow"
+ uiFile = "spokes/datetime_spoke.ui"
+
+ category = LocalizationCategory
+
+ icon = "preferences-system-date-and-time-symbolic"
+ title = N_("DATE & TIME")
+
+ def __init__(self, *args):
+ NormalSpoke.__init__(self, *args)
+
+ def initialize(self, cb=None):
+ NormalSpoke.initialize(self, cb)
+ self._daysStore = self.builder.get_object("days")
+ self._monthsStore = self.builder.get_object("months")
+ self._yearsStore = self.builder.get_object("years")
+ self._regionsStore = self.builder.get_object("regions")
+ self._citiesStore = self.builder.get_object("cities")
+ self._tzmap = self.builder.get_object("tzmap")
+
+ self._regions_zones = localization.get_all_regions_and_timezones()
+
+ for day in xrange(1, 32):
+ self.add_to_store(self._daysStore, day)
+
+ self._months_nums = dict()
+ for i in xrange(1, 13):
+ #a bit hacky way, but should return the translated string
+ #TODO: how to handle language change? Clear and populate again?
+ month = datetime.date(2000, i, 1).strftime('%B')
+ self.add_to_store(self._monthsStore, month)
+ self._months_nums[month] = i
+
+ for year in xrange(1990, 2051):
+ self.add_to_store(self._yearsStore, year)
+
+ for region in self._regions_zones.keys():
+ self.add_to_store(self._regionsStore, region)
+ for city in self._regions_zones[region]:
+ self.add_to_store(self._citiesStore, city)
+
+ self._tzmap.set_timezone("Europe/Prague")
+
+ @property
+ def status(self):
+ return _("Something selected")
+
+ def apply(self):
+ pass
+
+ @property
+ def completed(self):
+ #Always completed -- some date, time and timezone are always set
+ return True
+
+ def refresh(self):
+ #TODO: setup timer here!
+ pass
+
+ def add_to_store(self, store, item):
+ store.append([item])
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.ui b/pyanaconda/ui/gui/spokes/datetime_spoke.ui
new file mode 100644
index 0000000..8ca1876
--- /dev/null
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.ui
@@ -0,0 +1,619 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires AnacondaWidgets 1.0 -->
+ <object class="GtkListStore" id="cities">
+ <columns>
+ <!-- column-name name -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkTreeModelFilter" id="citiesFilter">
+ <property name="child_model">cities</property>
+ </object>
+ <object class="GtkTreeModelSort" id="citiesSort">
+ <property name="model">citiesFilter</property>
+ </object>
+ <object class="AnacondaSpokeWindow" id="datetimeWindow">
+ <property name="startup_id">filler</property>
+ <property name="can_focus">False</property>
+ <property name="startup_id">filler</property>
+ <child internal-child="main_box">
+ <object class="GtkBox" id="AnacondaSpokeWindow-main_box1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child internal-child="nav_area">
+ <object class="GtkGrid" id="AnacondaSpokeWindow-nav_area1">
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="margin_right">6</property>
+ <property name="margin_top">6</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child internal-child="alignment">
+ <object class="GtkAlignment" id="AnacondaSpokeWindow-alignment1">
+ <property name="can_focus">False</property>
+ <property name="yalign">0</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <child internal-child="action_area">
+ <object class="GtkBox" id="AnacondaSpokeWindow-action_area1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkAlignment" id="headerAlignment">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="xscale">0.94999998807907104</property>
+ <child>
+ <object class="GtkBox" id="headerBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="regionLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Region:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">3</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="regionCombobox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">regionsFilter</property>
+ <child>
+ <object class="GtkCellRendererText" id="regionsComboRenderer"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">2</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cityLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">City:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="cityCombobox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">citiesFilter</property>
+ <child>
+ <object class="GtkCellRendererText" id="citiesComboRenderer"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="xscale">0.20000000298023224</property>
+ <child>
+ <object class="GtkBox" id="box6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="networkTimeLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Network Time</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">3</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="networkTimeSwitch">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="use_action_appearance">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="AnacondaTimezoneMap" id="tzmap">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="padding">6</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="footerAlignment">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="xscale">0.94999998807907104</property>
+ <child>
+ <object class="GtkBox" id="footerBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_columns">5</property>
+ <child>
+ <object class="GtkLabel" id="hoursLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">00</property>
+ <attributes>
+ <attribute name="scale" value="2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="colonLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">:</property>
+ <attributes>
+ <attribute name="scale" value="2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="minutesLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">00</property>
+ <attributes>
+ <attribute name="scale" value="2"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="hoursUpButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">upImage</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="hoursDownButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">downImage</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="amPmUpButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">upImage1</property>
+ </object>
+ <packing>
+ <property name="left_attach">4</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="minutesUpButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">upImage2</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="amPmDownButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">downImage1</property>
+ </object>
+ <packing>
+ <property name="left_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="minutesDownButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">downImage2</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+
 

Thread Tools




All times are GMT. The time now is 10:25 AM.

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