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
=== modified file 'data/ui/dialogs.ui'
--- data/ui/dialogs.ui 2010-09-01 12:35:04 +0000
+++ data/ui/dialogs.ui 2010-09-09 20:07:42 +0000
@@ -1,4 +1,4 @@
1<?xml version="1.0"?>1<?xml version="1.0" encoding="UTF-8"?>
2<interface>2<interface>
3 <requires lib="gtk+" version="2.16"/>3 <requires lib="gtk+" version="2.16"/>
4 <!-- interface-naming-policy project-wide -->4 <!-- interface-naming-policy project-wide -->
@@ -262,7 +262,7 @@
262 <property name="modal">True</property>262 <property name="modal">True</property>
263 <property name="window_position">center</property>263 <property name="window_position">center</property>
264 <property name="type_hint">dialog</property>264 <property name="type_hint">dialog</property>
265 <property name="skip-taskbar-hint">True</property>265 <property name="skip_taskbar_hint">True</property>
266 <property name="has_separator">False</property>266 <property name="has_separator">False</property>
267 <child internal-child="vbox">267 <child internal-child="vbox">
268 <object class="GtkVBox" id="dialog-vbox6">268 <object class="GtkVBox" id="dialog-vbox6">
@@ -318,8 +318,8 @@
318 <property name="height_request">150</property>318 <property name="height_request">150</property>
319 <property name="visible">True</property>319 <property name="visible">True</property>
320 <property name="can_focus">True</property>320 <property name="can_focus">True</property>
321 <property name="hscrollbar_policy">never</property>
321 <property name="vscrollbar_policy">automatic</property>322 <property name="vscrollbar_policy">automatic</property>
322 <property name="hscrollbar_policy">never</property>
323 <child>323 <child>
324 <placeholder/>324 <placeholder/>
325 </child>325 </child>
@@ -346,8 +346,6 @@
346 </packing>346 </packing>
347 </child>347 </child>
348 <child internal-child="action_area">348 <child internal-child="action_area">
349 <!-- TODO: work out how to add extra padding to the right of the last
350 button //-->
351 <object class="GtkHButtonBox" id="dialog-action_area6">349 <object class="GtkHButtonBox" id="dialog-action_area6">
352 <property name="visible">True</property>350 <property name="visible">True</property>
353 <property name="layout_style">end</property>351 <property name="layout_style">end</property>
@@ -393,4 +391,132 @@
393 <action-widget response="-3">button_dependency_do</action-widget>391 <action-widget response="-3">button_dependency_do</action-widget>
394 </action-widgets>392 </action-widgets>
395 </object>393 </object>
394 <object class="GtkDialog" id="dialog_cache_error">
395 <property name="border_width">5</property>
396 <property name="title" translatable="yes"> </property>
397 <property name="modal">True</property>
398 <property name="window_position">center</property>
399 <property name="type_hint">normal</property>
400 <property name="skip_taskbar_hint">True</property>
401 <property name="has_separator">False</property>
402 <child internal-child="vbox">
403 <object class="GtkVBox" id="dialog-vbox8">
404 <property name="visible">True</property>
405 <property name="spacing">2</property>
406 <child>
407 <object class="GtkAlignment" id="alignment1">
408 <property name="visible">True</property>
409 <property name="top_padding">6</property>
410 <property name="bottom_padding">6</property>
411 <property name="left_padding">6</property>
412 <property name="right_padding">6</property>
413 <child>
414 <object class="GtkTable" id="table4">
415 <property name="visible">True</property>
416 <property name="n_rows">2</property>
417 <property name="n_columns">2</property>
418 <child>
419 <object class="GtkLabel" id="label_cache_error2">
420 <property name="visible">True</property>
421 <property name="xalign">0</property>
422 <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>
423 <property name="use_markup">True</property>
424 <property name="wrap">True</property>
425 </object>
426 <packing>
427 <property name="left_attach">1</property>
428 <property name="right_attach">2</property>
429 <property name="x_options"></property>
430 <property name="y_options">GTK_FILL</property>
431 <property name="x_padding">6</property>
432 <property name="y_padding">6</property>
433 </packing>
434 </child>
435 <child>
436 <object class="GtkImage" id="image_package_icon3">
437 <property name="visible">True</property>
438 <property name="pixel_size">48</property>
439 <property name="icon_name">softwarecenter</property>
440 </object>
441 <packing>
442 <property name="x_options"></property>
443 <property name="y_options">GTK_FILL</property>
444 <property name="x_padding">6</property>
445 <property name="y_padding">6</property>
446 </packing>
447 </child>
448 <child>
449 <object class="GtkLabel" id="label_cache_error">
450 <property name="visible">True</property>
451 <property name="xalign">0</property>
452 <property name="use_markup">True</property>
453 <property name="wrap">True</property>
454 </object>
455 <packing>
456 <property name="left_attach">1</property>
457 <property name="right_attach">2</property>
458 <property name="top_attach">1</property>
459 <property name="bottom_attach">2</property>
460 <property name="x_options">GTK_FILL</property>
461 <property name="y_options">GTK_FILL</property>
462 <property name="x_padding">6</property>
463 <property name="y_padding">6</property>
464 </packing>
465 </child>
466 <child>
467 <placeholder/>
468 </child>
469 </object>
470 </child>
471 </object>
472 <packing>
473 <property name="position">1</property>
474 </packing>
475 </child>
476 <child internal-child="action_area">
477 <object class="GtkHButtonBox" id="dialog-action_area8">
478 <property name="visible">True</property>
479 <property name="layout_style">end</property>
480 <child>
481 <object class="GtkButton" id="button_cancel">
482 <property name="label" translatable="yes">Cancel</property>
483 <property name="visible">True</property>
484 <property name="can_focus">True</property>
485 <property name="receives_default">True</property>
486 </object>
487 <packing>
488 <property name="expand">False</property>
489 <property name="fill">False</property>
490 <property name="position">0</property>
491 </packing>
492 </child>
493 <child>
494 <object class="GtkButton" id="button_change_channels">
495 <property name="label" translatable="yes">Change Software Channels...</property>
496 <property name="visible">True</property>
497 <property name="can_focus">True</property>
498 <property name="can_default">True</property>
499 <property name="has_default">True</property>
500 <property name="receives_default">True</property>
501 </object>
502 <packing>
503 <property name="expand">False</property>
504 <property name="fill">False</property>
505 <property name="position">1</property>
506 </packing>
507 </child>
508 </object>
509 <packing>
510 <property name="expand">False</property>
511 <property name="pack_type">end</property>
512 <property name="position">0</property>
513 </packing>
514 </child>
515 </object>
516 </child>
517 <action-widgets>
518 <action-widget response="-2">button_cancel</action-widget>
519 <action-widget response="-3">button_change_channels</action-widget>
520 </action-widgets>
521 </object>
396</interface>522</interface>
397523
=== modified file 'debian/changelog'
--- debian/changelog 2010-09-09 17:18:48 +0000
+++ debian/changelog 2010-09-09 20:07:42 +0000
@@ -1,3 +1,10 @@
1software-center (2.1.17.3) UNRELEASED; urgency=low
2
3 * Display a fatal error warning if the cache fails to open (LP:
4 #633626)
5
6 -- Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com> Thu, 09 Sep 2010 20:03:06 +0000
7
1software-center (2.1.17.2) maverick; urgency=low8software-center (2.1.17.2) maverick; urgency=low
29
3 * softwarecenter/backend/aptd.py:10 * softwarecenter/backend/aptd.py:
411
=== modified file 'softwarecenter/app.py'
--- softwarecenter/app.py 2010-09-08 16:41:23 +0000
+++ softwarecenter/app.py 2010-09-09 20:07:42 +0000
@@ -140,6 +140,7 @@
140 # a main iteration friendly apt cache140 # a main iteration friendly apt cache
141 self.cache = AptCache()141 self.cache = AptCache()
142 self.cache.connect("cache-broken", self._on_apt_cache_broken)142 self.cache.connect("cache-broken", self._on_apt_cache_broken)
143 self.cache.connect("cache-error", self._on_apt_cache_error)
143 self.backend = get_install_backend()144 self.backend = get_install_backend()
144 self.backend.connect("transaction-started", self._on_transaction_started)145 self.backend.connect("transaction-started", self._on_transaction_started)
145 self.backend.connect("transaction-finished", self._on_transaction_finished)146 self.backend.connect("transaction-finished", self._on_transaction_finished)
@@ -746,6 +747,14 @@
746747
747 def _on_apt_cache_broken(self, aptcache):748 def _on_apt_cache_broken(self, aptcache):
748 self._ask_and_repair_broken_cache()749 self._ask_and_repair_broken_cache()
750
751 def _on_apt_cache_error(self, aptcache, message):
752 if not view.dialogs.confirm_change_software_channels(self.datadir, message):
753 sys.exit(0)
754
755 # run software-properties-gtk
756 os.system("gksu --desktop /usr/share/applications/software-properties.desktop -- /usr/bin/software-properties-gtk -n --open-tab=1")
757 aptcache.open()
749758
750 def _on_transaction_started(self, backend):759 def _on_transaction_started(self, backend):
751 self.menuitem_install.set_sensitive(False)760 self.menuitem_install.set_sensitive(False)
752761
=== modified file 'softwarecenter/apt/aptcache.py'
--- softwarecenter/apt/aptcache.py 2010-09-08 16:41:23 +0000
+++ softwarecenter/apt/aptcache.py 2010-09-09 20:07:42 +0000
@@ -70,6 +70,9 @@
70 'cache-broken':(gobject.SIGNAL_RUN_FIRST,70 'cache-broken':(gobject.SIGNAL_RUN_FIRST,
71 gobject.TYPE_NONE,71 gobject.TYPE_NONE,
72 ()),72 ()),
73 'cache-error': (gobject.SIGNAL_RUN_FIRST,
74 gobject.TYPE_NONE,
75 (gobject.TYPE_STRING,)),
73 }76 }
7477
75 def __init__(self):78 def __init__(self):
@@ -101,7 +104,11 @@
101 self._ready = False104 self._ready = False
102 self.emit("cache-invalid")105 self.emit("cache-invalid")
103 if self._cache == None:106 if self._cache == None:
104 self._cache = apt.Cache(GtkMainIterationProgress())107 try:
108 self._cache = apt.Cache(GtkMainIterationProgress())
109 except SystemError, e:
110 self.emit("cache-error", str(e))
111 return
105 else:112 else:
106 self._cache.open(GtkMainIterationProgress())113 self._cache.open(GtkMainIterationProgress())
107 self._ready = True114 self._ready = True
108115
=== modified file 'softwarecenter/view/dialogs.py'
--- softwarecenter/view/dialogs.py 2010-09-08 16:41:23 +0000
+++ softwarecenter/view/dialogs.py 2010-09-09 20:07:42 +0000
@@ -46,6 +46,20 @@
46 return True46 return True
47 return False47 return False
4848
49def confirm_change_software_channels(datadir, message):
50 glade_dialog = SimpleGtkbuilderDialog(datadir)
51 dialog = glade_dialog.dialog_cache_error
52 dialog.set_default_size(380, -1)
53 glade_dialog.label_cache_error.set_text(_("The error message was: %s") % message)
54
55 result = dialog.run()
56 dialog.destroy()
57 while gtk.events_pending():
58 gtk.main_iteration()
59 if result == gtk.RESPONSE_ACCEPT:
60 return True
61 return False
62
49class DetailsMessageDialog(gtk.MessageDialog):63class DetailsMessageDialog(gtk.MessageDialog):
50 """Message dialog with optional details expander"""64 """Message dialog with optional details expander"""
51 def __init__(self,65 def __init__(self,

Subscribers

People subscribed via source and target branches