Merge lp:~ilidrissi.amine/software-center/ignore-malformed-source into lp:software-center

Proposed by Mohamed Amine Ilidrissi
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~ilidrissi.amine/software-center/ignore-malformed-source
Merge into: lp:software-center
Diff against target: 264 lines (+169/-6)
5 files modified
data/ui/dialogs.ui (+131/-5)
debian/changelog (+7/-0)
softwarecenter/app.py (+9/-0)
softwarecenter/apt/aptcache.py (+8/-1)
softwarecenter/view/dialogs.py (+14/-0)
To merge this branch: bzr merge lp:~ilidrissi.amine/software-center/ignore-malformed-source
Reviewer Review Type Date Requested Status
dobey Needs Fixing
Review via email: mp+35033@code.launchpad.net
To post a comment you must log in.
1141. By Mohamed Amine Ilidrissi

merge with trunk

Revision history for this message
dobey (dobey) wrote :

Can you please update to work against trunk? Thanks.

review: Needs Fixing

Unmerged revisions

1141. By Mohamed Amine Ilidrissi

merge with trunk

1140. By Mohamed Amine Ilidrissi

Added a button to open software-properties-gtk

1139. By Mohamed Amine Ilidrissi

Display a fatal error warning if the cache fails to open (LP:
#633626)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/ui/dialogs.ui'
2--- data/ui/dialogs.ui 2010-09-01 12:35:04 +0000
3+++ data/ui/dialogs.ui 2010-09-09 20:07:42 +0000
4@@ -1,4 +1,4 @@
5-<?xml version="1.0"?>
6+<?xml version="1.0" encoding="UTF-8"?>
7 <interface>
8 <requires lib="gtk+" version="2.16"/>
9 <!-- interface-naming-policy project-wide -->
10@@ -262,7 +262,7 @@
11 <property name="modal">True</property>
12 <property name="window_position">center</property>
13 <property name="type_hint">dialog</property>
14- <property name="skip-taskbar-hint">True</property>
15+ <property name="skip_taskbar_hint">True</property>
16 <property name="has_separator">False</property>
17 <child internal-child="vbox">
18 <object class="GtkVBox" id="dialog-vbox6">
19@@ -318,8 +318,8 @@
20 <property name="height_request">150</property>
21 <property name="visible">True</property>
22 <property name="can_focus">True</property>
23+ <property name="hscrollbar_policy">never</property>
24 <property name="vscrollbar_policy">automatic</property>
25- <property name="hscrollbar_policy">never</property>
26 <child>
27 <placeholder/>
28 </child>
29@@ -346,8 +346,6 @@
30 </packing>
31 </child>
32 <child internal-child="action_area">
33- <!-- TODO: work out how to add extra padding to the right of the last
34- button //-->
35 <object class="GtkHButtonBox" id="dialog-action_area6">
36 <property name="visible">True</property>
37 <property name="layout_style">end</property>
38@@ -393,4 +391,132 @@
39 <action-widget response="-3">button_dependency_do</action-widget>
40 </action-widgets>
41 </object>
42+ <object class="GtkDialog" id="dialog_cache_error">
43+ <property name="border_width">5</property>
44+ <property name="title" translatable="yes"> </property>
45+ <property name="modal">True</property>
46+ <property name="window_position">center</property>
47+ <property name="type_hint">normal</property>
48+ <property name="skip_taskbar_hint">True</property>
49+ <property name="has_separator">False</property>
50+ <child internal-child="vbox">
51+ <object class="GtkVBox" id="dialog-vbox8">
52+ <property name="visible">True</property>
53+ <property name="spacing">2</property>
54+ <child>
55+ <object class="GtkAlignment" id="alignment1">
56+ <property name="visible">True</property>
57+ <property name="top_padding">6</property>
58+ <property name="bottom_padding">6</property>
59+ <property name="left_padding">6</property>
60+ <property name="right_padding">6</property>
61+ <child>
62+ <object class="GtkTable" id="table4">
63+ <property name="visible">True</property>
64+ <property name="n_rows">2</property>
65+ <property name="n_columns">2</property>
66+ <child>
67+ <object class="GtkLabel" id="label_cache_error2">
68+ <property name="visible">True</property>
69+ <property name="xalign">0</property>
70+ <property name="label" translatable="yes">&lt;span weight="bold" font_size="large"&gt;Ubuntu Software Center cannot start because some software channel settings are incorrect. Do you want to fix them now?&lt;/span&gt;</property>
71+ <property name="use_markup">True</property>
72+ <property name="wrap">True</property>
73+ </object>
74+ <packing>
75+ <property name="left_attach">1</property>
76+ <property name="right_attach">2</property>
77+ <property name="x_options"></property>
78+ <property name="y_options">GTK_FILL</property>
79+ <property name="x_padding">6</property>
80+ <property name="y_padding">6</property>
81+ </packing>
82+ </child>
83+ <child>
84+ <object class="GtkImage" id="image_package_icon3">
85+ <property name="visible">True</property>
86+ <property name="pixel_size">48</property>
87+ <property name="icon_name">softwarecenter</property>
88+ </object>
89+ <packing>
90+ <property name="x_options"></property>
91+ <property name="y_options">GTK_FILL</property>
92+ <property name="x_padding">6</property>
93+ <property name="y_padding">6</property>
94+ </packing>
95+ </child>
96+ <child>
97+ <object class="GtkLabel" id="label_cache_error">
98+ <property name="visible">True</property>
99+ <property name="xalign">0</property>
100+ <property name="use_markup">True</property>
101+ <property name="wrap">True</property>
102+ </object>
103+ <packing>
104+ <property name="left_attach">1</property>
105+ <property name="right_attach">2</property>
106+ <property name="top_attach">1</property>
107+ <property name="bottom_attach">2</property>
108+ <property name="x_options">GTK_FILL</property>
109+ <property name="y_options">GTK_FILL</property>
110+ <property name="x_padding">6</property>
111+ <property name="y_padding">6</property>
112+ </packing>
113+ </child>
114+ <child>
115+ <placeholder/>
116+ </child>
117+ </object>
118+ </child>
119+ </object>
120+ <packing>
121+ <property name="position">1</property>
122+ </packing>
123+ </child>
124+ <child internal-child="action_area">
125+ <object class="GtkHButtonBox" id="dialog-action_area8">
126+ <property name="visible">True</property>
127+ <property name="layout_style">end</property>
128+ <child>
129+ <object class="GtkButton" id="button_cancel">
130+ <property name="label" translatable="yes">Cancel</property>
131+ <property name="visible">True</property>
132+ <property name="can_focus">True</property>
133+ <property name="receives_default">True</property>
134+ </object>
135+ <packing>
136+ <property name="expand">False</property>
137+ <property name="fill">False</property>
138+ <property name="position">0</property>
139+ </packing>
140+ </child>
141+ <child>
142+ <object class="GtkButton" id="button_change_channels">
143+ <property name="label" translatable="yes">Change Software Channels...</property>
144+ <property name="visible">True</property>
145+ <property name="can_focus">True</property>
146+ <property name="can_default">True</property>
147+ <property name="has_default">True</property>
148+ <property name="receives_default">True</property>
149+ </object>
150+ <packing>
151+ <property name="expand">False</property>
152+ <property name="fill">False</property>
153+ <property name="position">1</property>
154+ </packing>
155+ </child>
156+ </object>
157+ <packing>
158+ <property name="expand">False</property>
159+ <property name="pack_type">end</property>
160+ <property name="position">0</property>
161+ </packing>
162+ </child>
163+ </object>
164+ </child>
165+ <action-widgets>
166+ <action-widget response="-2">button_cancel</action-widget>
167+ <action-widget response="-3">button_change_channels</action-widget>
168+ </action-widgets>
169+ </object>
170 </interface>
171
172=== modified file 'debian/changelog'
173--- debian/changelog 2010-09-09 17:18:48 +0000
174+++ debian/changelog 2010-09-09 20:07:42 +0000
175@@ -1,3 +1,10 @@
176+software-center (2.1.17.3) UNRELEASED; urgency=low
177+
178+ * Display a fatal error warning if the cache fails to open (LP:
179+ #633626)
180+
181+ -- Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com> Thu, 09 Sep 2010 20:03:06 +0000
182+
183 software-center (2.1.17.2) maverick; urgency=low
184
185 * softwarecenter/backend/aptd.py:
186
187=== modified file 'softwarecenter/app.py'
188--- softwarecenter/app.py 2010-09-08 16:41:23 +0000
189+++ softwarecenter/app.py 2010-09-09 20:07:42 +0000
190@@ -140,6 +140,7 @@
191 # a main iteration friendly apt cache
192 self.cache = AptCache()
193 self.cache.connect("cache-broken", self._on_apt_cache_broken)
194+ self.cache.connect("cache-error", self._on_apt_cache_error)
195 self.backend = get_install_backend()
196 self.backend.connect("transaction-started", self._on_transaction_started)
197 self.backend.connect("transaction-finished", self._on_transaction_finished)
198@@ -746,6 +747,14 @@
199
200 def _on_apt_cache_broken(self, aptcache):
201 self._ask_and_repair_broken_cache()
202+
203+ def _on_apt_cache_error(self, aptcache, message):
204+ if not view.dialogs.confirm_change_software_channels(self.datadir, message):
205+ sys.exit(0)
206+
207+ # run software-properties-gtk
208+ os.system("gksu --desktop /usr/share/applications/software-properties.desktop -- /usr/bin/software-properties-gtk -n --open-tab=1")
209+ aptcache.open()
210
211 def _on_transaction_started(self, backend):
212 self.menuitem_install.set_sensitive(False)
213
214=== modified file 'softwarecenter/apt/aptcache.py'
215--- softwarecenter/apt/aptcache.py 2010-09-08 16:41:23 +0000
216+++ softwarecenter/apt/aptcache.py 2010-09-09 20:07:42 +0000
217@@ -70,6 +70,9 @@
218 'cache-broken':(gobject.SIGNAL_RUN_FIRST,
219 gobject.TYPE_NONE,
220 ()),
221+ 'cache-error': (gobject.SIGNAL_RUN_FIRST,
222+ gobject.TYPE_NONE,
223+ (gobject.TYPE_STRING,)),
224 }
225
226 def __init__(self):
227@@ -101,7 +104,11 @@
228 self._ready = False
229 self.emit("cache-invalid")
230 if self._cache == None:
231- self._cache = apt.Cache(GtkMainIterationProgress())
232+ try:
233+ self._cache = apt.Cache(GtkMainIterationProgress())
234+ except SystemError, e:
235+ self.emit("cache-error", str(e))
236+ return
237 else:
238 self._cache.open(GtkMainIterationProgress())
239 self._ready = True
240
241=== modified file 'softwarecenter/view/dialogs.py'
242--- softwarecenter/view/dialogs.py 2010-09-08 16:41:23 +0000
243+++ softwarecenter/view/dialogs.py 2010-09-09 20:07:42 +0000
244@@ -46,6 +46,20 @@
245 return True
246 return False
247
248+def confirm_change_software_channels(datadir, message):
249+ glade_dialog = SimpleGtkbuilderDialog(datadir)
250+ dialog = glade_dialog.dialog_cache_error
251+ dialog.set_default_size(380, -1)
252+ glade_dialog.label_cache_error.set_text(_("The error message was: %s") % message)
253+
254+ result = dialog.run()
255+ dialog.destroy()
256+ while gtk.events_pending():
257+ gtk.main_iteration()
258+ if result == gtk.RESPONSE_ACCEPT:
259+ return True
260+ return False
261+
262 class DetailsMessageDialog(gtk.MessageDialog):
263 """Message dialog with optional details expander"""
264 def __init__(self,

Subscribers

People subscribed via source and target branches