def test_SERIALISABLE_TYPE_APPLICATION_COMMAND(self):
        def test(obj, dupe_obj):

            self.assertEqual(obj.GetCommandType(), dupe_obj.GetCommandType())

            self.assertEqual(obj.GetData(), dupe_obj.GetData())

        acs = []

        acs.append(
            (ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                           'archive_file'), 'archive_file'))
        acs.append((ClientData.ApplicationCommand(
            CC.APPLICATION_COMMAND_TYPE_CONTENT,
            (HydrusData.GenerateKey(), HC.CONTENT_TYPE_MAPPINGS,
             HC.CONTENT_UPDATE_FLIP, 'test')),
                    'flip on/off mappings "test" for unknown service!'))
        acs.append((ClientData.ApplicationCommand(
            CC.APPLICATION_COMMAND_TYPE_CONTENT,
            (CC.LOCAL_TAG_SERVICE_KEY, HC.CONTENT_TYPE_MAPPINGS,
             HC.CONTENT_UPDATE_FLIP, 'test')),
                    'flip on/off mappings "test" for local tags'))
        acs.append((ClientData.ApplicationCommand(
            CC.APPLICATION_COMMAND_TYPE_CONTENT,
            (HydrusData.GenerateKey(), HC.CONTENT_TYPE_RATINGS,
             HC.CONTENT_UPDATE_SET, 0.4)),
                    'set ratings "0.4" for unknown service!'))

        for (ac, s) in acs:

            self._dump_and_load_and_test(ac, test)

            self.assertEqual(ac.ToString(), s)
Beispiel #2
0
 def _Archive( self ):
     
     if self._current_media.HasInbox():
         
         command = ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_file' )
         
     else:
         
         command = ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'inbox_file' )
         
     
     HG.client_controller.pub( 'canvas_application_command', command, self._canvas_key )
 def test_SERIALISABLE_TYPE_SHORTCUTS( self ):
     
     def test( obj, dupe_obj ):
         
         for ( shortcut, command ) in obj:
             
             self.assertEqual( dupe_obj.GetCommand( shortcut ).GetData(), command.GetData() )
             
         
     
     default_shortcuts = ClientDefaults.GetDefaultShortcuts()
     
     for shortcuts in default_shortcuts:
         
         self._dump_and_load_and_test( shortcuts, test )
         
     
     command_1 = ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_file' )
     command_2 = ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_CONTENT, ( HydrusData.GenerateKey(), HC.CONTENT_TYPE_MAPPINGS, HC.CONTENT_UPDATE_FLIP, 'test' ) )
     command_3 = ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_CONTENT, ( CC.LOCAL_TAG_SERVICE_KEY, HC.CONTENT_TYPE_MAPPINGS, HC.CONTENT_UPDATE_FLIP, 'test' ) )
     
     k_shortcut_1 = ClientGUIShortcuts.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_SPACE, [] )
     k_shortcut_2 = ClientGUIShortcuts.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'a' ), [ CC.SHORTCUT_MODIFIER_CTRL ] )
     k_shortcut_3 = ClientGUIShortcuts.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'A' ), [ CC.SHORTCUT_MODIFIER_CTRL ] )
     k_shortcut_4 = ClientGUIShortcuts.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_HOME, [ CC.SHORTCUT_MODIFIER_ALT, CC.SHORTCUT_MODIFIER_CTRL ] )
     
     m_shortcut_1 = ClientGUIShortcuts.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_LEFT, [] )
     m_shortcut_2 = ClientGUIShortcuts.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_MIDDLE, [ CC.SHORTCUT_MODIFIER_CTRL ] )
     m_shortcut_3 = ClientGUIShortcuts.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_SCROLL_DOWN, [ CC.SHORTCUT_MODIFIER_ALT, CC.SHORTCUT_MODIFIER_SHIFT ] )
     
     shortcuts = ClientGUIShortcuts.Shortcuts( 'test' )
     
     shortcuts.SetCommand( k_shortcut_1, command_1 )
     shortcuts.SetCommand( k_shortcut_2, command_2 )
     shortcuts.SetCommand( k_shortcut_3, command_2 )
     shortcuts.SetCommand( k_shortcut_4, command_3 )
     
     shortcuts.SetCommand( m_shortcut_1, command_1 )
     shortcuts.SetCommand( m_shortcut_2, command_2 )
     shortcuts.SetCommand( m_shortcut_3, command_3 )
     
     self._dump_and_load_and_test( shortcuts, test )
     
     self.assertEqual( shortcuts.GetCommand( k_shortcut_1 ).GetData(), command_1.GetData() )
     
     shortcuts.SetCommand( k_shortcut_1, command_3 )
     
     self.assertEqual( shortcuts.GetCommand( k_shortcut_1 ).GetData(), command_3.GetData() )
Beispiel #4
0
    def _PopulateLeftButtons(self):

        self._first_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.first, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'view_first'))
        self._first_button.SetToolTipString('first')

        self._top_hbox.AddF(self._first_button, CC.FLAGS_VCENTER)

        FullscreenHoverFrameTopNavigable._PopulateLeftButtons(self)

        self._last_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.last, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'view_last'))
        self._last_button.SetToolTipString('last')

        self._top_hbox.AddF(self._last_button, CC.FLAGS_VCENTER)
Beispiel #5
0
    def _PopulateLeftButtons(self):

        self._previous_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.previous, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'view_previous'))
        self._previous_button.SetToolTipString('previous')

        self._index_text = ClientGUICommon.BetterStaticText(self, 'index')

        self._next_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.next, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'view_next'))
        self._next_button.SetToolTipString('next')

        self._top_hbox.AddF(self._previous_button, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(self._index_text, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(self._next_button, CC.FLAGS_VCENTER)
Beispiel #6
0
    def _PopulateLeftButtons(self):

        self._back_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.previous, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'archive_delete_filter_back'))
        self._back_button.SetToolTipString('back')

        self._top_hbox.AddF(self._back_button, CC.FLAGS_VCENTER)

        FullscreenHoverFrameTop._PopulateLeftButtons(self)

        self._skip_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.next, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'archive_delete_filter_skip'))
        self._skip_button.SetToolTipString('skip')

        self._top_hbox.AddF(self._skip_button, CC.FLAGS_VCENTER)
Beispiel #7
0
    def _PopulateLeftButtons(self):

        self._first_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.first, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'duplicate_filter_back'))
        self._first_button.SetToolTip('go back a pair')

        self._top_hbox.Add(self._first_button, CC.FLAGS_VCENTER)

        FullscreenHoverFrameTopNavigable._PopulateLeftButtons(self)

        self._last_button = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.last, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'duplicate_filter_skip'))
        self._last_button.SetToolTip('show a different pair')

        self._top_hbox.Add(self._last_button, CC.FLAGS_VCENTER)
Beispiel #8
0
 def EventDragButton( self, event ):
     
     if self._current_media is None:
         
         event.Skip()
         
         return
         
     
     page_key = None
     
     media = [ self._current_media ]
     
     cmd_down = event.CmdDown()
     
     result = ClientDragDrop.DoFileExportDragDrop( self, page_key, media, cmd_down )
     
     if result not in ( wx.DragError, wx.DragNone ):
         
         HG.client_controller.pub( 'canvas_application_command', ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'pause_media' ), self._canvas_key )
Beispiel #9
0
 def _UpdateSerialisableInfo( self, version, old_serialisable_info ):
     
     if version == 1:
         
         ( serialisable_mouse_actions, serialisable_keyboard_actions ) = old_serialisable_info
         
         shortcuts_to_commands = {}
         
         # this never stored mouse actions, so skip
         
         services_manager = HG.client_controller.services_manager
         
         for ( modifier, key, ( serialisable_service_key, data ) ) in serialisable_keyboard_actions:
             
             if modifier not in CC.shortcut_wx_to_hydrus_lookup:
                 
                 modifiers = []
                 
             else:
                 
                 modifiers = [ CC.shortcut_wx_to_hydrus_lookup[ modifier ] ]
                 
             
             shortcut = Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, key, modifiers )
             
             if serialisable_service_key is None:
                 
                 command = ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, data )
                 
             else:
                 
                 service_key = serialisable_service_key.decode( 'hex' )
                 
                 if not services_manager.ServiceExists( service_key ):
                     
                     continue
                     
                 
                 action = HC.CONTENT_UPDATE_FLIP
                 
                 value = data
                 
                 service = services_manager.GetService( service_key )
                 
                 service_type = service.GetServiceType()
                 
                 if service_type in HC.TAG_SERVICES:
                     
                     content_type = HC.CONTENT_TYPE_MAPPINGS
                     
                 elif service_type in HC.RATINGS_SERVICES:
                     
                     content_type = HC.CONTENT_TYPE_RATINGS
                     
                 else:
                     
                     continue
                     
                 
                 command = ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_CONTENT, ( service_key, content_type, action, value ) )
                 
             
             shortcuts_to_commands[ shortcut ] = command
             
         
         new_serialisable_info = ( ( shortcut.GetSerialisableTuple(), command.GetSerialisableTuple() ) for ( shortcut, command ) in shortcuts_to_commands.items() )
         
         return ( 2, new_serialisable_info )
Beispiel #10
0
    def _PopulateCenterButtons(self):

        menu_items = []

        menu_items.append(
            ('normal', 'edit duplicate action options for \'this is better\'',
             'edit what content is merged when you filter files',
             HydrusData.Call(self._EditMergeOptions, HC.DUPLICATE_BETTER)))
        menu_items.append(
            ('normal', 'edit duplicate action options for \'same quality\'',
             'edit what content is merged when you filter files',
             HydrusData.Call(self._EditMergeOptions,
                             HC.DUPLICATE_SAME_QUALITY)))
        menu_items.append(
            ('normal', 'edit duplicate action options for \'alternates\'',
             'edit what content is merged when you filter files',
             HydrusData.Call(self._EditMergeOptions, HC.DUPLICATE_ALTERNATE)))
        menu_items.append(
            ('normal', 'edit duplicate action options for \'not duplicates\'',
             'edit what content is merged when you filter files',
             HydrusData.Call(self._EditMergeOptions,
                             HC.DUPLICATE_NOT_DUPLICATE)))
        menu_items.append(('separator', None, None, None))
        menu_items.append((
            'normal', 'edit background lighten/darken switch intensity',
            'edit how much the background will brighten or darken as you switch between the pair',
            self._EditBackgroundSwitchIntensity))

        cog_button = ClientGUICommon.MenuBitmapButton(self, CC.GlobalBMPs.cog,
                                                      menu_items)

        self._top_hbox.AddF(cog_button, CC.FLAGS_SIZER_VCENTER)

        FullscreenHoverFrameTopNavigable._PopulateCenterButtons(self)

        dupe_commands = []

        dupe_commands.append((
            'this is better',
            'Set that the current file you are looking at is better than the other in the pair.',
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'duplicate_filter_this_is_better')))
        dupe_commands.append(
            ('same quality',
             'Set that the two files are duplicates of very similar quality.',
             ClientData.ApplicationCommand(
                 CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                 'duplicate_filter_exactly_the_same')))
        dupe_commands.append((
            'alternates',
            'Set that the files are not duplicates, but that one is derived from the other or that they are both descendants of a common ancestor.',
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'duplicate_filter_alternates')))
        dupe_commands.append((
            'not duplicates',
            'Set that the files are not duplicates or otherwise related--that this pair is a false-positive match.',
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'duplicate_filter_not_dupes')))
        dupe_commands.append((
            'custom action',
            'Choose one of the other actions but customise the merge and delete options for this specific decision.',
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'duplicate_filter_custom_action')))

        for (label, tooltip, command) in dupe_commands:

            command_button = ClientGUICommon.BetterButton(
                self, label, HG.client_controller.pub,
                'canvas_application_command', self._canvas_key, command)

            command_button.SetToolTipString(tooltip)

            self._button_hbox.AddF(command_button, CC.FLAGS_VCENTER)
Beispiel #11
0
    def _Archive(self):

        HG.client_controller.pub(
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'archive_file'))
Beispiel #12
0
    def _PopulateRightButtons(self):

        self._zoom_text = ClientGUICommon.BetterStaticText(self, 'zoom')

        zoom_in = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.zoom_in, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'zoom_in'))
        zoom_in.SetToolTipString('zoom in')

        zoom_out = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.zoom_out, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'zoom_out'))
        zoom_out.SetToolTipString('zoom out')

        zoom_switch = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.zoom_switch, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(
                CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                'switch_between_100_percent_and_canvas_zoom'))
        zoom_switch.SetToolTipString('zoom switch')

        menu_items = []

        menu_items.append((
            'normal', 'edit shortcuts',
            'edit your sets of shortcuts, and change what shortcuts are currently active on this media viewer',
            self._ManageShortcuts))
        menu_items.append(
            ('normal', 'set current shortcuts',
             'change which custom shortcuts are active on this media viewers',
             HydrusData.Call(HG.client_controller.pub,
                             'edit_media_viewer_custom_shortcuts',
                             self._canvas_key)))
        menu_items.append((
            'normal', 'set default shortcuts',
            'change which custom shortcuts are typically active on new media viewers',
            self._SetDefaultShortcuts))

        shortcuts = ClientGUICommon.MenuBitmapButton(self,
                                                     CC.GlobalBMPs.keyboard,
                                                     menu_items)
        shortcuts.SetToolTipString('shortcuts')

        fullscreen_switch = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.fullscreen_switch, HG.client_controller.pub,
            'canvas_fullscreen_switch', self._canvas_key)
        fullscreen_switch.SetToolTipString('fullscreen switch')

        open_externally = ClientGUICommon.BetterBitmapButton(
            self, CC.GlobalBMPs.open_externally, HG.client_controller.pub,
            'canvas_application_command', self._canvas_key,
            ClientData.ApplicationCommand(CC.APPLICATION_COMMAND_TYPE_SIMPLE,
                                          'open_file_in_external_program'))
        open_externally.SetToolTipString('open externally')

        close = ClientGUICommon.BetterButton(self, 'X',
                                             HG.client_controller.pub,
                                             'canvas_close', self._canvas_key)
        close.SetToolTipString('close')

        self._top_hbox.AddF(self._zoom_text, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(zoom_in, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(zoom_out, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(zoom_switch, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(shortcuts, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(fullscreen_switch, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(open_externally, CC.FLAGS_VCENTER)
        self._top_hbox.AddF(close, CC.FLAGS_VCENTER)
Beispiel #13
0
 def _PopulateRightButtons( self ):
     
     self._zoom_text = ClientGUICommon.BetterStaticText( self, 'zoom' )
     
     zoom_in = ClientGUICommon.BetterBitmapButton( self, CC.GlobalBMPs.zoom_in, HG.client_controller.pub, 'canvas_application_command', ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_in' ), self._canvas_key )
     zoom_in.SetToolTip( 'zoom in' )
     
     zoom_out = ClientGUICommon.BetterBitmapButton( self, CC.GlobalBMPs.zoom_out, HG.client_controller.pub, 'canvas_application_command', ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_out' ), self._canvas_key )
     zoom_out.SetToolTip( 'zoom out' )
     
     zoom_switch = ClientGUICommon.BetterBitmapButton( self, CC.GlobalBMPs.zoom_switch, HG.client_controller.pub, 'canvas_application_command', ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'switch_between_100_percent_and_canvas_zoom' ), self._canvas_key )
     zoom_switch.SetToolTip( 'zoom switch' )
     
     shortcuts = ClientGUICommon.BetterBitmapButton( self, CC.GlobalBMPs.keyboard, self._ShowShortcutMenu )
     shortcuts.SetToolTip( 'shortcuts' )
     
     fullscreen_switch = ClientGUICommon.BetterBitmapButton( self, CC.GlobalBMPs.fullscreen_switch, HG.client_controller.pub, 'canvas_fullscreen_switch', self._canvas_key )
     fullscreen_switch.SetToolTip( 'fullscreen switch' )
     
     open_externally = ClientGUICommon.BetterBitmapButton( self, CC.GlobalBMPs.open_externally, HG.client_controller.pub, 'canvas_application_command', ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'open_file_in_external_program' ), self._canvas_key )
     open_externally.SetToolTip( 'open externally' )
     
     drag_button = wx.BitmapButton( self, bitmap = CC.GlobalBMPs.drag )
     drag_button.SetToolTip( 'drag from here to export file' )
     drag_button.Bind( wx.EVT_LEFT_DOWN, self.EventDragButton )
     
     close = ClientGUICommon.BetterButton( self, 'X', HG.client_controller.pub, 'canvas_close', self._canvas_key )
     close.SetToolTip( 'close' )
     
     self._top_hbox.Add( self._zoom_text, CC.FLAGS_VCENTER )
     self._top_hbox.Add( zoom_in, CC.FLAGS_VCENTER )
     self._top_hbox.Add( zoom_out, CC.FLAGS_VCENTER )
     self._top_hbox.Add( zoom_switch, CC.FLAGS_VCENTER )
     self._top_hbox.Add( shortcuts, CC.FLAGS_VCENTER )
     self._top_hbox.Add( fullscreen_switch, CC.FLAGS_VCENTER )
     self._top_hbox.Add( open_externally, CC.FLAGS_VCENTER )
     self._top_hbox.Add( drag_button, CC.FLAGS_VCENTER )
     self._top_hbox.Add( close, CC.FLAGS_VCENTER )
Beispiel #14
0
def GetDefaultShortcuts():
    
    shortcuts = []
    
    archive_delete_filter = ClientData.Shortcuts( 'archive_delete_filter' )
    
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_LEFT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_keep' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_RIGHT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_delete' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_MIDDLE, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_back' ) )
    
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_SPACE, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_keep' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F7, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_keep' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_DELETE, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_delete' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_DELETE, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_delete' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_BACK, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_back' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_UP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_skip' ) )
    archive_delete_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_UP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_delete_filter_skip' ) )
    
    shortcuts.append( archive_delete_filter )
    
    duplicate_filter = ClientData.Shortcuts( 'duplicate_filter' )
    
    duplicate_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_LEFT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'duplicate_filter_this_is_better' ) )
    duplicate_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_RIGHT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'duplicate_filter_alternates' ) )
    duplicate_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_MIDDLE, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'duplicate_filter_back' ) )
    
    duplicate_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_SPACE, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'duplicate_filter_this_is_better' ) )
    duplicate_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_UP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'duplicate_filter_skip' ) )
    duplicate_filter.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_UP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'duplicate_filter_skip' ) )
    
    shortcuts.append( duplicate_filter )
    
    media = ClientData.Shortcuts( 'media' )
    
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F4, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'manage_file_ratings' ) )
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F3, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'manage_file_tags' ) )
    
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F7, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'archive_file' ) )
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F7, [ CC.SHORTCUT_MODIFIER_SHIFT ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'inbox_file' ) )
    
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'E' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'open_file_in_external_program' ) )
    
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'R' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'remove_file_from_view' ) )
    
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F12, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'launch_the_archive_delete_filter' ) )
    
    media.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'C' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'copy_file' ) )
    
    shortcuts.append( media )
    
    main_gui = ClientData.Shortcuts( 'main_gui' )
    
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F5, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'refresh' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_F9, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'new_page' ) )
    
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'I' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'synchronised_wait_switch' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'M' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'set_media_focus' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'R' ), [ CC.SHORTCUT_MODIFIER_CTRL, CC.SHORTCUT_MODIFIER_SHIFT ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'show_hide_splitters' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'S' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'set_search_focus' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'T' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'new_page' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'U' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'unclose_page' ) )    
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'W' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'close_page' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'Y' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'redo' ) )
    main_gui.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'Z' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'undo' ) )
    
    shortcuts.append( main_gui )
    
    media_viewer_browser = ClientData.Shortcuts( 'media_viewer_browser' )
    
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_UP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_previous' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_LEFT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_previous' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_UP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_previous' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_LEFT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_previous' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_PAGEUP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_previous' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_PAGEUP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_previous' ) )
    
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_SCROLL_UP, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_previous' ) )
    
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_DOWN, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_next' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_RIGHT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_next' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_RIGHT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_next' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_DOWN, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_next' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_PAGEDOWN, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_next' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_PAGEDOWN, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_next' ) )
    
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_SCROLL_DOWN, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_next' ) )
    
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_HOME, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_first' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_HOME, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_first' ) )
    
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_END, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_last' ) )
    media_viewer_browser.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_END, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'view_last' ) )
    
    shortcuts.append( media_viewer_browser )
    
    media_viewer = ClientData.Shortcuts( 'media_viewer' )
    
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'B' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'move_animation_to_previous_frame' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'N' ), [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'move_animation_to_next_frame' ) )
    
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'F' ), [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'switch_between_fullscreen_borderless_and_regular_framed_window' ) )
    
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, ord( 'Z' ), [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'switch_between_100_percent_and_canvas_zoom' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_ADD, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_in' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_ADD, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_in' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_SUBTRACT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_out' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_NUMPAD_SUBTRACT, [] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_out' ) )
    
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_SCROLL_UP, [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_in' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_MOUSE, CC.SHORTCUT_MOUSE_SCROLL_DOWN, [ CC.SHORTCUT_MODIFIER_CTRL ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'zoom_out' ) )
    
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_UP, [ CC.SHORTCUT_MODIFIER_SHIFT ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'pan_up' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_DOWN, [ CC.SHORTCUT_MODIFIER_SHIFT ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'pan_down' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_LEFT, [ CC.SHORTCUT_MODIFIER_SHIFT ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'pan_left' ) )
    media_viewer.SetCommand( ClientData.Shortcut( CC.SHORTCUT_TYPE_KEYBOARD, wx.WXK_RIGHT, [ CC.SHORTCUT_MODIFIER_SHIFT ] ), ClientData.ApplicationCommand( CC.APPLICATION_COMMAND_TYPE_SIMPLE, 'pan_right' ) )
    
    shortcuts.append( media_viewer )
    
    return shortcuts