Added a setting for load (or not) images in posts. Closes #9

This commit is contained in:
Manuel Cortez 2016-08-17 17:18:17 -05:00
parent f079907a9e
commit 9fd845c424
5 changed files with 16 additions and 1 deletions

View File

@ -7,6 +7,7 @@
* Added an experimental photo viewer. Will show options for see the next and previous photo if the current post contains multiple images.
* Improved chats, now they should be more stable. Also you will be able to send the message by pressing enter in the text box. If you are trying to send the same message multiple times, you will be warned.
* Added video management (my videos, video albums and video search). For playing videos, you will be redirected to a website in your browser.
* Added a setting that allows you to specify if you want socializer to load images when you are opening posts. It could be useful for slow connection or those who don't want images to be loaded.
## Changes in build 2016.07.08 (08/07/2016)

View File

@ -13,10 +13,14 @@ class configuration(object):
self.dialog.create_general()
self.dialog.set_value("general", "wall_buffer_count", self.session.settings["buffers"]["count_for_wall_buffers"])
self.dialog.set_value("general", "audio_buffers_count", self.session.settings["buffers"]["count_for_audio_buffers"])
self.dialog.set_value("general", "video_buffers_count", self.session.settings["buffers"]["count_for_video_buffers"])
self.dialog.set_value("general", "load_images", self.session.settings["general"]["load_images"])
self.dialog.realize()
self.response = self.dialog.get_response()
def save_configuration(self):
self.session.settings["buffers"]["count_for_audio_buffers"] = self.dialog.get_value("general", "wall_buffer_count")
self.session.settings["buffers"]["count_for_audio_buffers"] = self.dialog.get_value("general", "audio_buffers_count")
self.session.settings["buffers"]["count_for_video_buffers"] = self.dialog.get_value("general", "video_buffers_count")
self.session.settings["general"]["load_images"] = self.dialog.get_value("general", "load_images")
self.session.settings.write()

View File

@ -174,7 +174,7 @@ class postController(object):
self.dialog.insert_attachments(attachments)
def check_image_load(self):
if self.load_images and len(self.images) > 0:
if self.load_images and len(self.images) > 0 and self.session.settings["general"]["load_images"]:
self.dialog.image.Enable(True)
nav = False # Disable navigation controls in photos
if len(self.images) > 1:

View File

@ -4,6 +4,7 @@ password = string(default="")
token = string(default="")
[general]
reverse_timelines = boolean(default=False)
load_images = boolean(default=True)
[buffers]
count_for_audio_buffers = integer(default=100)

View File

@ -20,6 +20,15 @@ class general(wx.Panel, widgetUtils.BaseDialog):
box2.Add(lbl2, 0, wx.ALL, 5)
box2.Add(self.audio_buffers_count, 0, wx.ALL, 5)
sizer.Add(box2, 0, wx.ALL, 5)
lbl3 = wx.StaticText(self, wx.NewId(), _(u"Number of items to load in video buffers (maximun 200)"))
self.video_buffers_count = wx.SpinCtrl(self, wx.NewId())
self.video_buffers_count.SetRange(1, 200)
box3 = wx.BoxSizer(wx.HORIZONTAL)
box3.Add(lbl3, 0, wx.ALL, 5)
box3.Add(self.video_buffers_count, 0, wx.ALL, 5)
sizer.Add(box3, 0, wx.ALL, 5)
self.load_images = wx.CheckBox(self, wx.NewId(), _(u"Load images in posts"))
sizer.Add(self.load_images, 0, wx.ALL, 5)
self.SetSizer(sizer)
class configurationDialog(widgetUtils.BaseDialog):