示例#1
0
    def hide_app(self, empty=False):
        """
        Hide the current application in this window

        :param bool empty: if ``True``, do not add the default launcher application
        """
        self.application_box.hide()
        if self.current_app:
            if self.current_app.app_name != 'launcher':
                self.application_actions[
                    self.current_app.app_name].set_visible(True)
            inventory_bar = getattr(self.current_app, 'inventory_bar', None)
            if inventory_bar:
                inventory_bar.hide()
            if self.current_app.search:
                self.current_app.search.save_columns()
            self.current_app.deactivate()
            if self._help_ui:
                self.uimanager.remove_ui(self._help_ui)
                self._help_ui = None
            self.current_widget.destroy()

            StopApplicationEvent.emit(self.current_app.app_name,
                                      self.current_app)
            self.current_app = None

        self._empty_message_area()
        for item in self.tool_items:
            item.destroy()
        self.tool_items = []
        self._update_toggle_actions('launcher')

        if not empty:
            self.run_application(app_name=u'launcher')
示例#2
0
    def hide_app(self, empty=False):
        """
        Hide the current application in this window

        :param bool empty: if ``True``, do not add the default launcher application
        """
        self.application_box.hide()
        if self.current_app:
            inventory_bar = getattr(self.current_app, "inventory_bar", None)
            if inventory_bar:
                inventory_bar.hide()
            if self.current_app.search:
                self.current_app.search.save_columns()
            self.current_app.deactivate()
            if self._help_ui:
                self.uimanager.remove_ui(self._help_ui)
                self._help_ui = None
            self.current_widget.destroy()

            StopApplicationEvent.emit(self.current_app.app_name, self.current_app)
            self.current_app = None

        self._empty_message_area()
        for item in self.tool_items:
            item.destroy()
        self.tool_items = []
        self._update_toggle_actions("launcher")

        if not empty:
            self.run_application(app_name=u"launcher")
示例#3
0
文件: ecfui.py 项目: LeonamSilva/stoq
    def __init__(self):
        self._ui = None
        self.default_store = get_default_store()
        self._printer_verified = False
        # Delay printer creation until we are accessing pos or till app. Other
        # applications should still be accessible without a printer
        self._printer = None

        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale)
        TillOpenEvent.connect(self._on_TillOpen)
        TillCloseEvent.connect(self._on_TillClose)
        TillAddCashEvent.connect(self._on_TillAddCash)
        TillAddTillEntryEvent.connect(self._on_AddTillEntry)
        TillRemoveCashEvent.connect(self._on_TillRemoveCash)
        StartApplicationEvent.connect(self._on_StartApplicationEvent)
        StopApplicationEvent.connect(self._on_StopApplicationEvent)
        CouponCreatedEvent.connect(self._on_CouponCreatedEvent)
        GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent)
        GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent)
        CheckECFStateEvent.connect(self._on_CheckECFStateEvent)
        HasPendingReduceZ.connect(self._on_HasPendingReduceZ)
        HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent)

        self._till_summarize_action = gtk.Action(
            'Summary', _('Summary'), None, None)
        self._till_summarize_action.connect(
            'activate', self._on_TillSummary__activate)

        add_bindings([
            ('plugin.ecf.read_memory', '<Primary>F9'),
            ('plugin.ecf.summarize', '<Primary>F11'),
        ])
示例#4
0
    def __init__(self):
        self._ui = None
        self.default_store = get_default_store()
        self._printer_verified = False
        # Delay printer creation until we are accessing pos or till app. Other
        # applications should still be accessible without a printer
        self._printer = None

        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale)
        TillOpenEvent.connect(self._on_TillOpen)
        TillCloseEvent.connect(self._on_TillClose)
        TillAddCashEvent.connect(self._on_TillAddCash)
        TillAddTillEntryEvent.connect(self._on_AddTillEntry)
        TillRemoveCashEvent.connect(self._on_TillRemoveCash)
        StartApplicationEvent.connect(self._on_StartApplicationEvent)
        StopApplicationEvent.connect(self._on_StopApplicationEvent)
        CouponCreatedEvent.connect(self._on_CouponCreatedEvent)
        GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent)
        GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent)
        CheckECFStateEvent.connect(self._on_CheckECFStateEvent)
        HasPendingReduceZ.connect(self._on_HasPendingReduceZ)
        HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent)

        self._till_summarize_action = gtk.Action('Summary', _('Summary'), None,
                                                 None)
        self._till_summarize_action.connect('activate',
                                            self._on_TillSummary__activate)

        add_bindings([
            ('plugin.ecf.read_memory', '<Primary>F9'),
            ('plugin.ecf.summarize', '<Primary>F11'),
        ])
示例#5
0
文件: opticalui.py 项目: tmaxter/stoq
 def __init__(self):
     self._ui = None
     self.default_store = get_default_store()
     StartApplicationEvent.connect(self._on_StartApplicationEvent)
     StopApplicationEvent.connect(self._on_StopApplicationEvent)
     EditorSlaveCreateEvent.connect(self._on_EditorSlaveCreateEvent)
     add_bindings([
         ('plugin.optical.pre_sale', ''),
     ])
示例#6
0
 def __init__(self):
     self._ui = None
     self.default_store = get_default_store()
     StartApplicationEvent.connect(self._on_StartApplicationEvent)
     StopApplicationEvent.connect(self._on_StopApplicationEvent)
     EditorSlaveCreateEvent.connect(self._on_EditorSlaveCreateEvent)
     add_bindings([
         ('plugin.books.search_books', '<Primary><Alt>B'),
         ('plugin.books.search_publishers', '<Primary><Alt>P'),
     ])
示例#7
0
 def __init__(self):
     self._ui = None
     self.default_store = get_default_store()
     StartApplicationEvent.connect(self._on_StartApplicationEvent)
     StopApplicationEvent.connect(self._on_StopApplicationEvent)
     EditorSlaveCreateEvent.connect(self._on_EditorSlaveCreateEvent)
     add_bindings([
         ('plugin.books.search_books', '<Primary><Alt>B'),
         ('plugin.books.search_publishers', '<Primary><Alt>P'),
     ])
示例#8
0
 def __init__(self):
     self._ui = None
     self.default_store = get_default_store()
     StartApplicationEvent.connect(self._on_StartApplicationEvent)
     StopApplicationEvent.connect(self._on_StopApplicationEvent)
     EditorCreateEvent.connect(self._on_EditorCreateEvent)
     RunDialogEvent.connect(self._on_RunDialogEvent)
     add_bindings([
         ('plugin.optical.pre_sale', ''),
         ('plugin.optical.search_medics', ''),
     ])
示例#9
0
 def _setup_events(self):
     SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
     SaleAvoidCancelEvent.connect(self._on_SaleAvoidCancel)
     TillOpenEvent.connect(self._on_TillOpen)
     TillCloseEvent.connect(self._on_TillClose)
     TillAddCashEvent.connect(self._on_TillAddCash)
     TillAddTillEntryEvent.connect(self._on_AddTillEntry)
     TillRemoveCashEvent.connect(self._on_TillRemoveCash)
     StartApplicationEvent.connect(self._on_StartApplicationEvent)
     StopApplicationEvent.connect(self._on_StopApplicationEvent)
     CouponCreatedEvent.connect(self._on_CouponCreatedEvent)
     GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent)
     GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent)
     CheckECFStateEvent.connect(self._on_CheckECFStateEvent)
     HasPendingReduceZ.connect(self._on_HasPendingReduceZ)
     HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent)
     EditorCreateEvent.connect(self._on_EditorCreateEvent)
示例#10
0
    def __init__(self):
        # This will contain a mapping of (appname, uimanager) -> extra_ui
        # We need to store that like this because each windows has it's unique
        # uimanager, and we have an extra_ui for different apps
        self._app_ui = dict()

        self.default_store = get_default_store()
        StartApplicationEvent.connect(self._on_StartApplicationEvent)
        StopApplicationEvent.connect(self._on_StopApplicationEvent)
        EditorCreateEvent.connect(self._on_EditorCreateEvent)
        RunDialogEvent.connect(self._on_RunDialogEvent)
        PrintReportEvent.connect(self._on_PrintReportEvent)
        SearchDialogSetupSearchEvent.connect(self._on_SearchDialogSetupSearchEvent)
        ApplicationSetupSearchEvent.connect(self._on_ApplicationSetupSearchEvent)

        add_bindings([
            ('plugin.optical.pre_sale', ''),
            ('plugin.optical.search_medics', ''),
        ])
示例#11
0
    def __init__(self):
        # This will contain a mapping of (appname, uimanager) -> extra_ui
        # We need to store that like this because each windows has it's unique
        # uimanager, and we have an extra_ui for different apps
        self._app_ui = dict()

        self.default_store = get_default_store()
        StartApplicationEvent.connect(self._on_StartApplicationEvent)
        StopApplicationEvent.connect(self._on_StopApplicationEvent)
        EditorCreateEvent.connect(self._on_EditorCreateEvent)
        RunDialogEvent.connect(self._on_RunDialogEvent)
        PrintReportEvent.connect(self._on_PrintReportEvent)
        SearchDialogSetupSearchEvent.connect(
            self._on_SearchDialogSetupSearchEvent)
        ApplicationSetupSearchEvent.connect(
            self._on_ApplicationSetupSearchEvent)

        add_bindings([
            ('plugin.optical.pre_sale', ''),
            ('plugin.optical.search_medics', ''),
        ])
示例#12
0
    def hide_app(self, empty=False):
        """
        Hide the current application in this window

        :param bool empty: if ``True``, do not add the default launcher application
        """
        self.application_box.hide()
        # Reset menus/headerbar
        self.main_menu.remove_all()
        self.search_menu.remove_all()
        self.new_menu.remove_all()

        if self.current_app:
            inventory_bar = getattr(self.current_app, 'inventory_bar', None)
            if inventory_bar:
                inventory_bar.hide()
            if self.current_app.search:
                self.current_app.search.save_columns()
            self.current_app.deactivate()

            # We need to remove the accels for this app, otherwise they would
            # still be active from other applications
            for spec in self._action_specs.values():
                fullname, icon, label, accel = spec[:-1]
                if accel:
                    self.app.set_accels_for_action(fullname, [])

            if self._help_section:
                self.help_section.remove(0)
                self._help_section = None
            self.current_widget.destroy()

            StopApplicationEvent.emit(self.current_app.app_name,
                                      self.current_app)
            self.current_app = None

        self._empty_message_area()
        if not empty:
            self.run_application(app_name=u'launcher')
示例#13
0
    def hide_app(self, empty=False):
        """
        Hide the current application in this window

        :param bool empty: if ``True``, do not add the default launcher application
        """
        self.application_box.hide()
        # Reset menus/headerbar
        self.main_menu.remove_all()
        self.search_menu.remove_all()
        self.new_menu.remove_all()

        if self.current_app:
            inventory_bar = getattr(self.current_app, 'inventory_bar', None)
            if inventory_bar:
                inventory_bar.hide()
            if self.current_app.search:
                self.current_app.search.save_columns()
            self.current_app.deactivate()

            # We need to remove the accels for this app, otherwise they would
            # still be active from other applications
            for spec in self._action_specs.values():
                fullname, icon, label, accel = spec[:-1]
                if accel:
                    self.app.set_accels_for_action(fullname, [])

            if self._help_section:
                self.help_section.remove(0)
                self._help_section = None
            self.current_widget.destroy()

            StopApplicationEvent.emit(self.current_app.app_name,
                                      self.current_app)
            self.current_app = None

        self._empty_message_area()
        if not empty:
            self.run_application(app_name=u'launcher')