/+junk/brz-gtk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/brz-gtk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from breezy import ui
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

class GtkUI (ui.UIFactory):
  def __init__(self):
    super (GtkUI, self).__init__()
  
  def __enter__ (self):
    Gtk.init ()
    return self
  
  def confirm_action (self, prompt, confirmation_id, prompt_kwargs):
    dialog = Gtk.MessageDialog (
      flags=0,
      message_type=Gtk.MessageType.INFO,
      buttons=Gtk.Buttons.YES_NO,
      text = 'Breezy',
    )
    dialog.format_secondary_text (prompt)
    response = dialog.run ()
    dialog.destroy ()
    if (response == Gtk.ResponseType.YES):
      return True
    else:
      return False