Philipp Hörist pushed to branch master at gajim / gajim
Commits:
54513a17 by Philipp Hörist at 2019-12-29T16:09:48Z
Remove unused import
- - - - -
587cec9e by Philipp Hörist at 2019-12-29T16:12:24Z
FileTransfer: Add annotation
- - - - -
2 changed files:
- gajim/common/filetransfer.py
- gajim/gtk/filetransfer_progress.py
Changes:
=====================================
gajim/common/filetransfer.py
=====================================
@@ -12,13 +12,14 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
+from typing import Dict
from gajim.common.helpers import Observable
from gajim.common.const import FTState
class FileTransfer(Observable):
- _state_descriptions = {}
+ _state_descriptions = {} # type: Dict[FTState, str]
def __init__(self, account, cancel_func=None):
Observable.__init__(self)
=====================================
gajim/gtk/filetransfer_progress.py
=====================================
@@ -12,7 +12,6 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
-import os
import time
from gi.repository import Gtk
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/3d07622ec77506e9aafda2200254c82b9…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/3d07622ec77506e9aafda2200254c82b9…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
068274fe by Philipp Hörist at 2019-12-27T22:11:19Z
MessageInput: Set min height for vertical scrollbar
Fixes #9574, #8980
- - - - -
2 changed files:
- gajim/chat_control_base.py
- gajim/data/style/gajim.css
Changes:
=====================================
gajim/chat_control_base.py
=====================================
@@ -1567,22 +1567,6 @@ class ScrolledWindow(Gtk.ScrolledWindow):
self.get_style_context().add_class('scrolled-no-border')
self.get_style_context().add_class('no-scroll-indicator')
self.get_style_context().add_class('scrollbar-style')
+ self.get_style_context().add_class('one-line-scrollbar')
self.set_shadow_type(Gtk.ShadowType.IN)
-
- def do_get_preferred_height(self):
- min_height, natural_height = Gtk.ScrolledWindow.do_get_preferred_height(self)
- # Gtk Bug: If policy is set to Automatic, the ScrolledWindow
- # has a min size of around 46-82 depending on the System. Because
- # we want it smaller, we set policy NEVER if the height is < 90
- # so the ScrolledWindow will shrink to around 26 (1 line height).
- # Once it gets over 90 its no problem to restore the policy.
- if natural_height < 90:
- GLib.idle_add(self.set_policy,
- Gtk.PolicyType.AUTOMATIC,
- Gtk.PolicyType.NEVER)
- else:
- GLib.idle_add(self.set_policy,
- Gtk.PolicyType.AUTOMATIC,
- Gtk.PolicyType.AUTOMATIC)
-
- return min_height, natural_height
+ self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
=====================================
gajim/data/style/gajim.css
=====================================
@@ -21,6 +21,7 @@
.scrollbar-style scrollbar trough {background-color:@theme_base_color; }
.scrollbar-style scrollbar {border:none; }
.scrollbar-style slider {min-width: 3px; background-color: #a0a3a4}
+.one-line-scrollbar scrollbar.vertical slider { min-height: 20px; }
.actionbar-no-border box {border: none}
.actionbar-no-border button {
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/068274feed324433a12313a97c4eeff52a…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/068274feed324433a12313a97c4eeff52a…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
162ca259 by Philipp Hörist at 2019-12-27T16:59:32Z
Make open_file() work with Path objects
- - - - -
1 changed file:
- gajim/common/helpers.py
Changes:
=====================================
gajim/common/helpers.py
=====================================
@@ -1587,6 +1587,8 @@ def open_file(path):
if os.name == 'nt':
os.startfile(path)
else:
+ # Call str() to make it work with pathlib.Path
+ path = str(path)
if not path.startswith('file://'):
path = 'file://' + path
Gio.AppInfo.launch_default_for_uri(path)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/162ca25902ab756af861e06f0253868228…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/162ca25902ab756af861e06f0253868228…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
91bb8c33 by Philipp Hörist at 2019-12-26T23:29:33Z
ConversationTextview: Add nickname tag
This makes it easier for plugins to detect the nickname
- - - - -
85e0e0da by Philipp Hörist at 2019-12-26T23:30:15Z
MessageInput: Add insert_text()
For convenience
- - - - -
2 changed files:
- gajim/conversation_textview.py
- gajim/gtk/message_input.py
Changes:
=====================================
gajim/conversation_textview.py
=====================================
@@ -272,6 +272,9 @@ class ConversationTextview(GObject.GObject):
textview_icon = buffer_.create_tag('textview-icon')
textview_icon.set_property('rise', Pango.units_from_double(-2.45))
+ # To help plugins easily identify the nickname
+ buffer_.create_tag('nickname')
+
tag = buffer_.create_tag('time_sometimes')
tag.set_property('foreground', 'darkgrey')
#Pango.SCALE_SMALL
@@ -1227,6 +1230,7 @@ class ConversationTextview(GObject.GObject):
if other_tags_for_name:
name_tags = other_tags_for_name[:] # create a new list
name_tags.append(kind)
+ name_tags.append('nickname')
for tag in name_tags:
if tag.startswith('muc_nickname_color_'):
=====================================
gajim/gtk/message_input.py
=====================================
@@ -117,6 +117,9 @@ class MessageInputTextView(Gtk.TextView):
self.emit('text-changed', self.get_buffer())
self._last_text = text
+ def insert_text(self, text):
+ self.get_buffer().insert_at_cursor(text)
+
def has_text(self):
buf = self.get_buffer()
start, end = buf.get_bounds()
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/209cd3c866c37384703f70c2401080fc0…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/209cd3c866c37384703f70c2401080fc0…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d4b9b823 by Philipp Hörist at 2019-12-23T22:41:49Z
HTTPUpload: Add missing argument
- - - - -
1 changed file:
- gajim/common/modules/httpupload.py
Changes:
=====================================
gajim/common/modules/httpupload.py
=====================================
@@ -240,7 +240,7 @@ class HTTPUpload(BaseModule):
if tls_errors:
phrase = get_tls_error_phrase(tls_errors)
- self._log.warning('TLS verification failed: %s')
+ self._log.warning('TLS verification failed: %s', phrase)
self._session.cancel_message(message, Soup.Status.CANCELLED)
self._raise_information_event('httpupload-error', phrase)
return
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d4b9b823b6b0ec2c46c051d28a2d63ad5d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d4b9b823b6b0ec2c46c051d28a2d63ad5d…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
9497dce2 by Philipp Hörist at 2019-12-21T21:54:52Z
Don't clean up temp file to early
We have to preserve it until the file transfer is finished
- - - - -
1 changed file:
- gajim/chat_control_base.py
Changes:
=====================================
gajim/chat_control_base.py
=====================================
@@ -26,7 +26,7 @@
import os
import time
import uuid
-from tempfile import TemporaryDirectory
+import tempfile
from gi.repository import Gtk
from gi.repository import Gdk
@@ -793,15 +793,12 @@ class ChatControlBase(ChatCommandProcessor, CommandTools, EventHelper):
if is_checked:
app.config.set('confirm_paste_image', False)
- tmp_dir = TemporaryDirectory()
- dir_ = tmp_dir.name
- path = os.path.join(dir_, '0.png')
+ dir_ = tempfile.gettempdir()
+ path = os.path.join(dir_, '%s.png' % str(uuid.uuid4()))
image.savev(path, 'png', [], [])
self._start_filetransfer(path)
- tmp_dir.cleanup()
-
def _get_pref_ft_method(self):
ft_pref = app.config.get_per('accounts', self.account,
'filetransfer_preference')
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9497dce25d432d67919d35b0f17fa18b6c…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9497dce25d432d67919d35b0f17fa18b6c…
You're receiving this email because of your account on dev.gajim.org.