File: plugin.xml

package info (click to toggle)
sight 25.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,252 kB
  • sloc: cpp: 310,629; xml: 17,622; ansic: 9,960; python: 1,379; sh: 144; makefile: 33
file content (227 lines) | stat: -rw-r--r-- 9,785 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!--
This example shows how to display notifications popups.

Mode 1: Using notifier service (recommanded) and 'notified' signal from base
connected to notifier slots 'pop'.

Mode 2: Standalone by calling directly the notification dialog inside your service (see display_test_notifications.cpp)
this mode is not recommanded since each service can pop notification without any knowlegde of how many notifications
are already displayed and where they are displayed on screen.

-->
<plugin id="ex_notifications" library="true">
    <requirement id="sight::module::service" />
    <requirement id="sight::module::ui::qt" />
    <requirement id="sight::module::ui" />

    <extension implements="sight::service::extension::factory">
        <type>sight::ui::action</type>
        <service>ex_notifications::display_test_notifications</service>
        <object>sight::data::object</object>
    </extension>

    <extension implements="sight::app::extension::config">
        <id>ex_notifications_AppCfg</id>
        <config>
            <!-- ******************************* UI declaration *********************************** -->

            <service uid="mainFrame" type="sight::module::ui::frame">
                <gui>
                    <frame>
                        <name>ex_notifications</name>
                        <icon>ex_notifications/app.ico</icon>
                        <min_size width="800" height="600" />
                    </frame>
                    <toolbar />
                </gui>
                <registry>
                    <toolbar sid="toolbarView" />
                    <view sid="mainview" />
                </registry>
            </service>

            <service uid="toolbarView" type="sight::module::ui::toolbar">
                <gui>
                    <layout>
                        <editor />
                        <editor />
                        <editor />
                        <editor />
                        <editor />
                        <editor />
                        <editor />
                        <separator />
                        <menuItem name="NOTIFY" />
                        <menuItem name="Close CHANNEL1" />
                        <spacer />
                        <separator />
                        <menuItem name="Color Theme" />
                    </layout>
                </gui>
                <registry>
                    <editor sid="useNotifierAct" />
                    <editor sid="maxChar" />
                    <editor sid="useSound" />
                    <editor sid="durationAct" />
                    <editor sid="typeAct" />
                    <editor sid="positionAct" />
                    <editor sid="channelAct" />
                    <menuItem sid="notifyAct" />
                    <menuItem sid="closeAct" />
                    <menuItem sid="changeThemeAct" />
                </registry>
            </service>

            <service uid="mainview" type="sight::module::ui::view">
                <gui>
                    <layout type="sight::ui::layout::line">
                        <orientation value="vertical" />
                    </layout>
                </gui>
            </service>

            <!-- ************************************* Action ************************************ -->

            <service uid="useNotifierAct" type="sight::module::ui::qt::parameters">
                <parameters>
                    <param type="bool" name="Use notifier to centralize." key="usenotifier" defaultValue="true" />
                </parameters>
            </service>

            <service uid="maxChar" type="sight::module::ui::qt::parameters">
                <parameters>
                    <param type="bool" name="Reach max. characters" key="reachMaxCharacters" defaultValue="false" />
                </parameters>
            </service>

            <service uid="useSound" type="sight::module::ui::qt::parameters">
                <parameters>
                    <param type="bool" name="Sound" key="sound" defaultValue="false" />
                </parameters>
            </service>

            <service uid="durationAct" type="sight::module::ui::qt::parameters">
                <parameters>
                    <param type="enum" name="Duration" key="duration" defaultValue="3000" values="3000,1000,infinite" />
                </parameters>
            </service>

            <service uid="typeAct" type="sight::module::ui::qt::parameters">
                <parameters>
                    <param type="enum" name="Type" key="type" defaultValue="INFO" values="INFO,SUCCESS,FAILURE" />
                </parameters>
            </service>

            <service uid="positionAct" type="sight::module::ui::qt::parameters">
                <parameters>
                    <param type="enum" name="Position" key="position" defaultValue="TOP_RIGHT" values="ALL,TOP_LEFT,TOP_RIGHT,CENTERED_TOP,CENTERED,BOTTOM_LEFT,BOTTOM_RIGHT,CENTERED_BOTTOM" />
                </parameters>
            </service>

            <service uid="channelAct" type="sight::module::ui::qt::parameters">
                <parameters>
                    <param type="enum" name="Channel" key="channel" defaultValue="GLOBAL" values="GLOBAL,CHANNEL1,CHANNEL2" />
                </parameters>
            </service>

            <service uid="notifyAct" type="sight::module::ui::action" />

            <service uid="closeAct" type="sight::module::ui::action" />

            <!-- preference to apply new theme on app -->
            <service uid="changeThemeAct" type="sight::module::ui::qt::preferences_configuration">
                <preference>
                    <type>combobox</type>
                    <name>Color Theme</name>
                    <key>THEME</key>
                    <values>DEFAULT,FLATDARK</values>
                    <default_value>FLATDARK</default_value>
                </preference>
            </service>

            <!-- ******************************* Services ******************************* -->

            <!-- Dummy service only used to test notifications -->
            <service uid="testNotifierSrv" type="ex_notifications::display_test_notifications">
                <notification>
                    <channel key="CHANNEL1" uid="CHANNEL1" />
                    <channel key="CHANNEL2" uid="CHANNEL2" />
                </notification>
            </service>

            <!-- notifier listen to all the connected service & display queued notification at the same place (here TOP_RIGHT)-->
            <service uid="notifierSrv" type="sight::module::ui::qt::notifier">
                <!-- Parent container where notifications will be displayed, use the xmlattr uid hack to generate the generic_uid prefix of "maview" -->
                <parent uid="mainview" />
                <!-- Default message printed if empty string is emitted in notify* signals -->
                <message>Default Message</message>
                <channels>
                    <!-- Channel without uid configures default for all notification. It can be changed using enumParameters -->
                    <channel position="TOP_RIGHT" duration="3000" max="3" size="200x60" />
                    <!-- CHANNEL2 configuration is fixd here. It cannot be changed -->
                    <channel uid="CHANNEL2" position="TOP_LEFT" duration="5000" max="3" size="800x120" closable="false" />
                </channels>
            </service>

            <service uid="qt_style_changer_srv" type="sight::module::ui::qt::style_selector" />

            <!-- ******************************* Connections ***************************************** -->

            <!-- connection from base notify signals to the notifier,you can add as many service as you need -->
            <connect>
                <signal>testNotifierSrv/notified</signal>
                <slot>notifierSrv/pop</slot>
            </connect>

            <connect>
                <signal>testNotifierSrv/notification_closed</signal>
                <slot>notifierSrv/close_notification</slot>
            </connect>

            <!-- Others connections -->
            <connect>
                <signal>positionAct/enum_changed</signal>
                <slot>testNotifierSrv/set_enum_parameter</slot>
                <slot>notifierSrv/set_enum_parameter</slot>
            </connect>

            <connect>
                <signal>durationAct/enum_changed</signal>
                <slot>testNotifierSrv/set_enum_parameter</slot>
                <slot>notifierSrv/set_enum_parameter</slot>
            </connect>

            <connect>
                <signal>typeAct/enum_changed</signal>
                <slot>testNotifierSrv/set_enum_parameter</slot>
            </connect>

            <connect>
                <signal>channelAct/enum_changed</signal>
                <slot>testNotifierSrv/set_enum_parameter</slot>
            </connect>

            <connect>
                <signal>useNotifierAct/bool_changed</signal>
                <signal>maxChar/bool_changed</signal>
                <signal>useSound/bool_changed</signal>
                <slot>testNotifierSrv/set_bool_parameter</slot>
            </connect>

            <connect>
                <signal>changeThemeAct/parameters_modified</signal>
                <slot>qt_style_changer_srv/update_from_preferences</slot>
            </connect>

            <connect>
                <signal>notifyAct/clicked</signal>
                <slot>testNotifierSrv/update</slot>
            </connect>

            <connect>
                <signal>closeAct/clicked</signal>
                <slot>testNotifierSrv/close_channel1</slot>
            </connect>
        </config>
    </extension>
</plugin>