Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
30692536
by wurstsalat at 2020-08-12T16:55:44+02:00
9 changed files:
- − gajim/data/gui/change_mood_dialog.ui
- − gajim/data/gui/change_status_message_dialog.ui
- gajim/data/gui/change_activity_dialog.ui → gajim/data/gui/status_change_window.ui
- gajim/dialogs.py
- gajim/gtk/const.py
- gajim/gtk/dialogs.py
- + gajim/gtk/status_change.py
- gajim/gtk/status_selector.py
- gajim/roster_window.py
Changes:
| 1 |
-<?xml version="1.0" encoding="UTF-8"?>
|
|
| 2 |
-<!-- Generated with glade 3.18.3 -->
|
|
| 3 |
-<interface>
|
|
| 4 |
- <requires lib="gtk+" version="3.12"/>
|
|
| 5 |
- <object class="GtkDialog" id="change_mood_dialog">
|
|
| 6 |
- <property name="can_focus">False</property>
|
|
| 7 |
- <property name="border_width">6</property>
|
|
| 8 |
- <property name="default_width">270</property>
|
|
| 9 |
- <property name="type_hint">dialog</property>
|
|
| 10 |
- <child internal-child="vbox">
|
|
| 11 |
- <object class="GtkBox" id="dialog-vbox5">
|
|
| 12 |
- <property name="visible">True</property>
|
|
| 13 |
- <property name="can_focus">False</property>
|
|
| 14 |
- <property name="orientation">vertical</property>
|
|
| 15 |
- <property name="spacing">6</property>
|
|
| 16 |
- <child internal-child="action_area">
|
|
| 17 |
- <object class="GtkButtonBox" id="dialog-action_area">
|
|
| 18 |
- <property name="visible">True</property>
|
|
| 19 |
- <property name="can_focus">False</property>
|
|
| 20 |
- <property name="layout_style">end</property>
|
|
| 21 |
- <child>
|
|
| 22 |
- <object class="GtkButton" id="cancel_button">
|
|
| 23 |
- <property name="label">gtk-cancel</property>
|
|
| 24 |
- <property name="visible">True</property>
|
|
| 25 |
- <property name="can_focus">True</property>
|
|
| 26 |
- <property name="can_default">True</property>
|
|
| 27 |
- <property name="receives_default">False</property>
|
|
| 28 |
- <property name="use_stock">True</property>
|
|
| 29 |
- <signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
|
|
| 30 |
- </object>
|
|
| 31 |
- <packing>
|
|
| 32 |
- <property name="expand">False</property>
|
|
| 33 |
- <property name="fill">False</property>
|
|
| 34 |
- <property name="position">0</property>
|
|
| 35 |
- </packing>
|
|
| 36 |
- </child>
|
|
| 37 |
- <child>
|
|
| 38 |
- <object class="GtkButton" id="ok_button">
|
|
| 39 |
- <property name="label">gtk-ok</property>
|
|
| 40 |
- <property name="visible">True</property>
|
|
| 41 |
- <property name="can_focus">True</property>
|
|
| 42 |
- <property name="can_default">True</property>
|
|
| 43 |
- <property name="has_default">True</property>
|
|
| 44 |
- <property name="receives_default">False</property>
|
|
| 45 |
- <property name="use_stock">True</property>
|
|
| 46 |
- <signal name="clicked" handler="on_ok_button_clicked" swapped="no"/>
|
|
| 47 |
- </object>
|
|
| 48 |
- <packing>
|
|
| 49 |
- <property name="expand">False</property>
|
|
| 50 |
- <property name="fill">False</property>
|
|
| 51 |
- <property name="position">1</property>
|
|
| 52 |
- </packing>
|
|
| 53 |
- </child>
|
|
| 54 |
- </object>
|
|
| 55 |
- <packing>
|
|
| 56 |
- <property name="expand">False</property>
|
|
| 57 |
- <property name="fill">False</property>
|
|
| 58 |
- <property name="pack_type">end</property>
|
|
| 59 |
- <property name="position">0</property>
|
|
| 60 |
- </packing>
|
|
| 61 |
- </child>
|
|
| 62 |
- <child>
|
|
| 63 |
- <object class="GtkGrid" id="grid1">
|
|
| 64 |
- <property name="visible">True</property>
|
|
| 65 |
- <property name="can_focus">False</property>
|
|
| 66 |
- <property name="hexpand">True</property>
|
|
| 67 |
- <property name="row_spacing">6</property>
|
|
| 68 |
- <property name="column_spacing">6</property>
|
|
| 69 |
- <child>
|
|
| 70 |
- <object class="GtkLabel" id="label">
|
|
| 71 |
- <property name="visible">True</property>
|
|
| 72 |
- <property name="can_focus">False</property>
|
|
| 73 |
- <property name="label" translatable="yes"><b>Mood:</b></property>
|
|
| 74 |
- <property name="use_markup">True</property>
|
|
| 75 |
- </object>
|
|
| 76 |
- <packing>
|
|
| 77 |
- <property name="left_attach">0</property>
|
|
| 78 |
- <property name="top_attach">1</property>
|
|
| 79 |
- </packing>
|
|
| 80 |
- </child>
|
|
| 81 |
- <child>
|
|
| 82 |
- <object class="GtkLabel" id="label2">
|
|
| 83 |
- <property name="visible">True</property>
|
|
| 84 |
- <property name="can_focus">False</property>
|
|
| 85 |
- <property name="label" translatable="yes"><b>Message:</b></property>
|
|
| 86 |
- <property name="use_markup">True</property>
|
|
| 87 |
- </object>
|
|
| 88 |
- <packing>
|
|
| 89 |
- <property name="left_attach">0</property>
|
|
| 90 |
- <property name="top_attach">2</property>
|
|
| 91 |
- </packing>
|
|
| 92 |
- </child>
|
|
| 93 |
- <child>
|
|
| 94 |
- <object class="GtkLabel" id="mood_label">
|
|
| 95 |
- <property name="visible">True</property>
|
|
| 96 |
- <property name="can_focus">False</property>
|
|
| 97 |
- <property name="xalign">0</property>
|
|
| 98 |
- <property name="label" translatable="yes">None</property>
|
|
| 99 |
- </object>
|
|
| 100 |
- <packing>
|
|
| 101 |
- <property name="left_attach">1</property>
|
|
| 102 |
- <property name="top_attach">1</property>
|
|
| 103 |
- </packing>
|
|
| 104 |
- </child>
|
|
| 105 |
- <child>
|
|
| 106 |
- <object class="GtkEntry" id="description_entry">
|
|
| 107 |
- <property name="visible">True</property>
|
|
| 108 |
- <property name="can_focus">True</property>
|
|
| 109 |
- <property name="hexpand">True</property>
|
|
| 110 |
- </object>
|
|
| 111 |
- <packing>
|
|
| 112 |
- <property name="left_attach">1</property>
|
|
| 113 |
- <property name="top_attach">2</property>
|
|
| 114 |
- </packing>
|
|
| 115 |
- </child>
|
|
| 116 |
- <child>
|
|
| 117 |
- <object class="GtkGrid" id="mood_icons_table">
|
|
| 118 |
- <property name="visible">True</property>
|
|
| 119 |
- <property name="can_focus">False</property>
|
|
| 120 |
- <property name="hexpand">True</property>
|
|
| 121 |
- <child>
|
|
| 122 |
- <object class="GtkRadioButton" id="no_mood_button">
|
|
| 123 |
- <property name="visible">True</property>
|
|
| 124 |
- <property name="can_focus">True</property>
|
|
| 125 |
- <property name="receives_default">False</property>
|
|
| 126 |
- <property name="relief">none</property>
|
|
| 127 |
- <property name="xalign">0.5</property>
|
|
| 128 |
- <property name="draw_indicator">False</property>
|
|
| 129 |
- <child>
|
|
| 130 |
- <object class="GtkImage" id="image1">
|
|
| 131 |
- <property name="visible">True</property>
|
|
| 132 |
- <property name="can_focus">False</property>
|
|
| 133 |
- <property name="stock">gtk-cancel</property>
|
|
| 134 |
- <property name="icon_size">1</property>
|
|
| 135 |
- </object>
|
|
| 136 |
- </child>
|
|
| 137 |
- </object>
|
|
| 138 |
- <packing>
|
|
| 139 |
- <property name="left_attach">0</property>
|
|
| 140 |
- <property name="top_attach">0</property>
|
|
| 141 |
- </packing>
|
|
| 142 |
- </child>
|
|
| 143 |
- <child>
|
|
| 144 |
- <placeholder/>
|
|
| 145 |
- </child>
|
|
| 146 |
- <child>
|
|
| 147 |
- <placeholder/>
|
|
| 148 |
- </child>
|
|
| 149 |
- <child>
|
|
| 150 |
- <placeholder/>
|
|
| 151 |
- </child>
|
|
| 152 |
- <child>
|
|
| 153 |
- <placeholder/>
|
|
| 154 |
- </child>
|
|
| 155 |
- <child>
|
|
| 156 |
- <placeholder/>
|
|
| 157 |
- </child>
|
|
| 158 |
- <child>
|
|
| 159 |
- <placeholder/>
|
|
| 160 |
- </child>
|
|
| 161 |
- <child>
|
|
| 162 |
- <placeholder/>
|
|
| 163 |
- </child>
|
|
| 164 |
- <child>
|
|
| 165 |
- <placeholder/>
|
|
| 166 |
- </child>
|
|
| 167 |
- <child>
|
|
| 168 |
- <placeholder/>
|
|
| 169 |
- </child>
|
|
| 170 |
- <child>
|
|
| 171 |
- <placeholder/>
|
|
| 172 |
- </child>
|
|
| 173 |
- <child>
|
|
| 174 |
- <placeholder/>
|
|
| 175 |
- </child>
|
|
| 176 |
- <child>
|
|
| 177 |
- <placeholder/>
|
|
| 178 |
- </child>
|
|
| 179 |
- <child>
|
|
| 180 |
- <placeholder/>
|
|
| 181 |
- </child>
|
|
| 182 |
- <child>
|
|
| 183 |
- <placeholder/>
|
|
| 184 |
- </child>
|
|
| 185 |
- <child>
|
|
| 186 |
- <placeholder/>
|
|
| 187 |
- </child>
|
|
| 188 |
- <child>
|
|
| 189 |
- <placeholder/>
|
|
| 190 |
- </child>
|
|
| 191 |
- <child>
|
|
| 192 |
- <placeholder/>
|
|
| 193 |
- </child>
|
|
| 194 |
- <child>
|
|
| 195 |
- <placeholder/>
|
|
| 196 |
- </child>
|
|
| 197 |
- <child>
|
|
| 198 |
- <placeholder/>
|
|
| 199 |
- </child>
|
|
| 200 |
- <child>
|
|
| 201 |
- <placeholder/>
|
|
| 202 |
- </child>
|
|
| 203 |
- <child>
|
|
| 204 |
- <placeholder/>
|
|
| 205 |
- </child>
|
|
| 206 |
- <child>
|
|
| 207 |
- <placeholder/>
|
|
| 208 |
- </child>
|
|
| 209 |
- <child>
|
|
| 210 |
- <placeholder/>
|
|
| 211 |
- </child>
|
|
| 212 |
- <child>
|
|
| 213 |
- <placeholder/>
|
|
| 214 |
- </child>
|
|
| 215 |
- <child>
|
|
| 216 |
- <placeholder/>
|
|
| 217 |
- </child>
|
|
| 218 |
- <child>
|
|
| 219 |
- <placeholder/>
|
|
| 220 |
- </child>
|
|
| 221 |
- <child>
|
|
| 222 |
- <placeholder/>
|
|
| 223 |
- </child>
|
|
| 224 |
- <child>
|
|
| 225 |
- <placeholder/>
|
|
| 226 |
- </child>
|
|
| 227 |
- <child>
|
|
| 228 |
- <placeholder/>
|
|
| 229 |
- </child>
|
|
| 230 |
- <child>
|
|
| 231 |
- <placeholder/>
|
|
| 232 |
- </child>
|
|
| 233 |
- <child>
|
|
| 234 |
- <placeholder/>
|
|
| 235 |
- </child>
|
|
| 236 |
- <child>
|
|
| 237 |
- <placeholder/>
|
|
| 238 |
- </child>
|
|
| 239 |
- <child>
|
|
| 240 |
- <placeholder/>
|
|
| 241 |
- </child>
|
|
| 242 |
- <child>
|
|
| 243 |
- <placeholder/>
|
|
| 244 |
- </child>
|
|
| 245 |
- <child>
|
|
| 246 |
- <placeholder/>
|
|
| 247 |
- </child>
|
|
| 248 |
- <child>
|
|
| 249 |
- <placeholder/>
|
|
| 250 |
- </child>
|
|
| 251 |
- <child>
|
|
| 252 |
- <placeholder/>
|
|
| 253 |
- </child>
|
|
| 254 |
- <child>
|
|
| 255 |
- <placeholder/>
|
|
| 256 |
- </child>
|
|
| 257 |
- <child>
|
|
| 258 |
- <placeholder/>
|
|
| 259 |
- </child>
|
|
| 260 |
- <child>
|
|
| 261 |
- <placeholder/>
|
|
| 262 |
- </child>
|
|
| 263 |
- <child>
|
|
| 264 |
- <placeholder/>
|
|
| 265 |
- </child>
|
|
| 266 |
- <child>
|
|
| 267 |
- <placeholder/>
|
|
| 268 |
- </child>
|
|
| 269 |
- <child>
|
|
| 270 |
- <placeholder/>
|
|
| 271 |
- </child>
|
|
| 272 |
- <child>
|
|
| 273 |
- <placeholder/>
|
|
| 274 |
- </child>
|
|
| 275 |
- <child>
|
|
| 276 |
- <placeholder/>
|
|
| 277 |
- </child>
|
|
| 278 |
- <child>
|
|
| 279 |
- <placeholder/>
|
|
| 280 |
- </child>
|
|
| 281 |
- <child>
|
|
| 282 |
- <placeholder/>
|
|
| 283 |
- </child>
|
|
| 284 |
- <child>
|
|
| 285 |
- <placeholder/>
|
|
| 286 |
- </child>
|
|
| 287 |
- <child>
|
|
| 288 |
- <placeholder/>
|
|
| 289 |
- </child>
|
|
| 290 |
- <child>
|
|
| 291 |
- <placeholder/>
|
|
| 292 |
- </child>
|
|
| 293 |
- <child>
|
|
| 294 |
- <placeholder/>
|
|
| 295 |
- </child>
|
|
| 296 |
- <child>
|
|
| 297 |
- <placeholder/>
|
|
| 298 |
- </child>
|
|
| 299 |
- <child>
|
|
| 300 |
- <placeholder/>
|
|
| 301 |
- </child>
|
|
| 302 |
- <child>
|
|
| 303 |
- <placeholder/>
|
|
| 304 |
- </child>
|
|
| 305 |
- <child>
|
|
| 306 |
- <placeholder/>
|
|
| 307 |
- </child>
|
|
| 308 |
- <child>
|
|
| 309 |
- <placeholder/>
|
|
| 310 |
- </child>
|
|
| 311 |
- <child>
|
|
| 312 |
- <placeholder/>
|
|
| 313 |
- </child>
|
|
| 314 |
- <child>
|
|
| 315 |
- <placeholder/>
|
|
| 316 |
- </child>
|
|
| 317 |
- <child>
|
|
| 318 |
- <placeholder/>
|
|
| 319 |
- </child>
|
|
| 320 |
- <child>
|
|
| 321 |
- <placeholder/>
|
|
| 322 |
- </child>
|
|
| 323 |
- <child>
|
|
| 324 |
- <placeholder/>
|
|
| 325 |
- </child>
|
|
| 326 |
- <child>
|
|
| 327 |
- <placeholder/>
|
|
| 328 |
- </child>
|
|
| 329 |
- <child>
|
|
| 330 |
- <placeholder/>
|
|
| 331 |
- </child>
|
|
| 332 |
- <child>
|
|
| 333 |
- <placeholder/>
|
|
| 334 |
- </child>
|
|
| 335 |
- <child>
|
|
| 336 |
- <placeholder/>
|
|
| 337 |
- </child>
|
|
| 338 |
- </object>
|
|
| 339 |
- <packing>
|
|
| 340 |
- <property name="left_attach">0</property>
|
|
| 341 |
- <property name="top_attach">0</property>
|
|
| 342 |
- <property name="width">2</property>
|
|
| 343 |
- </packing>
|
|
| 344 |
- </child>
|
|
| 345 |
- </object>
|
|
| 346 |
- <packing>
|
|
| 347 |
- <property name="expand">False</property>
|
|
| 348 |
- <property name="fill">True</property>
|
|
| 349 |
- <property name="position">0</property>
|
|
| 350 |
- </packing>
|
|
| 351 |
- </child>
|
|
| 352 |
- </object>
|
|
| 353 |
- </child>
|
|
| 354 |
- <action-widgets>
|
|
| 355 |
- <action-widget response="-6">cancel_button</action-widget>
|
|
| 356 |
- <action-widget response="-5">ok_button</action-widget>
|
|
| 357 |
- </action-widgets>
|
|
| 358 |
- </object>
|
|
| 359 |
-</interface>
|
| 1 |
-<?xml version="1.0" encoding="UTF-8"?>
|
|
| 2 |
-<!-- Generated with glade 3.22.1 -->
|
|
| 3 |
-<interface>
|
|
| 4 |
- <requires lib="gtk+" version="3.18"/>
|
|
| 5 |
- <object class="GtkDialog" id="change_status_message_dialog">
|
|
| 6 |
- <property name="can_focus">False</property>
|
|
| 7 |
- <property name="border_width">18</property>
|
|
| 8 |
- <property name="default_width">270</property>
|
|
| 9 |
- <property name="default_height">330</property>
|
|
| 10 |
- <property name="type_hint">dialog</property>
|
|
| 11 |
- <signal name="key-press-event" handler="on_change_status_message_dialog_key_press_event" swapped="no"/>
|
|
| 12 |
- <child>
|
|
| 13 |
- <placeholder/>
|
|
| 14 |
- </child>
|
|
| 15 |
- <child internal-child="vbox">
|
|
| 16 |
- <object class="GtkBox">
|
|
| 17 |
- <property name="visible">True</property>
|
|
| 18 |
- <property name="can_focus">False</property>
|
|
| 19 |
- <property name="orientation">vertical</property>
|
|
| 20 |
- <property name="spacing">12</property>
|
|
| 21 |
- <child internal-child="action_area">
|
|
| 22 |
- <object class="GtkButtonBox" id="dialog-action_area">
|
|
| 23 |
- <property name="visible">True</property>
|
|
| 24 |
- <property name="can_focus">False</property>
|
|
| 25 |
- <property name="margin_top">6</property>
|
|
| 26 |
- <property name="layout_style">end</property>
|
|
| 27 |
- <child>
|
|
| 28 |
- <object class="GtkButton" id="cancel_button">
|
|
| 29 |
- <property name="label">gtk-cancel</property>
|
|
| 30 |
- <property name="visible">True</property>
|
|
| 31 |
- <property name="can_focus">True</property>
|
|
| 32 |
- <property name="can_default">True</property>
|
|
| 33 |
- <property name="receives_default">False</property>
|
|
| 34 |
- <property name="use_stock">True</property>
|
|
| 35 |
- </object>
|
|
| 36 |
- <packing>
|
|
| 37 |
- <property name="expand">False</property>
|
|
| 38 |
- <property name="fill">True</property>
|
|
| 39 |
- <property name="position">0</property>
|
|
| 40 |
- </packing>
|
|
| 41 |
- </child>
|
|
| 42 |
- <child>
|
|
| 43 |
- <object class="GtkButton" id="ok_button">
|
|
| 44 |
- <property name="label">gtk-ok</property>
|
|
| 45 |
- <property name="visible">True</property>
|
|
| 46 |
- <property name="can_focus">True</property>
|
|
| 47 |
- <property name="can_default">True</property>
|
|
| 48 |
- <property name="has_default">True</property>
|
|
| 49 |
- <property name="receives_default">False</property>
|
|
| 50 |
- <property name="use_stock">True</property>
|
|
| 51 |
- <style>
|
|
| 52 |
- <class name="suggested-action"/>
|
|
| 53 |
- </style>
|
|
| 54 |
- </object>
|
|
| 55 |
- <packing>
|
|
| 56 |
- <property name="expand">False</property>
|
|
| 57 |
- <property name="fill">True</property>
|
|
| 58 |
- <property name="position">1</property>
|
|
| 59 |
- </packing>
|
|
| 60 |
- </child>
|
|
| 61 |
- </object>
|
|
| 62 |
- <packing>
|
|
| 63 |
- <property name="expand">False</property>
|
|
| 64 |
- <property name="fill">True</property>
|
|
| 65 |
- <property name="pack_type">end</property>
|
|
| 66 |
- <property name="position">0</property>
|
|
| 67 |
- </packing>
|
|
| 68 |
- </child>
|
|
| 69 |
- <child>
|
|
| 70 |
- <object class="GtkFrame">
|
|
| 71 |
- <property name="visible">True</property>
|
|
| 72 |
- <property name="can_focus">False</property>
|
|
| 73 |
- <property name="label_xalign">0</property>
|
|
| 74 |
- <property name="shadow_type">none</property>
|
|
| 75 |
- <child>
|
|
| 76 |
- <object class="GtkBox">
|
|
| 77 |
- <property name="visible">True</property>
|
|
| 78 |
- <property name="can_focus">False</property>
|
|
| 79 |
- <property name="margin_top">6</property>
|
|
| 80 |
- <property name="orientation">vertical</property>
|
|
| 81 |
- <property name="spacing">6</property>
|
|
| 82 |
- <child>
|
|
| 83 |
- <object class="GtkBox">
|
|
| 84 |
- <property name="visible">True</property>
|
|
| 85 |
- <property name="can_focus">False</property>
|
|
| 86 |
- <child>
|
|
| 87 |
- <object class="GtkScrolledWindow">
|
|
| 88 |
- <property name="visible">True</property>
|
|
| 89 |
- <property name="can_focus">True</property>
|
|
| 90 |
- <property name="shadow_type">in</property>
|
|
| 91 |
- <child>
|
|
| 92 |
- <object class="GtkTextView" id="message_textview">
|
|
| 93 |
- <property name="visible">True</property>
|
|
| 94 |
- <property name="can_focus">True</property>
|
|
| 95 |
- <property name="wrap_mode">word</property>
|
|
| 96 |
- <property name="left_margin">6</property>
|
|
| 97 |
- <property name="right_margin">6</property>
|
|
| 98 |
- <property name="top_margin">6</property>
|
|
| 99 |
- <property name="bottom_margin">6</property>
|
|
| 100 |
- </object>
|
|
| 101 |
- </child>
|
|
| 102 |
- </object>
|
|
| 103 |
- <packing>
|
|
| 104 |
- <property name="expand">True</property>
|
|
| 105 |
- <property name="fill">True</property>
|
|
| 106 |
- <property name="position">0</property>
|
|
| 107 |
- </packing>
|
|
| 108 |
- </child>
|
|
| 109 |
- <child>
|
|
| 110 |
- <object class="GtkButton" id="save_as_preset_button">
|
|
| 111 |
- <property name="visible">True</property>
|
|
| 112 |
- <property name="sensitive">False</property>
|
|
| 113 |
- <property name="can_focus">True</property>
|
|
| 114 |
- <property name="can_default">True</property>
|
|
| 115 |
- <property name="receives_default">False</property>
|
|
| 116 |
- <property name="tooltip_text" translatable="yes">Save this message as a preset</property>
|
|
| 117 |
- <signal name="clicked" handler="on_save_as_preset_button_clicked" swapped="no"/>
|
|
| 118 |
- <child>
|
|
| 119 |
- <object class="GtkImage">
|
|
| 120 |
- <property name="visible">True</property>
|
|
| 121 |
- <property name="can_focus">False</property>
|
|
| 122 |
- <property name="stock">gtk-save-as</property>
|
|
| 123 |
- </object>
|
|
| 124 |
- </child>
|
|
| 125 |
- </object>
|
|
| 126 |
- <packing>
|
|
| 127 |
- <property name="expand">False</property>
|
|
| 128 |
- <property name="fill">False</property>
|
|
| 129 |
- <property name="position">1</property>
|
|
| 130 |
- </packing>
|
|
| 131 |
- </child>
|
|
| 132 |
- </object>
|
|
| 133 |
- <packing>
|
|
| 134 |
- <property name="expand">True</property>
|
|
| 135 |
- <property name="fill">True</property>
|
|
| 136 |
- <property name="position">0</property>
|
|
| 137 |
- </packing>
|
|
| 138 |
- </child>
|
|
| 139 |
- <child>
|
|
| 140 |
- <object class="GtkGrid" id="under_table">
|
|
| 141 |
- <property name="visible">True</property>
|
|
| 142 |
- <property name="can_focus">False</property>
|
|
| 143 |
- <property name="halign">center</property>
|
|
| 144 |
- <property name="margin_top">6</property>
|
|
| 145 |
- <property name="row_spacing">6</property>
|
|
| 146 |
- <property name="column_spacing">12</property>
|
|
| 147 |
- <child>
|
|
| 148 |
- <object class="GtkLabel">
|
|
| 149 |
- <property name="visible">True</property>
|
|
| 150 |
- <property name="can_focus">False</property>
|
|
| 151 |
- <property name="halign">end</property>
|
|
| 152 |
- <property name="label" translatable="yes">Preset _messages</property>
|
|
| 153 |
- <property name="use_underline">True</property>
|
|
| 154 |
- <property name="mnemonic_widget">message_combobox</property>
|
|
| 155 |
- <style>
|
|
| 156 |
- <class name="dim-label"/>
|
|
| 157 |
- </style>
|
|
| 158 |
- </object>
|
|
| 159 |
- <packing>
|
|
| 160 |
- <property name="left_attach">0</property>
|
|
| 161 |
- <property name="top_attach">0</property>
|
|
| 162 |
- </packing>
|
|
| 163 |
- </child>
|
|
| 164 |
- <child>
|
|
| 165 |
- <object class="GtkLabel" id="activity_label">
|
|
| 166 |
- <property name="visible">True</property>
|
|
| 167 |
- <property name="can_focus">False</property>
|
|
| 168 |
- <property name="halign">end</property>
|
|
| 169 |
- <property name="margin_top">6</property>
|
|
| 170 |
- <property name="label" translatable="yes">Ac_tivity</property>
|
|
| 171 |
- <property name="use_underline">True</property>
|
|
| 172 |
- <property name="mnemonic_widget">activity_button</property>
|
|
| 173 |
- <style>
|
|
| 174 |
- <class name="dim-label"/>
|
|
| 175 |
- </style>
|
|
| 176 |
- </object>
|
|
| 177 |
- <packing>
|
|
| 178 |
- <property name="left_attach">0</property>
|
|
| 179 |
- <property name="top_attach">1</property>
|
|
| 180 |
- </packing>
|
|
| 181 |
- </child>
|
|
| 182 |
- <child>
|
|
| 183 |
- <object class="GtkLabel" id="mood_label">
|
|
| 184 |
- <property name="visible">True</property>
|
|
| 185 |
- <property name="can_focus">False</property>
|
|
| 186 |
- <property name="halign">end</property>
|
|
| 187 |
- <property name="label" translatable="yes">M_ood</property>
|
|
| 188 |
- <property name="use_underline">True</property>
|
|
| 189 |
- <property name="mnemonic_widget">mood_button</property>
|
|
| 190 |
- <style>
|
|
| 191 |
- <class name="dim-label"/>
|
|
| 192 |
- </style>
|
|
| 193 |
- </object>
|
|
| 194 |
- <packing>
|
|
| 195 |
- <property name="left_attach">0</property>
|
|
| 196 |
- <property name="top_attach">2</property>
|
|
| 197 |
- </packing>
|
|
| 198 |
- </child>
|
|
| 199 |
- <child>
|
|
| 200 |
- <object class="GtkComboBox" id="message_combobox">
|
|
| 201 |
- <property name="width_request">200</property>
|
|
| 202 |
- <property name="visible">True</property>
|
|
| 203 |
- <property name="can_focus">False</property>
|
|
| 204 |
- <property name="hexpand">True</property>
|
|
| 205 |
- <signal name="changed" handler="on_message_combobox_changed" swapped="no"/>
|
|
| 206 |
- </object>
|
|
| 207 |
- <packing>
|
|
| 208 |
- <property name="left_attach">1</property>
|
|
| 209 |
- <property name="top_attach">0</property>
|
|
| 210 |
- </packing>
|
|
| 211 |
- </child>
|
|
| 212 |
- <child>
|
|
| 213 |
- <object class="GtkButton" id="activity_button">
|
|
| 214 |
- <property name="visible">True</property>
|
|
| 215 |
- <property name="can_focus">True</property>
|
|
| 216 |
- <property name="receives_default">True</property>
|
|
| 217 |
- <property name="margin_top">6</property>
|
|
| 218 |
- <signal name="clicked" handler="on_activity_button_clicked" swapped="no"/>
|
|
| 219 |
- <child>
|
|
| 220 |
- <object class="GtkBox">
|
|
| 221 |
- <property name="visible">True</property>
|
|
| 222 |
- <property name="can_focus">False</property>
|
|
| 223 |
- <property name="spacing">6</property>
|
|
| 224 |
- <child>
|
|
| 225 |
- <object class="GtkImage" id="activity_image">
|
|
| 226 |
- <property name="visible">True</property>
|
|
| 227 |
- <property name="can_focus">False</property>
|
|
| 228 |
- <property name="stock">gtk-missing-image</property>
|
|
| 229 |
- </object>
|
|
| 230 |
- <packing>
|
|
| 231 |
- <property name="expand">False</property>
|
|
| 232 |
- <property name="fill">True</property>
|
|
| 233 |
- <property name="position">0</property>
|
|
| 234 |
- </packing>
|
|
| 235 |
- </child>
|
|
| 236 |
- <child>
|
|
| 237 |
- <object class="GtkLabel" id="activity_button_label">
|
|
| 238 |
- <property name="visible">True</property>
|
|
| 239 |
- <property name="can_focus">False</property>
|
|
| 240 |
- <property name="wrap">True</property>
|
|
| 241 |
- <property name="xalign">0</property>
|
|
| 242 |
- </object>
|
|
| 243 |
- <packing>
|
|
| 244 |
- <property name="expand">True</property>
|
|
| 245 |
- <property name="fill">True</property>
|
|
| 246 |
- <property name="position">1</property>
|
|
| 247 |
- </packing>
|
|
| 248 |
- </child>
|
|
| 249 |
- </object>
|
|
| 250 |
- </child>
|
|
| 251 |
- </object>
|
|
| 252 |
- <packing>
|
|
| 253 |
- <property name="left_attach">1</property>
|
|
| 254 |
- <property name="top_attach">1</property>
|
|
| 255 |
- </packing>
|
|
| 256 |
- </child>
|
|
| 257 |
- <child>
|
|
| 258 |
- <object class="GtkButton" id="mood_button">
|
|
| 259 |
- <property name="visible">True</property>
|
|
| 260 |
- <property name="can_focus">True</property>
|
|
| 261 |
- <property name="receives_default">True</property>
|
|
| 262 |
- <signal name="clicked" handler="on_mood_button_clicked" swapped="no"/>
|
|
| 263 |
- <child>
|
|
| 264 |
- <object class="GtkBox">
|
|
| 265 |
- <property name="visible">True</property>
|
|
| 266 |
- <property name="can_focus">False</property>
|
|
| 267 |
- <property name="spacing">6</property>
|
|
| 268 |
- <child>
|
|
| 269 |
- <object class="GtkImage" id="mood_image">
|
|
| 270 |
- <property name="visible">True</property>
|
|
| 271 |
- <property name="can_focus">False</property>
|
|
| 272 |
- <property name="stock">gtk-missing-image</property>
|
|
| 273 |
- </object>
|
|
| 274 |
- <packing>
|
|
| 275 |
- <property name="expand">False</property>
|
|
| 276 |
- <property name="fill">True</property>
|
|
| 277 |
- <property name="position">0</property>
|
|
| 278 |
- </packing>
|
|
| 279 |
- </child>
|
|
| 280 |
- <child>
|
|
| 281 |
- <object class="GtkLabel" id="mood_button_label">
|
|
| 282 |
- <property name="visible">True</property>
|
|
| 283 |
- <property name="can_focus">False</property>
|
|
| 284 |
- <property name="wrap">True</property>
|
|
| 285 |
- <property name="xalign">0</property>
|
|
| 286 |
- </object>
|
|
| 287 |
- <packing>
|
|
| 288 |
- <property name="expand">True</property>
|
|
| 289 |
- <property name="fill">True</property>
|
|
| 290 |
- <property name="position">1</property>
|
|
| 291 |
- </packing>
|
|
| 292 |
- </child>
|
|
| 293 |
- </object>
|
|
| 294 |
- </child>
|
|
| 295 |
- </object>
|
|
| 296 |
- <packing>
|
|
| 297 |
- <property name="left_attach">1</property>
|
|
| 298 |
- <property name="top_attach">2</property>
|
|
| 299 |
- </packing>
|
|
| 300 |
- </child>
|
|
| 301 |
- </object>
|
|
| 302 |
- <packing>
|
|
| 303 |
- <property name="expand">False</property>
|
|
| 304 |
- <property name="fill">True</property>
|
|
| 305 |
- <property name="position">1</property>
|
|
| 306 |
- </packing>
|
|
| 307 |
- </child>
|
|
| 308 |
- </object>
|
|
| 309 |
- </child>
|
|
| 310 |
- <child type="label">
|
|
| 311 |
- <object class="GtkLabel">
|
|
| 312 |
- <property name="visible">True</property>
|
|
| 313 |
- <property name="can_focus">False</property>
|
|
| 314 |
- <property name="label" translatable="yes">_Type your new status message</property>
|
|
| 315 |
- <property name="use_underline">True</property>
|
|
| 316 |
- <property name="justify">center</property>
|
|
| 317 |
- <property name="mnemonic_widget">message_textview</property>
|
|
| 318 |
- <style>
|
|
| 319 |
- <class name="dim-label"/>
|
|
| 320 |
- <class name="bold"/>
|
|
| 321 |
- </style>
|
|
| 322 |
- </object>
|
|
| 323 |
- </child>
|
|
| 324 |
- </object>
|
|
| 325 |
- <packing>
|
|
| 326 |
- <property name="expand">True</property>
|
|
| 327 |
- <property name="fill">True</property>
|
|
| 328 |
- <property name="position">2</property>
|
|
| 329 |
- </packing>
|
|
| 330 |
- </child>
|
|
| 331 |
- </object>
|
|
| 332 |
- </child>
|
|
| 333 |
- <action-widgets>
|
|
| 334 |
- <action-widget response="-6">cancel_button</action-widget>
|
|
| 335 |
- <action-widget response="-5">ok_button</action-widget>
|
|
| 336 |
- </action-widgets>
|
|
| 337 |
- </object>
|
|
| 338 |
-</interface>
|
| 1 | 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
-<!-- Generated with glade 3.18.3 -->
|
|
| 2 |
+<!-- Generated with glade 3.36.0 -->
|
|
| 3 | 3 |
<interface>
|
| 4 |
- <requires lib="gtk+" version="3.12"/>
|
|
| 5 |
- <object class="GtkDialog" id="change_activity_dialog">
|
|
| 4 |
+ <requires lib="gtk+" version="3.22"/>
|
|
| 5 |
+ <object class="GtkPopover" id="preset_popover">
|
|
| 6 | 6 |
<property name="can_focus">False</property>
|
| 7 |
- <property name="border_width">6</property>
|
|
| 8 |
- <property name="title" translatable="yes">Set Activity</property>
|
|
| 9 |
- <property name="default_width">270</property>
|
|
| 10 |
- <property name="type_hint">dialog</property>
|
|
| 11 |
- <child internal-child="vbox">
|
|
| 12 |
- <object class="GtkBox" id="dialog-vbox5">
|
|
| 7 |
+ <child>
|
|
| 8 |
+ <placeholder/>
|
|
| 9 |
+ </child>
|
|
| 10 |
+ </object>
|
|
| 11 |
+ <object class="GtkStack" id="status_stack">
|
|
| 12 |
+ <property name="visible">True</property>
|
|
| 13 |
+ <property name="can_focus">False</property>
|
|
| 14 |
+ <property name="transition_duration">150</property>
|
|
| 15 |
+ <child>
|
|
| 16 |
+ <object class="GtkBox">
|
|
| 13 | 17 |
<property name="visible">True</property>
|
| 14 | 18 |
<property name="can_focus">False</property>
|
| 19 |
+ <property name="border_width">18</property>
|
|
| 15 | 20 |
<property name="orientation">vertical</property>
|
| 16 | 21 |
<property name="spacing">6</property>
|
| 17 |
- <child internal-child="action_area">
|
|
| 18 |
- <object class="GtkButtonBox" id="dialog-action_area">
|
|
| 22 |
+ <child>
|
|
| 23 |
+ <object class="GtkLabel">
|
|
| 24 |
+ <property name="visible">True</property>
|
|
| 25 |
+ <property name="can_focus">False</property>
|
|
| 26 |
+ <property name="margin_bottom">12</property>
|
|
| 27 |
+ <property name="label" translatable="yes">Change Status</property>
|
|
| 28 |
+ <style>
|
|
| 29 |
+ <class name="large-header"/>
|
|
| 30 |
+ </style>
|
|
| 31 |
+ </object>
|
|
| 32 |
+ <packing>
|
|
| 33 |
+ <property name="expand">False</property>
|
|
| 34 |
+ <property name="fill">True</property>
|
|
| 35 |
+ <property name="position">0</property>
|
|
| 36 |
+ </packing>
|
|
| 37 |
+ </child>
|
|
| 38 |
+ <child>
|
|
| 39 |
+ <object class="GtkBox">
|
|
| 19 | 40 |
<property name="visible">True</property>
|
| 20 | 41 |
<property name="can_focus">False</property>
|
| 21 |
- <property name="layout_style">end</property>
|
|
| 42 |
+ <property name="halign">center</property>
|
|
| 43 |
+ <property name="spacing">12</property>
|
|
| 22 | 44 |
<child>
|
| 23 |
- <object class="GtkButton" id="cancel_button">
|
|
| 24 |
- <property name="label">gtk-cancel</property>
|
|
| 45 |
+ <object class="GtkMenuButton" id="preset_list_button">
|
|
| 25 | 46 |
<property name="visible">True</property>
|
| 26 | 47 |
<property name="can_focus">True</property>
|
| 27 |
- <property name="can_default">True</property>
|
|
| 28 |
- <property name="receives_default">False</property>
|
|
| 29 |
- <property name="use_stock">True</property>
|
|
| 30 |
- <signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
|
|
| 48 |
+ <property name="focus_on_click">False</property>
|
|
| 49 |
+ <property name="receives_default">True</property>
|
|
| 50 |
+ <property name="popover">preset_popover</property>
|
|
| 51 |
+ <signal name="toggled" handler="_stop_timeout" swapped="no"/>
|
|
| 52 |
+ <child>
|
|
| 53 |
+ <object class="GtkLabel">
|
|
| 54 |
+ <property name="visible">True</property>
|
|
| 55 |
+ <property name="can_focus">False</property>
|
|
| 56 |
+ <property name="label" translatable="yes">Status Presets…</property>
|
|
| 57 |
+ </object>
|
|
| 58 |
+ </child>
|
|
| 31 | 59 |
</object>
|
| 32 | 60 |
<packing>
|
| 33 | 61 |
<property name="expand">False</property>
|
| 34 |
- <property name="fill">False</property>
|
|
| 62 |
+ <property name="fill">True</property>
|
|
| 35 | 63 |
<property name="position">0</property>
|
| 36 | 64 |
</packing>
|
| 37 | 65 |
</child>
|
| 38 | 66 |
<child>
|
| 39 |
- <object class="GtkButton" id="ok_button">
|
|
| 40 |
- <property name="label">gtk-ok</property>
|
|
| 67 |
+ <object class="GtkButton">
|
|
| 41 | 68 |
<property name="visible">True</property>
|
| 42 | 69 |
<property name="can_focus">True</property>
|
| 43 | 70 |
<property name="can_default">True</property>
|
| 44 |
- <property name="has_default">True</property>
|
|
| 45 | 71 |
<property name="receives_default">False</property>
|
| 46 |
- <property name="use_stock">True</property>
|
|
| 47 |
- <signal name="clicked" handler="on_ok_button_clicked" swapped="no"/>
|
|
| 72 |
+ <property name="tooltip_text" translatable="yes">Save this message as a preset</property>
|
|
| 73 |
+ <signal name="clicked" handler="_on_save_as_preset_clicked" swapped="no"/>
|
|
| 74 |
+ <child>
|
|
| 75 |
+ <object class="GtkImage">
|
|
| 76 |
+ <property name="visible">True</property>
|
|
| 77 |
+ <property name="can_focus">False</property>
|
|
| 78 |
+ <property name="icon_name">document-save-as-symbolic</property>
|
|
| 79 |
+ </object>
|
|
| 80 |
+ </child>
|
|
| 48 | 81 |
</object>
|
| 49 | 82 |
<packing>
|
| 50 | 83 |
<property name="expand">False</property>
|
| 51 | 84 |
<property name="fill">False</property>
|
| 52 |
- <property name="position">1</property>
|
|
| 85 |
+ <property name="position">2</property>
|
|
| 86 |
+ </packing>
|
|
| 87 |
+ </child>
|
|
| 88 |
+ </object>
|
|
| 89 |
+ <packing>
|
|
| 90 |
+ <property name="expand">False</property>
|
|
| 91 |
+ <property name="fill">True</property>
|
|
| 92 |
+ <property name="position">1</property>
|
|
| 93 |
+ </packing>
|
|
| 94 |
+ </child>
|
|
| 95 |
+ <child>
|
|
| 96 |
+ <object class="GtkScrolledWindow">
|
|
| 97 |
+ <property name="visible">True</property>
|
|
| 98 |
+ <property name="can_focus">True</property>
|
|
| 99 |
+ <property name="shadow_type">in</property>
|
|
| 100 |
+ <child>
|
|
| 101 |
+ <object class="GtkTextView" id="message_textview">
|
|
| 102 |
+ <property name="visible">True</property>
|
|
| 103 |
+ <property name="can_focus">True</property>
|
|
| 104 |
+ <property name="wrap_mode">word</property>
|
|
| 105 |
+ <property name="left_margin">6</property>
|
|
| 106 |
+ <property name="right_margin">6</property>
|
|
| 107 |
+ <property name="top_margin">6</property>
|
|
| 108 |
+ <property name="bottom_margin">6</property>
|
|
| 109 |
+ </object>
|
|
| 110 |
+ </child>
|
|
| 111 |
+ </object>
|
|
| 112 |
+ <packing>
|
|
| 113 |
+ <property name="expand">True</property>
|
|
| 114 |
+ <property name="fill">True</property>
|
|
| 115 |
+ <property name="position">2</property>
|
|
| 116 |
+ </packing>
|
|
| 117 |
+ </child>
|
|
| 118 |
+ <child>
|
|
| 119 |
+ <object class="GtkGrid">
|
|
| 120 |
+ <property name="visible">True</property>
|
|
| 121 |
+ <property name="can_focus">False</property>
|
|
| 122 |
+ <property name="halign">center</property>
|
|
| 123 |
+ <property name="row_spacing">6</property>
|
|
| 124 |
+ <property name="column_spacing">12</property>
|
|
| 125 |
+ <child>
|
|
| 126 |
+ <object class="GtkLabel">
|
|
| 127 |
+ <property name="visible">True</property>
|
|
| 128 |
+ <property name="can_focus">False</property>
|
|
| 129 |
+ <property name="halign">end</property>
|
|
| 130 |
+ <property name="label" translatable="yes">Ac_tivity</property>
|
|
| 131 |
+ <property name="use_underline">True</property>
|
|
| 132 |
+ <style>
|
|
| 133 |
+ <class name="dim-label"/>
|
|
| 134 |
+ </style>
|
|
| 135 |
+ </object>
|
|
| 136 |
+ <packing>
|
|
| 137 |
+ <property name="left_attach">0</property>
|
|
| 138 |
+ <property name="top_attach">0</property>
|
|
| 139 |
+ </packing>
|
|
| 140 |
+ </child>
|
|
| 141 |
+ <child>
|
|
| 142 |
+ <object class="GtkLabel">
|
|
| 143 |
+ <property name="visible">True</property>
|
|
| 144 |
+ <property name="can_focus">False</property>
|
|
| 145 |
+ <property name="halign">end</property>
|
|
| 146 |
+ <property name="label" translatable="yes">M_ood</property>
|
|
| 147 |
+ <property name="use_underline">True</property>
|
|
| 148 |
+ <style>
|
|
| 149 |
+ <class name="dim-label"/>
|
|
| 150 |
+ </style>
|
|
| 151 |
+ </object>
|
|
| 152 |
+ <packing>
|
|
| 153 |
+ <property name="left_attach">0</property>
|
|
| 154 |
+ <property name="top_attach">1</property>
|
|
| 155 |
+ </packing>
|
|
| 156 |
+ </child>
|
|
| 157 |
+ <child>
|
|
| 158 |
+ <object class="GtkButton" id="activity_page_button">
|
|
| 159 |
+ <property name="visible">True</property>
|
|
| 160 |
+ <property name="sensitive">False</property>
|
|
| 161 |
+ <property name="can_focus">True</property>
|
|
| 162 |
+ <property name="receives_default">True</property>
|
|
| 163 |
+ <signal name="clicked" handler="_on_activity_page_clicked" swapped="no"/>
|
|
| 164 |
+ <child>
|
|
| 165 |
+ <object class="GtkBox">
|
|
| 166 |
+ <property name="visible">True</property>
|
|
| 167 |
+ <property name="can_focus">False</property>
|
|
| 168 |
+ <property name="spacing">6</property>
|
|
| 169 |
+ <child>
|
|
| 170 |
+ <object class="GtkImage" id="activity_image">
|
|
| 171 |
+ <property name="visible">True</property>
|
|
| 172 |
+ <property name="can_focus">False</property>
|
|
| 173 |
+ </object>
|
|
| 174 |
+ <packing>
|
|
| 175 |
+ <property name="expand">False</property>
|
|
| 176 |
+ <property name="fill">True</property>
|
|
| 177 |
+ <property name="position">0</property>
|
|
| 178 |
+ </packing>
|
|
| 179 |
+ </child>
|
|
| 180 |
+ <child>
|
|
| 181 |
+ <object class="GtkLabel" id="activity_button_label">
|
|
| 182 |
+ <property name="visible">True</property>
|
|
| 183 |
+ <property name="can_focus">False</property>
|
|
| 184 |
+ <property name="halign">start</property>
|
|
| 185 |
+ <property name="wrap">True</property>
|
|
| 186 |
+ </object>
|
|
| 187 |
+ <packing>
|
|
| 188 |
+ <property name="expand">True</property>
|
|
| 189 |
+ <property name="fill">True</property>
|
|
| 190 |
+ <property name="position">1</property>
|
|
| 191 |
+ </packing>
|
|
| 192 |
+ </child>
|
|
| 193 |
+ </object>
|
|
| 194 |
+ </child>
|
|
| 195 |
+ </object>
|
|
| 196 |
+ <packing>
|
|
| 197 |
+ <property name="left_attach">2</property>
|
|
| 198 |
+ <property name="top_attach">0</property>
|
|
| 199 |
+ </packing>
|
|
| 200 |
+ </child>
|
|
| 201 |
+ <child>
|
|
| 202 |
+ <object class="GtkButton" id="mood_page_button">
|
|
| 203 |
+ <property name="visible">True</property>
|
|
| 204 |
+ <property name="sensitive">False</property>
|
|
| 205 |
+ <property name="can_focus">True</property>
|
|
| 206 |
+ <property name="receives_default">True</property>
|
|
| 207 |
+ <signal name="clicked" handler="_on_mood_page_clicked" swapped="no"/>
|
|
| 208 |
+ <child>
|
|
| 209 |
+ <object class="GtkBox">
|
|
| 210 |
+ <property name="visible">True</property>
|
|
| 211 |
+ <property name="can_focus">False</property>
|
|
| 212 |
+ <property name="spacing">6</property>
|
|
| 213 |
+ <child>
|
|
| 214 |
+ <object class="GtkImage" id="mood_image">
|
|
| 215 |
+ <property name="visible">True</property>
|
|
| 216 |
+ <property name="can_focus">False</property>
|
|
| 217 |
+ </object>
|
|
| 218 |
+ <packing>
|
|
| 219 |
+ <property name="expand">False</property>
|
|
| 220 |
+ <property name="fill">True</property>
|
|
| 221 |
+ <property name="position">0</property>
|
|
| 222 |
+ </packing>
|
|
| 223 |
+ </child>
|
|
| 224 |
+ <child>
|
|
| 225 |
+ <object class="GtkLabel" id="mood_button_label">
|
|
| 226 |
+ <property name="visible">True</property>
|
|
| 227 |
+ <property name="can_focus">False</property>
|
|
| 228 |
+ <property name="halign">start</property>
|
|
| 229 |
+ <property name="wrap">True</property>
|
|
| 230 |
+ </object>
|
|
| 231 |
+ <packing>
|
|
| 232 |
+ <property name="expand">True</property>
|
|
| 233 |
+ <property name="fill">True</property>
|
|
| 234 |
+ <property name="position">1</property>
|
|
| 235 |
+ </packing>
|
|
| 236 |
+ </child>
|
|
| 237 |
+ </object>
|
|
| 238 |
+ </child>
|
|
| 239 |
+ </object>
|
|
| 240 |
+ <packing>
|
|
| 241 |
+ <property name="left_attach">2</property>
|
|
| 242 |
+ <property name="top_attach">1</property>
|
|
| 243 |
+ </packing>
|
|
| 244 |
+ </child>
|
|
| 245 |
+ <child>
|
|
| 246 |
+ <object class="GtkSwitch" id="activity_switch">
|
|
| 247 |
+ <property name="visible">True</property>
|
|
| 248 |
+ <property name="can_focus">True</property>
|
|
| 249 |
+ <property name="valign">center</property>
|
|
| 250 |
+ <signal name="notify::active" handler="_on_activity_switch" swapped="no"/>
|
|
| 251 |
+ </object>
|
|
| 252 |
+ <packing>
|
|
| 253 |
+ <property name="left_attach">1</property>
|
|
| 254 |
+ <property name="top_attach">0</property>
|
|
| 255 |
+ </packing>
|
|
| 256 |
+ </child>
|
|
| 257 |
+ <child>
|
|
| 258 |
+ <object class="GtkSwitch" id="mood_switch">
|
|
| 259 |
+ <property name="visible">True</property>
|
|
| 260 |
+ <property name="can_focus">True</property>
|
|
| 261 |
+ <property name="valign">center</property>
|
|
| 262 |
+ <signal name="notify::active" handler="_on_mood_switch" swapped="no"/>
|
|
| 263 |
+ </object>
|
|
| 264 |
+ <packing>
|
|
| 265 |
+ <property name="left_attach">1</property>
|
|
| 266 |
+ <property name="top_attach">1</property>
|
|
| 53 | 267 |
</packing>
|
| 54 | 268 |
</child>
|
| 55 | 269 |
</object>
|
| 56 | 270 |
<packing>
|
| 57 | 271 |
<property name="expand">False</property>
|
| 58 |
- <property name="fill">False</property>
|
|
| 59 |
- <property name="pack_type">end</property>
|
|
| 272 |
+ <property name="fill">True</property>
|
|
| 273 |
+ <property name="position">3</property>
|
|
| 274 |
+ </packing>
|
|
| 275 |
+ </child>
|
|
| 276 |
+ <child>
|
|
| 277 |
+ <object class="GtkButton">
|
|
| 278 |
+ <property name="label" translatable="yes">_Change Status</property>
|
|
| 279 |
+ <property name="visible">True</property>
|
|
| 280 |
+ <property name="can_focus">True</property>
|
|
| 281 |
+ <property name="receives_default">True</property>
|
|
| 282 |
+ <property name="halign">center</property>
|
|
| 283 |
+ <property name="margin_top">12</property>
|
|
| 284 |
+ <property name="use_underline">True</property>
|
|
| 285 |
+ <signal name="clicked" handler="_change_status" swapped="no"/>
|
|
| 286 |
+ <style>
|
|
| 287 |
+ <class name="suggested-action"/>
|
|
| 288 |
+ </style>
|
|
| 289 |
+ </object>
|
|
| 290 |
+ <packing>
|
|
| 291 |
+ <property name="expand">False</property>
|
|
| 292 |
+ <property name="fill">True</property>
|
|
| 293 |
+ <property name="position">5</property>
|
|
| 294 |
+ </packing>
|
|
| 295 |
+ </child>
|
|
| 296 |
+ </object>
|
|
| 297 |
+ <packing>
|
|
| 298 |
+ <property name="name">status-page</property>
|
|
| 299 |
+ </packing>
|
|
| 300 |
+ </child>
|
|
| 301 |
+ <child>
|
|
| 302 |
+ <object class="GtkBox">
|
|
| 303 |
+ <property name="visible">True</property>
|
|
| 304 |
+ <property name="can_focus">False</property>
|
|
| 305 |
+ <property name="border_width">18</property>
|
|
| 306 |
+ <property name="orientation">vertical</property>
|
|
| 307 |
+ <property name="spacing">6</property>
|
|
| 308 |
+ <child>
|
|
| 309 |
+ <object class="GtkLabel">
|
|
| 310 |
+ <property name="visible">True</property>
|
|
| 311 |
+ <property name="can_focus">False</property>
|
|
| 312 |
+ <property name="margin_bottom">12</property>
|
|
| 313 |
+ <property name="label" translatable="yes">Activity</property>
|
|
| 314 |
+ <style>
|
|
| 315 |
+ <class name="large-header"/>
|
|
| 316 |
+ </style>
|
|
| 317 |
+ </object>
|
|
| 318 |
+ <packing>
|
|
| 319 |
+ <property name="expand">False</property>
|
|
| 320 |
+ <property name="fill">True</property>
|
|
| 60 | 321 |
<property name="position">0</property>
|
| 61 | 322 |
</packing>
|
| 62 | 323 |
</child>
|
| 63 | 324 |
<child>
|
| 64 |
- <object class="GtkCheckButton" id="enable_checkbutton">
|
|
| 65 |
- <property name="label" translatable="yes">Set an activity</property>
|
|
| 325 |
+ <object class="GtkRadioButton" id="no_activity_button">
|
|
| 326 |
+ <property name="label" translatable="yes">_No Activity</property>
|
|
| 66 | 327 |
<property name="visible">True</property>
|
| 67 | 328 |
<property name="can_focus">True</property>
|
| 68 | 329 |
<property name="receives_default">False</property>
|
| 69 |
- <property name="xalign">0.5</property>
|
|
| 330 |
+ <property name="halign">center</property>
|
|
| 331 |
+ <property name="use_underline">True</property>
|
|
| 332 |
+ <property name="active">True</property>
|
|
| 70 | 333 |
<property name="draw_indicator">True</property>
|
| 71 |
- <signal name="toggled" handler="on_enable_checkbutton_toggled" swapped="no"/>
|
|
| 334 |
+ <signal name="toggled" handler="_on_no_activity_toggled" swapped="no"/>
|
|
| 72 | 335 |
</object>
|
| 73 | 336 |
<packing>
|
| 74 | 337 |
<property name="expand">False</property>
|
| 75 |
- <property name="fill">False</property>
|
|
| 76 |
- <property name="position">2</property>
|
|
| 338 |
+ <property name="fill">True</property>
|
|
| 339 |
+ <property name="position">1</property>
|
|
| 77 | 340 |
</packing>
|
| 78 | 341 |
</child>
|
| 79 | 342 |
<child>
|
| 80 |
- <object class="GtkNotebook" id="notebook">
|
|
| 343 |
+ <object class="GtkNotebook" id="activity_notebook">
|
|
| 81 | 344 |
<property name="visible">True</property>
|
| 82 |
- <property name="sensitive">False</property>
|
|
| 83 | 345 |
<property name="can_focus">True</property>
|
| 346 |
+ <property name="scrollable">True</property>
|
|
| 84 | 347 |
<child>
|
| 85 |
- <object class="GtkBox" id="doing_chores_vbox">
|
|
| 348 |
+ <object class="GtkBox" id="doing_chores_box">
|
|
| 86 | 349 |
<property name="visible">True</property>
|
| 87 | 350 |
<property name="can_focus">False</property>
|
| 351 |
+ <property name="border_width">6</property>
|
|
| 88 | 352 |
<property name="orientation">vertical</property>
|
| 353 |
+ <child>
|
|
| 354 |
+ <placeholder/>
|
|
| 355 |
+ </child>
|
|
| 356 |
+ <child>
|
|
| 357 |
+ <placeholder/>
|
|
| 358 |
+ </child>
|
|
| 359 |
+ <child>
|
|
| 360 |
+ <placeholder/>
|
|
| 361 |
+ </child>
|
|
| 89 | 362 |
</object>
|
| 90 | 363 |
</child>
|
| 91 | 364 |
<child type="tab">
|
| 92 | 365 |
<object class="GtkImage" id="doing_chores_image">
|
| 93 | 366 |
<property name="visible">True</property>
|
| 94 | 367 |
<property name="can_focus">False</property>
|
| 95 |
- <property name="stock">gtk-missing-image</property>
|
|
| 96 | 368 |
<property name="icon_size">1</property>
|
| 97 | 369 |
</object>
|
| 98 | 370 |
<packing>
|
| ... | ... | @@ -100,10 +372,20 @@ |
| 100 | 372 |
</packing>
|
| 101 | 373 |
</child>
|
| 102 | 374 |
<child>
|
| 103 |
- <object class="GtkBox" id="drinking_vbox">
|
|
| 375 |
+ <object class="GtkBox" id="drinking_box">
|
|
| 104 | 376 |
<property name="visible">True</property>
|
| 105 | 377 |
<property name="can_focus">False</property>
|
| 378 |
+ <property name="border_width">6</property>
|
|
| 106 | 379 |
<property name="orientation">vertical</property>
|
| 380 |
+ <child>
|
|
| 381 |
+ <placeholder/>
|
|
| 382 |
+ </child>
|
|
| 383 |
+ <child>
|
|
| 384 |
+ <placeholder/>
|
|
| 385 |
+ </child>
|
|
| 386 |
+ <child>
|
|
| 387 |
+ <placeholder/>
|
|
| 388 |
+ </child>
|
|
| 107 | 389 |
</object>
|
| 108 | 390 |
<packing>
|
| 109 | 391 |
<property name="position">1</property>
|
| ... | ... | @@ -113,7 +395,6 @@ |
| 113 | 395 |
<object class="GtkImage" id="drinking_image">
|
| 114 | 396 |
<property name="visible">True</property>
|
| 115 | 397 |
<property name="can_focus">False</property>
|
| 116 |
- <property name="stock">gtk-missing-image</property>
|
|
| 117 | 398 |
<property name="icon_size">1</property>
|
| 118 | 399 |
</object>
|
| 119 | 400 |
<packing>
|
| ... | ... | @@ -122,10 +403,20 @@ |
| 122 | 403 |
</packing>
|
| 123 | 404 |
</child>
|
| 124 | 405 |
<child>
|
| 125 |
- <object class="GtkBox" id="eating_vbox">
|
|
| 406 |
+ <object class="GtkBox" id="eating_box">
|
|
| 126 | 407 |
<property name="visible">True</property>
|
| 127 | 408 |
<property name="can_focus">False</property>
|
| 409 |
+ <property name="border_width">6</property>
|
|
| 128 | 410 |
<property name="orientation">vertical</property>
|
| 411 |
+ <child>
|
|
| 412 |
+ <placeholder/>
|
|
| 413 |
+ </child>
|
|
| 414 |
+ <child>
|
|
| 415 |
+ <placeholder/>
|
|
| 416 |
+ </child>
|
|
| 417 |
+ <child>
|
|
| 418 |
+ <placeholder/>
|
|
| 419 |
+ </child>
|
|
| 129 | 420 |
</object>
|
| 130 | 421 |
<packing>
|
| 131 | 422 |
<property name="position">2</property>
|
| ... | ... | @@ -135,7 +426,6 @@ |
| 135 | 426 |
<object class="GtkImage" id="eating_image">
|
| 136 | 427 |
<property name="visible">True</property>
|
| 137 | 428 |
<property name="can_focus">False</property>
|
| 138 |
- <property name="stock">gtk-missing-image</property>
|
|
| 139 | 429 |
<property name="icon_size">1</property>
|
| 140 | 430 |
</object>
|
| 141 | 431 |
<packing>
|
| ... | ... | @@ -144,10 +434,20 @@ |
| 144 | 434 |
</packing>
|
| 145 | 435 |
</child>
|
| 146 | 436 |
<child>
|
| 147 |
- <object class="GtkBox" id="exercising_vbox">
|
|
| 437 |
+ <object class="GtkBox" id="exercising_box">
|
|
| 148 | 438 |
<property name="visible">True</property>
|
| 149 | 439 |
<property name="can_focus">False</property>
|
| 440 |
+ <property name="border_width">6</property>
|
|
| 150 | 441 |
<property name="orientation">vertical</property>
|
| 442 |
+ <child>
|
|
| 443 |
+ <placeholder/>
|
|
| 444 |
+ </child>
|
|
| 445 |
+ <child>
|
|
| 446 |
+ <placeholder/>
|
|
| 447 |
+ </child>
|
|
| 448 |
+ <child>
|
|
| 449 |
+ <placeholder/>
|
|
| 450 |
+ </child>
|
|
| 151 | 451 |
</object>
|
| 152 | 452 |
<packing>
|
| 153 | 453 |
<property name="position">3</property>
|
| ... | ... | @@ -157,7 +457,6 @@ |
| 157 | 457 |
<object class="GtkImage" id="exercising_image">
|
| 158 | 458 |
<property name="visible">True</property>
|
| 159 | 459 |
<property name="can_focus">False</property>
|
| 160 |
- <property name="stock">gtk-missing-image</property>
|
|
| 161 | 460 |
<property name="icon_size">1</property>
|
| 162 | 461 |
</object>
|
| 163 | 462 |
<packing>
|
| ... | ... | @@ -166,10 +465,20 @@ |
| 166 | 465 |
</packing>
|
| 167 | 466 |
</child>
|
| 168 | 467 |
<child>
|
| 169 |
- <object class="GtkBox" id="grooming_vbox">
|
|
| 468 |
+ <object class="GtkBox" id="grooming_box">
|
|
| 170 | 469 |
<property name="visible">True</property>
|
| 171 | 470 |
<property name="can_focus">False</property>
|
| 471 |
+ <property name="border_width">6</property>
|
|
| 172 | 472 |
<property name="orientation">vertical</property>
|
| 473 |
+ <child>
|
|
| 474 |
+ <placeholder/>
|
|
| 475 |
+ </child>
|
|
| 476 |
+ <child>
|
|
| 477 |
+ <placeholder/>
|
|
| 478 |
+ </child>
|
|
| 479 |
+ <child>
|
|
| 480 |
+ <placeholder/>
|
|
| 481 |
+ </child>
|
|
| 173 | 482 |
</object>
|
| 174 | 483 |
<packing>
|
| 175 | 484 |
<property name="position">4</property>
|
| ... | ... | @@ -179,7 +488,6 @@ |
| 179 | 488 |
<object class="GtkImage" id="grooming_image">
|
| 180 | 489 |
<property name="visible">True</property>
|
| 181 | 490 |
<property name="can_focus">False</property>
|
| 182 |
- <property name="stock">gtk-missing-image</property>
|
|
| 183 | 491 |
<property name="icon_size">1</property>
|
| 184 | 492 |
</object>
|
| 185 | 493 |
<packing>
|
| ... | ... | @@ -188,10 +496,20 @@ |
| 188 | 496 |
</packing>
|
| 189 | 497 |
</child>
|
| 190 | 498 |
<child>
|
| 191 |
- <object class="GtkBox" id="having_appointment_vbox">
|
|
| 499 |
+ <object class="GtkBox" id="having_appointment_box">
|
|
| 192 | 500 |
<property name="visible">True</property>
|
| 193 | 501 |
<property name="can_focus">False</property>
|
| 502 |
+ <property name="border_width">6</property>
|
|
| 194 | 503 |
<property name="orientation">vertical</property>
|
| 504 |
+ <child>
|
|
| 505 |
+ <placeholder/>
|
|
| 506 |
+ </child>
|
|
| 507 |
+ <child>
|
|
| 508 |
+ <placeholder/>
|
|
| 509 |
+ </child>
|
|
| 510 |
+ <child>
|
|
| 511 |
+ <placeholder/>
|
|
| 512 |
+ </child>
|
|
| 195 | 513 |
</object>
|
| 196 | 514 |
<packing>
|
| 197 | 515 |
<property name="position">5</property>
|
| ... | ... | @@ -201,7 +519,6 @@ |
| 201 | 519 |
<object class="GtkImage" id="having_appointment_image">
|
| 202 | 520 |
<property name="visible">True</property>
|
| 203 | 521 |
<property name="can_focus">False</property>
|
| 204 |
- <property name="stock">gtk-missing-image</property>
|
|
| 205 | 522 |
<property name="icon_size">1</property>
|
| 206 | 523 |
</object>
|
| 207 | 524 |
<packing>
|
| ... | ... | @@ -210,10 +527,20 @@ |
| 210 | 527 |
</packing>
|
| 211 | 528 |
</child>
|
| 212 | 529 |
<child>
|
| 213 |
- <object class="GtkBox" id="inactive_vbox">
|
|
| 530 |
+ <object class="GtkBox" id="inactive_box">
|
|
| 214 | 531 |
<property name="visible">True</property>
|
| 215 | 532 |
<property name="can_focus">False</property>
|
| 533 |
+ <property name="border_width">6</property>
|
|
| 216 | 534 |
<property name="orientation">vertical</property>
|
| 535 |
+ <child>
|
|
| 536 |
+ <placeholder/>
|
|
| 537 |
+ </child>
|
|
| 538 |
+ <child>
|
|
| 539 |
+ <placeholder/>
|
|
| 540 |
+ </child>
|
|
| 541 |
+ <child>
|
|
| 542 |
+ <placeholder/>
|
|
| 543 |
+ </child>
|
|
| 217 | 544 |
</object>
|
| 218 | 545 |
<packing>
|
| 219 | 546 |
<property name="position">6</property>
|
| ... | ... | @@ -223,7 +550,6 @@ |
| 223 | 550 |
<object class="GtkImage" id="inactive_image">
|
| 224 | 551 |
<property name="visible">True</property>
|
| 225 | 552 |
<property name="can_focus">False</property>
|
| 226 |
- <property name="stock">gtk-missing-image</property>
|
|
| 227 | 553 |
<property name="icon_size">1</property>
|
| 228 | 554 |
</object>
|
| 229 | 555 |
<packing>
|
| ... | ... | @@ -232,10 +558,20 @@ |
| 232 | 558 |
</packing>
|
| 233 | 559 |
</child>
|
| 234 | 560 |
<child>
|
| 235 |
- <object class="GtkBox" id="relaxing_vbox">
|
|
| 561 |
+ <object class="GtkBox" id="relaxing_box">
|
|
| 236 | 562 |
<property name="visible">True</property>
|
| 237 | 563 |
<property name="can_focus">False</property>
|
| 564 |
+ <property name="border_width">6</property>
|
|
| 238 | 565 |
<property name="orientation">vertical</property>
|
| 566 |
+ <child>
|
|
| 567 |
+ <placeholder/>
|
|
| 568 |
+ </child>
|
|
| 569 |
+ <child>
|
|
| 570 |
+ <placeholder/>
|
|
| 571 |
+ </child>
|
|
| 572 |
+ <child>
|
|
| 573 |
+ <placeholder/>
|
|
| 574 |
+ </child>
|
|
| 239 | 575 |
</object>
|
| 240 | 576 |
<packing>
|
| 241 | 577 |
<property name="position">7</property>
|
| ... | ... | @@ -245,7 +581,6 @@ |
| 245 | 581 |
<object class="GtkImage" id="relaxing_image">
|
| 246 | 582 |
<property name="visible">True</property>
|
| 247 | 583 |
<property name="can_focus">False</property>
|
| 248 |
- <property name="stock">gtk-missing-image</property>
|
|
| 249 | 584 |
<property name="icon_size">1</property>
|
| 250 | 585 |
</object>
|
| 251 | 586 |
<packing>
|
| ... | ... | @@ -254,10 +589,20 @@ |
| 254 | 589 |
</packing>
|
| 255 | 590 |
</child>
|
| 256 | 591 |
<child>
|
| 257 |
- <object class="GtkBox" id="talking_vbox">
|
|
| 592 |
+ <object class="GtkBox" id="talking_box">
|
|
| 258 | 593 |
<property name="visible">True</property>
|
| 259 | 594 |
<property name="can_focus">False</property>
|
| 595 |
+ <property name="border_width">6</property>
|
|
| 260 | 596 |
<property name="orientation">vertical</property>
|
| 597 |
+ <child>
|
|
| 598 |
+ <placeholder/>
|
|
| 599 |
+ </child>
|
|
| 600 |
+ <child>
|
|
| 601 |
+ <placeholder/>
|
|
| 602 |
+ </child>
|
|
| 603 |
+ <child>
|
|
| 604 |
+ <placeholder/>
|
|
| 605 |
+ </child>
|
|
| 261 | 606 |
</object>
|
| 262 | 607 |
<packing>
|
| 263 | 608 |
<property name="position">8</property>
|
| ... | ... | @@ -267,7 +612,6 @@ |
| 267 | 612 |
<object class="GtkImage" id="talking_image">
|
| 268 | 613 |
<property name="visible">True</property>
|
| 269 | 614 |
<property name="can_focus">False</property>
|
| 270 |
- <property name="stock">gtk-missing-image</property>
|
|
| 271 | 615 |
<property name="icon_size">1</property>
|
| 272 | 616 |
</object>
|
| 273 | 617 |
<packing>
|
| ... | ... | @@ -276,10 +620,20 @@ |
| 276 | 620 |
</packing>
|
| 277 | 621 |
</child>
|
| 278 | 622 |
<child>
|
| 279 |
- <object class="GtkBox" id="traveling_vbox">
|
|
| 623 |
+ <object class="GtkBox" id="traveling_box">
|
|
| 280 | 624 |
<property name="visible">True</property>
|
| 281 | 625 |
<property name="can_focus">False</property>
|
| 626 |
+ <property name="border_width">6</property>
|
|
| 282 | 627 |
<property name="orientation">vertical</property>
|
| 628 |
+ <child>
|
|
| 629 |
+ <placeholder/>
|
|
| 630 |
+ </child>
|
|
| 631 |
+ <child>
|
|
| 632 |
+ <placeholder/>
|
|
| 633 |
+ </child>
|
|
| 634 |
+ <child>
|
|
| 635 |
+ <placeholder/>
|
|
| 636 |
+ </child>
|
|
| 283 | 637 |
</object>
|
| 284 | 638 |
<packing>
|
| 285 | 639 |
<property name="position">9</property>
|
| ... | ... | @@ -289,7 +643,6 @@ |
| 289 | 643 |
<object class="GtkImage" id="traveling_image">
|
| 290 | 644 |
<property name="visible">True</property>
|
| 291 | 645 |
<property name="can_focus">False</property>
|
| 292 |
- <property name="stock">gtk-missing-image</property>
|
|
| 293 | 646 |
<property name="icon_size">1</property>
|
| 294 | 647 |
</object>
|
| 295 | 648 |
<packing>
|
| ... | ... | @@ -298,10 +651,20 @@ |
| 298 | 651 |
</packing>
|
| 299 | 652 |
</child>
|
| 300 | 653 |
<child>
|
| 301 |
- <object class="GtkBox" id="working_vbox">
|
|
| 654 |
+ <object class="GtkBox" id="working_box">
|
|
| 302 | 655 |
<property name="visible">True</property>
|
| 303 | 656 |
<property name="can_focus">False</property>
|
| 657 |
+ <property name="border_width">6</property>
|
|
| 304 | 658 |
<property name="orientation">vertical</property>
|
| 659 |
+ <child>
|
|
| 660 |
+ <placeholder/>
|
|
| 661 |
+ </child>
|
|
| 662 |
+ <child>
|
|
| 663 |
+ <placeholder/>
|
|
| 664 |
+ </child>
|
|
| 665 |
+ <child>
|
|
| 666 |
+ <placeholder/>
|
|
| 667 |
+ </child>
|
|
| 305 | 668 |
</object>
|
| 306 | 669 |
<packing>
|
| 307 | 670 |
<property name="position">10</property>
|
| ... | ... | @@ -311,7 +674,6 @@ |
| 311 | 674 |
<object class="GtkImage" id="working_image">
|
| 312 | 675 |
<property name="visible">True</property>
|
| 313 | 676 |
<property name="can_focus">False</property>
|
| 314 |
- <property name="stock">gtk-missing-image</property>
|
|
| 315 | 677 |
<property name="icon_size">1</property>
|
| 316 | 678 |
</object>
|
| 317 | 679 |
<packing>
|
| ... | ... | @@ -320,53 +682,133 @@ |
| 320 | 682 |
</packing>
|
| 321 | 683 |
</child>
|
| 322 | 684 |
</object>
|
| 685 |
+ <packing>
|
|
| 686 |
+ <property name="expand">True</property>
|
|
| 687 |
+ <property name="fill">True</property>
|
|
| 688 |
+ <property name="position">2</property>
|
|
| 689 |
+ </packing>
|
|
| 690 |
+ </child>
|
|
| 691 |
+ <child>
|
|
| 692 |
+ <object class="GtkButton">
|
|
| 693 |
+ <property name="label" translatable="yes">_Back</property>
|
|
| 694 |
+ <property name="visible">True</property>
|
|
| 695 |
+ <property name="can_focus">True</property>
|
|
| 696 |
+ <property name="receives_default">True</property>
|
|
| 697 |
+ <property name="halign">center</property>
|
|
| 698 |
+ <property name="margin_top">12</property>
|
|
| 699 |
+ <property name="use_underline">True</property>
|
|
| 700 |
+ <signal name="clicked" handler="_on_back_clicked" swapped="no"/>
|
|
| 701 |
+ <style>
|
|
| 702 |
+ <class name="suggested-action"/>
|
|
| 703 |
+ </style>
|
|
| 704 |
+ </object>
|
|
| 323 | 705 |
<packing>
|
| 324 | 706 |
<property name="expand">False</property>
|
| 325 | 707 |
<property name="fill">True</property>
|
| 326 | 708 |
<property name="position">3</property>
|
| 327 | 709 |
</packing>
|
| 328 | 710 |
</child>
|
| 711 |
+ </object>
|
|
| 712 |
+ <packing>
|
|
| 713 |
+ <property name="name">activity-page</property>
|
|
| 714 |
+ <property name="position">1</property>
|
|
| 715 |
+ </packing>
|
|
| 716 |
+ </child>
|
|
| 717 |
+ <child>
|
|
| 718 |
+ <object class="GtkBox">
|
|
| 719 |
+ <property name="visible">True</property>
|
|
| 720 |
+ <property name="can_focus">False</property>
|
|
| 721 |
+ <property name="border_width">18</property>
|
|
| 722 |
+ <property name="orientation">vertical</property>
|
|
| 723 |
+ <property name="spacing">6</property>
|
|
| 329 | 724 |
<child>
|
| 330 |
- <object class="GtkBox" id="hbox1">
|
|
| 725 |
+ <object class="GtkLabel">
|
|
| 331 | 726 |
<property name="visible">True</property>
|
| 332 | 727 |
<property name="can_focus">False</property>
|
| 728 |
+ <property name="margin_bottom">12</property>
|
|
| 729 |
+ <property name="label" translatable="yes">Mood</property>
|
|
| 730 |
+ <style>
|
|
| 731 |
+ <class name="large-header"/>
|
|
| 732 |
+ </style>
|
|
| 733 |
+ </object>
|
|
| 734 |
+ <packing>
|
|
| 735 |
+ <property name="expand">False</property>
|
|
| 736 |
+ <property name="fill">True</property>
|
|
| 737 |
+ <property name="position">0</property>
|
|
| 738 |
+ </packing>
|
|
| 739 |
+ </child>
|
|
| 740 |
+ <child>
|
|
| 741 |
+ <object class="GtkLabel" id="mood_label">
|
|
| 742 |
+ <property name="visible">True</property>
|
|
| 743 |
+ <property name="can_focus">False</property>
|
|
| 744 |
+ <style>
|
|
| 745 |
+ <class name="bold"/>
|
|
| 746 |
+ </style>
|
|
| 747 |
+ </object>
|
|
| 748 |
+ <packing>
|
|
| 749 |
+ <property name="expand">False</property>
|
|
| 750 |
+ <property name="fill">True</property>
|
|
| 751 |
+ <property name="position">2</property>
|
|
| 752 |
+ </packing>
|
|
| 753 |
+ </child>
|
|
| 754 |
+ <child>
|
|
| 755 |
+ <object class="GtkGrid" id="moods_grid">
|
|
| 756 |
+ <property name="visible">True</property>
|
|
| 757 |
+ <property name="can_focus">False</property>
|
|
| 758 |
+ <property name="hexpand">True</property>
|
|
| 333 | 759 |
<child>
|
| 334 |
- <object class="GtkLabel" id="label1">
|
|
| 335 |
- <property name="visible">True</property>
|
|
| 336 |
- <property name="can_focus">False</property>
|
|
| 337 |
- <property name="label" translatable="yes"><b>Message:</b> </property>
|
|
| 338 |
- <property name="use_markup">True</property>
|
|
| 339 |
- </object>
|
|
| 340 |
- <packing>
|
|
| 341 |
- <property name="expand">False</property>
|
|
| 342 |
- <property name="fill">False</property>
|
|
| 343 |
- <property name="position">0</property>
|
|
| 344 |
- </packing>
|
|
| 345 |
- </child>
|
|
| 346 |
- <child>
|
|
| 347 |
- <object class="GtkEntry" id="description_entry">
|
|
| 760 |
+ <object class="GtkRadioButton" id="no_mood_button">
|
|
| 348 | 761 |
<property name="visible">True</property>
|
| 349 |
- <property name="sensitive">False</property>
|
|
| 350 | 762 |
<property name="can_focus">True</property>
|
| 763 |
+ <property name="receives_default">False</property>
|
|
| 764 |
+ <property name="relief">none</property>
|
|
| 765 |
+ <property name="active">True</property>
|
|
| 766 |
+ <property name="draw_indicator">False</property>
|
|
| 767 |
+ <child>
|
|
| 768 |
+ <object class="GtkImage">
|
|
| 769 |
+ <property name="visible">True</property>
|
|
| 770 |
+ <property name="can_focus">False</property>
|
|
| 771 |
+ <property name="icon_size">1</property>
|
|
| 772 |
+ </object>
|
|
| 773 |
+ </child>
|
|
| 351 | 774 |
</object>
|
| 352 | 775 |
<packing>
|
| 353 |
- <property name="expand">False</property>
|
|
| 354 |
- <property name="fill">True</property>
|
|
| 355 |
- <property name="position">1</property>
|
|
| 776 |
+ <property name="left_attach">0</property>
|
|
| 777 |
+ <property name="top_attach">0</property>
|
|
| 356 | 778 |
</packing>
|
| 357 | 779 |
</child>
|
| 358 | 780 |
</object>
|
| 781 |
+ <packing>
|
|
| 782 |
+ <property name="expand">True</property>
|
|
| 783 |
+ <property name="fill">True</property>
|
|
| 784 |
+ <property name="position">3</property>
|
|
| 785 |
+ </packing>
|
|
| 786 |
+ </child>
|
|
| 787 |
+ <child>
|
|
| 788 |
+ <object class="GtkButton">
|
|
| 789 |
+ <property name="label" translatable="yes">_Back</property>
|
|
| 790 |
+ <property name="visible">True</property>
|
|
| 791 |
+ <property name="can_focus">True</property>
|
|
| 792 |
+ <property name="receives_default">True</property>
|
|
| 793 |
+ <property name="halign">center</property>
|
|
| 794 |
+ <property name="margin_top">12</property>
|
|
| 795 |
+ <property name="use_underline">True</property>
|
|
| 796 |
+ <signal name="clicked" handler="_on_back_clicked" swapped="no"/>
|
|
| 797 |
+ <style>
|
|
| 798 |
+ <class name="suggested-action"/>
|
|
| 799 |
+ </style>
|
|
| 800 |
+ </object>
|
|
| 359 | 801 |
<packing>
|
| 360 | 802 |
<property name="expand">False</property>
|
| 361 |
- <property name="fill">False</property>
|
|
| 362 |
- <property name="position">4</property>
|
|
| 803 |
+ <property name="fill">True</property>
|
|
| 804 |
+ <property name="position">5</property>
|
|
| 363 | 805 |
</packing>
|
| 364 | 806 |
</child>
|
| 365 | 807 |
</object>
|
| 808 |
+ <packing>
|
|
| 809 |
+ <property name="name">mood-page</property>
|
|
| 810 |
+ <property name="position">2</property>
|
|
| 811 |
+ </packing>
|
|
| 366 | 812 |
</child>
|
| 367 |
- <action-widgets>
|
|
| 368 |
- <action-widget response="-6">cancel_button</action-widget>
|
|
| 369 |
- <action-widget response="-5">ok_button</action-widget>
|
|
| 370 |
- </action-widgets>
|
|
| 371 | 813 |
</object>
|
| 372 | 814 |
</interface>
|
| ... | ... | @@ -34,30 +34,19 @@ import logging |
| 34 | 34 |
|
| 35 | 35 |
from gi.repository import Gtk
|
| 36 | 36 |
from gi.repository import Gdk
|
| 37 |
-from gi.repository import GLib
|
|
| 38 | 37 |
|
| 39 | 38 |
from gajim.common.i18n import _
|
| 40 |
-from gajim.common.const import ACTIVITIES
|
|
| 41 |
-from gajim.common.const import MOODS
|
|
| 42 | 39 |
|
| 43 | 40 |
from gajim.common import app
|
| 44 | 41 |
from gajim.common import helpers
|
| 45 | 42 |
from gajim.common.exceptions import GajimGeneralException
|
| 46 | 43 |
|
| 47 |
-from gajim.gtk.dialogs import DialogButton
|
|
| 48 |
-from gajim.gtk.dialogs import NewConfirmationDialog
|
|
| 49 | 44 |
from gajim.gtk.dialogs import ErrorDialog
|
| 50 |
-from gajim.gtk.dialogs import InputDialog
|
|
| 51 | 45 |
from gajim.gtk.util import get_icon_name
|
| 52 | 46 |
from gajim.gtk.util import get_builder
|
| 53 |
-from gajim.gtk.util import get_activity_icon_name
|
|
| 54 | 47 |
from gajim.gtk.util import get_app_window
|
| 55 | 48 |
from gajim.gtk import gstreamer
|
| 56 | 49 |
|
| 57 |
-if app.is_installed('GSPELL'):
|
|
| 58 |
- from gi.repository import Gspell # pylint: disable=ungrouped-imports
|
|
| 59 |
- |
|
| 60 |
- |
|
| 61 | 50 |
log = logging.getLogger('gajim.dialogs')
|
| 62 | 51 |
|
| 63 | 52 |
|
| ... | ... | @@ -216,533 +205,6 @@ class EditGroupsDialog: |
| 216 | 205 |
column.add_attribute(renderer, 'inconsistent', 2)
|
| 217 | 206 |
|
| 218 | 207 |
|
| 219 |
-class ChangeActivityDialog:
|
|
| 220 |
- PAGELIST = [
|
|
| 221 |
- 'doing_chores', 'drinking', 'eating', 'exercising', 'grooming',
|
|
| 222 |
- 'having_appointment', 'inactive', 'relaxing', 'talking', 'traveling',
|
|
| 223 |
- 'working']
|
|
| 224 |
- |
|
| 225 |
- def __init__(self, on_response, activity_=None, subactivity_=None, text=''):
|
|
| 226 |
- self.on_response = on_response
|
|
| 227 |
- self.activity = activity_
|
|
| 228 |
- self.subactivity = subactivity_
|
|
| 229 |
- self.text = text
|
|
| 230 |
- self.xml = get_builder('change_activity_dialog.ui')
|
|
| 231 |
- self.window = self.xml.get_object('change_activity_dialog')
|
|
| 232 |
- self.window.set_transient_for(app.interface.roster.window)
|
|
| 233 |
- |
|
| 234 |
- self.checkbutton = self.xml.get_object('enable_checkbutton')
|
|
| 235 |
- self.notebook = self.xml.get_object('notebook')
|
|
| 236 |
- self.entry = self.xml.get_object('description_entry')
|
|
| 237 |
- |
|
| 238 |
- rbtns = {}
|
|
| 239 |
- group = None
|
|
| 240 |
- |
|
| 241 |
- for category in ACTIVITIES:
|
|
| 242 |
- icon_name = get_activity_icon_name(category)
|
|
| 243 |
- item = self.xml.get_object(category + '_image')
|
|
| 244 |
- item.set_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
| 245 |
- item.set_tooltip_text(ACTIVITIES[category]['category'])
|
|
| 246 |
- |
|
| 247 |
- vbox = self.xml.get_object(category + '_vbox')
|
|
| 248 |
- vbox.set_border_width(5)
|
|
| 249 |
- |
|
| 250 |
- # Other
|
|
| 251 |
- act = category + '_other'
|
|
| 252 |
- |
|
| 253 |
- if group:
|
|
| 254 |
- rbtns[act] = Gtk.RadioButton()
|
|
| 255 |
- rbtns[act].join_group(group)
|
|
| 256 |
- else:
|
|
| 257 |
- rbtns[act] = group = Gtk.RadioButton()
|
|
| 258 |
- |
|
| 259 |
- icon = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
| 260 |
- hbox = Gtk.HBox(homogeneous=False, spacing=5)
|
|
| 261 |
- hbox.pack_start(icon, False, False, 0)
|
|
| 262 |
- lbl = Gtk.Label(
|
|
| 263 |
- label='<b>%s</b>' % ACTIVITIES[category]['category'])
|
|
| 264 |
- lbl.set_use_markup(True)
|
|
| 265 |
- hbox.pack_start(lbl, False, False, 0)
|
|
| 266 |
- rbtns[act].add(hbox)
|
|
| 267 |
- rbtns[act].connect(
|
|
| 268 |
- 'toggled', self.on_rbtn_toggled, [category, 'other'])
|
|
| 269 |
- vbox.pack_start(rbtns[act], False, False, 0)
|
|
| 270 |
- |
|
| 271 |
- activities = list(ACTIVITIES[category].keys())
|
|
| 272 |
- activities.sort()
|
|
| 273 |
- for activity in activities:
|
|
| 274 |
- if activity == 'category':
|
|
| 275 |
- continue
|
|
| 276 |
- |
|
| 277 |
- act = category + '_' + activity
|
|
| 278 |
- |
|
| 279 |
- if group:
|
|
| 280 |
- rbtns[act] = Gtk.RadioButton()
|
|
| 281 |
- rbtns[act].join_group(group)
|
|
| 282 |
- else:
|
|
| 283 |
- rbtns[act] = group = Gtk.RadioButton()
|
|
| 284 |
- |
|
| 285 |
- icon_name = get_activity_icon_name(category, activity)
|
|
| 286 |
- icon = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
| 287 |
- label = Gtk.Label(label=ACTIVITIES[category][activity])
|
|
| 288 |
- hbox = Gtk.HBox(homogeneous=False, spacing=5)
|
|
| 289 |
- hbox.pack_start(icon, False, False, 0)
|
|
| 290 |
- hbox.pack_start(label, False, False, 0)
|
|
| 291 |
- rbtns[act].connect(
|
|
| 292 |
- 'toggled', self.on_rbtn_toggled, [category, activity])
|
|
| 293 |
- rbtns[act].add(hbox)
|
|
| 294 |
- vbox.pack_start(rbtns[act], False, False, 0)
|
|
| 295 |
- |
|
| 296 |
- |
|
| 297 |
- self.default_radio = rbtns['doing_chores_other']
|
|
| 298 |
- |
|
| 299 |
- if self.activity in ACTIVITIES:
|
|
| 300 |
- if not self.subactivity in ACTIVITIES[self.activity]:
|
|
| 301 |
- self.subactivity = 'other'
|
|
| 302 |
- |
|
| 303 |
- rbtns[self.activity + '_' + self.subactivity].set_active(True)
|
|
| 304 |
- |
|
| 305 |
- self.checkbutton.set_active(True)
|
|
| 306 |
- self.notebook.set_sensitive(True)
|
|
| 307 |
- self.entry.set_sensitive(True)
|
|
| 308 |
- |
|
| 309 |
- self.notebook.set_current_page(
|
|
| 310 |
- self.PAGELIST.index(self.activity))
|
|
| 311 |
- self.entry.set_text(text)
|
|
| 312 |
- |
|
| 313 |
- else:
|
|
| 314 |
- self.checkbutton.set_active(False)
|
|
| 315 |
- |
|
| 316 |
- self.xml.connect_signals(self)
|
|
| 317 |
- self.window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
|
|
| 318 |
- self.window.show_all()
|
|
| 319 |
- |
|
| 320 |
- def on_enable_checkbutton_toggled(self, widget):
|
|
| 321 |
- self.notebook.set_sensitive(widget.get_active())
|
|
| 322 |
- self.entry.set_sensitive(widget.get_active())
|
|
| 323 |
- if not self.activity:
|
|
| 324 |
- self.default_radio.set_active(True)
|
|
| 325 |
- |
|
| 326 |
- def on_rbtn_toggled(self, widget, data):
|
|
| 327 |
- if widget.get_active():
|
|
| 328 |
- self.activity = data[0]
|
|
| 329 |
- self.subactivity = data[1]
|
|
| 330 |
- |
|
| 331 |
- def on_ok_button_clicked(self, widget):
|
|
| 332 |
- """
|
|
| 333 |
- Return activity and message (None if no activity selected)
|
|
| 334 |
- """
|
|
| 335 |
- if self.checkbutton.get_active():
|
|
| 336 |
- self.on_response(
|
|
| 337 |
- self.activity, self.subactivity, self.entry.get_text())
|
|
| 338 |
- else:
|
|
| 339 |
- self.on_response(None, None, '')
|
|
| 340 |
- self.window.destroy()
|
|
| 341 |
- |
|
| 342 |
- def on_cancel_button_clicked(self, widget):
|
|
| 343 |
- self.window.destroy()
|
|
| 344 |
- |
|
| 345 |
-class ChangeMoodDialog:
|
|
| 346 |
- COLS = 11
|
|
| 347 |
- |
|
| 348 |
- def __init__(self, on_response, mood_=None, text=''):
|
|
| 349 |
- self.on_response = on_response
|
|
| 350 |
- self.mood = mood_
|
|
| 351 |
- self.text = text
|
|
| 352 |
- self.xml = get_builder('change_mood_dialog.ui')
|
|
| 353 |
- |
|
| 354 |
- self.window = self.xml.get_object('change_mood_dialog')
|
|
| 355 |
- self.window.set_transient_for(app.interface.roster.window)
|
|
| 356 |
- self.window.set_title(_('Set Mood'))
|
|
| 357 |
- |
|
| 358 |
- table = self.xml.get_object('mood_icons_table')
|
|
| 359 |
- self.label = self.xml.get_object('mood_label')
|
|
| 360 |
- self.entry = self.xml.get_object('description_entry')
|
|
| 361 |
- |
|
| 362 |
- no_mood_button = self.xml.get_object('no_mood_button')
|
|
| 363 |
- no_mood_button.set_mode(False)
|
|
| 364 |
- no_mood_button.connect('clicked',
|
|
| 365 |
- self.on_mood_button_clicked, None)
|
|
| 366 |
- |
|
| 367 |
- x = 1
|
|
| 368 |
- y = 0
|
|
| 369 |
- self.mood_buttons = {}
|
|
| 370 |
- |
|
| 371 |
- # Order them first
|
|
| 372 |
- self.MOODS = []
|
|
| 373 |
- for mood in MOODS:
|
|
| 374 |
- self.MOODS.append(mood)
|
|
| 375 |
- self.MOODS.sort()
|
|
| 376 |
- |
|
| 377 |
- for mood in self.MOODS:
|
|
| 378 |
- image = Gtk.Image.new_from_icon_name(
|
|
| 379 |
- 'mood-%s' % mood, Gtk.IconSize.MENU)
|
|
| 380 |
- self.mood_buttons[mood] = Gtk.RadioButton()
|
|
| 381 |
- self.mood_buttons[mood].join_group(no_mood_button)
|
|
| 382 |
- self.mood_buttons[mood].set_mode(False)
|
|
| 383 |
- self.mood_buttons[mood].add(image)
|
|
| 384 |
- self.mood_buttons[mood].set_relief(Gtk.ReliefStyle.NONE)
|
|
| 385 |
- self.mood_buttons[mood].set_tooltip_text(MOODS[mood])
|
|
| 386 |
- self.mood_buttons[mood].connect('clicked',
|
|
| 387 |
- self.on_mood_button_clicked, mood)
|
|
| 388 |
- table.attach(self.mood_buttons[mood], x, y, 1, 1)
|
|
| 389 |
- |
|
| 390 |
- # Calculate the next position
|
|
| 391 |
- x += 1
|
|
| 392 |
- if x >= self.COLS:
|
|
| 393 |
- x = 0
|
|
| 394 |
- y += 1
|
|
| 395 |
- |
|
| 396 |
- if self.mood in MOODS:
|
|
| 397 |
- self.mood_buttons[self.mood].set_active(True)
|
|
| 398 |
- self.label.set_text(MOODS[self.mood])
|
|
| 399 |
- self.entry.set_sensitive(True)
|
|
| 400 |
- if self.text:
|
|
| 401 |
- self.entry.set_text(self.text)
|
|
| 402 |
- else:
|
|
| 403 |
- self.label.set_text(_('None'))
|
|
| 404 |
- self.entry.set_text('')
|
|
| 405 |
- self.entry.set_sensitive(False)
|
|
| 406 |
- |
|
| 407 |
- self.xml.connect_signals(self)
|
|
| 408 |
- self.window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
|
|
| 409 |
- self.window.show_all()
|
|
| 410 |
- |
|
| 411 |
- def on_mood_button_clicked(self, widget, data):
|
|
| 412 |
- if data:
|
|
| 413 |
- self.label.set_text(MOODS[data])
|
|
| 414 |
- self.entry.set_sensitive(True)
|
|
| 415 |
- else:
|
|
| 416 |
- self.label.set_text(_('None'))
|
|
| 417 |
- self.entry.set_text('')
|
|
| 418 |
- self.entry.set_sensitive(False)
|
|
| 419 |
- self.mood = data
|
|
| 420 |
- |
|
| 421 |
- def on_ok_button_clicked(self, widget):
|
|
| 422 |
- '''Return mood and message (None if no mood selected)'''
|
|
| 423 |
- message = self.entry.get_text()
|
|
| 424 |
- self.on_response(self.mood, message)
|
|
| 425 |
- self.window.destroy()
|
|
| 426 |
- |
|
| 427 |
- def on_cancel_button_clicked(self, widget):
|
|
| 428 |
- self.window.destroy()
|
|
| 429 |
- |
|
| 430 |
-class TimeoutDialog:
|
|
| 431 |
- """
|
|
| 432 |
- Class designed to be derivated to create timeout'd dialogs (dialogs that
|
|
| 433 |
- closes automatically after a timeout)
|
|
| 434 |
- """
|
|
| 435 |
- def __init__(self, timeout):
|
|
| 436 |
- self.countdown_left = timeout
|
|
| 437 |
- self.countdown_enabled = True
|
|
| 438 |
- self.title_text = ''
|
|
| 439 |
- |
|
| 440 |
- def run_timeout(self):
|
|
| 441 |
- if self.countdown_left > 0:
|
|
| 442 |
- self.countdown()
|
|
| 443 |
- GLib.timeout_add_seconds(1, self.countdown)
|
|
| 444 |
- |
|
| 445 |
- def on_timeout(self):
|
|
| 446 |
- """
|
|
| 447 |
- To be implemented in derivated classes
|
|
| 448 |
- """
|
|
| 449 |
- |
|
| 450 |
- def countdown(self):
|
|
| 451 |
- if self.countdown_enabled:
|
|
| 452 |
- if self.countdown_left <= 0:
|
|
| 453 |
- self.on_timeout()
|
|
| 454 |
- return False
|
|
| 455 |
- self.dialog.set_title('%s [%s]' % (
|
|
| 456 |
- self.title_text, str(self.countdown_left)))
|
|
| 457 |
- self.countdown_left -= 1
|
|
| 458 |
- return True
|
|
| 459 |
- |
|
| 460 |
- self.dialog.set_title(self.title_text)
|
|
| 461 |
- return False
|
|
| 462 |
- |
|
| 463 |
-class ChangeStatusMessageDialog(TimeoutDialog):
|
|
| 464 |
- def __init__(self, on_response, show=None, show_pep=True):
|
|
| 465 |
- countdown_time = app.config.get('change_status_window_timeout')
|
|
| 466 |
- TimeoutDialog.__init__(self, countdown_time)
|
|
| 467 |
- self.show = show
|
|
| 468 |
- self.pep_dict = {}
|
|
| 469 |
- self.show_pep = show_pep
|
|
| 470 |
- self.on_response = on_response
|
|
| 471 |
- self.xml = get_builder('change_status_message_dialog.ui')
|
|
| 472 |
- self.dialog = self.xml.get_object('change_status_message_dialog')
|
|
| 473 |
- self.dialog.set_transient_for(app.interface.roster.window)
|
|
| 474 |
- msg = None
|
|
| 475 |
- if show:
|
|
| 476 |
- uf_show = helpers.get_uf_show(show)
|
|
| 477 |
- self.title_text = _('%s Status Message') % uf_show
|
|
| 478 |
- msg = app.config.get_per('statusmsg', '_last_' + self.show,
|
|
| 479 |
- 'message')
|
|
| 480 |
- self.pep_dict['activity'] = app.config.get_per('statusmsg',
|
|
| 481 |
- '_last_' + self.show, 'activity')
|
|
| 482 |
- self.pep_dict['subactivity'] = app.config.get_per('statusmsg',
|
|
| 483 |
- '_last_' + self.show, 'subactivity')
|
|
| 484 |
- self.pep_dict['activity_text'] = app.config.get_per('statusmsg',
|
|
| 485 |
- '_last_' + self.show, 'activity_text')
|
|
| 486 |
- self.pep_dict['mood'] = app.config.get_per('statusmsg',
|
|
| 487 |
- '_last_' + self.show, 'mood')
|
|
| 488 |
- self.pep_dict['mood_text'] = app.config.get_per('statusmsg',
|
|
| 489 |
- '_last_' + self.show, 'mood_text')
|
|
| 490 |
- else:
|
|
| 491 |
- self.title_text = _('Status Message')
|
|
| 492 |
- self.dialog.set_title(self.title_text)
|
|
| 493 |
- |
|
| 494 |
- message_textview = self.xml.get_object('message_textview')
|
|
| 495 |
- self.message_buffer = message_textview.get_buffer()
|
|
| 496 |
- |
|
| 497 |
- if app.config.get('use_speller') and app.is_installed('GSPELL'):
|
|
| 498 |
- lang = app.config.get('speller_language')
|
|
| 499 |
- gspell_lang = Gspell.language_lookup(lang)
|
|
| 500 |
- if gspell_lang is None:
|
|
| 501 |
- gspell_lang = Gspell.language_get_default()
|
|
| 502 |
- spell_buffer = Gspell.TextBuffer.get_from_gtk_text_buffer(
|
|
| 503 |
- self.message_buffer)
|
|
| 504 |
- spell_buffer.set_spell_checker(Gspell.Checker.new(gspell_lang))
|
|
| 505 |
- spell_view = Gspell.TextView.get_from_gtk_text_view(
|
|
| 506 |
- message_textview)
|
|
| 507 |
- spell_view.set_inline_spell_checking(True)
|
|
| 508 |
- spell_view.set_enable_language_menu(True)
|
|
| 509 |
- |
|
| 510 |
- self.message_buffer.connect('changed', self.on_message_buffer_changed)
|
|
| 511 |
- if not msg:
|
|
| 512 |
- msg = ''
|
|
| 513 |
- msg = helpers.from_one_line(msg)
|
|
| 514 |
- self.message_buffer.set_text(msg)
|
|
| 515 |
- |
|
| 516 |
- # have an empty string selectable, so user can clear msg
|
|
| 517 |
- self.preset_messages_dict = {'': ['', '', '', '', '', '']}
|
|
| 518 |
- for msg_name in app.config.get_per('statusmsg'):
|
|
| 519 |
- if msg_name.startswith('_last_'):
|
|
| 520 |
- continue
|
|
| 521 |
- opts = []
|
|
| 522 |
- for opt in ['message', 'activity', 'subactivity', 'activity_text',
|
|
| 523 |
- 'mood', 'mood_text']:
|
|
| 524 |
- opts.append(app.config.get_per('statusmsg', msg_name, opt))
|
|
| 525 |
- opts[0] = helpers.from_one_line(opts[0])
|
|
| 526 |
- self.preset_messages_dict[msg_name] = opts
|
|
| 527 |
- sorted_keys_list = helpers.get_sorted_keys(self.preset_messages_dict)
|
|
| 528 |
- |
|
| 529 |
- self.message_liststore = Gtk.ListStore(str) # msg_name
|
|
| 530 |
- self.message_combobox = self.xml.get_object('message_combobox')
|
|
| 531 |
- self.message_combobox.set_model(self.message_liststore)
|
|
| 532 |
- cellrenderertext = Gtk.CellRendererText()
|
|
| 533 |
- self.message_combobox.pack_start(cellrenderertext, True)
|
|
| 534 |
- self.message_combobox.add_attribute(cellrenderertext, 'text', 0)
|
|
| 535 |
- for msg_name in sorted_keys_list:
|
|
| 536 |
- self.message_liststore.append((msg_name,))
|
|
| 537 |
- |
|
| 538 |
- if show_pep:
|
|
| 539 |
- self.draw_activity()
|
|
| 540 |
- self.draw_mood()
|
|
| 541 |
- else:
|
|
| 542 |
- # remove acvtivity / mood lines
|
|
| 543 |
- self.xml.get_object('activity_label').set_no_show_all(True)
|
|
| 544 |
- self.xml.get_object('activity_button').set_no_show_all(True)
|
|
| 545 |
- self.xml.get_object('mood_label').set_no_show_all(True)
|
|
| 546 |
- self.xml.get_object('mood_button').set_no_show_all(True)
|
|
| 547 |
- self.xml.get_object('activity_label').hide()
|
|
| 548 |
- self.xml.get_object('activity_button').hide()
|
|
| 549 |
- self.xml.get_object('mood_label').hide()
|
|
| 550 |
- self.xml.get_object('mood_button').hide()
|
|
| 551 |
- |
|
| 552 |
- self.xml.connect_signals(self)
|
|
| 553 |
- self.run_timeout()
|
|
| 554 |
- self.dialog.connect('response', self.on_dialog_response)
|
|
| 555 |
- self.dialog.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
|
|
| 556 |
- self.dialog.show_all()
|
|
| 557 |
- |
|
| 558 |
- def draw_activity(self):
|
|
| 559 |
- """
|
|
| 560 |
- Set activity button
|
|
| 561 |
- """
|
|
| 562 |
- img = self.xml.get_object('activity_image')
|
|
| 563 |
- label = self.xml.get_object('activity_button_label')
|
|
| 564 |
- if 'activity' in self.pep_dict and self.pep_dict['activity'] in \
|
|
| 565 |
- ACTIVITIES:
|
|
| 566 |
- if 'subactivity' in self.pep_dict and self.pep_dict['subactivity'] \
|
|
| 567 |
- in ACTIVITIES[self.pep_dict['activity']]:
|
|
| 568 |
- icon_name = get_activity_icon_name(self.pep_dict['activity'],
|
|
| 569 |
- self.pep_dict['subactivity'])
|
|
| 570 |
- img.set_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
| 571 |
- else:
|
|
| 572 |
- icon_name = get_activity_icon_name(self.pep_dict['activity'])
|
|
| 573 |
- img.set_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
| 574 |
- if self.pep_dict['activity_text']:
|
|
| 575 |
- label.set_text(self.pep_dict['activity_text'])
|
|
| 576 |
- else:
|
|
| 577 |
- label.set_text('')
|
|
| 578 |
- else:
|
|
| 579 |
- img.set_from_pixbuf(None)
|
|
| 580 |
- label.set_text('')
|
|
| 581 |
- |
|
| 582 |
- def draw_mood(self):
|
|
| 583 |
- """
|
|
| 584 |
- Set mood button
|
|
| 585 |
- """
|
|
| 586 |
- img = self.xml.get_object('mood_image')
|
|
| 587 |
- label = self.xml.get_object('mood_button_label')
|
|
| 588 |
- if 'mood' in self.pep_dict and self.pep_dict['mood'] in MOODS:
|
|
| 589 |
- img.set_from_icon_name('mood-%s' % self.pep_dict['mood'],
|
|
| 590 |
- Gtk.IconSize.MENU)
|
|
| 591 |
- if self.pep_dict['mood_text']:
|
|
| 592 |
- label.set_text(self.pep_dict['mood_text'])
|
|
| 593 |
- else:
|
|
| 594 |
- label.set_text('')
|
|
| 595 |
- else:
|
|
| 596 |
- img.set_from_pixbuf(None)
|
|
| 597 |
- label.set_text('')
|
|
| 598 |
- |
|
| 599 |
- def on_timeout(self):
|
|
| 600 |
- # Prevent GUI freeze when the combobox menu is opened on close
|
|
| 601 |
- self.message_combobox.popdown()
|
|
| 602 |
- self.dialog.response(Gtk.ResponseType.OK)
|
|
| 603 |
- |
|
| 604 |
- def on_dialog_response(self, dialog, response):
|
|
| 605 |
- if response == Gtk.ResponseType.OK:
|
|
| 606 |
- beg, end = self.message_buffer.get_bounds()
|
|
| 607 |
- message = self.message_buffer.get_text(beg, end, True).strip()
|
|
| 608 |
- message = helpers.remove_invalid_xml_chars(message)
|
|
| 609 |
- msg = helpers.to_one_line(message)
|
|
| 610 |
- if self.show:
|
|
| 611 |
- app.config.set_per('statusmsg', '_last_' + self.show,
|
|
| 612 |
- 'message', msg)
|
|
| 613 |
- if self.show_pep:
|
|
| 614 |
- app.config.set_per('statusmsg', '_last_' + self.show,
|
|
| 615 |
- 'activity', self.pep_dict['activity'])
|
|
| 616 |
- app.config.set_per('statusmsg', '_last_' + self.show,
|
|
| 617 |
- 'subactivity', self.pep_dict['subactivity'])
|
|
| 618 |
- app.config.set_per('statusmsg', '_last_' + self.show,
|
|
| 619 |
- 'activity_text', self.pep_dict['activity_text'])
|
|
| 620 |
- app.config.set_per('statusmsg', '_last_' + self.show,
|
|
| 621 |
- 'mood', self.pep_dict['mood'])
|
|
| 622 |
- app.config.set_per('statusmsg', '_last_' + self.show,
|
|
| 623 |
- 'mood_text', self.pep_dict['mood_text'])
|
|
| 624 |
- else:
|
|
| 625 |
- message = None # user pressed Cancel button or X wm button
|
|
| 626 |
- self.dialog.destroy()
|
|
| 627 |
- self.on_response(message, self.pep_dict)
|
|
| 628 |
- |
|
| 629 |
- def on_message_combobox_changed(self, widget):
|
|
| 630 |
- self.countdown_enabled = False
|
|
| 631 |
- model = widget.get_model()
|
|
| 632 |
- active = widget.get_active()
|
|
| 633 |
- if active < 0:
|
|
| 634 |
- return None
|
|
| 635 |
- name = model[active][0]
|
|
| 636 |
- self.message_buffer.set_text(self.preset_messages_dict[name][0])
|
|
| 637 |
- self.pep_dict['activity'] = self.preset_messages_dict[name][1]
|
|
| 638 |
- self.pep_dict['subactivity'] = self.preset_messages_dict[name][2]
|
|
| 639 |
- self.pep_dict['activity_text'] = self.preset_messages_dict[name][3]
|
|
| 640 |
- self.pep_dict['mood'] = self.preset_messages_dict[name][4]
|
|
| 641 |
- self.pep_dict['mood_text'] = self.preset_messages_dict[name][5]
|
|
| 642 |
- self.draw_activity()
|
|
| 643 |
- self.draw_mood()
|
|
| 644 |
- |
|
| 645 |
- def on_change_status_message_dialog_key_press_event(self, widget, event):
|
|
| 646 |
- self.countdown_enabled = False
|
|
| 647 |
- if event.keyval == Gdk.KEY_Return or \
|
|
| 648 |
- event.keyval == Gdk.KEY_KP_Enter: # catch CTRL+ENTER
|
|
| 649 |
- if event.get_state() & Gdk.ModifierType.CONTROL_MASK:
|
|
| 650 |
- self.dialog.response(Gtk.ResponseType.OK)
|
|
| 651 |
- # Stop the event
|
|
| 652 |
- return True
|
|
| 653 |
- |
|
| 654 |
- def on_message_buffer_changed(self, widget):
|
|
| 655 |
- self.countdown_enabled = False
|
|
| 656 |
- self.toggle_sensitiviy_of_save_as_preset()
|
|
| 657 |
- |
|
| 658 |
- def toggle_sensitiviy_of_save_as_preset(self):
|
|
| 659 |
- btn = self.xml.get_object('save_as_preset_button')
|
|
| 660 |
- if self.message_buffer.get_char_count() == 0:
|
|
| 661 |
- btn.set_sensitive(False)
|
|
| 662 |
- else:
|
|
| 663 |
- btn.set_sensitive(True)
|
|
| 664 |
- |
|
| 665 |
- def on_save_as_preset_button_clicked(self, widget):
|
|
| 666 |
- self.countdown_enabled = False
|
|
| 667 |
- start_iter, finish_iter = self.message_buffer.get_bounds()
|
|
| 668 |
- status_message_to_save_as_preset = self.message_buffer.get_text(
|
|
| 669 |
- start_iter, finish_iter, True)
|
|
| 670 |
- |
|
| 671 |
- def _on_save_preset(msg_name):
|
|
| 672 |
- msg_text = status_message_to_save_as_preset
|
|
| 673 |
- msg_text_1l = helpers.to_one_line(msg_text)
|
|
| 674 |
- if not msg_name: # msg_name was ''
|
|
| 675 |
- msg_name = msg_text_1l
|
|
| 676 |
- |
|
| 677 |
- def _on_overwrite_preset():
|
|
| 678 |
- self.preset_messages_dict[msg_name] = [
|
|
| 679 |
- msg_text, self.pep_dict.get('activity'),
|
|
| 680 |
- self.pep_dict.get('subactivity'),
|
|
| 681 |
- self.pep_dict.get('activity_text'),
|
|
| 682 |
- self.pep_dict.get('mood'), self.pep_dict.get('mood_text')]
|
|
| 683 |
- app.config.set_per('statusmsg', msg_name, 'message',
|
|
| 684 |
- msg_text_1l)
|
|
| 685 |
- app.config.set_per('statusmsg', msg_name, 'activity',
|
|
| 686 |
- self.pep_dict.get('activity'))
|
|
| 687 |
- app.config.set_per('statusmsg', msg_name, 'subactivity',
|
|
| 688 |
- self.pep_dict.get('subactivity'))
|
|
| 689 |
- app.config.set_per('statusmsg', msg_name, 'activity_text',
|
|
| 690 |
- self.pep_dict.get('activity_text'))
|
|
| 691 |
- app.config.set_per('statusmsg', msg_name, 'mood',
|
|
| 692 |
- self.pep_dict.get('mood'))
|
|
| 693 |
- app.config.set_per('statusmsg', msg_name, 'mood_text',
|
|
| 694 |
- self.pep_dict.get('mood_text'))
|
|
| 695 |
- |
|
| 696 |
- if msg_name in self.preset_messages_dict:
|
|
| 697 |
- NewConfirmationDialog(
|
|
| 698 |
- _('Overwrite'),
|
|
| 699 |
- _('Overwrite Status Message?'),
|
|
| 700 |
- _('This name is already in use. Do you want to '
|
|
| 701 |
- 'overwrite this preset?'),
|
|
| 702 |
- [DialogButton.make('Cancel'),
|
|
| 703 |
- DialogButton.make('Remove',
|
|
| 704 |
- text=_('_Overwrite'),
|
|
| 705 |
- callback=_on_overwrite_preset)],
|
|
| 706 |
- transient_for=self.dialog).show()
|
|
| 707 |
- return
|
|
| 708 |
- |
|
| 709 |
- app.config.add_per('statusmsg', msg_name)
|
|
| 710 |
- _on_overwrite_preset()
|
|
| 711 |
- iter_ = self.message_liststore.append((msg_name,))
|
|
| 712 |
- # Select the one we just saved in combobox
|
|
| 713 |
- self.message_combobox.set_active_iter(iter_)
|
|
| 714 |
- |
|
| 715 |
- InputDialog(
|
|
| 716 |
- _('Status Preset'),
|
|
| 717 |
- _('Save status as preset'),
|
|
| 718 |
- _('Please assign a name to this status message preset'),
|
|
| 719 |
- [DialogButton.make('Cancel'),
|
|
| 720 |
- DialogButton.make('Accept',
|
|
| 721 |
- text=_('_Save'),
|
|
| 722 |
- callback=_on_save_preset)],
|
|
| 723 |
- input_str=_('New Status'),
|
|
| 724 |
- transient_for=self.dialog).show()
|
|
| 725 |
- |
|
| 726 |
- def on_activity_button_clicked(self, widget):
|
|
| 727 |
- self.countdown_enabled = False
|
|
| 728 |
- def on_response(activity, subactivity, text):
|
|
| 729 |
- self.pep_dict['activity'] = activity or ''
|
|
| 730 |
- self.pep_dict['subactivity'] = subactivity or ''
|
|
| 731 |
- self.pep_dict['activity_text'] = text
|
|
| 732 |
- self.draw_activity()
|
|
| 733 |
- ChangeActivityDialog(on_response, self.pep_dict['activity'],
|
|
| 734 |
- self.pep_dict['subactivity'], self.pep_dict['activity_text'])
|
|
| 735 |
- |
|
| 736 |
- def on_mood_button_clicked(self, widget):
|
|
| 737 |
- self.countdown_enabled = False
|
|
| 738 |
- def on_response(mood, text):
|
|
| 739 |
- self.pep_dict['mood'] = mood or ''
|
|
| 740 |
- self.pep_dict['mood_text'] = text
|
|
| 741 |
- self.draw_mood()
|
|
| 742 |
- ChangeMoodDialog(on_response, self.pep_dict['mood'],
|
|
| 743 |
- self.pep_dict['mood_text'])
|
|
| 744 |
- |
|
| 745 |
- |
|
| 746 | 208 |
class SynchroniseSelectAccountDialog:
|
| 747 | 209 |
def __init__(self, account):
|
| 748 | 210 |
# 'account' can be None if we are about to create our first one
|
| ... | ... | @@ -121,4 +121,5 @@ WINDOW_MODULES = { |
| 121 | 121 |
'ChangePassword': 'gajim.gtk.change_password',
|
| 122 | 122 |
'PluginsWindow': 'gajim.plugins.gui',
|
| 123 | 123 |
'Features': 'gajim.gtk.features',
|
| 124 |
+ 'StatusChange': 'gajim.gtk.status_change',
|
|
| 124 | 125 |
}
|
| ... | ... | @@ -518,6 +518,40 @@ class InputDialog(NewConfirmationDialog): |
| 518 | 518 |
super()._on_response(_dialog, response)
|
| 519 | 519 |
|
| 520 | 520 |
|
| 521 |
+class TimeoutWindow:
|
|
| 522 |
+ """
|
|
| 523 |
+ Class designed to be derivated by other windows
|
|
| 524 |
+ Derived windows close automatically after reaching the timeout
|
|
| 525 |
+ """
|
|
| 526 |
+ def __init__(self, timeout):
|
|
| 527 |
+ self.countdown_left = timeout
|
|
| 528 |
+ self.countdown_enabled = True
|
|
| 529 |
+ self.title_text = ''
|
|
| 530 |
+ |
|
| 531 |
+ def run_timeout(self):
|
|
| 532 |
+ if self.countdown_left > 0:
|
|
| 533 |
+ self.countdown()
|
|
| 534 |
+ GLib.timeout_add_seconds(1, self.countdown)
|
|
| 535 |
+ |
|
| 536 |
+ def on_timeout(self):
|
|
| 537 |
+ """
|
|
| 538 |
+ To be implemented by derivated classes
|
|
| 539 |
+ """
|
|
| 540 |
+ |
|
| 541 |
+ def countdown(self):
|
|
| 542 |
+ if self.countdown_enabled:
|
|
| 543 |
+ if self.countdown_left <= 0:
|
|
| 544 |
+ self.on_timeout()
|
|
| 545 |
+ return False
|
|
| 546 |
+ self.set_title('%s [%s]' % (
|
|
| 547 |
+ self.title_text, str(self.countdown_left)))
|
|
| 548 |
+ self.countdown_left -= 1
|
|
| 549 |
+ return True
|
|
| 550 |
+ |
|
| 551 |
+ self.set_title(self.title_text)
|
|
| 552 |
+ return False
|
|
| 553 |
+ |
|
| 554 |
+ |
|
| 521 | 555 |
class ShortcutsWindow:
|
| 522 | 556 |
def __init__(self):
|
| 523 | 557 |
transient = app.app.get_active_window()
|
| 1 |
+# This file is part of Gajim.
|
|
| 2 |
+#
|
|
| 3 |
+# Gajim is free software; you can redistribute it and/or modify
|
|
| 4 |
+# it under the terms of the GNU General Public License as published
|
|
| 5 |
+# by the Free Software Foundation; version 3 only.
|
|
| 6 |
+#
|
|
| 7 |
+# Gajim is distributed in the hope that it will be useful,
|
|
| 8 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 9 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 10 |
+# GNU General Public License for more details.
|
|
| 11 |
+#
|
|
| 12 |
+# You should have received a copy of the GNU General Public License
|
|
| 13 |
+# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
|
| 14 |
+ |
|
| 15 |
+from gi.repository import Gdk
|
|
| 16 |
+from gi.repository import Gtk
|
|
| 17 |
+ |
|
| 18 |
+from gajim.common import app
|
|
| 19 |
+from gajim.common.const import ACTIVITIES
|
|
| 20 |
+from gajim.common.const import MOODS
|
|
| 21 |
+from gajim.common.const import PEPEventType
|
|
| 22 |
+from gajim.common.helpers import from_one_line
|
|
| 23 |
+from gajim.common.helpers import to_one_line
|
|
| 24 |
+from gajim.common.helpers import remove_invalid_xml_chars
|
|
| 25 |
+from gajim.common.i18n import _
|
|
| 26 |
+ |
|
| 27 |
+from gajim.gtk.dialogs import TimeoutWindow
|
|
| 28 |
+from gajim.gtk.dialogs import DialogButton
|
|
| 29 |
+from gajim.gtk.dialogs import NewConfirmationDialog
|
|
| 30 |
+from gajim.gtk.dialogs import InputDialog
|
|
| 31 |
+from gajim.gtk.util import get_builder
|
|
| 32 |
+from gajim.gtk.util import get_activity_icon_name
|
|
| 33 |
+ |
|
| 34 |
+if app.is_installed('GSPELL'):
|
|
| 35 |
+ from gi.repository import Gspell # pylint: disable=ungrouped-imports
|
|
| 36 |
+ |
|
| 37 |
+ACTIVITY_PAGELIST = [
|
|
| 38 |
+ 'doing_chores',
|
|
| 39 |
+ 'drinking',
|
|
| 40 |
+ 'eating',
|
|
| 41 |
+ 'exercising',
|
|
| 42 |
+ 'grooming',
|
|
| 43 |
+ 'having_appointment',
|
|
| 44 |
+ 'inactive',
|
|
| 45 |
+ 'relaxing',
|
|
| 46 |
+ 'talking',
|
|
| 47 |
+ 'traveling',
|
|
| 48 |
+ 'working',
|
|
| 49 |
+]
|
|
| 50 |
+ |
|
| 51 |
+ |
|
| 52 |
+class StatusChange(Gtk.ApplicationWindow, TimeoutWindow):
|
|
| 53 |
+ def __init__(self, callback, account=None, show=None, show_pep=True):
|
|
| 54 |
+ Gtk.ApplicationWindow.__init__(self)
|
|
| 55 |
+ countdown_time = app.config.get('change_status_window_timeout')
|
|
| 56 |
+ TimeoutWindow.__init__(self, countdown_time)
|
|
| 57 |
+ self.set_name('StatusChange')
|
|
| 58 |
+ self.set_application(app.app)
|
|
| 59 |
+ self.set_position(Gtk.WindowPosition.CENTER)
|
|
| 60 |
+ self.set_show_menubar(False)
|
|
| 61 |
+ self.set_transient_for(app.interface.roster.window)
|
|
| 62 |
+ self.title_text = _('Status Message') # TimeoutWindow
|
|
| 63 |
+ |
|
| 64 |
+ self.account = account
|
|
| 65 |
+ self._callback = callback
|
|
| 66 |
+ self._show = show
|
|
| 67 |
+ self._show_pep = show_pep
|
|
| 68 |
+ |
|
| 69 |
+ self._ui = get_builder('status_change_window.ui')
|
|
| 70 |
+ self.add(self._ui.status_stack)
|
|
| 71 |
+ |
|
| 72 |
+ self._status_message = ''
|
|
| 73 |
+ self._pep_dict = {
|
|
| 74 |
+ 'activity': '',
|
|
| 75 |
+ 'subactivity': '',
|
|
| 76 |
+ 'mood': '',
|
|
| 77 |
+ }
|
|
| 78 |
+ self._get_current_status_data()
|
|
| 79 |
+ self._preset_messages_dict = {}
|
|
| 80 |
+ self._get_presets()
|
|
| 81 |
+ |
|
| 82 |
+ if self._show:
|
|
| 83 |
+ self._ui.activity_switch.set_active(self._pep_dict['activity'])
|
|
| 84 |
+ self._ui.activity_page_button.set_sensitive(
|
|
| 85 |
+ self._pep_dict['activity'])
|
|
| 86 |
+ self._ui.mood_switch.set_active(self._pep_dict['mood'])
|
|
| 87 |
+ self._ui.mood_page_button.set_sensitive(self._pep_dict['mood'])
|
|
| 88 |
+ |
|
| 89 |
+ self._message_buffer = self._ui.message_textview.get_buffer()
|
|
| 90 |
+ self._apply_speller()
|
|
| 91 |
+ self._message_buffer.set_text(from_one_line(self._status_message))
|
|
| 92 |
+ |
|
| 93 |
+ if show_pep:
|
|
| 94 |
+ self._draw_activity()
|
|
| 95 |
+ self._init_activities()
|
|
| 96 |
+ self._draw_mood()
|
|
| 97 |
+ self._init_moods()
|
|
| 98 |
+ else:
|
|
| 99 |
+ self._ui.activity_label.set_no_show_all(True)
|
|
| 100 |
+ self._ui.activity_button.set_no_show_all(True)
|
|
| 101 |
+ self._ui.mood_label.set_no_show_all(True)
|
|
| 102 |
+ self._ui.mood_button.set_no_show_all(True)
|
|
| 103 |
+ self._ui.activity_label.hide()
|
|
| 104 |
+ self._ui.activity_button.hide()
|
|
| 105 |
+ self._ui.mood_label.hide()
|
|
| 106 |
+ self._ui.mood_button.hide()
|
|
| 107 |
+ |
|
| 108 |
+ self._message_buffer.connect('changed', self._stop_timeout)
|
|
| 109 |
+ self.connect('key-press-event', self._on_key_press)
|
|
| 110 |
+ self._ui.connect_signals(self)
|
|
| 111 |
+ |
|
| 112 |
+ self.show_all()
|
|
| 113 |
+ self.run_timeout()
|
|
| 114 |
+ |
|
| 115 |
+ def on_timeout(self):
|
|
| 116 |
+ self._change_status()
|
|
| 117 |
+ |
|
| 118 |
+ def _stop_timeout(self, *args):
|
|
| 119 |
+ self.countdown_enabled = False
|
|
| 120 |
+ |
|
| 121 |
+ def _on_key_press(self, _widget, event):
|
|
| 122 |
+ self.countdown_enabled = False
|
|
| 123 |
+ if event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
|
|
| 124 |
+ if event.get_state() & Gdk.ModifierType.CONTROL_MASK:
|
|
| 125 |
+ self._change_status()
|
|
| 126 |
+ if event.keyval == Gdk.KEY_Escape:
|
|
| 127 |
+ self.destroy()
|
|
| 128 |
+ |
|
| 129 |
+ def _apply_speller(self):
|
|
| 130 |
+ if app.config.get('use_speller') and app.is_installed('GSPELL'):
|
|
| 131 |
+ lang = app.config.get('speller_language')
|
|
| 132 |
+ gspell_lang = Gspell.language_lookup(lang)
|
|
| 133 |
+ if gspell_lang is None:
|
|
| 134 |
+ gspell_lang = Gspell.language_get_default()
|
|
| 135 |
+ spell_buffer = Gspell.TextBuffer.get_from_gtk_text_buffer(
|
|
| 136 |
+ self._message_buffer)
|
|
| 137 |
+ spell_buffer.set_spell_checker(Gspell.Checker.new(gspell_lang))
|
|
| 138 |
+ spell_view = Gspell.TextView.get_from_gtk_text_view(
|
|
| 139 |
+ self._ui.message_textview)
|
|
| 140 |
+ spell_view.set_inline_spell_checking(True)
|
|
| 141 |
+ spell_view.set_enable_language_menu(True)
|
|
| 142 |
+ |
|
| 143 |
+ def _get_current_status_data(self):
|
|
| 144 |
+ '''
|
|
| 145 |
+ Gathers status/pep data for a given account or checks if all accounts
|
|
| 146 |
+ are synchronized. If not, no status message/pep data will be displayed.
|
|
| 147 |
+ '''
|
|
| 148 |
+ if self.account:
|
|
| 149 |
+ self._status_message = app.connections[self.account].status_message
|
|
| 150 |
+ activity_data = app.connections[self.account].pep.get(
|
|
| 151 |
+ PEPEventType.ACTIVITY)
|
|
| 152 |
+ mood_data = app.connections[self.account].pep.get(
|
|
| 153 |
+ PEPEventType.MOOD)
|
|
| 154 |
+ if activity_data:
|
|
| 155 |
+ self._pep_dict['activity'] = activity_data.activity
|
|
| 156 |
+ self._pep_dict['subactivity'] = activity_data.subactivity
|
|
| 157 |
+ if mood_data:
|
|
| 158 |
+ self._pep_dict['mood'] = mood_data.mood
|
|
| 159 |
+ else:
|
|
| 160 |
+ status_messages = []
|
|
| 161 |
+ activities = []
|
|
| 162 |
+ subactivities = []
|
|
| 163 |
+ moods = []
|
|
| 164 |
+ for account in app.get_connected_accounts():
|
|
| 165 |
+ status_messages.append(app.connections[account].status_message)
|
|
| 166 |
+ activity_data = app.connections[account].pep.get(
|
|
| 167 |
+ PEPEventType.ACTIVITY)
|
|
| 168 |
+ mood_data = app.connections[account].pep.get(PEPEventType.MOOD)
|
|
| 169 |
+ if activity_data:
|
|
| 170 |
+ activities.append(activity_data.activity)
|
|
| 171 |
+ subactivities.append(activity_data.subactivity)
|
|
| 172 |
+ if mood_data:
|
|
| 173 |
+ moods.append(mood_data.mood)
|
|
| 174 |
+ equal_messages = all(x == status_messages[0] for x in
|
|
| 175 |
+ status_messages)
|
|
| 176 |
+ equal_activities = all(x == activities[0] for x in activities)
|
|
| 177 |
+ equal_subactivities = all(x == subactivities[0] for x in
|
|
| 178 |
+ subactivities)
|
|
| 179 |
+ equal_moods = all(x == moods[0] for x in moods)
|
|
| 180 |
+ if equal_messages:
|
|
| 181 |
+ self._status_message = status_messages[0]
|
|
| 182 |
+ if activities and equal_activities:
|
|
| 183 |
+ self._pep_dict['activity'] = activities[0]
|
|
| 184 |
+ if subactivities and equal_subactivities:
|
|
| 185 |
+ self._pep_dict['subactivity'] = subactivities[0]
|
|
| 186 |
+ if moods and equal_moods:
|
|
| 187 |
+ self._pep_dict['mood'] = moods[0]
|
|
| 188 |
+ |
|
| 189 |
+ def _get_presets(self):
|
|
| 190 |
+ self._preset_messages_dict = {}
|
|
| 191 |
+ for msg_name in app.config.get_per('statusmsg'):
|
|
| 192 |
+ if msg_name.startswith('_last_'):
|
|
| 193 |
+ continue
|
|
| 194 |
+ opts = []
|
|
| 195 |
+ for opt in ['message', 'activity', 'subactivity', 'mood']:
|
|
| 196 |
+ opts.append(app.config.get_per('statusmsg', msg_name, opt))
|
|
| 197 |
+ opts[0] = from_one_line(opts[0])
|
|
| 198 |
+ self._preset_messages_dict[msg_name] = opts
|
|
| 199 |
+ self._build_preset_popover()
|
|
| 200 |
+ |
|
| 201 |
+ def _build_preset_popover(self):
|
|
| 202 |
+ child = self._ui.preset_popover.get_children()
|
|
| 203 |
+ if child:
|
|
| 204 |
+ self._ui.preset_popover.remove(child[0])
|
|
| 205 |
+ |
|
| 206 |
+ preset_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
|
| 207 |
+ preset_box.get_style_context().add_class('margin-3')
|
|
| 208 |
+ self._ui.preset_popover.add(preset_box)
|
|
| 209 |
+ |
|
| 210 |
+ for preset in self._preset_messages_dict:
|
|
| 211 |
+ button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
|
| 212 |
+ |
|
| 213 |
+ preset_button = Gtk.Button()
|
|
| 214 |
+ preset_button.set_name(preset)
|
|
| 215 |
+ preset_button.set_relief(Gtk.ReliefStyle.NONE)
|
|
| 216 |
+ preset_button.set_hexpand(True)
|
|
| 217 |
+ preset_button.add(Gtk.Label(label=preset, halign=Gtk.Align.START))
|
|
| 218 |
+ preset_button.connect('clicked', self._on_preset_select)
|
|
| 219 |
+ button_box.add(preset_button)
|
|
| 220 |
+ |
|
| 221 |
+ remove_button = Gtk.Button()
|
|
| 222 |
+ remove_button.set_name(preset)
|
|
| 223 |
+ remove_button.set_relief(Gtk.ReliefStyle.NONE)
|
|
| 224 |
+ remove_button.set_halign(Gtk.Align.END)
|
|
| 225 |
+ remove_button.add(Gtk.Image.new_from_icon_name(
|
|
| 226 |
+ 'edit-delete-symbolic', Gtk.IconSize.MENU))
|
|
| 227 |
+ remove_button.connect('clicked', self._on_preset_remove)
|
|
| 228 |
+ button_box.add(remove_button)
|
|
| 229 |
+ preset_box.add(button_box)
|
|
| 230 |
+ preset_box.show_all()
|
|
| 231 |
+ |
|
| 232 |
+ def _init_activities(self):
|
|
| 233 |
+ radio_btns = {}
|
|
| 234 |
+ group = None
|
|
| 235 |
+ |
|
| 236 |
+ for category in ACTIVITIES:
|
|
| 237 |
+ icon_name = get_activity_icon_name(category)
|
|
| 238 |
+ item = self._ui.get_object(category + '_image')
|
|
| 239 |
+ item.set_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
| 240 |
+ item.set_tooltip_text(ACTIVITIES[category]['category'])
|
|
| 241 |
+ |
|
| 242 |
+ category_box = self._ui.get_object(category + '_box')
|
|
| 243 |
+ |
|
| 244 |
+ # Other
|
|
| 245 |
+ act = category + '_other'
|
|
| 246 |
+ if group:
|
|
| 247 |
+ radio_btns[act] = Gtk.RadioButton()
|
|
| 248 |
+ radio_btns[act].join_group(group)
|
|
| 249 |
+ else:
|
|
| 250 |
+ radio_btns[act] = group = Gtk.RadioButton()
|
|
| 251 |
+ |
|
| 252 |
+ icon = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
| 253 |
+ icon_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL,
|
|
| 254 |
+ spacing=6)
|
|
| 255 |
+ icon_box.pack_start(icon, False, False, 0)
|
|
| 256 |
+ label = Gtk.Label(
|
|
| 257 |
+ label='<b>%s</b>' % ACTIVITIES[category]['category'])
|
|
| 258 |
+ label.set_use_markup(True)
|
|
| 259 |
+ icon_box.pack_start(label, False, False, 0)
|
|
| 260 |
+ radio_btns[act].add(icon_box)
|
|
| 261 |
+ radio_btns[act].join_group(self._ui.no_activity_button)
|
|
| 262 |
+ radio_btns[act].connect(
|
|
| 263 |
+ 'toggled', self._on_activity_toggled, [category, 'other'])
|
|
| 264 |
+ category_box.pack_start(radio_btns[act], False, False, 0)
|
|
| 265 |
+ |
|
| 266 |
+ activities = list(ACTIVITIES[category].keys())
|
|
| 267 |
+ activities.sort()
|
|
| 268 |
+ for activity in activities:
|
|
| 269 |
+ if activity == 'category':
|
|
| 270 |
+ continue
|
|
| 271 |
+ |
|
| 272 |
+ act = category + '_' + activity
|
|
| 273 |
+ |
|
| 274 |
+ if group:
|
|
| 275 |
+ radio_btns[act] = Gtk.RadioButton()
|
|
| 276 |
+ radio_btns[act].join_group(group)
|
|
| 277 |
+ else:
|
|
| 278 |
+ radio_btns[act] = group = Gtk.RadioButton()
|
|
| 279 |
+ |
|
| 280 |
+ icon_name = get_activity_icon_name(category, activity)
|
|
| 281 |
+ icon = Gtk.Image.new_from_icon_name(
|
|
| 282 |
+ icon_name, Gtk.IconSize.MENU)
|
|
| 283 |
+ label = Gtk.Label(label=ACTIVITIES[category][activity])
|
|
| 284 |
+ icon_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL,
|
|
| 285 |
+ spacing=6)
|
|
| 286 |
+ icon_box.pack_start(icon, False, False, 0)
|
|
| 287 |
+ icon_box.pack_start(label, False, False, 0)
|
|
| 288 |
+ radio_btns[act].join_group(self._ui.no_activity_button)
|
|
| 289 |
+ radio_btns[act].connect('toggled', self._on_activity_toggled,
|
|
| 290 |
+ [category, activity])
|
|
| 291 |
+ radio_btns[act].add(icon_box)
|
|
| 292 |
+ category_box.pack_start(radio_btns[act], False, False, 0)
|
|
| 293 |
+ |
|
| 294 |
+ if not self._pep_dict['activity']:
|
|
| 295 |
+ self._ui.no_activity_button.set_active(True)
|
|
| 296 |
+ |
|
| 297 |
+ if self._pep_dict['activity'] in ACTIVITIES:
|
|
| 298 |
+ if self._pep_dict['subactivity'] not in ACTIVITIES[
|
|
| 299 |
+ self._pep_dict['activity']]:
|
|
| 300 |
+ self._pep_dict['subactivity'] = 'other'
|
|
| 301 |
+ |
|
| 302 |
+ radio_btns[self._pep_dict['activity'] + '_' + self._pep_dict[
|
|
| 303 |
+ 'subactivity']].set_active(True)
|
|
| 304 |
+ |
|
| 305 |
+ self._ui.activity_notebook.set_current_page(
|
|
| 306 |
+ ACTIVITY_PAGELIST.index(self._pep_dict['activity']))
|
|
| 307 |
+ |
|
| 308 |
+ def _draw_activity(self):
|
|
| 309 |
+ if self._pep_dict['activity'] in ACTIVITIES:
|
|
| 310 |
+ if (self._pep_dict['subactivity'] in
|
|
| 311 |
+ ACTIVITIES[self._pep_dict['activity']]):
|
|
| 312 |
+ icon_name = get_activity_icon_name(
|
|
| 313 |
+ self._pep_dict['activity'],
|
|
| 314 |
+ self._pep_dict['subactivity'])
|
|
| 315 |
+ self._ui.activity_image.set_from_icon_name(
|
|
| 316 |
+ icon_name, Gtk.IconSize.MENU)
|
|
| 317 |
+ self._ui.activity_button_label.set_text(
|
|
| 318 |
+ ACTIVITIES[self._pep_dict['activity']][
|
|
| 319 |
+ self._pep_dict['subactivity']])
|
|
| 320 |
+ else:
|
|
| 321 |
+ icon_name = get_activity_icon_name(self._pep_dict['activity'])
|
|
| 322 |
+ self._ui.activity_image.set_from_icon_name(
|
|
| 323 |
+ icon_name, Gtk.IconSize.MENU)
|
|
| 324 |
+ self._ui.activity_button_label.set_text(
|
|
| 325 |
+ ACTIVITIES[self._pep_dict['activity']]['category'])
|
|
| 326 |
+ else:
|
|
| 327 |
+ self._ui.activity_image.set_from_pixbuf(None)
|
|
| 328 |
+ self._ui.activity_button_label.set_text(_('No activity'))
|
|
| 329 |
+ |
|
| 330 |
+ def _init_moods(self):
|
|
| 331 |
+ self._ui.no_mood_button.set_mode(False)
|
|
| 332 |
+ self._ui.no_mood_button.connect(
|
|
| 333 |
+ 'clicked', self._on_mood_button_clicked, None)
|
|
| 334 |
+ |
|
| 335 |
+ x_position = 1
|
|
| 336 |
+ y_position = 0
|
|
| 337 |
+ mood_buttons = {}
|
|
| 338 |
+ |
|
| 339 |
+ # Order them first
|
|
| 340 |
+ moods = []
|
|
| 341 |
+ for mood in MOODS:
|
|
| 342 |
+ moods.append(mood)
|
|
| 343 |
+ moods.sort()
|
|
| 344 |
+ |
|
| 345 |
+ for mood in moods:
|
|
| 346 |
+ image = Gtk.Image.new_from_icon_name(
|
|
| 347 |
+ 'mood-%s' % mood, Gtk.IconSize.MENU)
|
|
| 348 |
+ mood_buttons[mood] = Gtk.RadioButton()
|
|
| 349 |
+ mood_buttons[mood].join_group(self._ui.no_mood_button)
|
|
| 350 |
+ mood_buttons[mood].set_mode(False)
|
|
| 351 |
+ mood_buttons[mood].add(image)
|
|
| 352 |
+ mood_buttons[mood].set_relief(Gtk.ReliefStyle.NONE)
|
|
| 353 |
+ mood_buttons[mood].set_tooltip_text(MOODS[mood])
|
|
| 354 |
+ mood_buttons[mood].connect(
|
|
| 355 |
+ 'clicked', self._on_mood_button_clicked, mood)
|
|
| 356 |
+ self._ui.moods_grid.attach(
|
|
| 357 |
+ mood_buttons[mood], x_position, y_position, 1, 1)
|
|
| 358 |
+ |
|
| 359 |
+ # Calculate the next position
|
|
| 360 |
+ x_position += 1
|
|
| 361 |
+ if x_position >= 11:
|
|
| 362 |
+ x_position = 0
|
|
| 363 |
+ y_position += 1
|
|
| 364 |
+ |
|
| 365 |
+ if self._pep_dict['mood'] in MOODS:
|
|
| 366 |
+ mood_buttons[self._pep_dict['mood']].set_active(True)
|
|
| 367 |
+ self._ui.mood_label.set_text(MOODS[self._pep_dict['mood']])
|
|
| 368 |
+ else:
|
|
| 369 |
+ self._ui.mood_label.set_text(_('No mood selected'))
|
|
| 370 |
+ |
|
| 371 |
+ def _draw_mood(self):
|
|
| 372 |
+ if self._pep_dict['mood'] in MOODS:
|
|
| 373 |
+ self._ui.mood_image.set_from_icon_name(
|
|
| 374 |
+ 'mood-%s' % self._pep_dict['mood'], Gtk.IconSize.MENU)
|
|
| 375 |
+ self._ui.mood_button_label.set_text(
|
|
| 376 |
+ MOODS[self._pep_dict['mood']])
|
|
| 377 |
+ else:
|
|
| 378 |
+ self._ui.mood_image.set_from_pixbuf(None)
|
|
| 379 |
+ self._ui.mood_button_label.set_text(_('No mood'))
|
|
| 380 |
+ |
|
| 381 |
+ def _on_preset_select(self, widget):
|
|
| 382 |
+ self.countdown_enabled = False
|
|
| 383 |
+ self._ui.preset_popover.popdown()
|
|
| 384 |
+ name = widget.get_name()
|
|
| 385 |
+ self._message_buffer.set_text(self._preset_messages_dict[name][0])
|
|
| 386 |
+ self._pep_dict['activity'] = self._preset_messages_dict[name][1]
|
|
| 387 |
+ self._pep_dict['subactivity'] = self._preset_messages_dict[name][2]
|
|
| 388 |
+ self._pep_dict['mood'] = self._preset_messages_dict[name][3]
|
|
| 389 |
+ self._draw_activity()
|
|
| 390 |
+ self._draw_mood()
|
|
| 391 |
+ |
|
| 392 |
+ self._ui.activity_switch.set_active(self._pep_dict['activity'])
|
|
| 393 |
+ self._ui.activity_page_button.set_sensitive(self._pep_dict['activity'])
|
|
| 394 |
+ self._ui.mood_switch.set_active(self._pep_dict['mood'])
|
|
| 395 |
+ self._ui.mood_page_button.set_sensitive(self._pep_dict['mood'])
|
|
| 396 |
+ |
|
| 397 |
+ def _on_preset_remove(self, widget):
|
|
| 398 |
+ self.countdown_enabled = False
|
|
| 399 |
+ name = widget.get_name()
|
|
| 400 |
+ app.config.del_per('statusmsg', name)
|
|
| 401 |
+ self._get_presets()
|
|
| 402 |
+ |
|
| 403 |
+ def _on_save_as_preset_clicked(self, _widget):
|
|
| 404 |
+ self.countdown_enabled = False
|
|
| 405 |
+ start_iter, finish_iter = self._message_buffer.get_bounds()
|
|
| 406 |
+ message_text = self._message_buffer.get_text(
|
|
| 407 |
+ start_iter, finish_iter, True)
|
|
| 408 |
+ |
|
| 409 |
+ def _on_save_preset(preset_name):
|
|
| 410 |
+ msg_text_one_line = to_one_line(message_text)
|
|
| 411 |
+ if not preset_name:
|
|
| 412 |
+ preset_name = msg_text_one_line
|
|
| 413 |
+ |
|
| 414 |
+ def _on_set_config():
|
|
| 415 |
+ activity = ''
|
|
| 416 |
+ subactivity = ''
|
|
| 417 |
+ mood = ''
|
|
| 418 |
+ if self._ui.activity_switch.get_active():
|
|
| 419 |
+ activity = self._pep_dict['activity']
|
|
| 420 |
+ subactivity = self._pep_dict['subactivity']
|
|
| 421 |
+ if self._ui.mood_switch.get_active():
|
|
| 422 |
+ mood = self._pep_dict['mood']
|
|
| 423 |
+ app.config.set_per('statusmsg', preset_name, 'message',
|
|
| 424 |
+ msg_text_one_line)
|
|
| 425 |
+ app.config.set_per('statusmsg', preset_name, 'activity',
|
|
| 426 |
+ activity)
|
|
| 427 |
+ app.config.set_per('statusmsg', preset_name, 'subactivity',
|
|
| 428 |
+ subactivity)
|
|
| 429 |
+ app.config.set_per('statusmsg', preset_name, 'mood', mood)
|
|
| 430 |
+ self._get_presets()
|
|
| 431 |
+ |
|
| 432 |
+ if preset_name in self._preset_messages_dict:
|
|
| 433 |
+ NewConfirmationDialog(
|
|
| 434 |
+ _('Overwrite'),
|
|
| 435 |
+ _('Overwrite Status Message?'),
|
|
| 436 |
+ _('This name is already in use. Do you want to '
|
|
| 437 |
+ 'overwrite this preset?'),
|
|
| 438 |
+ [DialogButton.make('Cancel'),
|
|
| 439 |
+ DialogButton.make('Remove',
|
|
| 440 |
+ text=_('_Overwrite'),
|
|
| 441 |
+ callback=_on_set_config)],
|
|
| 442 |
+ transient_for=self).show()
|
|
| 443 |
+ return
|
|
| 444 |
+ |
|
| 445 |
+ app.config.add_per('statusmsg', preset_name)
|
|
| 446 |
+ _on_set_config()
|
|
| 447 |
+ |
|
| 448 |
+ InputDialog(
|
|
| 449 |
+ _('Status Preset'),
|
|
| 450 |
+ _('Save status as preset'),
|
|
| 451 |
+ _('Please assign a name to this status message preset'),
|
|
| 452 |
+ [DialogButton.make('Cancel'),
|
|
| 453 |
+ DialogButton.make('Accept',
|
|
| 454 |
+ text=_('_Save'),
|
|
| 455 |
+ callback=_on_save_preset)],
|
|
| 456 |
+ input_str=_('New Status'),
|
|
| 457 |
+ transient_for=self).show()
|
|
| 458 |
+ |
|
| 459 |
+ def _on_activity_page_clicked(self, _widget):
|
|
| 460 |
+ self.countdown_enabled = False
|
|
| 461 |
+ self._ui.status_stack.set_visible_child_full(
|
|
| 462 |
+ 'activity-page',
|
|
| 463 |
+ Gtk.StackTransitionType.SLIDE_LEFT)
|
|
| 464 |
+ |
|
| 465 |
+ def _on_activity_toggled(self, widget, data):
|
|
| 466 |
+ if widget.get_active():
|
|
| 467 |
+ self._pep_dict['activity'] = data[0]
|
|
| 468 |
+ self._pep_dict['subactivity'] = data[1]
|
|
| 469 |
+ |
|
| 470 |
+ def _on_no_activity_toggled(self, _widget):
|
|
| 471 |
+ self._pep_dict['activity'] = ''
|
|
| 472 |
+ self._pep_dict['subactivity'] = ''
|
|
| 473 |
+ |
|
| 474 |
+ def _on_mood_page_clicked(self, _widget):
|
|
| 475 |
+ self.countdown_enabled = False
|
|
| 476 |
+ self._ui.status_stack.set_visible_child_full(
|
|
| 477 |
+ 'mood-page',
|
|
| 478 |
+ Gtk.StackTransitionType.SLIDE_LEFT)
|
|
| 479 |
+ |
|
| 480 |
+ def _on_mood_button_clicked(self, _widget, data):
|
|
| 481 |
+ if data:
|
|
| 482 |
+ self._ui.mood_label.set_text(MOODS[data])
|
|
| 483 |
+ else:
|
|
| 484 |
+ self._ui.mood_label.set_text(_('No mood selected'))
|
|
| 485 |
+ self._pep_dict['mood'] = data
|
|
| 486 |
+ |
|
| 487 |
+ def _on_back_clicked(self, _widget):
|
|
| 488 |
+ self._ui.status_stack.set_visible_child_full(
|
|
| 489 |
+ 'status-page',
|
|
| 490 |
+ Gtk.StackTransitionType.SLIDE_RIGHT)
|
|
| 491 |
+ self._draw_activity()
|
|
| 492 |
+ self._draw_mood()
|
|
| 493 |
+ |
|
| 494 |
+ def _on_activity_switch(self, switch, *args):
|
|
| 495 |
+ self.countdown_enabled = False
|
|
| 496 |
+ self._ui.activity_page_button.set_sensitive(switch.get_active())
|
|
| 497 |
+ |
|
| 498 |
+ def _on_mood_switch(self, switch, *args):
|
|
| 499 |
+ self.countdown_enabled = False
|
|
| 500 |
+ self._ui.mood_page_button.set_sensitive(switch.get_active())
|
|
| 501 |
+ |
|
| 502 |
+ def _change_status(self, *args):
|
|
| 503 |
+ beg, end = self._message_buffer.get_bounds()
|
|
| 504 |
+ message = self._message_buffer.get_text(beg, end, True).strip()
|
|
| 505 |
+ message = remove_invalid_xml_chars(message)
|
|
| 506 |
+ |
|
| 507 |
+ if not self._ui.activity_switch.get_active():
|
|
| 508 |
+ self._pep_dict['activity'] = ''
|
|
| 509 |
+ self._pep_dict['subactivity'] = ''
|
|
| 510 |
+ |
|
| 511 |
+ if not self._ui.mood_switch.get_active():
|
|
| 512 |
+ self._pep_dict['mood'] = ''
|
|
| 513 |
+ |
|
| 514 |
+ self._callback(message, self._pep_dict)
|
|
| 515 |
+ self.destroy()
|
| ... | ... | @@ -20,9 +20,9 @@ from gajim.common.helpers import get_uf_show |
| 20 | 20 |
from gajim.common.helpers import get_global_show
|
| 21 | 21 |
from gajim.common.helpers import statuses_unified
|
| 22 | 22 |
from gajim.common.i18n import _
|
| 23 |
-from gajim.dialogs import ChangeStatusMessageDialog
|
|
| 24 | 23 |
|
| 25 | 24 |
from gajim.gtk.util import get_icon_name
|
| 25 |
+from gajim.gtk.util import open_window
|
|
| 26 | 26 |
|
| 27 | 27 |
|
| 28 | 28 |
class StatusSelector(Gtk.MenuButton):
|
| ... | ... | @@ -101,7 +101,7 @@ class StatusSelector(Gtk.MenuButton): |
| 101 | 101 |
|
| 102 | 102 |
def _on_change_status(self, button):
|
| 103 | 103 |
def _on_response(message, pep_dict):
|
| 104 |
- if message is None: # None if user pressed Cancel
|
|
| 104 |
+ if message is None: # None if user canceled
|
|
| 105 | 105 |
return
|
| 106 | 106 |
for account in app.contacts.get_accounts():
|
| 107 | 107 |
sync_account = app.config.get_per(
|
| ... | ... | @@ -115,7 +115,7 @@ class StatusSelector(Gtk.MenuButton): |
| 115 | 115 |
new_show = button.get_name()
|
| 116 | 116 |
if new_show == 'change_status_message':
|
| 117 | 117 |
new_show = get_global_show()
|
| 118 |
- ChangeStatusMessageDialog(_on_response, new_show)
|
|
| 118 |
+ open_window('StatusChange', callback=_on_response, show=new_show)
|
|
| 119 | 119 |
return
|
| 120 | 120 |
|
| 121 | 121 |
app.interface.roster.get_status_message(new_show, _on_response)
|
| ... | ... | @@ -2159,7 +2159,7 @@ class RosterWindow: |
| 2159 | 2159 |
app.interface.systray.change_status(show)
|
| 2160 | 2160 |
self._status_selector.update()
|
| 2161 | 2161 |
|
| 2162 |
- def get_status_message(self, show, on_response, show_pep=True,
|
|
| 2162 |
+ def get_status_message(self, show, callback, show_pep=True,
|
|
| 2163 | 2163 |
always_ask=False):
|
| 2164 | 2164 |
"""
|
| 2165 | 2165 |
Get the status message by:
|
| ... | ... | @@ -2174,22 +2174,21 @@ class RosterWindow: |
| 2174 | 2174 |
'mood': '',
|
| 2175 | 2175 |
'mood_text': ''}
|
| 2176 | 2176 |
if not always_ask and ((show == 'online' and not app.config.get(
|
| 2177 |
- 'ask_online_status')) or (show == 'offline' and not \
|
|
| 2178 |
- app.config.get('ask_offline_status'))):
|
|
| 2179 |
- on_response('', empty_pep)
|
|
| 2177 |
+ 'ask_online_status')) or (show == 'offline' and not
|
|
| 2178 |
+ app.config.get('ask_offline_status'))):
|
|
| 2179 |
+ callback('', empty_pep)
|
|
| 2180 | 2180 |
return
|
| 2181 | 2181 |
|
| 2182 |
- dlg = dialogs.ChangeStatusMessageDialog(on_response, show, show_pep)
|
|
| 2183 |
- dlg.dialog.present() # show it on current workspace
|
|
| 2182 |
+ open_window('StatusChange', callback=callback, show=show,
|
|
| 2183 |
+ show_pep=show_pep)
|
|
| 2184 | 2184 |
|
| 2185 | 2185 |
def change_status(self, widget, account, status):
|
| 2186 |
- def on_response(message, pep_dict):
|
|
| 2187 |
- if message is None:
|
|
| 2188 |
- # user pressed Cancel to change status message dialog
|
|
| 2186 |
+ def _on_response(message, pep_dict):
|
|
| 2187 |
+ if message is None: # None if user canceled
|
|
| 2189 | 2188 |
return
|
| 2190 | 2189 |
self.send_status(account, status, message)
|
| 2191 | 2190 |
self.send_pep(account, pep_dict)
|
| 2192 |
- self.get_status_message(status, on_response)
|
|
| 2191 |
+ self.get_status_message(status, _on_response)
|
|
| 2193 | 2192 |
|
| 2194 | 2193 |
def get_show(self, lcontact):
|
| 2195 | 2194 |
prio = lcontact[0].priority
|
| ... | ... | @@ -2928,12 +2927,13 @@ class RosterWindow: |
| 2928 | 2927 |
|
| 2929 | 2928 |
def on_change_status_message_activate(self, widget, account):
|
| 2930 | 2929 |
show = app.connections[account].status
|
| 2931 |
- def on_response(message, pep_dict):
|
|
| 2932 |
- if message is None: # None is if user pressed Cancel
|
|
| 2930 |
+ def _on_response(message, pep_dict):
|
|
| 2931 |
+ if message is None: # None if user canceled
|
|
| 2933 | 2932 |
return
|
| 2934 | 2933 |
self.send_status(account, show, message)
|
| 2935 | 2934 |
self.send_pep(account, pep_dict)
|
| 2936 |
- dialogs.ChangeStatusMessageDialog(on_response, show)
|
|
| 2935 |
+ open_window('StatusChange', account=account, callback=_on_response,
|
|
| 2936 |
+ show=show)
|
|
| 2937 | 2937 |
|
| 2938 | 2938 |
def on_add_to_roster(self, widget, contact, account):
|
| 2939 | 2939 |
AddNewContactWindow(account, contact.jid, contact.name)
|
| ... | ... | @@ -3031,7 +3031,7 @@ class RosterWindow: |
| 3031 | 3031 |
if keyval == Gdk.KEY_s: # CTRL + s
|
| 3032 | 3032 |
show = helpers.get_global_show()
|
| 3033 | 3033 |
def _on_response(message, pep_dict):
|
| 3034 |
- if message is not None: # None if user pressed Cancel
|
|
| 3034 |
+ if message is not None: # None if user canceled
|
|
| 3035 | 3035 |
for account in app.contacts.get_accounts():
|
| 3036 | 3036 |
sync_account = app.config.get_per(
|
| 3037 | 3037 |
'accounts', account, 'sync_with_global_status')
|
| ... | ... | @@ -3039,9 +3039,9 @@ class RosterWindow: |
| 3039 | 3039 |
continue
|
| 3040 | 3040 |
self.send_status(account, show, message)
|
| 3041 | 3041 |
self.send_pep(account, pep_dict)
|
| 3042 |
- dialogs.ChangeStatusMessageDialog(_on_response, show)
|
|
| 3042 |
+ open_window('StatusChange', callback=_on_response, show=show)
|
|
| 3043 | 3043 |
return True
|
| 3044 |
- if keyval == Gdk.KEY_k: # CTRL + k
|
|
| 3044 |
+ if keyval == Gdk.KEY_k: # CTRL + k
|
|
| 3045 | 3045 |
self.enable_rfilter('')
|
| 3046 | 3046 |
|
| 3047 | 3047 |
def on_roster_treeview_button_press_event(self, widget, event):
|
| ... | ... | @@ -3084,17 +3084,17 @@ class RosterWindow: |
| 3084 | 3084 |
show = helpers.get_global_show()
|
| 3085 | 3085 |
if show == 'offline':
|
| 3086 | 3086 |
return True
|
| 3087 |
- def on_response(message, pep_dict):
|
|
| 3088 |
- if message is None:
|
|
| 3087 |
+ def _on_response(message, pep_dict):
|
|
| 3088 |
+ if message is None: # None if user canceled
|
|
| 3089 | 3089 |
return True
|
| 3090 | 3090 |
for acct in app.connections:
|
| 3091 | 3091 |
if not app.config.get_per('accounts', acct,
|
| 3092 |
- 'sync_with_global_status'):
|
|
| 3092 |
+ 'sync_with_global_status'):
|
|
| 3093 | 3093 |
continue
|
| 3094 | 3094 |
current_show = app.connections[acct].status
|
| 3095 | 3095 |
self.send_status(acct, current_show, message)
|
| 3096 | 3096 |
self.send_pep(acct, pep_dict)
|
| 3097 |
- dialogs.ChangeStatusMessageDialog(on_response, show)
|
|
| 3097 |
+ open_window('StatusChange', callback=_on_response, show=show)
|
|
| 3098 | 3098 |
return True
|
| 3099 | 3099 |
|
| 3100 | 3100 |
if event.button == 1: # Left click
|