python-gi fixes

This commit is contained in:
Sean Davis 2014-01-25 17:44:45 -05:00
parent 527fa8cf4c
commit a1691007b0
4 changed files with 6 additions and 4 deletions

View File

@ -22,6 +22,7 @@ import logging
logger = logging.getLogger('mugshot')
from gi.repository import Gtk, GObject, Gst, GdkPixbuf
from gi.repository import GdkX11, GstVideo # lint:ok
import cairo
import tempfile

View File

@ -133,7 +133,8 @@ def get_confirmation_dialog(parent, primary_message, secondary_message,
icon_name=None):
"""Display a confirmation (yes/no) dialog configured with primary and
secondary messages, as well as a custom icon if requested."""
dialog = Gtk.MessageDialog(parent, flags=0, type=Gtk.MessageType.QUESTION,
dialog = Gtk.MessageDialog(transient_for=parent, flags=0,
type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.YES_NO,
message_format=primary_message)
dialog.format_secondary_text(secondary_message)

View File

@ -64,7 +64,7 @@ class Window(Gtk.Window):
self.CameraDialog = None # class
self.camera_dialog = None # instance
self.settings = Gio.Settings("apps.mugshot")
self.settings = Gio.Settings.new("apps.mugshot")
self.settings.connect('changed', self.on_preferences_changed)
def on_help_activate(self, widget, data=None):