Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
80ceee57
by Philipp Hörist at 2017-12-17T22:30:16+01:00
-
e3effdcb
by Philipp Hörist at 2017-12-17T22:30:16+01:00
-
f4a6b029
by Philipp Hörist at 2017-12-17T22:30:16+01:00
7 changed files:
- gajim/chat_control_base.py
- − gajim/data/gui/subscription_request_popup_menu.ui
- gajim/data/gui/subscription_request_window.ui
- gajim/dialogs.py
- gajim/gtkgui_helpers.py
- gajim/gui_interface.py
- gajim/message_window.py
Changes:
| ... | ... | @@ -1044,16 +1044,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): |
| 1044 | 1044 |
def on_clear_formatting_menuitem_activate(self, widget):
|
| 1045 | 1045 |
self.msg_textview.clear_tags()
|
| 1046 | 1046 |
|
| 1047 |
- def on_actions_button_clicked(self, widget):
|
|
| 1048 |
- """
|
|
| 1049 |
- Popup action menu
|
|
| 1050 |
- """
|
|
| 1051 |
- menu = self.prepare_context_menu(hide_buttonbar_items=True)
|
|
| 1052 |
- menu.show_all()
|
|
| 1053 |
- menu.attach_to_widget(widget, None)
|
|
| 1054 |
- gtkgui_helpers.popup_emoticons_under_button(menu, widget,
|
|
| 1055 |
- self.parent_win)
|
|
| 1056 |
- |
|
| 1057 | 1047 |
def update_tags(self):
|
| 1058 | 1048 |
self.conv_textview.update_tags()
|
| 1059 | 1049 |
|
| 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="GtkAccelGroup" id="accelgroup1"/>
|
|
| 6 |
- <object class="GtkMenu" id="subscription_request_popup_menu">
|
|
| 7 |
- <property name="can_focus">False</property>
|
|
| 8 |
- <child>
|
|
| 9 |
- <object class="GtkMenuItem" id="start_chat_menuitem">
|
|
| 10 |
- <property name="visible">True</property>
|
|
| 11 |
- <property name="can_focus">False</property>
|
|
| 12 |
- <property name="label" translatable="yes">_Start Chat</property>
|
|
| 13 |
- <property name="use_underline">True</property>
|
|
| 14 |
- <signal name="activate" handler="on_start_chat_activate" swapped="no"/>
|
|
| 15 |
- </object>
|
|
| 16 |
- </child>
|
|
| 17 |
- <child>
|
|
| 18 |
- <object class="GtkMenuItem" id="information_menuitem">
|
|
| 19 |
- <property name="visible">True</property>
|
|
| 20 |
- <property name="can_focus">False</property>
|
|
| 21 |
- <property name="label">_Information</property>
|
|
| 22 |
- <property name="use_underline">True</property>
|
|
| 23 |
- <signal name="activate" handler="on_contact_info_activate" swapped="no"/>
|
|
| 24 |
- </object>
|
|
| 25 |
- </child>
|
|
| 26 |
- </object>
|
|
| 27 |
-</interface>
|
| 1 | 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
-<!-- Generated with glade 3.18.3 -->
|
|
| 2 |
+<!-- Generated with glade 3.20.1 -->
|
|
| 3 | 3 |
<interface>
|
| 4 | 4 |
<requires lib="gtk+" version="3.12"/>
|
| 5 |
- <object class="GtkImage" id="image1">
|
|
| 5 |
+ <object class="GtkMenu" id="subscription_request_popup_menu">
|
|
| 6 | 6 |
<property name="visible">True</property>
|
| 7 | 7 |
<property name="can_focus">False</property>
|
| 8 |
- <property name="stock">gtk-add</property>
|
|
| 8 |
+ <child>
|
|
| 9 |
+ <object class="GtkMenuItem" id="start_chat_menuitem">
|
|
| 10 |
+ <property name="visible">True</property>
|
|
| 11 |
+ <property name="can_focus">False</property>
|
|
| 12 |
+ <property name="label" translatable="yes">_Start Chat</property>
|
|
| 13 |
+ <property name="use_underline">True</property>
|
|
| 14 |
+ <signal name="activate" handler="on_start_chat_activate" swapped="no"/>
|
|
| 15 |
+ </object>
|
|
| 16 |
+ </child>
|
|
| 17 |
+ <child>
|
|
| 18 |
+ <object class="GtkMenuItem" id="information_menuitem">
|
|
| 19 |
+ <property name="visible">True</property>
|
|
| 20 |
+ <property name="can_focus">False</property>
|
|
| 21 |
+ <property name="label">_Information</property>
|
|
| 22 |
+ <property name="use_underline">True</property>
|
|
| 23 |
+ <signal name="activate" handler="on_contact_info_activate" swapped="no"/>
|
|
| 24 |
+ </object>
|
|
| 25 |
+ </child>
|
|
| 9 | 26 |
</object>
|
| 10 |
- <object class="GtkImage" id="image2">
|
|
| 27 |
+ <object class="GtkBox" id="subscription_box">
|
|
| 11 | 28 |
<property name="visible">True</property>
|
| 12 | 29 |
<property name="can_focus">False</property>
|
| 13 |
- <property name="stock">gtk-cancel</property>
|
|
| 14 |
- </object>
|
|
| 15 |
- <object class="GtkTextBuffer" id="textbuffer1"/>
|
|
| 16 |
- <object class="GtkWindow" id="subscription_request_window">
|
|
| 17 |
- <property name="can_focus">False</property>
|
|
| 18 |
- <property name="border_width">12</property>
|
|
| 19 |
- <property name="title" translatable="yes">Subscription Request</property>
|
|
| 20 |
- <property name="resizable">False</property>
|
|
| 21 |
- <property name="type_hint">dialog</property>
|
|
| 22 |
- <signal name="destroy" handler="on_subscription_request_window_destroy" swapped="no"/>
|
|
| 30 |
+ <property name="margin_left">18</property>
|
|
| 31 |
+ <property name="margin_right">18</property>
|
|
| 32 |
+ <property name="margin_top">18</property>
|
|
| 33 |
+ <property name="margin_bottom">18</property>
|
|
| 34 |
+ <property name="orientation">vertical</property>
|
|
| 35 |
+ <property name="spacing">5</property>
|
|
| 23 | 36 |
<child>
|
| 24 |
- <object class="GtkBox" id="vbox10">
|
|
| 37 |
+ <object class="GtkLabel" id="from_label">
|
|
| 25 | 38 |
<property name="visible">True</property>
|
| 26 | 39 |
<property name="can_focus">False</property>
|
| 27 |
- <property name="orientation">vertical</property>
|
|
| 28 |
- <property name="spacing">5</property>
|
|
| 40 |
+ </object>
|
|
| 41 |
+ <packing>
|
|
| 42 |
+ <property name="expand">False</property>
|
|
| 43 |
+ <property name="fill">False</property>
|
|
| 44 |
+ <property name="position">0</property>
|
|
| 45 |
+ </packing>
|
|
| 46 |
+ </child>
|
|
| 47 |
+ <child>
|
|
| 48 |
+ <object class="GtkScrolledWindow" id="scrolledwindow8">
|
|
| 49 |
+ <property name="height_request">100</property>
|
|
| 50 |
+ <property name="visible">True</property>
|
|
| 51 |
+ <property name="can_focus">True</property>
|
|
| 52 |
+ <property name="border_width">5</property>
|
|
| 53 |
+ <property name="shadow_type">in</property>
|
|
| 54 |
+ <child>
|
|
| 55 |
+ <object class="GtkTextView" id="message_textview">
|
|
| 56 |
+ <property name="visible">True</property>
|
|
| 57 |
+ <property name="can_focus">True</property>
|
|
| 58 |
+ <property name="editable">False</property>
|
|
| 59 |
+ <property name="wrap_mode">word</property>
|
|
| 60 |
+ <property name="cursor_visible">False</property>
|
|
| 61 |
+ </object>
|
|
| 62 |
+ </child>
|
|
| 63 |
+ </object>
|
|
| 64 |
+ <packing>
|
|
| 65 |
+ <property name="expand">True</property>
|
|
| 66 |
+ <property name="fill">True</property>
|
|
| 67 |
+ <property name="position">1</property>
|
|
| 68 |
+ </packing>
|
|
| 69 |
+ </child>
|
|
| 70 |
+ <child>
|
|
| 71 |
+ <object class="GtkButtonBox" id="hbuttonbox3">
|
|
| 72 |
+ <property name="visible">True</property>
|
|
| 73 |
+ <property name="can_focus">False</property>
|
|
| 74 |
+ <property name="border_width">5</property>
|
|
| 75 |
+ <property name="spacing">12</property>
|
|
| 76 |
+ <property name="layout_style">end</property>
|
|
| 29 | 77 |
<child>
|
| 30 |
- <object class="GtkLabel" id="from_label">
|
|
| 78 |
+ <object class="GtkButton" id="close_button">
|
|
| 79 |
+ <property name="label">_Close</property>
|
|
| 31 | 80 |
<property name="visible">True</property>
|
| 32 |
- <property name="can_focus">False</property>
|
|
| 81 |
+ <property name="can_focus">True</property>
|
|
| 82 |
+ <property name="can_default">True</property>
|
|
| 83 |
+ <property name="receives_default">False</property>
|
|
| 84 |
+ <property name="use_underline">True</property>
|
|
| 85 |
+ <signal name="clicked" handler="on_close_button_clicked" swapped="no"/>
|
|
| 33 | 86 |
</object>
|
| 34 | 87 |
<packing>
|
| 35 | 88 |
<property name="expand">False</property>
|
| ... | ... | @@ -38,154 +91,66 @@ |
| 38 | 91 |
</packing>
|
| 39 | 92 |
</child>
|
| 40 | 93 |
<child>
|
| 41 |
- <object class="GtkScrolledWindow" id="scrolledwindow8">
|
|
| 42 |
- <property name="height_request">100</property>
|
|
| 94 |
+ <object class="GtkButton" id="deny_button">
|
|
| 95 |
+ <property name="label" translatable="yes">_Deny</property>
|
|
| 43 | 96 |
<property name="visible">True</property>
|
| 44 | 97 |
<property name="can_focus">True</property>
|
| 45 |
- <property name="border_width">5</property>
|
|
| 46 |
- <property name="shadow_type">in</property>
|
|
| 98 |
+ <property name="can_default">True</property>
|
|
| 99 |
+ <property name="receives_default">False</property>
|
|
| 100 |
+ <property name="tooltip_text" translatable="yes">Deny authorization from contact so he or she cannot know when you're connected</property>
|
|
| 101 |
+ <property name="use_underline">True</property>
|
|
| 102 |
+ <signal name="clicked" handler="on_deny_button_clicked" swapped="no"/>
|
|
| 103 |
+ </object>
|
|
| 104 |
+ <packing>
|
|
| 105 |
+ <property name="expand">False</property>
|
|
| 106 |
+ <property name="fill">False</property>
|
|
| 107 |
+ <property name="position">1</property>
|
|
| 108 |
+ </packing>
|
|
| 109 |
+ </child>
|
|
| 110 |
+ <child>
|
|
| 111 |
+ <object class="GtkMenuButton">
|
|
| 112 |
+ <property name="visible">True</property>
|
|
| 113 |
+ <property name="can_focus">True</property>
|
|
| 114 |
+ <property name="receives_default">True</property>
|
|
| 115 |
+ <property name="popup">subscription_request_popup_menu</property>
|
|
| 116 |
+ <property name="use_popover">False</property>
|
|
| 47 | 117 |
<child>
|
| 48 |
- <object class="GtkTextView" id="message_textview">
|
|
| 118 |
+ <object class="GtkImage">
|
|
| 49 | 119 |
<property name="visible">True</property>
|
| 50 |
- <property name="can_focus">True</property>
|
|
| 51 |
- <property name="editable">False</property>
|
|
| 52 |
- <property name="wrap_mode">word</property>
|
|
| 53 |
- <property name="cursor_visible">False</property>
|
|
| 54 |
- <property name="buffer">textbuffer1</property>
|
|
| 120 |
+ <property name="can_focus">False</property>
|
|
| 121 |
+ <property name="icon_name">applications-system-symbolic</property>
|
|
| 55 | 122 |
</object>
|
| 56 | 123 |
</child>
|
| 57 | 124 |
</object>
|
| 58 | 125 |
<packing>
|
| 59 | 126 |
<property name="expand">True</property>
|
| 60 | 127 |
<property name="fill">True</property>
|
| 61 |
- <property name="position">1</property>
|
|
| 128 |
+ <property name="position">2</property>
|
|
| 62 | 129 |
</packing>
|
| 63 | 130 |
</child>
|
| 64 | 131 |
<child>
|
| 65 |
- <object class="GtkButtonBox" id="hbuttonbox3">
|
|
| 132 |
+ <object class="GtkButton" id="authorize_button">
|
|
| 133 |
+ <property name="label" translatable="yes">Au_thorize</property>
|
|
| 66 | 134 |
<property name="visible">True</property>
|
| 67 |
- <property name="can_focus">False</property>
|
|
| 68 |
- <property name="border_width">5</property>
|
|
| 69 |
- <property name="spacing">12</property>
|
|
| 70 |
- <property name="layout_style">end</property>
|
|
| 71 |
- <child>
|
|
| 72 |
- <object class="GtkButton" id="close_button">
|
|
| 73 |
- <property name="label">gtk-close</property>
|
|
| 74 |
- <property name="visible">True</property>
|
|
| 75 |
- <property name="can_focus">True</property>
|
|
| 76 |
- <property name="can_default">True</property>
|
|
| 77 |
- <property name="receives_default">False</property>
|
|
| 78 |
- <property name="use_stock">True</property>
|
|
| 79 |
- <signal name="clicked" handler="on_close_button_clicked" swapped="no"/>
|
|
| 80 |
- </object>
|
|
| 81 |
- <packing>
|
|
| 82 |
- <property name="expand">False</property>
|
|
| 83 |
- <property name="fill">False</property>
|
|
| 84 |
- <property name="position">0</property>
|
|
| 85 |
- </packing>
|
|
| 86 |
- </child>
|
|
| 87 |
- <child>
|
|
| 88 |
- <object class="GtkButton" id="deny_button">
|
|
| 89 |
- <property name="label" translatable="yes">_Deny</property>
|
|
| 90 |
- <property name="visible">True</property>
|
|
| 91 |
- <property name="can_focus">True</property>
|
|
| 92 |
- <property name="can_default">True</property>
|
|
| 93 |
- <property name="receives_default">False</property>
|
|
| 94 |
- <property name="tooltip_text" translatable="yes">Deny authorization from contact so he or she cannot know when you're connected</property>
|
|
| 95 |
- <property name="image">image2</property>
|
|
| 96 |
- <property name="use_underline">True</property>
|
|
| 97 |
- <signal name="clicked" handler="on_deny_button_clicked" swapped="no"/>
|
|
| 98 |
- </object>
|
|
| 99 |
- <packing>
|
|
| 100 |
- <property name="expand">False</property>
|
|
| 101 |
- <property name="fill">False</property>
|
|
| 102 |
- <property name="position">1</property>
|
|
| 103 |
- </packing>
|
|
| 104 |
- </child>
|
|
| 105 |
- <child>
|
|
| 106 |
- <object class="GtkButton" id="actions_button">
|
|
| 107 |
- <property name="visible">True</property>
|
|
| 108 |
- <property name="can_focus">True</property>
|
|
| 109 |
- <property name="receives_default">False</property>
|
|
| 110 |
- <signal name="clicked" handler="on_actions_button_clicked" swapped="no"/>
|
|
| 111 |
- <child>
|
|
| 112 |
- <object class="GtkBox" id="hbox3009">
|
|
| 113 |
- <property name="visible">True</property>
|
|
| 114 |
- <property name="can_focus">False</property>
|
|
| 115 |
- <property name="spacing">2</property>
|
|
| 116 |
- <child>
|
|
| 117 |
- <object class="GtkImage" id="image1338">
|
|
| 118 |
- <property name="visible">True</property>
|
|
| 119 |
- <property name="can_focus">False</property>
|
|
| 120 |
- <property name="stock">gtk-execute</property>
|
|
| 121 |
- </object>
|
|
| 122 |
- <packing>
|
|
| 123 |
- <property name="expand">False</property>
|
|
| 124 |
- <property name="fill">False</property>
|
|
| 125 |
- <property name="position">0</property>
|
|
| 126 |
- </packing>
|
|
| 127 |
- </child>
|
|
| 128 |
- <child>
|
|
| 129 |
- <object class="GtkLabel" id="label372">
|
|
| 130 |
- <property name="visible">True</property>
|
|
| 131 |
- <property name="can_focus">False</property>
|
|
| 132 |
- <property name="label" translatable="yes" comments="Make sure the character after "_" is not M/m (conflicts with Alt+M that is supposed to show the Emoticon Selector)">_Actions</property>
|
|
| 133 |
- <property name="use_underline">True</property>
|
|
| 134 |
- </object>
|
|
| 135 |
- <packing>
|
|
| 136 |
- <property name="expand">False</property>
|
|
| 137 |
- <property name="fill">False</property>
|
|
| 138 |
- <property name="position">1</property>
|
|
| 139 |
- </packing>
|
|
| 140 |
- </child>
|
|
| 141 |
- <child>
|
|
| 142 |
- <object class="GtkArrow" id="arrow4">
|
|
| 143 |
- <property name="visible">True</property>
|
|
| 144 |
- <property name="can_focus">False</property>
|
|
| 145 |
- <property name="arrow_type">down</property>
|
|
| 146 |
- </object>
|
|
| 147 |
- <packing>
|
|
| 148 |
- <property name="expand">False</property>
|
|
| 149 |
- <property name="fill">False</property>
|
|
| 150 |
- <property name="position">2</property>
|
|
| 151 |
- </packing>
|
|
| 152 |
- </child>
|
|
| 153 |
- </object>
|
|
| 154 |
- </child>
|
|
| 155 |
- </object>
|
|
| 156 |
- <packing>
|
|
| 157 |
- <property name="expand">False</property>
|
|
| 158 |
- <property name="fill">False</property>
|
|
| 159 |
- <property name="position">2</property>
|
|
| 160 |
- </packing>
|
|
| 161 |
- </child>
|
|
| 162 |
- <child>
|
|
| 163 |
- <object class="GtkButton" id="authorize_button">
|
|
| 164 |
- <property name="label" translatable="yes">Au_thorize</property>
|
|
| 165 |
- <property name="visible">True</property>
|
|
| 166 |
- <property name="can_focus">True</property>
|
|
| 167 |
- <property name="can_default">True</property>
|
|
| 168 |
- <property name="has_default">True</property>
|
|
| 169 |
- <property name="receives_default">False</property>
|
|
| 170 |
- <property name="tooltip_text" translatable="yes">Authorize contact so he or she can know when you're connected</property>
|
|
| 171 |
- <property name="image">image1</property>
|
|
| 172 |
- <property name="use_underline">True</property>
|
|
| 173 |
- <signal name="clicked" handler="on_authorize_button_clicked" swapped="no"/>
|
|
| 174 |
- </object>
|
|
| 175 |
- <packing>
|
|
| 176 |
- <property name="expand">False</property>
|
|
| 177 |
- <property name="fill">False</property>
|
|
| 178 |
- <property name="position">3</property>
|
|
| 179 |
- </packing>
|
|
| 180 |
- </child>
|
|
| 135 |
+ <property name="can_focus">True</property>
|
|
| 136 |
+ <property name="can_default">True</property>
|
|
| 137 |
+ <property name="receives_default">False</property>
|
|
| 138 |
+ <property name="tooltip_text" translatable="yes">Authorize contact so he or she can know when you're connected</property>
|
|
| 139 |
+ <property name="use_underline">True</property>
|
|
| 140 |
+ <signal name="clicked" handler="on_authorize_button_clicked" swapped="no"/>
|
|
| 181 | 141 |
</object>
|
| 182 | 142 |
<packing>
|
| 183 | 143 |
<property name="expand">False</property>
|
| 184 | 144 |
<property name="fill">False</property>
|
| 185 |
- <property name="position">2</property>
|
|
| 145 |
+ <property name="position">3</property>
|
|
| 186 | 146 |
</packing>
|
| 187 | 147 |
</child>
|
| 188 | 148 |
</object>
|
| 149 |
+ <packing>
|
|
| 150 |
+ <property name="expand">False</property>
|
|
| 151 |
+ <property name="fill">False</property>
|
|
| 152 |
+ <property name="position">2</property>
|
|
| 153 |
+ </packing>
|
|
| 189 | 154 |
</child>
|
| 190 | 155 |
</object>
|
| 191 | 156 |
</interface>
|
| ... | ... | @@ -2269,10 +2269,18 @@ class DoubleInputDialog: |
| 2269 | 2269 |
else:
|
| 2270 | 2270 |
self.cancel_handler()
|
| 2271 | 2271 |
|
| 2272 |
-class SubscriptionRequestWindow:
|
|
| 2272 |
+class SubscriptionRequestWindow(Gtk.ApplicationWindow):
|
|
| 2273 | 2273 |
def __init__(self, jid, text, account, user_nick=None):
|
| 2274 |
+ Gtk.ApplicationWindow.__init__(self)
|
|
| 2275 |
+ self.set_name('SubscriptionRequest')
|
|
| 2276 |
+ self.set_application(app.app)
|
|
| 2277 |
+ self.set_show_menubar(False)
|
|
| 2278 |
+ self.set_resizable(False)
|
|
| 2279 |
+ self.set_position(Gtk.WindowPosition.CENTER)
|
|
| 2280 |
+ self.set_title(_('Subscription Request'))
|
|
| 2281 |
+ |
|
| 2274 | 2282 |
xml = gtkgui_helpers.get_gtk_builder('subscription_request_window.ui')
|
| 2275 |
- self.window = xml.get_object('subscription_request_window')
|
|
| 2283 |
+ self.add(xml.get_object('subscription_box'))
|
|
| 2276 | 2284 |
self.jid = jid
|
| 2277 | 2285 |
self.account = account
|
| 2278 | 2286 |
self.user_nick = user_nick
|
| ... | ... | @@ -2282,10 +2290,16 @@ class SubscriptionRequestWindow: |
| 2282 | 2290 |
% {'account': account, 'jid': self.jid}
|
| 2283 | 2291 |
else:
|
| 2284 | 2292 |
prompt_text = _('Subscription request from %s') % self.jid
|
| 2285 |
- xml.get_object('from_label').set_text(prompt_text)
|
|
| 2286 |
- xml.get_object('message_textview').get_buffer().set_text(text)
|
|
| 2293 |
+ |
|
| 2294 |
+ from_label = xml.get_object('from_label')
|
|
| 2295 |
+ from_label.set_text(prompt_text)
|
|
| 2296 |
+ |
|
| 2297 |
+ textview = xml.get_object('message_textview')
|
|
| 2298 |
+ textview.get_buffer().set_text(text)
|
|
| 2299 |
+ |
|
| 2300 |
+ self.set_default(xml.get_object('authorize_button'))
|
|
| 2287 | 2301 |
xml.connect_signals(self)
|
| 2288 |
- self.window.show_all()
|
|
| 2302 |
+ self.show_all()
|
|
| 2289 | 2303 |
|
| 2290 | 2304 |
def on_subscription_request_window_destroy(self, widget):
|
| 2291 | 2305 |
"""
|
| ... | ... | @@ -2295,21 +2309,15 @@ class SubscriptionRequestWindow: |
| 2295 | 2309 |
# remove us from open windows
|
| 2296 | 2310 |
del app.interface.instances[self.account]['sub_request'][self.jid]
|
| 2297 | 2311 |
|
| 2298 |
- def prepare_popup_menu(self):
|
|
| 2299 |
- xml = gtkgui_helpers.get_gtk_builder('subscription_request_popup_menu.ui')
|
|
| 2300 |
- menu = xml.get_object('subscription_request_popup_menu')
|
|
| 2301 |
- xml.connect_signals(self)
|
|
| 2302 |
- return menu
|
|
| 2303 |
- |
|
| 2304 | 2312 |
def on_close_button_clicked(self, widget):
|
| 2305 |
- self.window.destroy()
|
|
| 2313 |
+ self.destroy()
|
|
| 2306 | 2314 |
|
| 2307 | 2315 |
def on_authorize_button_clicked(self, widget):
|
| 2308 | 2316 |
"""
|
| 2309 | 2317 |
Accept the request
|
| 2310 | 2318 |
"""
|
| 2311 | 2319 |
app.connections[self.account].send_authorization(self.jid)
|
| 2312 |
- self.window.destroy()
|
|
| 2320 |
+ self.destroy()
|
|
| 2313 | 2321 |
contact = app.contacts.get_contact(self.account, self.jid)
|
| 2314 | 2322 |
if not contact or _('Not in Roster') in contact.groups:
|
| 2315 | 2323 |
AddNewContactWindow(self.account, self.jid, self.user_nick)
|
| ... | ... | @@ -2342,16 +2350,7 @@ class SubscriptionRequestWindow: |
| 2342 | 2350 |
contact = app.contacts.get_contact(self.account, self.jid)
|
| 2343 | 2351 |
if contact and _('Not in Roster') in contact.get_shown_groups():
|
| 2344 | 2352 |
app.interface.roster.remove_contact(self.jid, self.account)
|
| 2345 |
- self.window.destroy()
|
|
| 2346 |
- |
|
| 2347 |
- def on_actions_button_clicked(self, widget):
|
|
| 2348 |
- """
|
|
| 2349 |
- Popup action menu
|
|
| 2350 |
- """
|
|
| 2351 |
- menu = self.prepare_popup_menu()
|
|
| 2352 |
- menu.show_all()
|
|
| 2353 |
- gtkgui_helpers.popup_emoticons_under_button(menu, widget,
|
|
| 2354 |
- self.window.get_window())
|
|
| 2353 |
+ self.destroy()
|
|
| 2355 | 2354 |
|
| 2356 | 2355 |
class JoinGroupchatWindow(Gtk.ApplicationWindow):
|
| 2357 | 2356 |
def __init__(self, account, room_jid, password=None, automatic=None):
|
| ... | ... | @@ -3178,11 +3177,12 @@ class PopupNotificationWindow: |
| 3178 | 3177 |
window_width, self.window_height = self.window.get_size()
|
| 3179 | 3178 |
app.interface.roster.popups_notification_height += self.window_height
|
| 3180 | 3179 |
pos_x = app.config.get('notification_position_x')
|
| 3180 |
+ screen_w, screen_h = gtkgui_helpers.get_display_geometry()
|
|
| 3181 | 3181 |
if pos_x < 0:
|
| 3182 |
- pos_x = Gdk.Screen.width() - window_width + pos_x + 1
|
|
| 3182 |
+ pos_x = screen_w - window_width + pos_x + 1
|
|
| 3183 | 3183 |
pos_y = app.config.get('notification_position_y')
|
| 3184 | 3184 |
if pos_y < 0:
|
| 3185 |
- pos_y = Gdk.Screen.height() - \
|
|
| 3185 |
+ pos_y = screen_h - \
|
|
| 3186 | 3186 |
app.interface.roster.popups_notification_height + pos_y + 1
|
| 3187 | 3187 |
self.window.move(pos_x, pos_y)
|
| 3188 | 3188 |
|
| ... | ... | @@ -3214,8 +3214,9 @@ class PopupNotificationWindow: |
| 3214 | 3214 |
current_index += 1
|
| 3215 | 3215 |
window_width, window_height = window_instance.window.get_size()
|
| 3216 | 3216 |
app.interface.roster.popups_notification_height += window_height
|
| 3217 |
- window_instance.window.move(Gdk.Screen.width() - window_width,
|
|
| 3218 |
- Gdk.Screen.height() - \
|
|
| 3217 |
+ screen_w, screen_h = gtkgui_helpers.get_display_geometry()
|
|
| 3218 |
+ window_instance.window.move(screen_w - window_width,
|
|
| 3219 |
+ screen_h - \
|
|
| 3219 | 3220 |
app.interface.roster.popups_notification_height)
|
| 3220 | 3221 |
|
| 3221 | 3222 |
def on_popup_notification_window_button_press_event(self, widget, event):
|
| ... | ... | @@ -99,8 +99,11 @@ if os.name == 'nt': |
| 99 | 99 |
|
| 100 | 100 |
from gajim.common import helpers
|
| 101 | 101 |
|
| 102 |
-screen_w = Gdk.Screen.width()
|
|
| 103 |
-screen_h = Gdk.Screen.height()
|
|
| 102 |
+def get_display_geometry():
|
|
| 103 |
+ display = Gdk.Display.get_default()
|
|
| 104 |
+ monitor = display.get_monitor(0)
|
|
| 105 |
+ geometry = monitor.get_geometry()
|
|
| 106 |
+ return geometry.width, geometry.height
|
|
| 104 | 107 |
|
| 105 | 108 |
def add_image_to_button(button, icon_name):
|
| 106 | 109 |
img = Gtk.Image()
|
| ... | ... | @@ -151,43 +154,6 @@ def get_completion_liststore(entry): |
| 151 | 154 |
entry.set_completion(completion)
|
| 152 | 155 |
return liststore
|
| 153 | 156 |
|
| 154 |
- |
|
| 155 |
-def popup_emoticons_under_button(menu, button, parent_win):
|
|
| 156 |
- """
|
|
| 157 |
- Popup the emoticons menu under button, which is in parent_win
|
|
| 158 |
- """
|
|
| 159 |
- window_x1, window_y1 = parent_win.get_origin()[1:]
|
|
| 160 |
- |
|
| 161 |
- def position_menu_under_button(menu, _x=None, _y=None, data=None):
|
|
| 162 |
- # inline function, which will not keep refs, when used as CB
|
|
| 163 |
- alloc = button.get_allocation()
|
|
| 164 |
- button_x, button_y = alloc.x, alloc.y
|
|
| 165 |
- translated_coordinates = button.translate_coordinates(
|
|
| 166 |
- app.interface.roster.window, 0, 0)
|
|
| 167 |
- if translated_coordinates:
|
|
| 168 |
- button_x, button_y = translated_coordinates
|
|
| 169 |
- |
|
| 170 |
- # now convert them to X11-relative
|
|
| 171 |
- window_x, window_y = window_x1, window_y1
|
|
| 172 |
- x = window_x + button_x
|
|
| 173 |
- y = window_y + button_y
|
|
| 174 |
- |
|
| 175 |
- menu_height = menu.get_preferred_size()[0].height
|
|
| 176 |
- |
|
| 177 |
- ## should we pop down or up?
|
|
| 178 |
- if (y + alloc.height + menu_height < Gdk.Screen.height()):
|
|
| 179 |
- # now move the menu below the button
|
|
| 180 |
- y += alloc.height
|
|
| 181 |
- else:
|
|
| 182 |
- # now move the menu above the button
|
|
| 183 |
- y -= menu_height
|
|
| 184 |
- |
|
| 185 |
- # push_in is True so all the menuitems are always inside screen
|
|
| 186 |
- push_in = True
|
|
| 187 |
- return (x, y, push_in)
|
|
| 188 |
- |
|
| 189 |
- menu.popup(None, None, position_menu_under_button, None, 1, 0)
|
|
| 190 |
- |
|
| 191 | 157 |
def get_theme_font_for_option(theme, option):
|
| 192 | 158 |
"""
|
| 193 | 159 |
Return string description of the font, stored in theme preferences
|
| ... | ... | @@ -208,6 +174,7 @@ def move_window(window, x, y): |
| 208 | 174 |
"""
|
| 209 | 175 |
Move the window, but also check if out of screen
|
| 210 | 176 |
"""
|
| 177 |
+ screen_w, screen_h = get_display_geometry()
|
|
| 211 | 178 |
if x < 0:
|
| 212 | 179 |
x = 0
|
| 213 | 180 |
if y < 0:
|
| ... | ... | @@ -223,6 +190,7 @@ def resize_window(window, w, h): |
| 223 | 190 |
"""
|
| 224 | 191 |
Resize window, but also checks if huge window or negative values
|
| 225 | 192 |
"""
|
| 193 |
+ screen_w, screen_h = get_display_geometry()
|
|
| 226 | 194 |
if not w or not h:
|
| 227 | 195 |
return
|
| 228 | 196 |
if w > screen_w:
|
| ... | ... | @@ -499,7 +499,7 @@ class Interface: |
| 499 | 499 |
account = obj.conn.name
|
| 500 | 500 |
if helpers.allow_popup_window(account) or not self.systray_enabled:
|
| 501 | 501 |
if obj.jid in self.instances[account]['sub_request']:
|
| 502 |
- self.instances[account]['sub_request'][obj.jid].window.destroy()
|
|
| 502 |
+ self.instances[account]['sub_request'][obj.jid].destroy()
|
|
| 503 | 503 |
self.instances[account]['sub_request'][obj.jid] = \
|
| 504 | 504 |
dialogs.SubscriptionRequestWindow(obj.jid, obj.status, account,
|
| 505 | 505 |
obj.user_nick)
|
| ... | ... | @@ -829,7 +829,7 @@ class Interface: |
| 829 | 829 |
self.roster.draw_contact(obj.jid, account)
|
| 830 | 830 |
if obj.jid in self.instances[account]['sub_request'] and obj.sub in (
|
| 831 | 831 |
'from', 'both'):
|
| 832 |
- self.instances[account]['sub_request'][obj.jid].window.destroy()
|
|
| 832 |
+ self.instances[account]['sub_request'][obj.jid].destroy()
|
|
| 833 | 833 |
|
| 834 | 834 |
def handle_event_bookmarks(self, obj):
|
| 835 | 835 |
# ('BOOKMARKS', account, [{name,jid,autojoin,password,nick}, {}])
|
| ... | ... | @@ -451,11 +451,6 @@ class MessageWindow(object): |
| 451 | 451 |
elif keyval == Gdk.KEY_m: # ALT + M show emoticons menu
|
| 452 | 452 |
control.emoticons_button.get_popover().show()
|
| 453 | 453 |
return True
|
| 454 |
- elif keyval == Gdk.KEY_d: # ALT + D show actions menu
|
|
| 455 |
- if Gtk.Settings.get_default().get_property(
|
|
| 456 |
- 'gtk-key-theme-name') != 'Emacs':
|
|
| 457 |
- control.on_actions_button_clicked(control.actions_button)
|
|
| 458 |
- return True
|
|
| 459 | 454 |
elif control.type_id == message_control.TYPE_GC and \
|
| 460 | 455 |
keyval == Gdk.KEY_t: # ALT + t
|
| 461 | 456 |
control._on_change_subject_menuitem_activate(None)
|