# Path: coverart_browser_prefs.py
# class CoverLocale:
#     '''
#     This class manages the locale
#     '''
#     # storage for the instance reference
#     __instance = None
# 
#     class __impl:
#         """ Implementation of the singleton interface """
#         # below public variables and methods that can be called for CoverLocale
#         def __init__(self):
#             '''
#             Initializes the singleton interface, assigning all the constants
#             used to access the plugin's settings.
#             '''
#             self.Locale = self._enum(
#                 RB='rhythmbox',
#                 LOCALE_DOMAIN='coverart_browser')
# 
#         def switch_locale(self, locale_type):
#             '''
#             Change the locale
#             '''
#             locale.setlocale(locale.LC_ALL, '')
#             locale.bindtextdomain(locale_type, RB.locale_dir())
#             locale.textdomain(locale_type)
#             gettext.bindtextdomain(locale_type, RB.locale_dir())
#             gettext.textdomain(locale_type)
#             gettext.install(locale_type)
# 
#         def get_locale(self):
#             '''
#             return the string representation of the users locale
#             for example
#             en_US
#             '''
#             return locale.getdefaultlocale()[0]
# 
#         def _enum(self, **enums):
#             '''
#             Create an enumn.
#             '''
#             return type('Enum', (), enums)
# 
#     def __init__(self):
#         """ Create singleton instance """
#         # Check whether we already have an instance
#         if CoverLocale.__instance is None:
#             # Create and remember instance
#             CoverLocale.__instance = CoverLocale.__impl()
# 
#         # Store instance reference as the only member in the handle
#         self.__dict__['_CoverLocale__instance'] = CoverLocale.__instance
# 
#     def __getattr__(self, attr):
#         """ Delegate access to implementation """
#         return getattr(self.__instance, attr)
# 
#     def __setattr__(self, attr, value):
#         """ Delegate access to implementation """
#         return setattr(self.__instance, attr, value)


from gi.repository import Gtk
from gi.repository import GdkPixbuf
from gi.repository import GObject
from coverart_browser_prefs import CoverLocale
import rb
# MERCHANTABILITY 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, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.




class CoverWindow(GObject.Object):
    """Shows the cover in a simple image viewer"""

    # signals
    __gsignals__ = {
        'close-window': (GObject.SIGNAL_RUN_LAST, None, ())
    }

    def __init__(self, plugin, parent, savedir=None):
        """Initializes and shows the cover

        :param plugin: source
        :type plugin: RBSource
        :param parent: Parent window to attach to
        :type parent: Gtk.Window
        :param savedir: Initial directory for the Save As functionality
        :type savedir: basestring
        """

        super(CoverWindow, self).__init__()

# Path: coverart_browser_prefs.py
# class CoverLocale:
#     '''
#     This class manages the locale
#     '''
#     # storage for the instance reference
#     __instance = None
# 
#     class __impl:
#         """ Implementation of the singleton interface """
#         # below public variables and methods that can be called for CoverLocale
#         def __init__(self):
#             '''
#             Initializes the singleton interface, assigning all the constants
#             used to access the plugin's settings.
#             '''
#             self.Locale = self._enum(
#                 RB='rhythmbox',
#                 LOCALE_DOMAIN='coverart_browser')
# 
#         def switch_locale(self, locale_type):
#             '''
#             Change the locale
#             '''
#             locale.setlocale(locale.LC_ALL, '')
#             locale.bindtextdomain(locale_type, RB.locale_dir())
#             locale.textdomain(locale_type)
#             gettext.bindtextdomain(locale_type, RB.locale_dir())
#             gettext.textdomain(locale_type)
#             gettext.install(locale_type)
# 
#         def get_locale(self):
#             '''
#             return the string representation of the users locale
#             for example
#             en_US
#             '''
#             return locale.getdefaultlocale()[0]
# 
#         def _enum(self, **enums):
#             '''
#             Create an enumn.
#             '''
#             return type('Enum', (), enums)
# 
#     def __init__(self):
#         """ Create singleton instance """
#         # Check whether we already have an instance
#         if CoverLocale.__instance is None:
#             # Create and remember instance
#             CoverLocale.__instance = CoverLocale.__impl()
# 
#         # Store instance reference as the only member in the handle
#         self.__dict__['_CoverLocale__instance'] = CoverLocale.__instance
# 
#     def __getattr__(self, attr):
#         """ Delegate access to implementation """
#         return getattr(self.__instance, attr)
# 
#     def __setattr__(self, attr, value):
#         """ Delegate access to implementation """
#         return setattr(self.__instance, attr, value)


# Path: coverart_window.py
from gi.repository import Gtk
from gi.repository import GdkPixbuf
from gi.repository import GObject
from coverart_browser_prefs import CoverLocale
import rb

# MERCHANTABILITY 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, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.




class CoverWindow(GObject.Object):
    """Shows the cover in a simple image viewer"""

    # signals
    __gsignals__ = {
        'close-window': (GObject.SIGNAL_RUN_LAST, None, ())
    }

    def __init__(self, plugin, parent, savedir=None):
        """Initializes and shows the cover

        :param plugin: source
        :type plugin: RBSource
        :param parent: Parent window to attach to
        :type parent: Gtk.Window
        :param savedir: Initial directory for the Save As functionality
        :type savedir: basestring
        """

        super(CoverWindow, self).__init__()

        cl = CoverLocale()