Skip to content

Commit

Permalink
Version 375
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrusnetwork committed Nov 28, 2019
1 parent 4d4f399 commit d184101
Show file tree
Hide file tree
Showing 35 changed files with 3,484 additions and 2,783 deletions.
40 changes: 40 additions & 0 deletions help/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,46 @@
<div class="content">
<h3>changelog</h3>
<ul>
<li><h3>version 375</h3></li>
<ul>
<li>qt:</li>
<li>disabled the failed legacy high dpi scaling mode experiment (which was scaling up thumbnails and media in an ugly way) and returned to font-size-based natural ui scaling as set by the OS. a couple of non-font things like bitmap buttons and various layout margins are too small on >100% UI scale, and the splash screen is borked again, but it looks clear again. I'll keep working on this</li>
<li>fixed the custom taglist at >100% UI scale, which was spacing its tags at the wrong text height. this should survive changing ui scale while the program is open and environments with multiple monitors at different ui scale</li>
<li>re-fixed a critical old media-viewer-close-on-video memory leak from wx code to qt code. this was also a cause for some child ffmpeg processes not being terminated</li>
<li>fixed the media viewer not redrawing correctly when the media size completely exceeds the canvas window size</li>
<li>fixed the loading of the shortcut edit panel when the shortcut set a tag</li>
<li>fixed some url class edit path component ui</li>
<li>fixed and cleaned up some 'safe window size/position' calculations that were missing out the total frame geometry, meaning some dialogs were not moving up and left enough to show entirely on screen, and dialogs with parent-dimension gravity were not calculating initial size accurately</li>
<li>fixed focusing on the already-open manage tags text input when you hit 'manage tags' on a canvas with a manage tags dialog already open</li>
<li>fixed the html formula rule edit ui actually rendering html tag labels, lmao</li>
<li>updated boot-password entry to use the normal hydrus text entry dialog, and fixed a hydrus password cancel not setting a 'clean' exit for the next boot</li>
<li>fixed page layout splitter sash positions not resetting nicely from the menu command</li>
<li>fixed keyboard delete in the manage urls dialog</li>
<li>popup message titles are now in bold</li>
<li>popup message titles should now multiline correctly and fill available width</li>
<li>the popup messages manager should now set its min/fixed width more sensibly</li>
<li>subscription popups now will be wider if space is available</li>
<li>wrote a new class to manage better asynchronous updates for future Qt ui presentation</li>
<li>the file, pages, and pending menubar menus, which all require a db hit to generate, now operate on this new update class. all three should update faster when able and more politely and smoothly wait when the db is busy</li>
<li>reduced some accidental blocking in an old ui-update routine that kicked in when it was running hard</li>
<li>if the media_viewer frame type is set not to remember its 'last size', it will now instantiate with a small min size</li>
<li>when pasting new queries into a sub, if there are more than 5 or 50 that are already in or new, they will be rendered in a more compact way in order to stop the notification dialog growing too tall</li>
<li>improved stability of page update, splash screen update, and perhaps pubsub update</li>
<li>.</li>
<li>new file maintenance jobs:</li>
<li>added a new 'check for missing files' file maintenance job, where if the file is missing and has urls, those urls will be queued up in a new url downloader for redownload. the file record is not removed, preserving archive/inbox and import time</li>
<li>added a new 'check for invalid files' file maintenance job that does the same deal as above with an additional expensive byte-for-byte content check if the file is not missing</li>
<li>added a new 'check for invalid files' file maintenance job that only cares about invalidity--if the file is present and invalid, it is moved out but the file record is not removed</li>
<li>.</li>
<li>the rest:</li>
<li>network jobs that receive low-bandwidth error codes from the server now use a separate wait routine (previously, they piggybacked on the connection fail retry system). they have a separate cog-menu action to override these waits</li>
<li>the time delay multiple for connection errors and serverside bandwidth problems are now editable under options->connection. old default was 10 seconds base, now 15 and 60 seconds respectively</li>
<li>updated the danbooru login script</li>
<li>improved the precision of the thumbnail size estimate in database migration</li>
<li>the alphabetisation of a url class's GET paramaters on normalise is now optional. it is a new checkbox on the url class edit panel</li>
<li>when a default object fails to load from a png path, a simple error is now written to the log</li>
<li>misc cleanup</li>
</ul>
<li><h3>version 374</h3></li>
<ul>
<li>qt environment/build:</li>
Expand Down
32 changes: 29 additions & 3 deletions include/ClientCaches.py
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,8 @@ def __init__( self, controller ):
self._waterfall_queue_quick = set()
self._waterfall_queue = []

self._waterfall_queue_empty_event = threading.Event()

self._delayed_regeneration_queue_quick = set()
self._delayed_regeneration_queue = []

Expand Down Expand Up @@ -2101,6 +2103,15 @@ def sort_waterfall( item ):
# we pop off the end, so reverse
self._waterfall_queue.sort( key = sort_waterfall, reverse = True )

if len( self._waterfall_queue ) == 0:

self._waterfall_queue_empty_event.set()

else:

self._waterfall_queue_empty_event.clear()


def sort_regen( item ):

media_result = item
Expand Down Expand Up @@ -2189,11 +2200,21 @@ def ClearThumbnails( self, hashes ):



def DoingWork( self ):
def WaitUntilFree( self ):

with self._lock:
while True:

if HG.view_shutdown:

raise HydrusExceptions.ShutdownException( 'Application shutting down!' )


queue_is_empty = self._waterfall_queue_empty_event.wait( 1 )

return len( self._waterfall_queue ) > 0
if queue_is_empty:

return




Expand Down Expand Up @@ -2324,6 +2345,11 @@ def DAEMONWaterfall( self ):

result = self._waterfall_queue.pop()

if len( self._waterfall_queue ) == 0:

self._waterfall_queue_empty_event.set()


self._waterfall_queue_quick.discard( result )


Expand Down
34 changes: 12 additions & 22 deletions include/ClientController.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,14 @@ def qt_code( win, job_key ):

if win is not None and not QP.isValid( win ):

raise HydrusExceptions.QtDeadWindowException('Parent Window was destroyed before Qt command was called!')
if HG.view_shutdown:

raise HydrusExceptions.ShutdownException( 'Application is shutting down!' )

else:

raise HydrusExceptions.QtDeadWindowException('Parent Window was destroyed before Qt command was called!')



result = func( *args, **kwargs )
Expand Down Expand Up @@ -854,7 +861,7 @@ def qt_code_password():

while True:

with QP.PasswordEntryDialog( self._splash, 'Enter your password:', 'Enter password' ) as dlg:
with ClientGUIDialogs.DialogTextEntry( self._splash, 'Enter your password.', allow_blank = True, password_entry = True ) as dlg:

if dlg.exec() == QW.QDialog.Accepted:

Expand Down Expand Up @@ -1208,11 +1215,6 @@ def Run( self ):

QP.MonkeyPatchMissingMethods()

if hasattr( QC.Qt, 'AA_EnableHighDpiScaling' ):

QW.QApplication.setAttribute( QC.Qt.AA_EnableHighDpiScaling, True )


self.app = App( sys.argv )

HydrusData.Print( 'booting controller\u2026' )
Expand Down Expand Up @@ -1545,6 +1547,8 @@ def THREADBootEverything( self ):

HydrusData.Print( e )

HydrusData.CleanRunningFile( self.db_dir, 'client' )

QP.CallAfter( QW.QApplication.exit, 0 )

except Exception as e:
Expand Down Expand Up @@ -1682,21 +1686,7 @@ def WaitUntilViewFree( self ):

def WaitUntilThumbnailsFree( self ):

while True:

if HG.view_shutdown:

raise HydrusExceptions.ShutdownException( 'Application shutting down!' )

elif not self._caches[ 'thumbnail' ].DoingWork():

return

else:

time.sleep( 0.00001 )


self._caches[ 'thumbnail' ].WaitUntilFree()


def Write( self, action, *args, **kwargs ):
Expand Down
26 changes: 26 additions & 0 deletions include/ClientDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -13163,6 +13163,32 @@ def ask_what_to_do():



if version == 374:

try:

login_manager = self._GetJSONDump( HydrusSerialisable.SERIALISABLE_TYPE_NETWORK_LOGIN_MANAGER )

login_manager.Initialise()

#

login_manager.OverwriteDefaultLoginScripts( [ 'danbooru login' ] )

#

self._SetJSONDump( login_manager )

except Exception as e:

HydrusData.PrintException( e )

message = 'Trying to update some login scripts failed! Please let hydrus dev know!'

self.pub_initial_message( message )



self._controller.pub( 'splash_set_title_text', 'updated db to v' + str( version + 1 ) )

self._c.execute( 'UPDATE version SET version = ?;', ( version + 1, ) )
Expand Down
4 changes: 0 additions & 4 deletions include/ClientDaemons.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ def DAEMONMaintainTrash( controller ):

service_keys_to_content_updates = { CC.TRASH_SERVICE_KEY : [ content_update ] }

controller.WaitUntilModelFree()

controller.WriteSynchronous( 'content_updates', service_keys_to_content_updates )

service_info = controller.Read( 'service_info', CC.TRASH_SERVICE_KEY )
Expand All @@ -129,8 +127,6 @@ def DAEMONMaintainTrash( controller ):

service_keys_to_content_updates = { CC.TRASH_SERVICE_KEY : [ content_update ] }

controller.WaitUntilModelFree()

controller.WriteSynchronous( 'content_updates', service_keys_to_content_updates )

hashes = controller.Read( 'trash_hashes', limit = 10, minimum_age = max_age )
Expand Down
5 changes: 3 additions & 2 deletions include/ClientDefaults.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from . import ClientConstants as CC
from . import ClientData
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusGlobals as HG
from . import HydrusNetworking
from . import HydrusSerialisable
Expand Down Expand Up @@ -469,9 +470,9 @@ def GetDefaultObjectsFromPNGs( dir_path, allowed_object_types ):



except:
except Exception as e:

pass
HydrusData.Print( 'Object at location "{}" failed to load: {}'.format( path, e ) )



Expand Down
2 changes: 0 additions & 2 deletions include/ClientDownloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ def MainLoop( self ):

file_repository.Request( HC.GET, 'file', { 'hash' : hash }, temp_path = temp_path )

self._controller.WaitUntilModelFree()

exclude_deleted = False # this is the important part here
do_not_check_known_urls_before_importing = False
do_not_check_hashes_before_importing = False
Expand Down

0 comments on commit d184101

Please sign in to comment.