OSG_Mugshot_fork/mugshot_lib/CameraDialog.py

62 lines
2.3 KiB
Python
Raw Normal View History

2014-01-25 23:13:56 +00:00
#!/usr/bin/python3
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2014-01-25 23:13:56 +00:00
# Mugshot - Lightweight user configuration utility
# Copyright (C) 2013-2015 Sean Davis <smd.seandavis@gmail.com>
2014-01-25 22:21:53 +00:00
#
2014-01-25 23:13:56 +00:00
# This program is free software: you can redistribute it and/or modify it
2014-07-28 00:07:47 +00:00
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
2014-07-28 00:07:47 +00:00
# (at your option) any later version.
2014-01-25 22:21:53 +00:00
#
2014-01-25 23:13:56 +00:00
# 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 <http://www.gnu.org/licenses/>.
2014-01-25 22:21:53 +00:00
from gi.repository import Gtk # pylint: disable=E0611
import logging
logger = logging.getLogger('mugshot_lib')
2014-01-25 23:31:53 +00:00
from . helpers import get_builder
2014-01-25 22:21:53 +00:00
class CameraDialog(Gtk.Dialog):
2015-09-01 02:31:02 +00:00
2014-01-25 22:21:53 +00:00
"""Camera Dialog"""
__gtype_name__ = "CameraDialog"
def __new__(cls):
2014-01-25 22:21:53 +00:00
"""Special static method that's automatically called by Python when
constructing a new instance of this class.
2014-01-25 22:21:53 +00:00
Returns a fully instantiated PreferencesDialog object.
"""
builder = get_builder('CameraMugshotDialog')
new_object = builder.get_object("camera_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.
2014-01-25 22:21:53 +00:00
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):
2014-01-25 22:21:53 +00:00
"""Destroy the dialog when closed."""
self.destroy()