2016-02-13 17:06:36 -06:00
# -*- coding: utf-8 -*-
2019-02-26 08:38:49 -06:00
""" This module contains all context menus needed to be displayed in different sections. Basically any menu that is bigger than 2 menu items should be here. """
2019-01-01 19:42:53 -06:00
from __future__ import unicode_literals
2016-02-13 17:06:36 -06:00
import wx
class postMenu ( wx . Menu ) :
2019-02-26 08:38:49 -06:00
""" Display a menu with actions related to posts in the news feed or walls. """
2019-01-03 12:08:38 -06:00
def __init__ ( self , can_delete = False , * args , * * kwargs ) :
2016-02-13 17:06:36 -06:00
super ( postMenu , self ) . __init__ ( * args , * * kwargs )
2019-04-13 18:43:48 -05:00
self . open = self . Append ( wx . NewId ( ) , _ ( " Open " ) )
self . like = self . Append ( wx . NewId ( ) , _ ( " Like " ) )
self . dislike = self . Append ( wx . NewId ( ) , _ ( " Dislike " ) )
2016-06-08 05:45:03 -05:00
self . dislike . Enable ( False )
2019-04-13 18:43:48 -05:00
self . comment = self . Append ( wx . NewId ( ) , _ ( " Add comment " ) )
2019-01-03 12:08:38 -06:00
if can_delete :
2019-04-13 18:43:48 -05:00
self . delete = self . Append ( wx . NewId ( ) , _ ( " Delete " ) )
2019-01-03 12:08:38 -06:00
else :
2019-04-13 18:43:48 -05:00
self . post_in_wall = self . Append ( wx . NewId ( ) , _ ( " Post to this profile " ) )
2019-01-03 12:08:38 -06:00
self . post_in_wall . Enable ( False )
2019-04-13 18:43:48 -05:00
self . view_profile = self . Append ( wx . NewId ( ) , _ ( " View user profile " ) )
self . open_in_browser = self . Append ( wx . NewId ( ) , _ ( " Open in vk.com " ) )
2016-02-13 17:06:36 -06:00
2016-06-08 05:45:03 -05:00
class audioMenu ( wx . Menu ) :
def __init__ ( self , * args , * * kwargs ) :
super ( audioMenu , self ) . __init__ ( * args , * * kwargs )
2019-04-13 18:43:48 -05:00
self . open = self . Append ( wx . NewId ( ) , _ ( " &Open " ) )
self . play = self . Append ( wx . NewId ( ) , _ ( " &Play " ) )
self . library = self . Append ( wx . NewId ( ) , _ ( " &Add to library " ) )
self . move = self . Append ( wx . NewId ( ) , _ ( " Move to album " ) )
# self.open_in_browser = self.Append(wx.NewId(), _("Open in vk.com"))
2016-06-08 05:45:03 -05:00
class peopleMenu ( wx . Menu ) :
2019-04-15 16:16:17 -05:00
def __init__ ( self , is_request = False , is_subscriber = False , not_friend = False , * args , * * kwargs ) :
2016-06-08 05:45:03 -05:00
super ( peopleMenu , self ) . __init__ ( * args , * * kwargs )
2018-12-10 17:35:36 -06:00
if is_request :
2019-01-21 04:42:52 -06:00
self . create_request_items ( )
elif is_subscriber :
self . create_subscriber_items ( )
2019-04-13 18:43:48 -05:00
self . view_profile = self . Append ( wx . NewId ( ) , _ ( " View profile " ) )
self . message = self . Append ( wx . NewId ( ) , _ ( " Send a message " ) )
self . timeline = self . Append ( wx . NewId ( ) , _ ( " Open timeline " ) )
2019-04-15 16:16:17 -05:00
if not_friend == False :
self . common_friends = self . Append ( wx . NewId ( ) , _ ( " View friends in common " ) )
if is_request == False and is_subscriber == False and not_friend == False :
2019-04-13 18:43:48 -05:00
self . decline = self . Append ( wx . NewId ( ) , _ ( " Remove from friends " ) )
self . open_in_browser = self . Append ( wx . NewId ( ) , _ ( " Open in vk.com " ) )
2018-12-10 17:35:36 -06:00
2019-01-21 04:42:52 -06:00
def create_request_items ( self ) :
2019-04-13 18:43:48 -05:00
self . accept = self . Append ( wx . NewId ( ) , _ ( " Accept " ) )
self . decline = self . Append ( wx . NewId ( ) , _ ( " Decline " ) )
self . keep_as_follower = self . Append ( wx . NewId ( ) , _ ( " Keep as follower " ) )
2016-06-08 05:45:03 -05:00
2019-01-21 04:42:52 -06:00
def create_subscriber_items ( self ) :
2019-04-13 18:43:48 -05:00
self . add = self . Append ( wx . NewId ( ) , _ ( " Add to friends " ) )
2019-01-21 04:42:52 -06:00
2019-02-26 08:38:49 -06:00
class documentMenu ( wx . Menu ) :
def __init__ ( self , added = False , * args , * * kwargs ) :
super ( documentMenu , self ) . __init__ ( * args , * * kwargs )
self . download = self . Append ( wx . NewId ( ) , _ ( " Download document " ) )
if added == True :
self . action = self . Append ( wx . NewId ( ) , _ ( " Remove from my documents " ) )
else :
self . action = self . Append ( wx . NewId ( ) , _ ( " Add to my documents " ) )
2019-04-13 18:43:48 -05:00
self . open_in_browser = self . Append ( wx . NewId ( ) , _ ( " Open in vk.com " ) )
2019-02-26 08:38:49 -06:00
2016-02-13 17:06:36 -06:00
class commentMenu ( wx . Menu ) :
def __init__ ( self , * args , * * kwargs ) :
super ( commentMenu , self ) . __init__ ( * args , * * kwargs )
2019-04-13 18:43:48 -05:00
self . open = self . Append ( wx . NewId ( ) , _ ( " Open " ) )
self . like = self . Append ( wx . NewId ( ) , _ ( " Like " ) )
self . dislike = self . Append ( wx . NewId ( ) , _ ( " Dislike " ) )
self . open_in_browser = self . Append ( wx . NewId ( ) , _ ( " Open in vk.com " ) )
2018-12-20 17:46:54 -06:00
class attachMenu ( wx . Menu ) :
def __init__ ( self ) :
super ( attachMenu , self ) . __init__ ( )
2019-04-13 18:43:48 -05:00
self . upload = self . Append ( wx . NewId ( ) , _ ( " Upload from computer " ) )
self . add = self . Append ( wx . NewId ( ) , _ ( " Add from VK " ) )
2019-01-30 15:32:46 -06:00
class communityBufferMenu ( wx . Menu ) :
def __init__ ( self ) :
super ( communityBufferMenu , self ) . __init__ ( )
load = wx . Menu ( )
self . load_posts = load . Append ( wx . NewId ( ) , _ ( " Load posts " ) )
self . load_topics = load . Append ( wx . NewId ( ) , _ ( " Load topics " ) )
self . load_audios = load . Append ( wx . NewId ( ) , _ ( " Load audios " ) )
self . load_videos = load . Append ( wx . NewId ( ) , _ ( " Load videos " ) )
2019-02-05 12:20:50 -06:00
self . load_documents = load . Append ( wx . NewId ( ) , _ ( " Load documents " ) )
2019-04-09 17:55:05 -05:00
self . Append ( wx . NewId ( ) , _ ( " Load " ) , load )
2019-04-13 18:43:48 -05:00
self . open_in_browser = self . Append ( wx . NewId ( ) , _ ( " Open in vk.com " ) )
2019-04-09 17:55:05 -05:00
class conversationBufferMenu ( wx . Menu ) :
def __init__ ( self ) :
super ( conversationBufferMenu , self ) . __init__ ( )
2019-04-13 18:43:48 -05:00
self . delete = self . Append ( wx . NewId ( ) , _ ( " Delete conversation " ) )
self . open_in_browser = self . Append ( wx . NewId ( ) , _ ( " Open in vk.com " ) )