Skip to content

Commit

Permalink
Version 352
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrusnetwork committed May 15, 2019
1 parent 35ad43c commit 93e8578
Show file tree
Hide file tree
Showing 29 changed files with 479 additions and 154 deletions.
22 changes: 22 additions & 0 deletions help/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@
<div class="content">
<h3>changelog</h3>
<ul>
<li><h3>version 352</h3></li>
<ul>
<li>the client now supports importing .ico files! (.cur should be supported too)</li>
<li>finally, 'collect by' is saved for sessions! if your default collect by previously included ratings services, it will forget them this one time--please reset it under the options->sort/collect</li>
<li>fixed the issue where the media viewer's hover windows were hovering over child dialogs (manage tags, ratings, or known urls)</li>
<li>improved some os x hover window focus handling for the new always-on-top duplicate action window</li>
<li>the entries on the 'sort by' list on gui pages are now subcategorised better. it should be a bit easier to find what you are looking for</li>
<li>the 'sort by file: approximate bitrate' sort option now sorts still images as well by filesize / num_pixels</li>
<li>to reduce confusion, sort by mime and system:mime are now renamed to 'filetype'</li>
<li>fixed an issue where the 'unclose_page' shortcut was restoring pages in reverse order (unclosing least-recently-closed-first rather than most-recently-closed-first)</li>
<li>improved rigour of video framerate estimation</li>
<li>stopped the video metadata parser from opting to manually frame count videos with size >128MB or num_frames estimate >2,400</li>
<li>fixed the forced manual frame count to deal with frame counts >9999</li>
<li>the 'ffmpeg not found' error on file import will now put up a popup message once per boot informing you of this problem more broadly and steps to address it</li>
<li>fixed some underreporting issues with subprocess_report_mode</li>
<li>fixed an issue with some yes/no dialogs returning 'no' on escape/window_close_button rather than 'cancel', which affected cancelability some db maintenance questions</li>
<li>fixed an issue where media that fitted the media viewer canvas width or height exactly at 100% zoom would not respond to zoom switch events to restore non-100% zoom to 100%</li>
<li>when a local server's CORS mode is turned on, Access-Control-Allow-Origin is now correctly added to GET/POST requests with an Origin request header</li>
<li>improved reliability of some timestamp rendering code, which should help some users who had trouble opening cookies management page after malformed cookie import</li>
<li>I believe I fixed an issue with 'open externally' on certain custom paths where the external program could spawn without an ui (flash projector did this). please let me know if your 'open externally' calls start making terminal windows everywhere</li>
<li>fixed a runtime stability issue with the new duplicates page and slow-updating counts that come in after the page has been deleted</li>
</ul>
<li><h3>version 351</h3></li>
<ul>
<li>wrote a new (always on top!) hover window for the duplicate filter that sits on the middle-right. the duplicate cog button and action buttons are moved to this new window, as are the file comparison statements</li>
Expand Down
1 change: 1 addition & 0 deletions include/ClientConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
media_viewer_capabilities[ HC.IMAGE_PNG ] = static_full_support
media_viewer_capabilities[ HC.IMAGE_WEBP ] = static_full_support
media_viewer_capabilities[ HC.IMAGE_TIFF ] = static_full_support
media_viewer_capabilities[ HC.IMAGE_ICON ] = static_full_support
media_viewer_capabilities[ HC.IMAGE_APNG ] = animated_full_support
media_viewer_capabilities[ HC.IMAGE_GIF ] = animated_full_support

Expand Down
2 changes: 1 addition & 1 deletion include/ClientDefaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def GetClientDefaultOptions():
options = {}

options[ 'play_dumper_noises' ] = True
options[ 'default_collect' ] = None
options[ 'default_collect' ] = []
options[ 'export_path' ] = None
options[ 'hpos' ] = 400
options[ 'vpos' ] = 700
Expand Down
2 changes: 1 addition & 1 deletion include/ClientGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -4065,7 +4065,7 @@ def _UnclosePage( self, closed_page_index = None ):
return


closed_page_index = 0
closed_page_index = len( self._closed_pages ) - 1


( time_closed, page ) = self._closed_pages.pop( closed_page_index )
Expand Down
2 changes: 1 addition & 1 deletion include/ClientGUIACDropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def __init__( self, parent ):
self._float_mode = True


self._text_ctrl = wx.TextCtrl( self, style=wx.TE_PROCESS_ENTER )
self._text_ctrl = wx.TextCtrl( self, style = wx.TE_PROCESS_ENTER )

self._UpdateBackgroundColour()

Expand Down
7 changes: 6 additions & 1 deletion include/ClientGUICanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,12 @@ def _ZoomOut( self ):

def _ZoomSwitch( self ):

if self._current_media is not None and self._IsZoomable() and self._canvas_zoom != 1.0:
if self._current_media is not None and self._IsZoomable():

if self._canvas_zoom == 1.0 and self._current_zoom == 1.0:

return


( my_width, my_height ) = self.GetClientSize()

Expand Down
75 changes: 53 additions & 22 deletions include/ClientGUICommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,21 +1073,33 @@ def _Draw( self, dc ):

class CheckboxCollect( wx.ComboCtrl ):

def __init__( self, parent, page_key = None ):
def __init__( self, parent, management_controller = None ):

wx.ComboCtrl.__init__( self, parent, style = wx.CB_READONLY )

self._page_key = page_key
self._management_controller = management_controller

if self._management_controller is not None and self._management_controller.HasVariable( 'media_collect' ):

self._collect_by = self._management_controller.GetVariable( 'media_collect' )

else:

self._collect_by = HC.options[ 'default_collect' ]


self._collect_by = HC.options[ 'default_collect' ]
if self._collect_by is None:

self._collect_by = []


popup = self._Popup( self._collect_by )

#self.UseAltPopupWindow( True )

self.SetPopupControl( popup )

self.SetValue( 'no collections' )
self.SetValue( 'no collections' ) # initialising to this because if there are no collections, no broadcast call goes through


def GetChoice( self ):
Expand All @@ -1097,11 +1109,20 @@ def GetChoice( self ):

def SetCollectTypes( self, collect_by, description ):

collect_by = list( collect_by )

self._collect_by = collect_by

self.SetValue( description )

HG.client_controller.pub( 'collect_media', self._page_key, self._collect_by )
if self._management_controller is not None:

self._management_controller.SetVariable( 'media_collect', collect_by )

page_key = self._management_controller.GetKey( 'page' )

HG.client_controller.pub( 'collect_media', page_key, self._collect_by )



class _Popup( wx.ComboPopup ):
Expand Down Expand Up @@ -1134,7 +1155,7 @@ def GetControl( self ):

def GetStringValue( self ):

# this is an abstract method that provides the strin to put in the comboctrl
# this is an abstract method that provides the string to put in the comboctrl
# I've never used/needed it, but one user reported getting the NotImplemented thing by repeatedly clicking, so let's add it anyway

if self._control is None:
Expand Down Expand Up @@ -1167,7 +1188,7 @@ def __init__( self, parent, special_parent, collect_by ):

for ratings_service in ratings_services:

text_and_data_tuples.append( ( ratings_service.GetName(), ( 'rating', ratings_service.GetServiceKey() ) ) )
text_and_data_tuples.append( ( ratings_service.GetName(), ( 'rating', ratings_service.GetServiceKey().hex() ) ) )


texts = [ text for ( text, data ) in text_and_data_tuples ] # we do this so it sizes its height properly on init
Expand Down Expand Up @@ -1251,29 +1272,39 @@ def GetDescription( self ):

def SetValue( self, collect_by ):

# an old possible value, now collapsed to []
if collect_by is None:
try:

# an old possible value, now collapsed to []
if collect_by is None:

collect_by = []


collect_by = []
# tuple for the set hashing
desired_collect_by_rows = { tuple( item ) for item in collect_by }


desired_collect_by_rows = set( collect_by )

indices_to_check = []

for index in range( self.GetCount() ):
indices_to_check = []

if self.GetClientData( index ) in desired_collect_by_rows:
for index in range( self.GetCount() ):

indices_to_check.append( index )
if self.GetClientData( index ) in desired_collect_by_rows:

indices_to_check.append( index )




if len( indices_to_check ) > 0:
if len( indices_to_check ) > 0:

self.SetCheckedItems( indices_to_check )

self._BroadcastCollect()


except Exception as e:

self.SetCheckedItems( indices_to_check )
HydrusData.ShowText( 'Failed to set a collect-by value!' )

self._BroadcastCollect()
HydrusData.ShowException( e )



Expand Down
4 changes: 0 additions & 4 deletions include/ClientGUIDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2002,8 +2002,6 @@ def __init__( self, parent, message, title = 'Are you sure?', yes_label = 'yes',
self._no.SetForegroundColour( ( 128, 0, 0 ) )
self._no.SetLabelText( no_label )

self.SetEscapeId( wx.ID_NO )

#

hbox = wx.BoxSizer( wx.HORIZONTAL )
Expand Down Expand Up @@ -2058,8 +2056,6 @@ def __init__( self, parent, message, title = 'Are you sure?', yes_tuples = None,
self._no.SetForegroundColour( ( 128, 0, 0 ) )
self._no.SetLabelText( no_label )

self.SetEscapeId( wx.ID_NO )

#

hbox = wx.BoxSizer( wx.HORIZONTAL )
Expand Down
32 changes: 27 additions & 5 deletions include/ClientGUIHoverFrames.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def _SizeAndPosition( self ):
self.SetSize( my_ideal_size )


if HC.PLATFORM_OSX and self.GetPosition() != my_ideal_position and self._always_on_top:
changes_occurred = should_resize or self.GetPosition() != my_ideal_position

if HC.PLATFORM_OSX and changes_occurred and self._always_on_top:

self.Raise()

Expand All @@ -87,6 +89,13 @@ def SetDisplayMedia( self, canvas_key, media ):

def TIMERUIUpdate( self ):

current_focus_tlp = ClientGUICommon.GetFocusTLP()

focus_is_on_descendant = ClientGUICommon.IsWXAncestor( current_focus_tlp, self._my_canvas.GetTopLevelParent(), through_tlws = True )
focus_has_right_window_type = isinstance( current_focus_tlp, ( ClientGUICanvas.CanvasFrame, FullscreenHoverFrame ) )

focus_is_good = focus_is_on_descendant and focus_has_right_window_type

new_options = HG.client_controller.new_options

if self._always_on_top or new_options.GetBoolean( 'always_show_hover_windows' ):
Expand All @@ -95,6 +104,23 @@ def TIMERUIUpdate( self ):

self.Show()

if HC.PLATFORM_OSX:

( mouse_x, mouse_y ) = wx.GetMousePosition()

( my_x, my_y ) = self.GetPosition()

( my_width, my_height ) = self.GetSize()

in_actual_x = my_x <= mouse_x and mouse_x <= my_x + my_width
in_actual_y = my_y <= mouse_y and mouse_y <= my_y + my_height

if in_actual_x and in_actual_y and focus_is_good:

self.Raise()



return


Expand Down Expand Up @@ -177,10 +203,6 @@ def TIMERUIUpdate( self ):

mouse_is_over_something_important = mouse_is_over_interactable_media or mouse_is_near_animation_bar

current_focus = ClientGUICommon.GetFocusTLP()

focus_is_good = ClientGUICommon.IsWXAncestor( current_focus, self._my_canvas.GetTopLevelParent(), through_tlws = True )

ready_to_show = in_position and not mouse_is_over_something_important and focus_is_good and not dialog_open and not menu_open
ready_to_hide = not menu_open and ( not in_position or dialog_open or not focus_is_good )

Expand Down
33 changes: 32 additions & 1 deletion include/ClientGUIManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ def CreateManagementController( page_name, management_type, file_service_key = N
management_controller.SetKey( 'file_service', file_service_key )
management_controller.SetVariable( 'media_sort', new_options.GetDefaultSort() )

collect_by = HC.options[ 'default_collect' ]

if collect_by is None:

collect_by = []


management_controller.SetVariable( 'media_collect', collect_by )

return management_controller

def CreateManagementControllerDuplicateFilter():
Expand Down Expand Up @@ -875,7 +884,19 @@ def __init__( self, parent, page, controller, management_controller ):

self._sort_by = ClientGUICommon.ChoiceSort( self, management_controller = self._management_controller )

self._collect_by = ClientGUICommon.CheckboxCollect( self, self._page_key )
self._collect_by = ClientGUICommon.CheckboxCollect( self, management_controller = self._management_controller )


def GetCollectBy( self ):

if self._collect_by.IsShown():

return self._collect_by.GetChoice()

else:

return []



def _MakeCurrentSelectionTagsBox( self, sizer ):
Expand Down Expand Up @@ -1235,6 +1256,11 @@ def _RefreshDuplicateCounts( self ):

def wx_code( unknown_duplicates_count ):

if not self:

return


self._currently_refreshing_dupe_count_numbers = False

self._refresh_dupe_counts_button.Enable()
Expand Down Expand Up @@ -1267,6 +1293,11 @@ def _RefreshMaintenanceStatus( self ):

def wx_code( similar_files_maintenance_status ):

if not self:

return


self._currently_refreshing_maintenance_numbers = False

self._refresh_maintenance_status.SetLabelText( '' )
Expand Down
2 changes: 1 addition & 1 deletion include/ClientGUIMedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,7 @@ def ClearPageKey( self ):
self._page_key = 'dead media panel page key'


def Collect( self, page_key, collect_by = -1 ):
def Collect( self, page_key, collect_by = None ):

if page_key == self._page_key:

Expand Down
7 changes: 7 additions & 0 deletions include/ClientGUIPages.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ def _SwapMediaPanel( self, new_panel ):

self._media_panel.ClearPageKey()

collect_by = self._management_panel.GetCollectBy()

if collect_by != []:

new_panel.Collect( self._page_key, collect_by )


self.ReplaceWindow( self._media_panel, new_panel )

self._media_panel.DestroyLater()
Expand Down
2 changes: 1 addition & 1 deletion include/ClientGUIPanels.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ def _SyncNow( self ):

def do_it():

self._service.Sync( False )
self._service.Sync( only_process_when_idle = False )

self._my_updater.Update()

Expand Down
2 changes: 1 addition & 1 deletion include/ClientGUIPredicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ def __init__( self, parent ):

hbox = wx.BoxSizer( wx.HORIZONTAL )

hbox.Add( ClientGUICommon.BetterStaticText( self, 'system:mime' ), CC.FLAGS_VCENTER )
hbox.Add( ClientGUICommon.BetterStaticText( self, 'system:filetype' ), CC.FLAGS_VCENTER )
hbox.Add( self._mimes, CC.FLAGS_VCENTER )

self.SetSizer( hbox )
Expand Down
2 changes: 1 addition & 1 deletion include/ClientGUIScrolledPanelsManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,7 @@ def __init__( self, parent ):

self._media_zooms.SetValue( ','.join( ( str( media_zoom ) for media_zoom in media_zooms ) ) )

mimes_in_correct_order = ( HC.IMAGE_JPEG, HC.IMAGE_PNG, HC.IMAGE_APNG, HC.IMAGE_GIF, HC.IMAGE_WEBP, HC.IMAGE_TIFF, HC.APPLICATION_FLASH, HC.APPLICATION_PDF, HC.APPLICATION_PSD, HC.APPLICATION_ZIP, HC.APPLICATION_RAR, HC.APPLICATION_7Z, HC.APPLICATION_HYDRUS_UPDATE_CONTENT, HC.APPLICATION_HYDRUS_UPDATE_DEFINITIONS, HC.VIDEO_AVI, HC.VIDEO_FLV, HC.VIDEO_MOV, HC.VIDEO_MP4, HC.VIDEO_MKV, HC.VIDEO_MPEG, HC.VIDEO_WEBM, HC.VIDEO_WMV, HC.AUDIO_MP3, HC.AUDIO_OGG, HC.AUDIO_FLAC, HC.AUDIO_WMA )
mimes_in_correct_order = ( HC.IMAGE_JPEG, HC.IMAGE_PNG, HC.IMAGE_APNG, HC.IMAGE_GIF, HC.IMAGE_WEBP, HC.IMAGE_TIFF, HC.IMAGE_ICON, HC.APPLICATION_FLASH, HC.APPLICATION_PDF, HC.APPLICATION_PSD, HC.APPLICATION_ZIP, HC.APPLICATION_RAR, HC.APPLICATION_7Z, HC.APPLICATION_HYDRUS_UPDATE_CONTENT, HC.APPLICATION_HYDRUS_UPDATE_DEFINITIONS, HC.VIDEO_AVI, HC.VIDEO_FLV, HC.VIDEO_MOV, HC.VIDEO_MP4, HC.VIDEO_MKV, HC.VIDEO_MPEG, HC.VIDEO_WEBM, HC.VIDEO_WMV, HC.AUDIO_MP3, HC.AUDIO_OGG, HC.AUDIO_FLAC, HC.AUDIO_WMA )

for mime in mimes_in_correct_order:

Expand Down

0 comments on commit 93e8578

Please sign in to comment.