-
-
diff --git a/mugshot/MugshotWindow.py b/mugshot/MugshotWindow.py
index 39dee76..3dad648 100644
--- a/mugshot/MugshotWindow.py
+++ b/mugshot/MugshotWindow.py
@@ -28,7 +28,6 @@ logger = logging.getLogger('mugshot')
from mugshot_lib import Window
from mugshot.AboutMugshotDialog import AboutMugshotDialog
-from mugshot.PreferencesMugshotDialog import PreferencesMugshotDialog
username = os.getenv('USER')
if not username:
@@ -77,7 +76,6 @@ class MugshotWindow(Window):
super(MugshotWindow, self).finish_initializing(builder)
self.AboutDialog = AboutMugshotDialog
- self.PreferencesDialog = PreferencesMugshotDialog
# User Image widgets
self.image_button = builder.get_object('image_button')
diff --git a/mugshot/PreferencesMugshotDialog.py b/mugshot/PreferencesMugshotDialog.py
deleted file mode 100644
index e116d2e..0000000
--- a/mugshot/PreferencesMugshotDialog.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
-### BEGIN LICENSE
-# Copyright (C) 2013 Sean Davis
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3, as published
-# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranties of
-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see .
-### END LICENSE
-
-# This is your preferences dialog.
-#
-# Define your preferences in
-# data/glib-2.0/schemas/net.launchpad.mugshot.gschema.xml
-# See http://developer.gnome.org/gio/stable/GSettings.html for more info.
-
-from gi.repository import Gio # pylint: disable=E0611
-
-from locale import gettext as _
-
-import logging
-logger = logging.getLogger('mugshot')
-
-from mugshot_lib.PreferencesDialog import PreferencesDialog
-
-class PreferencesMugshotDialog(PreferencesDialog):
- __gtype_name__ = "PreferencesMugshotDialog"
-
- def finish_initializing(self, builder): # pylint: disable=E1002
- """Set up the preferences dialog"""
- super(PreferencesMugshotDialog, self).finish_initializing(builder)
-
- # Bind each preference widget to gsettings
- settings = Gio.Settings("net.launchpad.mugshot")
- widget = self.builder.get_object('example_entry')
- settings.bind("example", widget, "text", Gio.SettingsBindFlags.DEFAULT)
-
- # Code for other initialization actions should be added here.
diff --git a/mugshot_lib/PreferencesDialog.py b/mugshot_lib/PreferencesDialog.py
deleted file mode 100644
index e5da5bc..0000000
--- a/mugshot_lib/PreferencesDialog.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
-### BEGIN LICENSE
-# Copyright (C) 2013 Sean Davis
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3, as published
-# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranties of
-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see .
-### END LICENSE
-
-### DO NOT EDIT THIS FILE ###
-
-"""this dialog adjusts values in gsettings
-"""
-
-from gi.repository import Gtk # pylint: disable=E0611
-import logging
-logger = logging.getLogger('mugshot_lib')
-
-from . helpers import get_builder, show_uri, get_help_uri
-
-class PreferencesDialog(Gtk.Dialog):
- __gtype_name__ = "PreferencesDialog"
-
- def __new__(cls):
- """Special static method that's automatically called by Python when
- constructing a new instance of this class.
-
- Returns a fully instantiated PreferencesDialog object.
- """
- builder = get_builder('PreferencesMugshotDialog')
- new_object = builder.get_object("preferences_mugshot_dialog")
- new_object.finish_initializing(builder)
- return new_object
-
- def finish_initializing(self, builder):
- """Called while initializing this instance in __new__
-
- finish_initalizing should be called after parsing the ui definition
- and creating a PreferencesDialog object with it in order to
- finish initializing the start of the new PerferencesMugshotDialog
- instance.
-
- Put your initialization code in here and leave __init__ undefined.
- """
-
- # Get a reference to the builder and set up the signals.
- self.builder = builder
- self.ui = builder.get_ui(self, True)
-
- # code for other initialization actions should be added here
-
- def on_btn_close_clicked(self, widget, data=None):
- self.destroy()
-
- def on_btn_help_clicked(self, widget, data=None):
- show_uri(self, "ghelp:%s" % get_help_uri('preferences'))
-
diff --git a/mugshot_lib/Window.py b/mugshot_lib/Window.py
index 60e65b6..58cba3f 100644
--- a/mugshot_lib/Window.py
+++ b/mugshot_lib/Window.py
@@ -58,8 +58,6 @@ class Window(Gtk.Window):
# Get a reference to the builder and set up the signals.
self.builder = builder
self.ui = builder.get_ui(self, True)
- self.PreferencesDialog = None # class
- self.preferences_dialog = None # instance
self.AboutDialog = None # class
self.settings = Gio.Settings("apps.mugshot")
@@ -88,24 +86,6 @@ class Window(Gtk.Window):
response = about.run()
about.destroy()
- def on_mnu_preferences_activate(self, widget, data=None):
- """Display the preferences window for mugshot."""
-
- """ From the PyGTK Reference manual
- Say for example the preferences dialog is currently open,
- and the user chooses Preferences from the menu a second time;
- use the present() method to move the already-open dialog
- where the user can see it."""
- if self.preferences_dialog is not None:
- logger.debug('show existing preferences_dialog')
- self.preferences_dialog.present()
- elif self.PreferencesDialog is not None:
- logger.debug('create new preferences_dialog')
- self.preferences_dialog = self.PreferencesDialog() # pylint: disable=E1102
- self.preferences_dialog.connect('destroy', self.on_preferences_dialog_destroyed)
- self.preferences_dialog.show()
- # destroy command moved into dialog to allow for a help button
-
def on_mnu_close_activate(self, widget, data=None):
"""Signal handler for closing the MugshotWindow."""
self.destroy()
@@ -118,12 +98,3 @@ class Window(Gtk.Window):
def on_preferences_changed(self, settings, key, data=None):
logger.debug('preference changed: %s = %s' % (key, str(settings.get_value(key))))
- def on_preferences_dialog_destroyed(self, widget, data=None):
- '''only affects gui
-
- logically there is no difference between the user closing,
- minimising or ignoring the preferences dialog'''
- logger.debug('on_preferences_dialog_destroyed')
- # to determine whether to create or present preferences_dialog
- self.preferences_dialog = None
-