mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-18 22:16:08 -04:00
view user info is now posible from the menu bar or control+win+shift+n
This commit is contained in:
@@ -1 +1 @@
|
||||
import baseDialog, trends, configuration, lists, message, search, show_user, update_profile, urlList, userSelection
|
||||
import baseDialog, trends, configuration, lists, message, search, show_user, update_profile, urlList, userSelection, utils
|
||||
|
@@ -23,3 +23,6 @@ class BaseWXDialog(wx.Dialog):
|
||||
elif hasattr(control, "ChangeValue"): return getattr(control, "ChangeValue")(text)
|
||||
else: return -1
|
||||
else: return 0
|
||||
|
||||
def set_title(self, title):
|
||||
self.SetTitle(title)
|
||||
|
@@ -1,17 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import wx
|
||||
import baseDialog
|
||||
|
||||
class showUserProfile(wx.Dialog):
|
||||
def __init__(self, screen_name):
|
||||
super(showUserProfile, self).__init__(self, None, -1)
|
||||
self.SetTitle(_(u"Information for %s") % (screen_name))
|
||||
class showUserProfile(baseDialog.BaseWXDialog):
|
||||
def __init__(self):
|
||||
super(showUserProfile, self).__init__(parent=None, id=wx.NewId())
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
static = wx.StaticText(panel, -1, _(u"Details"))
|
||||
sizer.Add(static, 0, wx.ALL, 5)
|
||||
text = wx.TextCtrl(panel, -1, style=wx.TE_MULTILINE|wx.TE_READONLY)
|
||||
text.SetFocus()
|
||||
sizer.Add(text, 0, wx.ALL|wx.EXPAND, 5)
|
||||
self.text = wx.TextCtrl(panel, -1, style=wx.TE_MULTILINE|wx.TE_READONLY, size=(350, 250))
|
||||
self.text.SetFocus()
|
||||
sizer.Add(self.text, 0, wx.ALL|wx.EXPAND, 5)
|
||||
self.url = wx.Button(panel, -1, _(u"Go to URL"), size=wx.DefaultSize)
|
||||
self.url.Disable()
|
||||
close = wx.Button(panel, wx.ID_CANCEL, _(u"Close"))
|
||||
@@ -19,10 +19,8 @@ class showUserProfile(wx.Dialog):
|
||||
btnSizer.Add(self.url, 0, wx.ALL, 5)
|
||||
btnSizer.Add(close, 0, wx.ALL, 5)
|
||||
sizer.Add(btnSizer, 0, wx.ALL, 5)
|
||||
text.ChangeValue(self.compose_string())
|
||||
text.SetSize(text.GetBestSize())
|
||||
panel.SetSizer(sizer)
|
||||
self.SetClientSize(sizer.CalcMin())
|
||||
|
||||
def get_response(self):
|
||||
return self.ShowModal()
|
||||
def enable_url(self, enabled=True):
|
||||
self.url.Enable(enabled)
|
46
src/wxUI/dialogs/utils.py
Normal file
46
src/wxUI/dialogs/utils.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
############################################################
|
||||
# Copyright (c) 2013, 2014 Manuel Eduardo Cortéz Vallejo <manuel@manuelcortez.net>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
import wx
|
||||
import baseDialog
|
||||
|
||||
class selectUserDialog(baseDialog.BaseWXDialog):
|
||||
def __init__(self, title, users):
|
||||
super(selectUserDialog, self).__init__(parent=None, id=wx.NewId(), title=title)
|
||||
panel = wx.Panel(self)
|
||||
userSizer = wx.BoxSizer()
|
||||
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0], size=wx.DefaultSize)
|
||||
self.cb.SetFocus()
|
||||
userSizer.Add(wx.StaticText(panel, -1, _(u"User")), 0, wx.ALL, 5)
|
||||
userSizer.Add(self.cb)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
||||
ok.SetDefault()
|
||||
# ok.Bind(wx.EVT_BUTTON, self.onok)
|
||||
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Close"))
|
||||
btnsizer = wx.BoxSizer()
|
||||
btnsizer.Add(ok, 0, wx.ALL, 5)
|
||||
btnsizer.Add(cancel, 0, wx.ALL, 5)
|
||||
sizer.Add(userSizer, 0, wx.ALL, 5)
|
||||
sizer.Add(btnsizer, 0, wx.ALL, 5)
|
||||
panel.SetSizer(sizer)
|
||||
self.SetClientSize(sizer.CalcMin())
|
||||
|
||||
def get_user(self):
|
||||
return self.cb.GetValue()
|
||||
|
Reference in New Issue
Block a user