| 
									
										
										
										
											2016-04-12 15:36:30 -05:00
										 |  |  | # -*- coding: utf-8 -*- | 
					
						
							| 
									
										
										
										
											2019-01-02 04:42:53 +03:00
										 |  |  | from __future__ import unicode_literals | 
					
						
							| 
									
										
										
										
											2016-04-12 15:36:30 -05:00
										 |  |  | import wx | 
					
						
							|  |  |  | import widgetUtils | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class timelineDialog(widgetUtils.BaseDialog): | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def __init__(self, users=[]): | 
					
						
							| 
									
										
										
										
											2019-01-02 04:42:53 +03:00
										 |  |  | 		super(timelineDialog, self).__init__(parent=None, title=_("New timeline for {0}").format(users[0],)) | 
					
						
							| 
									
										
										
										
											2016-04-12 15:36:30 -05:00
										 |  |  | 		panel = wx.Panel(self) | 
					
						
							|  |  |  | 		sizer = wx.BoxSizer(wx.HORIZONTAL) | 
					
						
							| 
									
										
										
										
											2019-01-02 04:42:53 +03:00
										 |  |  | 		userLabel = wx.StaticText(panel, -1, _("User")) | 
					
						
							| 
									
										
										
										
											2016-04-12 15:36:30 -05:00
										 |  |  | 		self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0]) | 
					
						
							|  |  |  | 		self.cb.SetFocus() | 
					
						
							|  |  |  | 		userSizer = wx.BoxSizer() | 
					
						
							|  |  |  | 		userSizer.Add(userLabel, 0, wx.ALL, 5) | 
					
						
							|  |  |  | 		userSizer.Add(self.cb, 0, wx.ALL, 5) | 
					
						
							| 
									
										
										
										
											2019-01-14 17:20:12 -06:00
										 |  |  | 		actionsSizer = wx.StaticBoxSizer(parent=panel, orient=wx.VERTICAL, label=_("Buffer type")) | 
					
						
							|  |  |  | 		self.wall    = wx.RadioButton(actionsSizer.GetStaticBox(), wx.NewId(), _("&Wall posts"), style=wx.RB_GROUP) | 
					
						
							|  |  |  | 		self.audio = wx.RadioButton(actionsSizer.GetStaticBox(), wx.NewId(), _("Audio")) | 
					
						
							|  |  |  | 		self.friends = wx.RadioButton(actionsSizer.GetStaticBox(), wx.NewId(), _("Friends")) | 
					
						
							|  |  |  | 		actionsSizer.Add(self.wall, 0, wx.ALL, 5) | 
					
						
							|  |  |  | 		actionsSizer.Add(self.audio, 0, wx.ALL, 5) | 
					
						
							|  |  |  | 		actionsSizer.Add(self.friends, 0, wx.ALL, 5) | 
					
						
							|  |  |  | 		sizer.Add(actionsSizer, 0, wx.ALL, 5) | 
					
						
							| 
									
										
										
										
											2019-01-02 04:42:53 +03:00
										 |  |  | 		ok = wx.Button(panel, wx.ID_OK, _("&OK")) | 
					
						
							| 
									
										
										
										
											2016-04-12 15:36:30 -05:00
										 |  |  | 		ok.SetDefault() | 
					
						
							| 
									
										
										
										
											2019-01-02 04:42:53 +03:00
										 |  |  | 		cancel = wx.Button(panel, wx.ID_CANCEL, _("&Close")) | 
					
						
							| 
									
										
										
										
											2019-01-14 17:20:12 -06:00
										 |  |  | 		btnsizer = wx.BoxSizer(wx.HORIZONTAL) | 
					
						
							| 
									
										
										
										
											2016-04-12 15:36:30 -05:00
										 |  |  | 		btnsizer.Add(ok, 0, wx.ALL, 5) | 
					
						
							|  |  |  | 		btnsizer.Add(cancel, 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() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def get_buffer_type(self): | 
					
						
							| 
									
										
										
										
											2018-12-09 05:22:37 -06:00
										 |  |  | 		if self.audio.GetValue() == True: | 
					
						
							|  |  |  | 			return "audio" | 
					
						
							|  |  |  | 		elif self.wall.GetValue() == True: | 
					
						
							| 
									
										
										
										
											2016-06-02 13:12:42 -05:00
										 |  |  | 			return "wall" | 
					
						
							|  |  |  | 		elif self.friends.GetValue() == True: | 
					
						
							|  |  |  | 			return "friends" |