~ubuntu-branches/ubuntu/wily/blueman/wily

« back to all changes in this revision

Viewing changes to blueman/gui/Dialogs.py

  • Committer: Package Import Robot
  • Author(s): Sean Davis
  • Date: 2015-09-07 12:48:18 UTC
  • mfrom: (2.3.11 sid)
  • Revision ID: package-import@ubuntu.com-20150907124818-evulc0mhjotz8q29
Tags: 2.0-1ubuntu1
* Merge from Debian unstable (LP: #1482626). Remaining changes:
  - debian/patches/03_filemanage_fix.patch:
    + Dropped, no longer needed.
  - debian/patches/dhcpclient_priority
  - debian/patches/01_dont_autostart_lxde.patch
    + Refreshed patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from __future__ import print_function
 
2
from __future__ import division
 
3
from __future__ import absolute_import
 
4
from __future__ import unicode_literals
 
5
 
 
6
from gi.repository import Gtk
 
7
 
 
8
class NetworkErrorDialog(Gtk.MessageDialog):
 
9
    def __init__(self, excp, secondary_markup=None):
 
10
        Gtk.MessageDialog.__init__(self, buttons=Gtk.ButtonsType.OK, type=Gtk.MessageType.ERROR)
 
11
 
 
12
        self.props.icon_name = "dialog.error"
 
13
        self.set_markup("<b>Failed to apply network settings</b>")
 
14
 
 
15
        if secondary_markup:
 
16
            self.format_secondary_markup(secondary_markup)
 
17
 
 
18
        self.message_box = self.get_message_area()
 
19
 
 
20
        label_expander = Gtk.Label()
 
21
        label_expander.set_markup("<b>Exception</b>")
 
22
 
 
23
        excp_label = Gtk.Label(str(excp))
 
24
        excp_label.props.selectable = True
 
25
 
 
26
        self.expander = Gtk.Expander()
 
27
        self.expander.set_label_widget(label_expander)
 
28
        self.expander.add(excp_label)
 
29
 
 
30
 
 
31
        self.message_box.pack_start(self.expander, False, False, 10)
 
32
        self.message_box.show_all()