mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Moved about dialog and fixed a few bugs in tweet dialogs
This commit is contained in:
parent
6f838d12e9
commit
861de1f354
@ -29,8 +29,6 @@ class basicTweet(object):
|
|||||||
self.message = getattr(message, messageType)(title, caption, text, *args, **kwargs)
|
self.message = getattr(message, messageType)(title, caption, text, *args, **kwargs)
|
||||||
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
|
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
|
||||||
widgetUtils.connect_event(self.message.attach, widgetUtils.BUTTON_PRESSED, self.attach)
|
widgetUtils.connect_event(self.message.attach, widgetUtils.BUTTON_PRESSED, self.attach)
|
||||||
# if system == "Windows":
|
|
||||||
# if messageType != "dm":
|
|
||||||
widgetUtils.connect_event(self.message.text, widgetUtils.ENTERED_TEXT, self.text_processor)
|
widgetUtils.connect_event(self.message.text, widgetUtils.ENTERED_TEXT, self.text_processor)
|
||||||
widgetUtils.connect_event(self.message.shortenButton, widgetUtils.BUTTON_PRESSED, self.shorten)
|
widgetUtils.connect_event(self.message.shortenButton, widgetUtils.BUTTON_PRESSED, self.shorten)
|
||||||
widgetUtils.connect_event(self.message.unshortenButton, widgetUtils.BUTTON_PRESSED, self.unshorten)
|
widgetUtils.connect_event(self.message.unshortenButton, widgetUtils.BUTTON_PRESSED, self.unshorten)
|
||||||
@ -201,6 +199,7 @@ class viewTweet(basicTweet):
|
|||||||
param tweetList: If is_tweet is set to True, this could be a list of quoted tweets.
|
param tweetList: If is_tweet is set to True, this could be a list of quoted tweets.
|
||||||
param is_tweet: True or false, depending wether the passed object is a tweet or not."""
|
param is_tweet: True or false, depending wether the passed object is a tweet or not."""
|
||||||
if is_tweet == True:
|
if is_tweet == True:
|
||||||
|
self.title = _(u"Tweet")
|
||||||
image_description = []
|
image_description = []
|
||||||
text = ""
|
text = ""
|
||||||
for i in xrange(0, len(tweetList)):
|
for i in xrange(0, len(tweetList)):
|
||||||
@ -255,6 +254,7 @@ class viewTweet(basicTweet):
|
|||||||
self.message.set_title(len(text))
|
self.message.set_title(len(text))
|
||||||
[self.message.set_image_description(i) for i in image_description]
|
[self.message.set_image_description(i) for i in image_description]
|
||||||
else:
|
else:
|
||||||
|
self.title = _(u"View item")
|
||||||
text = tweet
|
text = tweet
|
||||||
self.message = message.viewNonTweet(text)
|
self.message = message.viewNonTweet(text)
|
||||||
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
|
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
|
||||||
|
@ -305,7 +305,7 @@ class viewTweet(widgetUtils.BaseDialog):
|
|||||||
self.text = wx.TextCtrl(panel, -1, text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
self.text = wx.TextCtrl(panel, -1, text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
||||||
dc = wx.WindowDC(self.text)
|
dc = wx.WindowDC(self.text)
|
||||||
dc.SetFont(self.text.GetFont())
|
dc.SetFont(self.text.GetFont())
|
||||||
(x, y, z) = dc.GetMultiLineTextExtent("0"*140)
|
(x, y) = dc.GetMultiLineTextExtent("0"*140)
|
||||||
self.text.SetSize((x, y))
|
self.text.SetSize((x, y))
|
||||||
self.text.SetFocus()
|
self.text.SetFocus()
|
||||||
textBox = wx.BoxSizer(wx.HORIZONTAL)
|
textBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
@ -317,7 +317,7 @@ class viewTweet(widgetUtils.BaseDialog):
|
|||||||
self.image_description = wx.TextCtrl(panel, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
self.image_description = wx.TextCtrl(panel, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
||||||
dc = wx.WindowDC(self.image_description)
|
dc = wx.WindowDC(self.image_description)
|
||||||
dc.SetFont(self.image_description.GetFont())
|
dc.SetFont(self.image_description.GetFont())
|
||||||
(x, y, z) = dc.GetMultiLineTextExtent("0"*450)
|
(x, y) = dc.GetMultiLineTextExtent("0"*450)
|
||||||
self.image_description.SetSize((x, y))
|
self.image_description.SetSize((x, y))
|
||||||
self.image_description.Enable(False)
|
self.image_description.Enable(False)
|
||||||
iBox = wx.BoxSizer(wx.HORIZONTAL)
|
iBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
@ -398,7 +398,7 @@ class viewNonTweet(widgetUtils.BaseDialog):
|
|||||||
self.text = wx.TextCtrl(parent=panel, id=-1, value=text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
self.text = wx.TextCtrl(parent=panel, id=-1, value=text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
||||||
dc = wx.WindowDC(self.text)
|
dc = wx.WindowDC(self.text)
|
||||||
dc.SetFont(self.text.GetFont())
|
dc.SetFont(self.text.GetFont())
|
||||||
(x, y, z) = dc.GetMultiLineTextExtent("0"*140)
|
(x, y) = dc.GetMultiLineTextExtent("0"*140)
|
||||||
self.text.SetSize((x, y))
|
self.text.SetSize((x, y))
|
||||||
self.text.SetFocus()
|
self.text.SetFocus()
|
||||||
textBox = wx.BoxSizer(wx.HORIZONTAL)
|
textBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import wx
|
import wx
|
||||||
|
import wx.adv
|
||||||
import application
|
import application
|
||||||
|
|
||||||
class mainFrame(wx.Frame):
|
class mainFrame(wx.Frame):
|
||||||
@ -173,7 +174,7 @@ class mainFrame(wx.Frame):
|
|||||||
self.nb.DeletePage(pos)
|
self.nb.DeletePage(pos)
|
||||||
|
|
||||||
def about_dialog(self):
|
def about_dialog(self):
|
||||||
info = wx.AboutDialogInfo()
|
info = wx.adv.AboutDialogInfo()
|
||||||
info.SetName(application.name)
|
info.SetName(application.name)
|
||||||
info.SetVersion(application.version)
|
info.SetVersion(application.version)
|
||||||
info.SetDescription(application.description)
|
info.SetDescription(application.description)
|
||||||
@ -182,7 +183,8 @@ class mainFrame(wx.Frame):
|
|||||||
# info.SetLicence(application.licence)
|
# info.SetLicence(application.licence)
|
||||||
for i in application.authors:
|
for i in application.authors:
|
||||||
info.AddDeveloper(i)
|
info.AddDeveloper(i)
|
||||||
wx.AboutBox(info)
|
wx.adv.AboutBox(info)
|
||||||
|
|
||||||
def set_focus(self):
|
def set_focus(self):
|
||||||
self.SetFocus()
|
self.SetFocus()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user