Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
b6c4fcfb
by Philipp Hörist at 2018-11-04T21:50:21Z
10 changed files:
- gajim/app_actions.py
- gajim/application.py
- gajim/chat_control.py
- gajim/chat_control_base.py
- gajim/data/gui/history_window.ui
- gajim/groupchat_control.py
- gajim/gtk/history.py
- gajim/gui_menu_builder.py
- gajim/message_window.py
- gajim/roster_window.py
Changes:
| ... | ... | @@ -313,10 +313,7 @@ def on_file_transfers(action, param): |
| 313 | 313 |
|
| 314 | 314 |
|
| 315 | 315 |
def on_history(action, param):
|
| 316 |
- if 'logs' in interface.instances:
|
|
| 317 |
- interface.instances['logs'].window.present()
|
|
| 318 |
- else:
|
|
| 319 |
- interface.instances['logs'] = HistoryWindow()
|
|
| 316 |
+ on_browse_history(action, param)
|
|
| 320 | 317 |
|
| 321 | 318 |
|
| 322 | 319 |
def on_open_event(action, param):
|
| ... | ... | @@ -369,3 +366,19 @@ def join_groupchat(_action, param): |
| 369 | 366 |
account, jid = param.get_strv()
|
| 370 | 367 |
room_jid = jid.split('?')[0]
|
| 371 | 368 |
app.interface.join_gc_minimal(account, room_jid)
|
| 369 |
+ |
|
| 370 |
+ |
|
| 371 |
+def on_browse_history(_action, param):
|
|
| 372 |
+ jid, account = None, None
|
|
| 373 |
+ if param is not None:
|
|
| 374 |
+ dict_ = param.unpack()
|
|
| 375 |
+ jid = dict_.get('jid')
|
|
| 376 |
+ account = dict_.get('account')
|
|
| 377 |
+ |
|
| 378 |
+ window = app.get_app_window(HistoryWindow)
|
|
| 379 |
+ if window is None:
|
|
| 380 |
+ HistoryWindow(jid, account)
|
|
| 381 |
+ else:
|
|
| 382 |
+ window.present()
|
|
| 383 |
+ if jid is not None and account is not None:
|
|
| 384 |
+ window.open_history(jid, account)
|
| ... | ... | @@ -418,6 +418,11 @@ class GajimApplication(Gtk.Application): |
| 418 | 418 |
act.connect("activate", app_actions.open_link)
|
| 419 | 419 |
self.add_action(act)
|
| 420 | 420 |
|
| 421 |
+ act = Gio.SimpleAction.new('browse-history',
|
|
| 422 |
+ GLib.VariantType.new('a{sv}'))
|
|
| 423 |
+ act.connect("activate", app_actions.on_browse_history)
|
|
| 424 |
+ self.add_action(act)
|
|
| 425 |
+ |
|
| 421 | 426 |
for action in general_actions:
|
| 422 | 427 |
action_name, func = action
|
| 423 | 428 |
act = Gio.SimpleAction.new(action_name, None)
|
| ... | ... | @@ -110,7 +110,7 @@ class ChatControl(ChatControlBase): |
| 110 | 110 |
|
| 111 | 111 |
# Menu for the HeaderBar
|
| 112 | 112 |
self.control_menu = gui_menu_builder.get_singlechat_menu(
|
| 113 |
- self.control_id)
|
|
| 113 |
+ self.control_id, self.account, self.contact.jid)
|
|
| 114 | 114 |
settings_menu = self.xml.get_object('settings_menu')
|
| 115 | 115 |
settings_menu.set_menu_model(self.control_menu)
|
| 116 | 116 |
|
| ... | ... | @@ -388,11 +388,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): |
| 388 | 388 |
action.connect("change-state", self.change_encryption)
|
| 389 | 389 |
self.parent_win.window.add_action(action)
|
| 390 | 390 |
|
| 391 |
- action = Gio.SimpleAction.new(
|
|
| 392 |
- 'browse-history-%s' % self.control_id, GLib.VariantType.new('s'))
|
|
| 393 |
- action.connect('activate', self._on_history)
|
|
| 394 |
- self.parent_win.window.add_action(action)
|
|
| 395 |
- |
|
| 396 | 391 |
action = Gio.SimpleAction.new(
|
| 397 | 392 |
'send-file-%s' % self.control_id, None)
|
| 398 | 393 |
action.connect('activate', self._on_send_file)
|
| ... | ... | @@ -413,21 +408,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): |
| 413 | 408 |
|
| 414 | 409 |
# Actions
|
| 415 | 410 |
|
| 416 |
- def _on_history(self, action, param):
|
|
| 417 |
- """
|
|
| 418 |
- When history menuitem is pressed: call history window
|
|
| 419 |
- """
|
|
| 420 |
- jid = param.get_string()
|
|
| 421 |
- if jid == 'none':
|
|
| 422 |
- jid = self.contact.jid
|
|
| 423 |
- |
|
| 424 |
- if 'logs' in app.interface.instances:
|
|
| 425 |
- app.interface.instances['logs'].window.present()
|
|
| 426 |
- app.interface.instances['logs'].open_history(jid, self.account)
|
|
| 427 |
- else:
|
|
| 428 |
- from gajim.gtk.history import HistoryWindow
|
|
| 429 |
- app.interface.instances['logs'] = HistoryWindow(jid, self.account)
|
|
| 430 |
- |
|
| 431 | 411 |
def change_encryption(self, action, param):
|
| 432 | 412 |
encryption = param.get_string()
|
| 433 | 413 |
if encryption == 'disabled':
|
| ... | ... | @@ -1039,20 +1019,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): |
| 1039 | 1019 |
start, end = buffer_.get_bounds()
|
| 1040 | 1020 |
buffer_.delete(start, end)
|
| 1041 | 1021 |
|
| 1042 |
- def _on_history_menuitem_activate(self, widget=None, jid=None):
|
|
| 1043 |
- """
|
|
| 1044 |
- When history menuitem is pressed: call history window
|
|
| 1045 |
- """
|
|
| 1046 |
- if not jid:
|
|
| 1047 |
- jid = self.contact.jid
|
|
| 1048 |
- |
|
| 1049 |
- if 'logs' in app.interface.instances:
|
|
| 1050 |
- app.interface.instances['logs'].window.present()
|
|
| 1051 |
- app.interface.instances['logs'].open_history(jid, self.account)
|
|
| 1052 |
- else:
|
|
| 1053 |
- from gajim.gtk.history import HistoryWindow
|
|
| 1054 |
- app.interface.instances['logs'] = HistoryWindow(jid, self.account)
|
|
| 1055 |
- |
|
| 1056 | 1022 |
def _on_send_file(self, action, param):
|
| 1057 | 1023 |
# get file transfer preference
|
| 1058 | 1024 |
ft_pref = app.config.get_per('accounts', self.account,
|
| ... | ... | @@ -278,296 +278,282 @@ |
| 278 | 278 |
</object>
|
| 279 | 279 |
</child>
|
| 280 | 280 |
</object>
|
| 281 |
- <object class="GtkApplicationWindow" id="history_window">
|
|
| 281 |
+ <object class="GtkBox" id="history_box">
|
|
| 282 |
+ <property name="width_request">600</property>
|
|
| 283 |
+ <property name="visible">True</property>
|
|
| 282 | 284 |
<property name="can_focus">False</property>
|
| 283 |
- <property name="title" translatable="yes">Conversation History</property>
|
|
| 284 |
- <property name="window_position">center</property>
|
|
| 285 |
- <property name="show_menubar">False</property>
|
|
| 286 |
- <signal name="delete-event" handler="on_history_window_delete_event" swapped="no"/>
|
|
| 287 |
- <signal name="destroy" handler="on_history_window_destroy" swapped="no"/>
|
|
| 288 |
- <signal name="key-press-event" handler="on_history_window_key_press_event" swapped="no"/>
|
|
| 289 |
- <child type="titlebar">
|
|
| 290 |
- <placeholder/>
|
|
| 291 |
- </child>
|
|
| 285 |
+ <property name="margin_left">18</property>
|
|
| 286 |
+ <property name="margin_right">18</property>
|
|
| 287 |
+ <property name="margin_top">18</property>
|
|
| 288 |
+ <property name="margin_bottom">18</property>
|
|
| 289 |
+ <property name="orientation">vertical</property>
|
|
| 290 |
+ <property name="spacing">24</property>
|
|
| 292 | 291 |
<child>
|
| 293 |
- <object class="GtkBox" id="vbox">
|
|
| 294 |
- <property name="width_request">600</property>
|
|
| 292 |
+ <object class="GtkGrid">
|
|
| 295 | 293 |
<property name="visible">True</property>
|
| 296 | 294 |
<property name="can_focus">False</property>
|
| 297 |
- <property name="margin_left">18</property>
|
|
| 298 |
- <property name="margin_right">18</property>
|
|
| 299 |
- <property name="margin_top">18</property>
|
|
| 300 |
- <property name="margin_bottom">18</property>
|
|
| 301 |
- <property name="orientation">vertical</property>
|
|
| 302 |
- <property name="spacing">24</property>
|
|
| 295 |
+ <property name="row_spacing">6</property>
|
|
| 296 |
+ <property name="column_spacing">12</property>
|
|
| 303 | 297 |
<child>
|
| 304 |
- <object class="GtkGrid">
|
|
| 298 |
+ <object class="GtkLabel">
|
|
| 305 | 299 |
<property name="visible">True</property>
|
| 306 | 300 |
<property name="can_focus">False</property>
|
| 307 |
- <property name="row_spacing">6</property>
|
|
| 308 |
- <property name="column_spacing">12</property>
|
|
| 309 |
- <child>
|
|
| 310 |
- <object class="GtkLabel">
|
|
| 311 |
- <property name="visible">True</property>
|
|
| 312 |
- <property name="can_focus">False</property>
|
|
| 313 |
- <property name="halign">start</property>
|
|
| 314 |
- <property name="label" translatable="yes">Chat</property>
|
|
| 315 |
- <style>
|
|
| 316 |
- <class name="dim-label"/>
|
|
| 317 |
- </style>
|
|
| 318 |
- </object>
|
|
| 319 |
- <packing>
|
|
| 320 |
- <property name="left_attach">0</property>
|
|
| 321 |
- <property name="top_attach">0</property>
|
|
| 322 |
- </packing>
|
|
| 323 |
- </child>
|
|
| 324 |
- <child>
|
|
| 325 |
- <object class="GtkSwitch" id="log_history_checkbutton">
|
|
| 301 |
+ <property name="halign">start</property>
|
|
| 302 |
+ <property name="label" translatable="yes">Chat</property>
|
|
| 303 |
+ <style>
|
|
| 304 |
+ <class name="dim-label"/>
|
|
| 305 |
+ </style>
|
|
| 306 |
+ </object>
|
|
| 307 |
+ <packing>
|
|
| 308 |
+ <property name="left_attach">0</property>
|
|
| 309 |
+ <property name="top_attach">0</property>
|
|
| 310 |
+ </packing>
|
|
| 311 |
+ </child>
|
|
| 312 |
+ <child>
|
|
| 313 |
+ <object class="GtkSwitch" id="log_history_checkbutton">
|
|
| 314 |
+ <property name="visible">True</property>
|
|
| 315 |
+ <property name="can_focus">True</property>
|
|
| 316 |
+ <property name="tooltip_text" translatable="yes">Record history for this chat</property>
|
|
| 317 |
+ <signal name="notify::active" handler="on_log_history_checkbutton_toggled" swapped="no"/>
|
|
| 318 |
+ </object>
|
|
| 319 |
+ <packing>
|
|
| 320 |
+ <property name="left_attach">3</property>
|
|
| 321 |
+ <property name="top_attach">0</property>
|
|
| 322 |
+ </packing>
|
|
| 323 |
+ </child>
|
|
| 324 |
+ <child>
|
|
| 325 |
+ <object class="GtkLabel">
|
|
| 326 |
+ <property name="visible">True</property>
|
|
| 327 |
+ <property name="can_focus">False</property>
|
|
| 328 |
+ <property name="margin_left">6</property>
|
|
| 329 |
+ <property name="label" translatable="yes">Record History</property>
|
|
| 330 |
+ <style>
|
|
| 331 |
+ <class name="dim-label"/>
|
|
| 332 |
+ </style>
|
|
| 333 |
+ </object>
|
|
| 334 |
+ <packing>
|
|
| 335 |
+ <property name="left_attach">2</property>
|
|
| 336 |
+ <property name="top_attach">0</property>
|
|
| 337 |
+ </packing>
|
|
| 338 |
+ </child>
|
|
| 339 |
+ <child>
|
|
| 340 |
+ <object class="GtkComboBox" id="query_entry">
|
|
| 341 |
+ <property name="width_request">400</property>
|
|
| 342 |
+ <property name="visible">True</property>
|
|
| 343 |
+ <property name="can_focus">False</property>
|
|
| 344 |
+ <property name="hexpand">True</property>
|
|
| 345 |
+ <property name="model">liststore1</property>
|
|
| 346 |
+ <property name="tearoff_title" translatable="yes">Ttitle</property>
|
|
| 347 |
+ <property name="has_entry">True</property>
|
|
| 348 |
+ <property name="entry_text_column">1</property>
|
|
| 349 |
+ <property name="id_column">1</property>
|
|
| 350 |
+ <signal name="changed" handler="on_jid_entry_changed" swapped="no"/>
|
|
| 351 |
+ <child internal-child="entry">
|
|
| 352 |
+ <object class="GtkEntry">
|
|
| 326 | 353 |
<property name="visible">True</property>
|
| 327 | 354 |
<property name="can_focus">True</property>
|
| 328 |
- <property name="tooltip_text" translatable="yes">Record history for this chat</property>
|
|
| 329 |
- <signal name="notify::active" handler="on_log_history_checkbutton_toggled" swapped="no"/>
|
|
| 330 |
- </object>
|
|
| 331 |
- <packing>
|
|
| 332 |
- <property name="left_attach">3</property>
|
|
| 333 |
- <property name="top_attach">0</property>
|
|
| 334 |
- </packing>
|
|
| 335 |
- </child>
|
|
| 336 |
- <child>
|
|
| 337 |
- <object class="GtkLabel">
|
|
| 338 |
- <property name="visible">True</property>
|
|
| 339 |
- <property name="can_focus">False</property>
|
|
| 340 |
- <property name="margin_left">6</property>
|
|
| 341 |
- <property name="label" translatable="yes">Record History</property>
|
|
| 342 |
- <style>
|
|
| 343 |
- <class name="dim-label"/>
|
|
| 344 |
- </style>
|
|
| 355 |
+ <signal name="activate" handler="on_jid_entry_activate" swapped="no"/>
|
|
| 345 | 356 |
</object>
|
| 346 |
- <packing>
|
|
| 347 |
- <property name="left_attach">2</property>
|
|
| 348 |
- <property name="top_attach">0</property>
|
|
| 349 |
- </packing>
|
|
| 350 |
- </child>
|
|
| 351 |
- <child>
|
|
| 352 |
- <object class="GtkComboBox" id="query_entry">
|
|
| 353 |
- <property name="width_request">400</property>
|
|
| 354 |
- <property name="visible">True</property>
|
|
| 355 |
- <property name="can_focus">False</property>
|
|
| 356 |
- <property name="hexpand">True</property>
|
|
| 357 |
- <property name="model">liststore1</property>
|
|
| 358 |
- <property name="tearoff_title" translatable="yes">Ttitle</property>
|
|
| 359 |
- <property name="has_entry">True</property>
|
|
| 360 |
- <property name="entry_text_column">1</property>
|
|
| 361 |
- <property name="id_column">1</property>
|
|
| 362 |
- <signal name="changed" handler="on_jid_entry_changed" swapped="no"/>
|
|
| 363 |
- <child internal-child="entry">
|
|
| 364 |
- <object class="GtkEntry">
|
|
| 365 |
- <property name="visible">True</property>
|
|
| 366 |
- <property name="can_focus">True</property>
|
|
| 367 |
- <signal name="activate" handler="on_jid_entry_activate" swapped="no"/>
|
|
| 368 |
- </object>
|
|
| 369 |
- </child>
|
|
| 370 |
- </object>
|
|
| 371 |
- <packing>
|
|
| 372 |
- <property name="left_attach">1</property>
|
|
| 373 |
- <property name="top_attach">0</property>
|
|
| 374 |
- </packing>
|
|
| 375 | 357 |
</child>
|
| 376 | 358 |
</object>
|
| 377 | 359 |
<packing>
|
| 378 |
- <property name="expand">False</property>
|
|
| 379 |
- <property name="fill">True</property>
|
|
| 380 |
- <property name="position">0</property>
|
|
| 360 |
+ <property name="left_attach">1</property>
|
|
| 361 |
+ <property name="top_attach">0</property>
|
|
| 381 | 362 |
</packing>
|
| 382 | 363 |
</child>
|
| 364 |
+ </object>
|
|
| 365 |
+ <packing>
|
|
| 366 |
+ <property name="expand">False</property>
|
|
| 367 |
+ <property name="fill">True</property>
|
|
| 368 |
+ <property name="position">0</property>
|
|
| 369 |
+ </packing>
|
|
| 370 |
+ </child>
|
|
| 371 |
+ <child>
|
|
| 372 |
+ <object class="GtkBox">
|
|
| 373 |
+ <property name="visible">True</property>
|
|
| 374 |
+ <property name="can_focus">False</property>
|
|
| 375 |
+ <property name="orientation">vertical</property>
|
|
| 383 | 376 |
<child>
|
| 384 | 377 |
<object class="GtkBox">
|
| 385 | 378 |
<property name="visible">True</property>
|
| 386 | 379 |
<property name="can_focus">False</property>
|
| 387 |
- <property name="orientation">vertical</property>
|
|
| 388 |
- <child>
|
|
| 380 |
+ <child type="center">
|
|
| 389 | 381 |
<object class="GtkBox">
|
| 390 | 382 |
<property name="visible">True</property>
|
| 391 | 383 |
<property name="can_focus">False</property>
|
| 392 |
- <child type="center">
|
|
| 393 |
- <object class="GtkBox">
|
|
| 384 |
+ <child>
|
|
| 385 |
+ <object class="GtkSearchEntry" id="search_entry">
|
|
| 386 |
+ <property name="width_request">300</property>
|
|
| 394 | 387 |
<property name="visible">True</property>
|
| 395 |
- <property name="can_focus">False</property>
|
|
| 396 |
- <child>
|
|
| 397 |
- <object class="GtkSearchEntry" id="search_entry">
|
|
| 398 |
- <property name="width_request">300</property>
|
|
| 399 |
- <property name="visible">True</property>
|
|
| 400 |
- <property name="can_focus">True</property>
|
|
| 401 |
- <property name="primary_icon_name">edit-find-symbolic</property>
|
|
| 402 |
- <property name="primary_icon_activatable">False</property>
|
|
| 403 |
- <property name="primary_icon_sensitive">False</property>
|
|
| 404 |
- <signal name="activate" handler="on_search_entry_activate" swapped="no"/>
|
|
| 405 |
- </object>
|
|
| 406 |
- <packing>
|
|
| 407 |
- <property name="expand">False</property>
|
|
| 408 |
- <property name="fill">True</property>
|
|
| 409 |
- <property name="position">0</property>
|
|
| 410 |
- </packing>
|
|
| 411 |
- </child>
|
|
| 412 |
- <child>
|
|
| 413 |
- <object class="GtkMenuButton" id="search_menu_button">
|
|
| 414 |
- <property name="visible">True</property>
|
|
| 415 |
- <property name="can_focus">True</property>
|
|
| 416 |
- <property name="receives_default">True</property>
|
|
| 417 |
- <property name="halign">start</property>
|
|
| 418 |
- <property name="popover">search_menu</property>
|
|
| 419 |
- <child>
|
|
| 420 |
- <object class="GtkBox">
|
|
| 421 |
- <property name="visible">True</property>
|
|
| 422 |
- <property name="can_focus">False</property>
|
|
| 423 |
- <property name="spacing">6</property>
|
|
| 424 |
- <child>
|
|
| 425 |
- <object class="GtkLabel" id="date_label">
|
|
| 426 |
- <property name="visible">True</property>
|
|
| 427 |
- <property name="can_focus">False</property>
|
|
| 428 |
- <property name="margin_left">3</property>
|
|
| 429 |
- <property name="margin_right">3</property>
|
|
| 430 |
- </object>
|
|
| 431 |
- <packing>
|
|
| 432 |
- <property name="expand">False</property>
|
|
| 433 |
- <property name="fill">True</property>
|
|
| 434 |
- <property name="position">0</property>
|
|
| 435 |
- </packing>
|
|
| 436 |
- </child>
|
|
| 437 |
- <child>
|
|
| 438 |
- <object class="GtkImage">
|
|
| 439 |
- <property name="visible">True</property>
|
|
| 440 |
- <property name="can_focus">False</property>
|
|
| 441 |
- <property name="icon_name">pan-down-symbolic</property>
|
|
| 442 |
- </object>
|
|
| 443 |
- <packing>
|
|
| 444 |
- <property name="expand">False</property>
|
|
| 445 |
- <property name="fill">True</property>
|
|
| 446 |
- <property name="position">1</property>
|
|
| 447 |
- </packing>
|
|
| 448 |
- </child>
|
|
| 449 |
- </object>
|
|
| 450 |
- </child>
|
|
| 451 |
- </object>
|
|
| 452 |
- <packing>
|
|
| 453 |
- <property name="expand">False</property>
|
|
| 454 |
- <property name="fill">True</property>
|
|
| 455 |
- <property name="position">1</property>
|
|
| 456 |
- </packing>
|
|
| 457 |
- </child>
|
|
| 458 |
- <style>
|
|
| 459 |
- <class name="linked"/>
|
|
| 460 |
- </style>
|
|
| 388 |
+ <property name="can_focus">True</property>
|
|
| 389 |
+ <property name="primary_icon_name">edit-find-symbolic</property>
|
|
| 390 |
+ <property name="primary_icon_activatable">False</property>
|
|
| 391 |
+ <property name="primary_icon_sensitive">False</property>
|
|
| 392 |
+ <signal name="activate" handler="on_search_entry_activate" swapped="no"/>
|
|
| 461 | 393 |
</object>
|
| 462 | 394 |
<packing>
|
| 463 | 395 |
<property name="expand">False</property>
|
| 464 | 396 |
<property name="fill">True</property>
|
| 465 |
- <property name="position">2</property>
|
|
| 397 |
+ <property name="position">0</property>
|
|
| 466 | 398 |
</packing>
|
| 467 | 399 |
</child>
|
| 468 | 400 |
<child>
|
| 469 |
- <object class="GtkBox">
|
|
| 401 |
+ <object class="GtkMenuButton" id="search_menu_button">
|
|
| 470 | 402 |
<property name="visible">True</property>
|
| 471 |
- <property name="can_focus">False</property>
|
|
| 472 |
- <property name="orientation">vertical</property>
|
|
| 403 |
+ <property name="can_focus">True</property>
|
|
| 404 |
+ <property name="receives_default">True</property>
|
|
| 405 |
+ <property name="halign">start</property>
|
|
| 406 |
+ <property name="popover">search_menu</property>
|
|
| 473 | 407 |
<child>
|
| 474 |
- <object class="GtkMenuButton">
|
|
| 408 |
+ <object class="GtkBox">
|
|
| 475 | 409 |
<property name="visible">True</property>
|
| 476 |
- <property name="can_focus">True</property>
|
|
| 477 |
- <property name="receives_default">True</property>
|
|
| 478 |
- <property name="popover">more_menu</property>
|
|
| 410 |
+ <property name="can_focus">False</property>
|
|
| 411 |
+ <property name="spacing">6</property>
|
|
| 412 |
+ <child>
|
|
| 413 |
+ <object class="GtkLabel" id="date_label">
|
|
| 414 |
+ <property name="visible">True</property>
|
|
| 415 |
+ <property name="can_focus">False</property>
|
|
| 416 |
+ <property name="margin_left">3</property>
|
|
| 417 |
+ <property name="margin_right">3</property>
|
|
| 418 |
+ </object>
|
|
| 419 |
+ <packing>
|
|
| 420 |
+ <property name="expand">False</property>
|
|
| 421 |
+ <property name="fill">True</property>
|
|
| 422 |
+ <property name="position">0</property>
|
|
| 423 |
+ </packing>
|
|
| 424 |
+ </child>
|
|
| 479 | 425 |
<child>
|
| 480 | 426 |
<object class="GtkImage">
|
| 481 | 427 |
<property name="visible">True</property>
|
| 482 | 428 |
<property name="can_focus">False</property>
|
| 483 |
- <property name="icon_name">view-more-symbolic</property>
|
|
| 429 |
+ <property name="icon_name">pan-down-symbolic</property>
|
|
| 484 | 430 |
</object>
|
| 431 |
+ <packing>
|
|
| 432 |
+ <property name="expand">False</property>
|
|
| 433 |
+ <property name="fill">True</property>
|
|
| 434 |
+ <property name="position">1</property>
|
|
| 435 |
+ </packing>
|
|
| 485 | 436 |
</child>
|
| 486 | 437 |
</object>
|
| 487 |
- <packing>
|
|
| 488 |
- <property name="expand">False</property>
|
|
| 489 |
- <property name="fill">True</property>
|
|
| 490 |
- <property name="position">0</property>
|
|
| 491 |
- </packing>
|
|
| 492 | 438 |
</child>
|
| 493 | 439 |
</object>
|
| 494 | 440 |
<packing>
|
| 495 | 441 |
<property name="expand">False</property>
|
| 496 | 442 |
<property name="fill">True</property>
|
| 497 |
- <property name="pack_type">end</property>
|
|
| 498 | 443 |
<property name="position">1</property>
|
| 499 | 444 |
</packing>
|
| 500 | 445 |
</child>
|
| 501 | 446 |
<style>
|
| 502 |
- <class name="inline-toolbar"/>
|
|
| 503 |
- <class name="ontop-bar"/>
|
|
| 447 |
+ <class name="linked"/>
|
|
| 504 | 448 |
</style>
|
| 505 | 449 |
</object>
|
| 506 | 450 |
<packing>
|
| 507 | 451 |
<property name="expand">False</property>
|
| 508 | 452 |
<property name="fill">True</property>
|
| 509 |
- <property name="position">0</property>
|
|
| 453 |
+ <property name="position">2</property>
|
|
| 510 | 454 |
</packing>
|
| 511 | 455 |
</child>
|
| 512 | 456 |
<child>
|
| 513 |
- <object class="GtkPaned">
|
|
| 457 |
+ <object class="GtkBox">
|
|
| 514 | 458 |
<property name="visible">True</property>
|
| 515 |
- <property name="can_focus">True</property>
|
|
| 516 |
- <property name="vexpand">True</property>
|
|
| 459 |
+ <property name="can_focus">False</property>
|
|
| 517 | 460 |
<property name="orientation">vertical</property>
|
| 518 | 461 |
<child>
|
| 519 |
- <object class="GtkScrolledWindow" id="results_scrolledwindow">
|
|
| 462 |
+ <object class="GtkMenuButton">
|
|
| 463 |
+ <property name="visible">True</property>
|
|
| 520 | 464 |
<property name="can_focus">True</property>
|
| 521 |
- <property name="no_show_all">True</property>
|
|
| 522 |
- <property name="shadow_type">in</property>
|
|
| 465 |
+ <property name="receives_default">True</property>
|
|
| 466 |
+ <property name="popover">more_menu</property>
|
|
| 523 | 467 |
<child>
|
| 524 |
- <object class="GtkTreeView" id="results_treeview">
|
|
| 468 |
+ <object class="GtkImage">
|
|
| 525 | 469 |
<property name="visible">True</property>
|
| 526 |
- <property name="can_focus">True</property>
|
|
| 527 |
- <property name="rules_hint">True</property>
|
|
| 528 |
- <property name="hover_expand">True</property>
|
|
| 529 |
- <signal name="cursor-changed" handler="on_results_treeview_cursor_changed" swapped="no"/>
|
|
| 530 |
- <child internal-child="selection">
|
|
| 531 |
- <object class="GtkTreeSelection"/>
|
|
| 532 |
- </child>
|
|
| 470 |
+ <property name="can_focus">False</property>
|
|
| 471 |
+ <property name="icon_name">view-more-symbolic</property>
|
|
| 533 | 472 |
</object>
|
| 534 | 473 |
</child>
|
| 535 | 474 |
</object>
|
| 536 | 475 |
<packing>
|
| 537 |
- <property name="resize">True</property>
|
|
| 538 |
- <property name="shrink">True</property>
|
|
| 476 |
+ <property name="expand">False</property>
|
|
| 477 |
+ <property name="fill">True</property>
|
|
| 478 |
+ <property name="position">0</property>
|
|
| 539 | 479 |
</packing>
|
| 540 | 480 |
</child>
|
| 481 |
+ </object>
|
|
| 482 |
+ <packing>
|
|
| 483 |
+ <property name="expand">False</property>
|
|
| 484 |
+ <property name="fill">True</property>
|
|
| 485 |
+ <property name="pack_type">end</property>
|
|
| 486 |
+ <property name="position">1</property>
|
|
| 487 |
+ </packing>
|
|
| 488 |
+ </child>
|
|
| 489 |
+ <style>
|
|
| 490 |
+ <class name="inline-toolbar"/>
|
|
| 491 |
+ <class name="ontop-bar"/>
|
|
| 492 |
+ </style>
|
|
| 493 |
+ </object>
|
|
| 494 |
+ <packing>
|
|
| 495 |
+ <property name="expand">False</property>
|
|
| 496 |
+ <property name="fill">True</property>
|
|
| 497 |
+ <property name="position">0</property>
|
|
| 498 |
+ </packing>
|
|
| 499 |
+ </child>
|
|
| 500 |
+ <child>
|
|
| 501 |
+ <object class="GtkPaned">
|
|
| 502 |
+ <property name="visible">True</property>
|
|
| 503 |
+ <property name="can_focus">True</property>
|
|
| 504 |
+ <property name="vexpand">True</property>
|
|
| 505 |
+ <property name="orientation">vertical</property>
|
|
| 506 |
+ <child>
|
|
| 507 |
+ <object class="GtkScrolledWindow" id="results_scrolledwindow">
|
|
| 508 |
+ <property name="can_focus">True</property>
|
|
| 509 |
+ <property name="no_show_all">True</property>
|
|
| 510 |
+ <property name="shadow_type">in</property>
|
|
| 541 | 511 |
<child>
|
| 542 |
- <object class="GtkScrolledWindow" id="scrolledwindow">
|
|
| 512 |
+ <object class="GtkTreeView" id="results_treeview">
|
|
| 543 | 513 |
<property name="visible">True</property>
|
| 544 | 514 |
<property name="can_focus">True</property>
|
| 545 |
- <property name="shadow_type">etched-in</property>
|
|
| 546 |
- <property name="min_content_height">200</property>
|
|
| 547 |
- <child>
|
|
| 548 |
- <placeholder/>
|
|
| 515 |
+ <property name="rules_hint">True</property>
|
|
| 516 |
+ <property name="hover_expand">True</property>
|
|
| 517 |
+ <signal name="cursor-changed" handler="on_results_treeview_cursor_changed" swapped="no"/>
|
|
| 518 |
+ <child internal-child="selection">
|
|
| 519 |
+ <object class="GtkTreeSelection"/>
|
|
| 549 | 520 |
</child>
|
| 550 | 521 |
</object>
|
| 551 |
- <packing>
|
|
| 552 |
- <property name="resize">True</property>
|
|
| 553 |
- <property name="shrink">True</property>
|
|
| 554 |
- </packing>
|
|
| 555 | 522 |
</child>
|
| 556 | 523 |
</object>
|
| 557 | 524 |
<packing>
|
| 558 |
- <property name="expand">True</property>
|
|
| 559 |
- <property name="fill">True</property>
|
|
| 560 |
- <property name="position">1</property>
|
|
| 525 |
+ <property name="resize">True</property>
|
|
| 526 |
+ <property name="shrink">True</property>
|
|
| 527 |
+ </packing>
|
|
| 528 |
+ </child>
|
|
| 529 |
+ <child>
|
|
| 530 |
+ <object class="GtkScrolledWindow" id="scrolledwindow">
|
|
| 531 |
+ <property name="visible">True</property>
|
|
| 532 |
+ <property name="can_focus">True</property>
|
|
| 533 |
+ <property name="shadow_type">etched-in</property>
|
|
| 534 |
+ <property name="min_content_height">200</property>
|
|
| 535 |
+ <child>
|
|
| 536 |
+ <placeholder/>
|
|
| 537 |
+ </child>
|
|
| 538 |
+ </object>
|
|
| 539 |
+ <packing>
|
|
| 540 |
+ <property name="resize">True</property>
|
|
| 541 |
+ <property name="shrink">True</property>
|
|
| 561 | 542 |
</packing>
|
| 562 | 543 |
</child>
|
| 563 | 544 |
</object>
|
| 564 | 545 |
<packing>
|
| 565 |
- <property name="expand">False</property>
|
|
| 546 |
+ <property name="expand">True</property>
|
|
| 566 | 547 |
<property name="fill">True</property>
|
| 567 |
- <property name="position">2</property>
|
|
| 548 |
+ <property name="position">1</property>
|
|
| 568 | 549 |
</packing>
|
| 569 | 550 |
</child>
|
| 570 | 551 |
</object>
|
| 552 |
+ <packing>
|
|
| 553 |
+ <property name="expand">False</property>
|
|
| 554 |
+ <property name="fill">True</property>
|
|
| 555 |
+ <property name="position">2</property>
|
|
| 556 |
+ </packing>
|
|
| 571 | 557 |
</child>
|
| 572 | 558 |
</object>
|
| 573 | 559 |
</interface>
|
| ... | ... | @@ -494,7 +494,9 @@ class GroupchatControl(ChatControlBase): |
| 494 | 494 |
# GC Roster tooltip
|
| 495 | 495 |
self.gc_tooltip = GCTooltip()
|
| 496 | 496 |
|
| 497 |
- self.control_menu = gui_menu_builder.get_groupchat_menu(self.control_id)
|
|
| 497 |
+ self.control_menu = gui_menu_builder.get_groupchat_menu(self.control_id,
|
|
| 498 |
+ self.account,
|
|
| 499 |
+ self.room_jid)
|
|
| 498 | 500 |
settings_menu = self.xml.get_object('settings_menu')
|
| 499 | 501 |
settings_menu.set_menu_model(self.control_menu)
|
| 500 | 502 |
|
| ... | ... | @@ -2714,8 +2716,11 @@ class GroupchatControl(ChatControlBase): |
| 2714 | 2716 |
self.handlers[id_] = item
|
| 2715 | 2717 |
|
| 2716 | 2718 |
item = xml.get_object('history_menuitem')
|
| 2717 |
- id_ = item.connect('activate', self.on_history, nick)
|
|
| 2718 |
- self.handlers[id_] = item
|
|
| 2719 |
+ item.set_action_name('app.browse-history')
|
|
| 2720 |
+ dict_ = {'jid': GLib.Variant('s', fjid),
|
|
| 2721 |
+ 'account': GLib.Variant('s', self.account)}
|
|
| 2722 |
+ variant = GLib.Variant('a{sv}', dict_)
|
|
| 2723 |
+ item.set_action_target_value(variant)
|
|
| 2719 | 2724 |
|
| 2720 | 2725 |
item = xml.get_object('add_to_roster_menuitem')
|
| 2721 | 2726 |
our_jid = app.get_jid_from_account(self.account)
|
| ... | ... | @@ -2981,10 +2986,6 @@ class GroupchatControl(ChatControlBase): |
| 2981 | 2986 |
app.interface.instances[self.account]['infos'][contact.jid] = \
|
| 2982 | 2987 |
vcard.VcardWindow(contact, self.account, gc_contact)
|
| 2983 | 2988 |
|
| 2984 |
- def on_history(self, widget, nick):
|
|
| 2985 |
- jid = app.construct_fjid(self.room_jid, nick)
|
|
| 2986 |
- self._on_history_menuitem_activate(widget=widget, jid=jid)
|
|
| 2987 |
- |
|
| 2988 | 2989 |
def on_add_to_roster(self, widget, jid):
|
| 2989 | 2990 |
AddNewContactWindow(self.account, jid)
|
| 2990 | 2991 |
|
| ... | ... | @@ -69,14 +69,17 @@ class Column(IntEnum): |
| 69 | 69 |
LOG_LINE_ID = 5
|
| 70 | 70 |
|
| 71 | 71 |
|
| 72 |
-class HistoryWindow:
|
|
| 73 |
- """
|
|
| 74 |
- Class for browsing logs of conversations with contacts
|
|
| 75 |
- """
|
|
| 76 |
- |
|
| 72 |
+class HistoryWindow(Gtk.ApplicationWindow):
|
|
| 77 | 73 |
def __init__(self, jid=None, account=None):
|
| 74 |
+ Gtk.ApplicationWindow.__init__(self)
|
|
| 75 |
+ self.set_application(app.app)
|
|
| 76 |
+ self.set_position(Gtk.WindowPosition.CENTER)
|
|
| 77 |
+ self.set_show_menubar(False)
|
|
| 78 |
+ self.set_title(_('Conversation History'))
|
|
| 79 |
+ |
|
| 78 | 80 |
self._ui = get_builder('history_window.ui')
|
| 79 |
- self._ui.history_window.set_application(app.app)
|
|
| 81 |
+ |
|
| 82 |
+ self.add(self._ui.history_box)
|
|
| 80 | 83 |
|
| 81 | 84 |
self.history_textview = conversation_textview.ConversationTextview(
|
| 82 | 85 |
account, used_in_history_window=True)
|
| ... | ... | @@ -130,15 +133,18 @@ class HistoryWindow: |
| 130 | 133 |
else:
|
| 131 | 134 |
self._load_history(None)
|
| 132 | 135 |
|
| 133 |
- resize_window(self._ui.history_window,
|
|
| 136 |
+ resize_window(self,
|
|
| 134 | 137 |
app.config.get('history_window_width'),
|
| 135 | 138 |
app.config.get('history_window_height'))
|
| 136 |
- move_window(self._ui.history_window,
|
|
| 139 |
+ move_window(self,
|
|
| 137 | 140 |
app.config.get('history_window_x-position'),
|
| 138 | 141 |
app.config.get('history_window_y-position'))
|
| 139 | 142 |
|
| 140 | 143 |
self._ui.connect_signals(self)
|
| 141 |
- self._ui.history_window.show_all()
|
|
| 144 |
+ self.connect('delete-event', self._on_delete)
|
|
| 145 |
+ self.connect('destroy', self._on_destroy)
|
|
| 146 |
+ self.connect('key-press-event', self._on_key_press)
|
|
| 147 |
+ self.show_all()
|
|
| 142 | 148 |
|
| 143 | 149 |
# PluginSystem: adding GUI extension point for
|
| 144 | 150 |
# HistoryWindow instance object
|
| ... | ... | @@ -255,21 +261,20 @@ class HistoryWindow: |
| 255 | 261 |
break
|
| 256 | 262 |
return account
|
| 257 | 263 |
|
| 258 |
- def on_history_window_delete_event(self, widget, *args):
|
|
| 264 |
+ def _on_delete(self, widget, *args):
|
|
| 259 | 265 |
self.save_state()
|
| 260 | 266 |
|
| 261 |
- def on_history_window_destroy(self, widget):
|
|
| 267 |
+ def _on_destroy(self, widget):
|
|
| 262 | 268 |
# PluginSystem: removing GUI extension points connected with
|
| 263 | 269 |
# HistoryWindow instance object
|
| 264 | 270 |
app.plugin_manager.remove_gui_extension_point(
|
| 265 | 271 |
'history_window', self)
|
| 266 | 272 |
self.history_textview.del_handlers()
|
| 267 |
- del app.interface.instances['logs']
|
|
| 268 | 273 |
|
| 269 |
- def on_history_window_key_press_event(self, widget, event):
|
|
| 274 |
+ def _on_key_press(self, widget, event):
|
|
| 270 | 275 |
if event.keyval == Gdk.KEY_Escape:
|
| 271 | 276 |
self.save_state()
|
| 272 |
- self._ui.history_window.destroy()
|
|
| 277 |
+ self.destroy()
|
|
| 273 | 278 |
|
| 274 | 279 |
def on_jid_entry_match_selected(self, widget, model, iter_, *args):
|
| 275 | 280 |
self._jid_entry_search(model[iter_][1])
|
| ... | ... | @@ -799,8 +804,8 @@ class HistoryWindow: |
| 799 | 804 |
self._ui.results_scrolledwindow.set_property('visible', False)
|
| 800 | 805 |
|
| 801 | 806 |
def save_state(self):
|
| 802 |
- x, y = self._ui.history_window.get_window().get_root_origin()
|
|
| 803 |
- width, height = self._ui.history_window.get_size()
|
|
| 807 |
+ x, y = self.get_window().get_root_origin()
|
|
| 808 |
+ width, height = self.get_size()
|
|
| 804 | 809 |
|
| 805 | 810 |
app.config.set('history_window_x-position', x)
|
| 806 | 811 |
app.config.set('history_window_y-position', y)
|
| ... | ... | @@ -272,7 +272,12 @@ control=None, gc_contact=None, is_anonymous=True): |
| 272 | 272 |
|
| 273 | 273 |
rename_menuitem.connect('activate', roster.on_rename, 'contact', jid,
|
| 274 | 274 |
account)
|
| 275 |
- history_menuitem.connect('activate', roster.on_history, contact, account)
|
|
| 275 |
+ |
|
| 276 |
+ history_menuitem.set_action_name('app.browse-history')
|
|
| 277 |
+ dict_ = {'jid': GLib.Variant('s', contact.jid),
|
|
| 278 |
+ 'account': GLib.Variant('s', account)}
|
|
| 279 |
+ variant = GLib.Variant('a{sv}', dict_)
|
|
| 280 |
+ history_menuitem.set_action_target_value(variant)
|
|
| 276 | 281 |
|
| 277 | 282 |
if control:
|
| 278 | 283 |
convert_to_gc_menuitem.connect('activate',
|
| ... | ... | @@ -605,7 +610,7 @@ def show_save_as_menu(sha, name): |
| 605 | 610 |
menu.popup_at_pointer()
|
| 606 | 611 |
|
| 607 | 612 |
|
| 608 |
-def get_singlechat_menu(control_id):
|
|
| 613 |
+def get_singlechat_menu(control_id, account, jid):
|
|
| 609 | 614 |
singlechat_menu = [
|
| 610 | 615 |
(_('Send File…'), [
|
| 611 | 616 |
('win.send-file-httpupload-', _('Upload File…')),
|
| ... | ... | @@ -616,7 +621,7 @@ def get_singlechat_menu(control_id): |
| 616 | 621 |
('win.toggle-audio-', _('Audio Session')),
|
| 617 | 622 |
('win.toggle-video-', _('Video Session')),
|
| 618 | 623 |
('win.information-', _('Information')),
|
| 619 |
- ('win.browse-history-', _('History')),
|
|
| 624 |
+ ('app.browse-history', _('History')),
|
|
| 620 | 625 |
]
|
| 621 | 626 |
|
| 622 | 627 |
def build_menu(preset):
|
| ... | ... | @@ -624,8 +629,14 @@ def get_singlechat_menu(control_id): |
| 624 | 629 |
for item in preset:
|
| 625 | 630 |
if isinstance(item[1], str):
|
| 626 | 631 |
action_name, label = item
|
| 627 |
- if action_name == 'win.browse-history-':
|
|
| 628 |
- menu.append(label, action_name + control_id + '::none')
|
|
| 632 |
+ if action_name == 'app.browse-history':
|
|
| 633 |
+ menuitem = Gio.MenuItem.new(label, action_name)
|
|
| 634 |
+ dict_ = {'account': GLib.Variant('s', account),
|
|
| 635 |
+ 'jid': GLib.Variant('s', jid)}
|
|
| 636 |
+ variant_dict = GLib.Variant('a{sv}', dict_)
|
|
| 637 |
+ menuitem.set_action_and_target_value(action_name,
|
|
| 638 |
+ variant_dict)
|
|
| 639 |
+ menu.append_item(menuitem)
|
|
| 629 | 640 |
else:
|
| 630 | 641 |
menu.append(label, action_name + control_id)
|
| 631 | 642 |
else:
|
| ... | ... | @@ -638,7 +649,7 @@ def get_singlechat_menu(control_id): |
| 638 | 649 |
return build_menu(singlechat_menu)
|
| 639 | 650 |
|
| 640 | 651 |
|
| 641 |
-def get_groupchat_menu(control_id):
|
|
| 652 |
+def get_groupchat_menu(control_id, account, jid):
|
|
| 642 | 653 |
groupchat_menu = [
|
| 643 | 654 |
(_('Manage Room'), [
|
| 644 | 655 |
('win.change-subject-', _('Change Subject')),
|
| ... | ... | @@ -653,7 +664,7 @@ def get_groupchat_menu(control_id): |
| 653 | 664 |
('win.notify-on-message-', _('Notify on all messages')),
|
| 654 | 665 |
('win.minimize-', _('Minimize on close')),
|
| 655 | 666 |
('win.execute-command-', _('Execute command')),
|
| 656 |
- ('win.browse-history-', _('History')),
|
|
| 667 |
+ ('app.browse-history', _('History')),
|
|
| 657 | 668 |
('win.disconnect-', _('Disconnect')),
|
| 658 | 669 |
]
|
| 659 | 670 |
|
| ... | ... | @@ -662,8 +673,14 @@ def get_groupchat_menu(control_id): |
| 662 | 673 |
for item in preset:
|
| 663 | 674 |
if isinstance(item[1], str):
|
| 664 | 675 |
action_name, label = item
|
| 665 |
- if action_name == 'win.browse-history-':
|
|
| 666 |
- menu.append(label, action_name + control_id + '::none')
|
|
| 676 |
+ if action_name == 'app.browse-history':
|
|
| 677 |
+ menuitem = Gio.MenuItem.new(label, action_name)
|
|
| 678 |
+ dict_ = {'account': GLib.Variant('s', account),
|
|
| 679 |
+ 'jid': GLib.Variant('s', jid)}
|
|
| 680 |
+ variant_dict = GLib.Variant('a{sv}', dict_)
|
|
| 681 |
+ menuitem.set_action_and_target_value(action_name,
|
|
| 682 |
+ variant_dict)
|
|
| 683 |
+ menu.append_item(menuitem)
|
|
| 667 | 684 |
else:
|
| 668 | 685 |
menu.append(label, action_name + control_id)
|
| 669 | 686 |
else:
|
| ... | ... | @@ -355,9 +355,10 @@ class MessageWindow: |
| 355 | 355 |
if keyval == Gdk.KEY_h: # CTRL + h
|
| 356 | 356 |
if Gtk.Settings.get_default().get_property(
|
| 357 | 357 |
'gtk-key-theme-name') != 'Emacs':
|
| 358 |
- arg = GLib.Variant('s', 'none')
|
|
| 359 |
- self.window.lookup_action(
|
|
| 360 |
- 'browse-history-%s' % control.control_id).activate(arg)
|
|
| 358 |
+ dict_ = {'jid': GLib.Variant('s', control.contact.jid),
|
|
| 359 |
+ 'account': GLib.Variant('s', control.account)}
|
|
| 360 |
+ variant = GLib.Variant('a{sv}', dict_)
|
|
| 361 |
+ app.app.activate_action('browse-history', variant)
|
|
| 361 | 362 |
return True
|
| 362 | 363 |
elif control.type_id == message_control.TYPE_CHAT and \
|
| 363 | 364 |
keyval == Gdk.KEY_f: # CTRL + f
|
| ... | ... | @@ -78,7 +78,6 @@ from gajim.gtk.bookmarks import ManageBookmarksWindow |
| 78 | 78 |
from gajim.gtk.account_wizard import AccountCreationWizard
|
| 79 | 79 |
from gajim.gtk.service_registration import ServiceRegistration
|
| 80 | 80 |
from gajim.gtk.discovery import ServiceDiscoveryWindow
|
| 81 |
-from gajim.gtk.history import HistoryWindow
|
|
| 82 | 81 |
from gajim.gtk.accounts import AccountsWindow
|
| 83 | 82 |
from gajim.gtk.tooltips import RosterTooltip
|
| 84 | 83 |
from gajim.gtk.adhoc_commands import CommandWindow
|
| ... | ... | @@ -3041,16 +3040,6 @@ class RosterWindow: |
| 3041 | 3040 |
def on_edit_groups(self, widget, list_):
|
| 3042 | 3041 |
dialogs.EditGroupsDialog(list_)
|
| 3043 | 3042 |
|
| 3044 |
- def on_history(self, widget, contact, account):
|
|
| 3045 |
- """
|
|
| 3046 |
- When history menuitem is activated: call log window
|
|
| 3047 |
- """
|
|
| 3048 |
- if 'logs' in app.interface.instances:
|
|
| 3049 |
- app.interface.instances['logs'].window.present()
|
|
| 3050 |
- app.interface.instances['logs'].open_history(contact.jid, account)
|
|
| 3051 |
- else:
|
|
| 3052 |
- app.interface.instances['logs'] = HistoryWindow(contact.jid, account)
|
|
| 3053 |
- |
|
| 3054 | 3043 |
def on_disconnect(self, widget, jid, account):
|
| 3055 | 3044 |
"""
|
| 3056 | 3045 |
When disconnect menuitem is activated: disconnect from room
|
| ... | ... | @@ -3756,6 +3745,9 @@ class RosterWindow: |
| 3756 | 3745 |
self.on_info(widget, contact, account)
|
| 3757 | 3746 |
elif event.get_state() & Gdk.ModifierType.CONTROL_MASK and event.keyval == \
|
| 3758 | 3747 |
Gdk.KEY_h:
|
| 3748 |
+ if app.config.get('one_message_window') == 'always_with_roster':
|
|
| 3749 |
+ # Let MessageWindow handle this
|
|
| 3750 |
+ return
|
|
| 3759 | 3751 |
treeselection = self.tree.get_selection()
|
| 3760 | 3752 |
model, list_of_paths = treeselection.get_selected_rows()
|
| 3761 | 3753 |
if len(list_of_paths) != 1:
|
| ... | ... | @@ -3767,7 +3759,10 @@ class RosterWindow: |
| 3767 | 3759 |
account = model[path][Column.ACCOUNT]
|
| 3768 | 3760 |
contact = app.contacts.get_first_contact_from_jid(account,
|
| 3769 | 3761 |
jid)
|
| 3770 |
- self.on_history(widget, contact, account)
|
|
| 3762 |
+ dict_ = {'jid': GLib.Variant('s', jid),
|
|
| 3763 |
+ 'account': GLib.Variant('s', account)}
|
|
| 3764 |
+ app.app.activate_action('browse-history',
|
|
| 3765 |
+ GLib.Variant('a{sv}', dict_))
|
|
| 3771 | 3766 |
|
| 3772 | 3767 |
def on_roster_window_popup_menu(self, widget):
|
| 3773 | 3768 |
event = Gdk.Event.new(Gdk.EventType.KEY_PRESS)
|
| ... | ... | @@ -5392,7 +5387,12 @@ class RosterWindow: |
| 5392 | 5387 |
menu.append(item)
|
| 5393 | 5388 |
|
| 5394 | 5389 |
history_menuitem = Gtk.MenuItem.new_with_mnemonic(_('_History'))
|
| 5395 |
- history_menuitem.connect('activate', self.on_history, contact, account)
|
|
| 5390 |
+ history_menuitem.set_action_name('app.browse-history')
|
|
| 5391 |
+ dict_ = {'jid': GLib.Variant('s', contact.jid),
|
|
| 5392 |
+ 'account': GLib.Variant('s', account)}
|
|
| 5393 |
+ variant = GLib.Variant('a{sv}', dict_)
|
|
| 5394 |
+ history_menuitem.set_action_target_value(variant)
|
|
| 5395 |
+ |
|
| 5396 | 5396 |
menu.append(history_menuitem)
|
| 5397 | 5397 |
|
| 5398 | 5398 |
event_button = gtkgui_helpers.get_possible_button_event(event)
|