コード例 #1
0
ファイル: page.py プロジェクト: hpcgam/dicomimport
    def __init__(self, application):
        """
        Constructs the PageController.
        """
        self.application = application
        Controller.__init__(self, application.get_null_page_model())

        status_controller = application.get_status_controller()
        self.status_context = status_controller.get_context_id(self.__class__.__name__)

        application.get_preferences_model().register_observer(self)

        self.log = logging.getLogger(self.__class__.__name__)

        # The preview pixbuf is cached so it can be rerendered without
        # reapplying zoom transformations.
        self.preview_pixbuf = None

        # Non persistent settings that apply to all scanned pages
        self.preview_width = 0
        self.preview_height = 0
        self.preview_zoom = 1.0
        self.preview_is_best_fit = False

        self.preview_zoom_rect_color = gtk.gdk.colormap_get_system().alloc_color(
            gtk.gdk.Color(65535, 0, 0), False, True
        )

        # Reusable temp vars to hold the start point of a mouse drag action.
        self.zoom_drag_start_x = 0
        self.zoom_drag_start_y = 0
        self.move_drag_start_x = 0
        self.move_drag_start_y = 0

        self.log.debug("Created.")
コード例 #2
0
ファイル: status.py プロジェクト: HughP/nostaples
    def __init__(self, application):
        """
        Constructs the StatusController.
        """
        self.application = application
        Controller.__init__(self, application.get_status_model())

        self.log = logging.getLogger(self.__class__.__name__)
        self.log.debug('Created.')
コード例 #3
0
ファイル: save.py プロジェクト: HughP/nostaples
    def __init__(self, application):
        """
        Constructs the SaveController.
        """
        self.application = application
        Controller.__init__(self, application.get_save_model())
        
        status_controller = application.get_status_controller()
        self.status_context = \
            status_controller.get_context_id(self.__class__.__name__)

        self.log = logging.getLogger(self.__class__.__name__)
        self.log.debug('Created.')
コード例 #4
0
ファイル: about.py プロジェクト: HughP/nostaples
    def __init__(self, application):
        """
        Constructs the AboutController.
        
        Note that About has no model, an empty model is
        passed to the super constructor to avoid assertion
        failures later on.
        """
        self.application = application
        Controller.__init__(self, Model())

        self.log = logging.getLogger(self.__class__.__name__)
        self.log.debug('Created.')
コード例 #5
0
ファイル: main.py プロジェクト: HughP/nostaples
 def __init__(self, application):
     """
     Constructs the MainController, as well as necessary sub-controllers 
     and services.
     """
     self.application = application
     Controller.__init__(self, application.get_main_model())
     
     application.get_document_model().register_observer(self)
     application.get_preferences_model().register_observer(self)
     
     status_controller = application.get_status_controller()
     self.status_context = \
         status_controller.get_context_id(self.__class__.__name__)
     
     self.log = logging.getLogger(self.__class__.__name__)
     self.log.debug('Created.')
コード例 #6
0
ファイル: preferences.py プロジェクト: HughP/nostaples
 def __init__(self, application):
     """
     Constructs the PreferencesController.
     """
     self.application = application
     Controller.__init__(self, application.get_preferences_model())
     
     application.get_main_model().register_observer(self)
     
     # Setup GConf observer for system-wide toolbar settings
     self.gconf_client = gconf.client_get_default()
     self.gconf_client.add_dir(
         '/desktop/gnome/interface', gconf.CLIENT_PRELOAD_NONE)
     self.gconf_client.notify_add(
         '/desktop/gnome/interface/toolbar_style', 
         self.on_default_toolbar_style_changed)
     
     self.log = logging.getLogger(self.__class__.__name__)
     self.log.debug('Created.')
コード例 #7
0
ファイル: document.py プロジェクト: HughP/nostaples
    def __init__(self, application):
        """
        Constructs the DocumentsController, as well as necessary
        sub-controllers.
        """
        self.application = application
        Controller.__init__(self, application.get_document_model())
        
        preferences_model = application.get_preferences_model()
        preferences_model.register_observer(self)
        
        status_controller = application.get_status_controller()
        self.status_context = \
            status_controller.get_context_id(self.__class__.__name__)
        
        application.get_document_model().connect(
          'row-changed', self.on_document_model_row_changed)

        self.log = logging.getLogger(self.__class__.__name__)
        self.log.debug('Created.')