Gentoo Archives: gentoo-commits

From: Wiktor W Brodlo <wiktor@××××××.net>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/anaconda:master commit in: /, ui/, iw/
Date: Sun, 03 Jul 2011 23:37:32
Message-Id: c17fa85feb9b5da645969a0fd96c3873e4e7c80b.wiktor@gentoo
1 commit: c17fa85feb9b5da645969a0fd96c3873e4e7c80b
2 Author: wiktor w brodlo <wiktor <AT> brodlo <DOT> net>
3 AuthorDate: Sun Jul 3 23:37:10 2011 +0000
4 Commit: Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net>
5 CommitDate: Sun Jul 3 23:37:10 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/anaconda.git;a=commit;h=c17fa85f
7
8 profile selection
9
10 ---
11 dispatch.py | 2 +-
12 gui.py | 1 +
13 installclass.py | 1 +
14 iw/profile_gui.py | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++
15 ui/profile.glade | 17 ++++++++++---
16 5 files changed, 80 insertions(+), 5 deletions(-)
17
18 diff --git a/dispatch.py b/dispatch.py
19 index 4ade775..55064ea 100644
20 --- a/dispatch.py
21 +++ b/dispatch.py
22 @@ -98,7 +98,7 @@ installSteps = [
23 # Installing the Gentoo Base System
24 ("mirrorselect", ),
25 ("mirrorselect-sync", ),
26 - # profile
27 + ("profile", ),
28 # use
29
30 # Configuring the Kernel
31
32 diff --git a/gui.py b/gui.py
33 index 41f127c..8c9bf17 100755
34 --- a/gui.py
35 +++ b/gui.py
36 @@ -82,6 +82,7 @@ stepToClass = {
37 # Installing the Gentoo Base System
38 "mirrorselect": ("mirrorselect_gui", "MirrorselectWindow"),
39 "mirrorselect-sync": ("mirrorselect-sync_gui", "MirrorselectSyncWindow"),
40 + "profile": ("profile_gui", "ProfileWindow"),
41
42 # Configuring the Kernel
43 "timezone" : ("timezone_gui", "TimezoneWindow"),
44
45 diff --git a/installclass.py b/installclass.py
46 index 28104d8..a6413a6 100644
47 --- a/installclass.py
48 +++ b/installclass.py
49 @@ -105,6 +105,7 @@ class BaseInstallClass(object):
50 # Installing the Gentoo Base System
51 "mirrorselect",
52 "mirrorselect-sync",
53 + "profile"
54
55 # Configuring the Kernel
56 "timezone",
57
58 diff --git a/iw/profile_gui.py b/iw/profile_gui.py
59 new file mode 100644
60 index 0000000..79ed4a3
61 --- /dev/null
62 +++ b/iw/profile_gui.py
63 @@ -0,0 +1,64 @@
64 +#
65 +# profile_gui.py: gui profile selection.
66 +#
67 +# Copyright (C) 2011 wiktor w brodlo
68 +# Copyright (C) 2011 Gentoo Foundation
69 +#
70 +# This program is free software; you can redistribute it and/or modify
71 +# it under the terms of the GNU General Public License as published by
72 +# the Free Software Foundation; either version 2 of the License, or
73 +# (at your option) any later version.
74 +#
75 +# This program is distributed in the hope that it will be useful,
76 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
77 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78 +# GNU General Public License for more details.
79 +#
80 +# You should have received a copy of the GNU General Public License
81 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
82 +#
83 +
84 +import string
85 +import gtk
86 +import gtk.glade
87 +import gtk.gdk
88 +import gobject
89 +import pango
90 +import sys
91 +import gui
92 +import subprocess
93 +
94 +from iw_gui import *
95 +
96 +from constants import *
97 +import gettext
98 +_ = lambda x: gettext.ldgettext("anaconda", x)
99 +
100 +class ProfileWindow(InstallWindow):
101 + def getNext(self):
102 + return None
103 +
104 + def getScreen(self, anaconda):
105 + self.anaconda = anaconda
106 + self.intf = anaconda.intf
107 +
108 + (self.xml, self.align) = gui.getGladeWidget("profile.glade", "profile_align")
109 +
110 + out = subprocess.check_output(["eselect", "profile", "list"])
111 + lines = out.split("\n")
112 + del lines[0]
113 +
114 + profiles = []
115 + for line in lines:
116 + s = line.split()
117 + if s != []:
118 + profiles.append(s[1])
119 +
120 + box = self.xml.get_widget("profiles_box")
121 +
122 + for profile in profiles:
123 + cb = gtk.CheckButton(label=profile)
124 + box.pack_start(cb)
125 +
126 + return self.align
127 +
128
129 diff --git a/ui/profile.glade b/ui/profile.glade
130 index af75dce..c3125dc 100644
131 --- a/ui/profile.glade
132 +++ b/ui/profile.glade
133 @@ -19,11 +19,14 @@
134 <child>
135 <widget class="GtkLabel" id="label1">
136 <property name="visible">True</property>
137 + <property name="xalign">0</property>
138 + <property name="yalign">0</property>
139 <property name="label" translatable="yes">A profile is a building block for any Gentoo system. Not only does it specify default values for USE, CFLAGS and other important variables, it also locks the system to a certain range of package versions. This is all maintained by the Gentoo developers.
140 Note: The developer subprofile is specifically for Gentoo Linux development tasks. It is not meant to help set up general development environments.</property>
141 <property name="justify">center</property>
142 </widget>
143 <packing>
144 + <property name="expand">False</property>
145 <property name="position">0</property>
146 </packing>
147 </child>
148 @@ -34,12 +37,18 @@ Note: The developer subprofile is specifically for Gentoo Linux development task
149 <property name="hscrollbar_policy">automatic</property>
150 <property name="vscrollbar_policy">automatic</property>
151 <child>
152 - <widget class="GtkVBox" id="profiles_box">
153 + <widget class="GtkViewport" id="viewport1">
154 <property name="visible">True</property>
155 - <property name="orientation">vertical</property>
156 - <property name="homogeneous">True</property>
157 + <property name="resize_mode">queue</property>
158 <child>
159 - <placeholder/>
160 + <widget class="GtkVBox" id="profiles_box">
161 + <property name="visible">True</property>
162 + <property name="orientation">vertical</property>
163 + <property name="homogeneous">True</property>
164 + <child>
165 + <placeholder/>
166 + </child>
167 + </widget>
168 </child>
169 </widget>
170 </child>