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-01-01 19:42:53 -06:00
self . open = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Open " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . open )
2019-01-01 19:42:53 -06:00
self . like = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Like " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . like )
2019-01-01 19:42:53 -06:00
self . dislike = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Dislike " ) )
2016-06-08 05:45:03 -05:00
self . dislike . Enable ( False )
2018-09-03 13:22:54 -05:00
self . Append ( self . dislike )
2019-01-01 19:42:53 -06:00
self . comment = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Add comment " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . comment )
2019-01-03 12:08:38 -06:00
if can_delete :
self . delete = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Delete " ) )
self . Append ( self . delete )
else :
self . post_in_wall = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Post to this profile " ) )
self . post_in_wall . Enable ( False )
self . Append ( self . post_in_wall )
self . view_profile = wx . MenuItem ( self , wx . NewId ( ) , _ ( " View user profile " ) )
self . Append ( self . view_profile )
2016-02-13 17:06:36 -06:00
def create_specific_post_options ( self ) :
2019-01-01 19:42:53 -06:00
self . update = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Update " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . update )
2019-01-01 19:42:53 -06:00
self . delete = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Delete " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . delete )
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-01-01 19:42:53 -06:00
self . open = wx . MenuItem ( self , wx . NewId ( ) , _ ( " &Open " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . open )
2019-01-01 19:42:53 -06:00
self . play = wx . MenuItem ( self , wx . NewId ( ) , _ ( " &Play " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . play )
2019-01-01 19:42:53 -06:00
self . library = wx . MenuItem ( self , wx . NewId ( ) , _ ( " &Add to library " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . library )
2019-01-01 19:42:53 -06:00
self . move = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Move to album " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . move )
2016-06-08 05:45:03 -05:00
class peopleMenu ( wx . Menu ) :
2019-01-21 04:42:52 -06:00
def __init__ ( self , is_request = False , is_subscriber = 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-01-01 19:42:53 -06:00
self . view_profile = wx . MenuItem ( self , wx . NewId ( ) , _ ( " View profile " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . view_profile )
2019-01-01 19:42:53 -06:00
self . message = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Send a message " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . message )
2019-01-01 19:42:53 -06:00
self . timeline = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Open timeline " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . timeline )
2019-01-01 19:42:53 -06:00
self . common_friends = wx . MenuItem ( self , wx . NewId ( ) , _ ( " View friends in common " ) )
2018-12-10 17:35:36 -06:00
self . Append ( self . common_friends )
2019-01-24 17:10:32 -06:00
if is_request == False and is_subscriber == False :
self . decline = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Remove from friends " ) )
self . Append ( self . decline )
2018-12-10 17:35:36 -06:00
2019-01-21 04:42:52 -06:00
def create_request_items ( self ) :
2019-01-01 19:42:53 -06:00
self . accept = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Accept " ) )
2018-12-10 17:35:36 -06:00
self . Append ( self . accept )
2019-01-01 19:42:53 -06:00
self . decline = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Decline " ) )
2018-12-10 17:35:36 -06:00
self . Append ( self . decline )
2019-01-01 19:42:53 -06:00
self . keep_as_follower = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Keep as follower " ) )
2018-12-10 17:52:01 -06:00
self . Append ( self . keep_as_follower )
2016-06-08 05:45:03 -05:00
2019-01-21 04:42:52 -06:00
def create_subscriber_items ( self ) :
self . add = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Add to friends " ) )
self . Append ( self . add )
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 . view_info = self . Append ( wx . NewId ( ) , _ ( " View information " ) )
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 " ) )
2016-02-13 17:06:36 -06:00
class commentMenu ( wx . Menu ) :
def __init__ ( self , * args , * * kwargs ) :
super ( commentMenu , self ) . __init__ ( * args , * * kwargs )
2019-01-01 19:42:53 -06:00
self . open = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Open " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . open )
2019-01-01 19:42:53 -06:00
self . like = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Like " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . like )
2019-01-01 19:42:53 -06:00
self . unlike = wx . MenuItem ( self , - 1 , _ ( " Unlike " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . unlike )
2016-02-13 17:06:36 -06:00
def create_specific_comment_options ( self ) :
2019-01-01 19:42:53 -06:00
self . delete = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Delete " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . delete )
2016-02-13 17:06:36 -06:00
class notificationsMenu ( wx . Menu ) :
def __init__ ( self ) :
super ( notificationsMenu , self ) . __init__ ( )
2019-01-01 19:42:53 -06:00
self . mark_as_read = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Mark as read " ) )
2018-09-03 13:22:54 -05:00
self . Append ( self . mark_as_read )
2018-12-20 17:46:54 -06:00
class attachMenu ( wx . Menu ) :
def __init__ ( self ) :
super ( attachMenu , self ) . __init__ ( )
2019-01-01 19:42:53 -06:00
self . upload = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Upload from computer " ) )
2018-12-20 17:46:54 -06:00
self . Append ( self . upload )
2019-01-01 19:42:53 -06:00
self . add = wx . MenuItem ( self , wx . NewId ( ) , _ ( " Add from VK " ) )
2019-01-30 15:32:46 -06:00
self . Append ( self . add )
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-01-30 15:32:46 -06:00
self . Append ( wx . NewId ( ) , _ ( " Load " ) , load )