Version 128

This commit is contained in:
Hydrus 2014-09-03 15:26:49 -05:00
parent 23ed4016f6
commit 48056815ca
14 changed files with 478 additions and 86 deletions

View File

@ -8,6 +8,20 @@
<div class="content">
<h3>changelog</h3>
<ul>
<li><h3>version 128</h3></li>
<ul>
<li>fixed right click on thumbnail error</li>
<li>improved assumed permission defaults on tag dialogs and right click download/upload actions (i.e. tag dialog's entry A/C will no longer disappear when you desync from tag service)</li>
<li>removed account desync on network version mismatch, to stop this problem anyway</li>
<li>fixed tag parents not showing in autocomplete dropdowns</li>
<li>added sqlite3 command line tool to db folder for convenience</li>
<li>fixed a typo in manage server's services dialog</li>
<li>some misc code cleanup</li>
<li>added default advanced tag options pane to manage options dialog</li>
<li>added default advanced tag options to manage subscriptions dialog</li>
<li>fixed booru namespaces in manage subscriptions dialog to be booru-specific</li>
<li>added default advanced tag options to normal download pages</li>
</ul>
<li><h3>version 127</h3></li>
<ul>
<li>finished service_identifier rewrite, phew</li>

View File

@ -230,6 +230,8 @@ CLIENT_DEFAULT_OPTIONS[ 'sort_by' ] = default_sort_by_choices
CLIENT_DEFAULT_OPTIONS[ 'show_all_tags_in_autocomplete' ] = True
CLIENT_DEFAULT_OPTIONS[ 'fullscreen_borderless' ] = True
CLIENT_DEFAULT_OPTIONS[ 'default_advanced_tag_options' ] = {}
shortcuts = {}
shortcuts[ wx.ACCEL_NORMAL ] = {}
@ -411,10 +413,10 @@ def GenerateDumpMultipartFormDataCTAndBody( fields ):
m = multipart.Multipart()
for ( name, type, value ) in fields:
for ( name, field_type, value ) in fields:
if type in ( FIELD_TEXT, FIELD_COMMENT, FIELD_PASSWORD, FIELD_VERIFICATION_RECAPTCHA, FIELD_THREAD_ID ): m.field( name, HC.b( value ) )
elif type == FIELD_CHECKBOX:
if field_type in ( FIELD_TEXT, FIELD_COMMENT, FIELD_PASSWORD, FIELD_VERIFICATION_RECAPTCHA, FIELD_THREAD_ID ): m.field( name, HC.b( value ) )
elif field_type == FIELD_CHECKBOX:
if value:
@ -426,7 +428,7 @@ def GenerateDumpMultipartFormDataCTAndBody( fields ):
m.field( name, value )
elif type == FIELD_FILE:
elif field_type == FIELD_FILE:
( hash, mime, file ) = value
@ -2232,9 +2234,9 @@ MENU_EVENT_ID_TO_ACTION_CACHE = MenuEventIdToActionCache()
class RenderedImageCache( object ):
def __init__( self, type ):
def __init__( self, cache_type ):
self._type = type
self._type = cache_type
if self._type == 'fullscreen': self._data_cache = DataCache( 'fullscreen_cache_size' )
elif self._type == 'preview': self._data_cache = DataCache( 'preview_cache_size' )
@ -2541,7 +2543,7 @@ class Service( HC.HydrusYAMLBase ):
HC.app.Write( 'service_updates', { self._key : [ HC.ServiceUpdate( HC.SERVICE_UPDATE_ERROR, HC.u( e ) ) ] } )
if isinstance( e, ( HydrusExceptions.PermissionException, HydrusExceptions.NetworkVersionException ) ):
if isinstance( e, HydrusExceptions.PermissionException ):
HC.app.Write( 'service_updates', { self._key : [ HC.ServiceUpdate( HC.SERVICE_UPDATE_ACCOUNT, HC.GetUnknownAccount() ) ] } )

View File

@ -69,11 +69,11 @@ The database will be locked while the backup occurs, which may lock up your gui
self._preview_image_cache.Clear()
def Clipboard( self, type, data ):
def Clipboard( self, data_type, data ):
# need this cause can't do it in a non-gui thread
if type == 'paths':
if data_type == 'paths':
paths = data
@ -96,7 +96,7 @@ The database will be locked while the backup occurs, which may lock up your gui
else: wx.MessageBox( 'Could not get permission to access the clipboard!' )
elif type == 'text':
elif data_type == 'text':
text = data
@ -130,7 +130,7 @@ The database will be locked while the backup occurs, which may lock up your gui
def GetLog( self ): return self._log
def GetManager( self, type ): return self._managers[ type ]
def GetManager( self, manager_type ): return self._managers[ manager_type ]
def GetPreviewImageCache( self ): return self._preview_image_cache

View File

@ -2861,6 +2861,8 @@ class ServiceDB( FileDB, MessageDB, TagDB, RatingDB ):
service = self._GetService( c, service_id )
service_key = service.GetKey()
statuses_to_pairs = HC.BuildKeyToSetDict( ( ( status, ( self._GetNamespaceTag( c, child_namespace_id, child_tag_id ), self._GetNamespaceTag( c, parent_namespace_id, parent_tag_id ) ) ) for ( status, child_namespace_id, child_tag_id, parent_namespace_id, parent_tag_id ) in statuses_and_pair_ids ) )
service_keys_to_statuses_to_pairs[ service_key ] = statuses_to_pairs
@ -4874,11 +4876,6 @@ class DB( ServiceDB ):
def _UpdateDB( self, c, version ):
if version == 76:
c.execute( 'CREATE TABLE import_folders ( path TEXT, details TEXT_YAML );' )
if version == 78:
c.execute( 'DELETE FROM import_folders;' )

View File

@ -1280,13 +1280,13 @@ class FrameGUI( ClientGUICommon.FrameThatResizes ):
def _NewPageImportGallery( self, name, type ):
def _NewPageImportGallery( self, name, import_type ):
new_page = ClientGUIPages.PageImportGallery( self._notebook, name, type )
new_page = ClientGUIPages.PageImportGallery( self._notebook, name, import_type )
if name == 'booru': page_name = type.GetName()
elif type is None: page_name = name
else: page_name = name + ' by ' + type
if name == 'booru': page_name = import_type.GetName()
elif import_type is None: page_name = name
else: page_name = name + ' by ' + import_type
self._notebook.AddPage( new_page, page_name, select = True )

View File

@ -3384,16 +3384,7 @@ class CollapsiblePanel( wx.Panel ):
self.SetSizer( self._vbox )
def SetPanel( self, panel ):
self._panel = panel
self._vbox.AddF( self._panel, FLAGS_EXPAND_BOTH_WAYS )
self._panel.Hide()
def EventChange( self, event ):
def _Change( self ):
if self._expanded:
@ -3427,8 +3418,21 @@ class CollapsiblePanel( wx.Panel ):
if issubclass( type( tlp ), wx.Dialog ): tlp.Fit()
def ExpandCollapse( self ): self._Change()
def EventChange( self, event ): self._Change()
def IsExpanded( self ): return self._expanded
def SetPanel( self, panel ):
self._panel = panel
self._vbox.AddF( self._panel, FLAGS_EXPAND_BOTH_WAYS )
self._panel.Hide()
class AdvancedOptions( StaticBox ):
def __init__( self, parent, title ):
@ -3446,6 +3450,8 @@ class AdvancedOptions( StaticBox ):
self.AddF( self._collapsible_panel, FLAGS_EXPAND_PERPENDICULAR )
def ExpandCollapse( self ): self._collapsible_panel.ExpandCollapse()
class AdvancedHentaiFoundryOptions( AdvancedOptions ):
def __init__( self, parent ): AdvancedOptions.__init__( self, parent, 'advanced hentai foundry options' )
@ -3816,16 +3822,29 @@ class AdvancedTagOptions( AdvancedOptions ):
if self._collapsible_panel.IsExpanded(): self._collapsible_panel.EventChange( None )
def SetInfo( self, info ):
def SetInfo( self, new_service_keys_to_namespaces_info ):
for ( service_key, checkbox_info ) in self._service_keys_to_checkbox_info.items():
if service_key in info:
if service_key in new_service_keys_to_namespaces_info:
new_namespaces_info = new_service_keys_to_namespaces_info[ service_key ]
for ( namespace, checkbox ) in checkbox_info:
if namespace in info[ service_key ]: checkbox.SetValue( True )
else: checkbox.SetValue( False )
if type( new_namespaces_info ) == bool:
value = new_namespaces_info
checkbox.SetValue( value )
else:
new_namespaces = new_namespaces_info
if namespace in new_namespaces: checkbox.SetValue( True )
else: checkbox.SetValue( False )
else:
@ -4397,12 +4416,12 @@ class TagsBoxCounts( TagsBox ):
self._RecalcStrings()
def SetShow( self, type, value ):
def SetShow( self, show_type, value ):
if type == 'current': self._show_current = value
elif type == 'deleted': self._show_deleted = value
elif type == 'pending': self._show_pending = value
elif type == 'petitioned': self._show_petitioned = value
if show_type == 'current': self._show_current = value
elif show_type == 'deleted': self._show_deleted = value
elif show_type == 'pending': self._show_pending = value
elif show_type == 'petitioned': self._show_petitioned = value
self._RecalcStrings()

View File

@ -689,6 +689,109 @@ class DialogGenerateNewAccounts( Dialog ):
finally: self.EndModal( wx.ID_OK )
class DialogInputAdvancedTagOptions( Dialog ):
def __init__( self, parent, pretty_name, name, ato ):
def InitialiseControls():
if name in ( 'default', HC.SITE_TYPE_BOORU ): namespaces = [ 'all namespaces' ]
elif name == HC.SITE_TYPE_DEVIANT_ART: namespaces = [ 'creator', 'title', '' ]
elif name == HC.SITE_TYPE_GIPHY: namespaces = [ '' ]
elif name == HC.SITE_TYPE_HENTAI_FOUNDRY: namespaces = [ 'creator', 'title', '' ]
elif name == HC.SITE_TYPE_NEWGROUNDS: namespaces = [ 'creator', 'title', '' ]
elif name == HC.SITE_TYPE_PIXIV: namespaces = [ 'creator', 'title', '' ]
elif name == HC.SITE_TYPE_TUMBLR: namespaces = [ '' ]
else:
( booru_id, booru_name ) = name
booru = HC.app.Read( 'remote_booru', booru_name )
namespaces = booru.GetNamespaces()
self._name = name
self._advanced_tag_options = ClientGUICommon.AdvancedTagOptions( self, namespaces = namespaces )
self._ok = wx.Button( self, id = wx.ID_OK, label = 'ok' )
self._ok.SetForegroundColour( ( 0, 128, 0 ) )
self._cancel = wx.Button( self, id = wx.ID_CANCEL, label = 'cancel' )
self._cancel.SetForegroundColour( ( 128, 0, 0 ) )
def PopulateControls():
if name in ( 'default', HC.SITE_TYPE_BOORU ):
namespaces = [ 'all namespaces' ]
new_ato = {}
for ( service_key, boolean ) in self._initial_ato.items():
if boolean: new_ato[ service_key ] = [ 'all namespaces' ]
self._initial_ato = new_ato
self._advanced_tag_options.SetInfo( self._initial_ato )
def ArrangeControls():
b_box = wx.BoxSizer( wx.HORIZONTAL )
b_box.AddF( self._ok, FLAGS_MIXED )
b_box.AddF( self._cancel, FLAGS_MIXED )
vbox = wx.BoxSizer( wx.VERTICAL )
vbox.AddF( self._advanced_tag_options, FLAGS_EXPAND_BOTH_WAYS )
vbox.AddF( b_box, FLAGS_BUTTON_SIZERS )
self.SetSizer( vbox )
( x, y ) = self.GetEffectiveMinSize()
self.SetInitialSize( ( x, y ) )
self._name = name
self._initial_ato = ato
Dialog.__init__( self, parent, 'configure default advanced tag options for ' + pretty_name )
InitialiseControls()
PopulateControls()
ArrangeControls()
wx.CallAfter( self._advanced_tag_options.ExpandCollapse )
def GetATO( self ):
ato = self._advanced_tag_options.GetInfo()
if self._name in ( 'default', HC.SITE_TYPE_BOORU ):
new_ato = {}
for ( service_key, namespaces ) in ato.items():
if namespaces == [ 'all namespaces' ]: new_ato[ service_key ] = True
ato = new_ato
return ato
class DialogInputCustomFilterAction( Dialog ):
def __init__( self, parent, modifier = wx.ACCEL_NORMAL, key = wx.WXK_F7, service_key = None, action = 'archive' ):
@ -1375,13 +1478,13 @@ class DialogInputFileSystemPredicate( Dialog ):
def PopulateControls():
( media, type ) = system_predicates[ 'mime' ]
( media, media_type ) = system_predicates[ 'mime' ]
self._mime_media.SetSelection( media )
self.EventMime( None )
self._mime_type.SetSelection( type )
self._mime_type.SetSelection( media_type )
def ArrangeControls():
@ -3985,7 +4088,7 @@ class DialogPathsToTagsRegex( Dialog ):
account = service.GetInfo( 'account' )
if account.HasPermission( HC.POST_DATA ):
if account.HasPermission( HC.POST_DATA ) or account.HasNoPermissions():
service_key = service.GetKey()

View File

@ -2922,6 +2922,25 @@ class DialogManageOptions( ClientGUIDialogs.Dialog ):
self._listbook.AddPage( self._file_system_predicates_page, 'default file system predicates' )
# default advanced tag options
self._advanced_tag_options_page = wx.Panel( self._listbook )
self._advanced_tag_options_page.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) )
self._advanced_tag_options = wx.ListBox( self._advanced_tag_options_page )
self._advanced_tag_options.Bind( wx.EVT_LEFT_DCLICK, self.EventATODelete )
self._advanced_tag_options_add = wx.Button( self._advanced_tag_options_page, label = 'add' )
self._advanced_tag_options_add.Bind( wx.EVT_BUTTON, self.EventATOAdd )
self._advanced_tag_options_edit = wx.Button( self._advanced_tag_options_page, label = 'edit' )
self._advanced_tag_options_edit.Bind( wx.EVT_BUTTON, self.EventATOEdit )
self._advanced_tag_options_delete = wx.Button( self._advanced_tag_options_page, label = 'delete' )
self._advanced_tag_options_delete.Bind( wx.EVT_BUTTON, self.EventATODelete )
self._listbook.AddPage( self._advanced_tag_options_page, 'default advanced tag options' )
# colours
self._colour_page = wx.Panel( self._listbook )
@ -3090,13 +3109,13 @@ class DialogManageOptions( ClientGUIDialogs.Dialog ):
self._file_system_predicate_limit.SetValue( limit )
( media, type ) = system_predicates[ 'mime' ]
( media, media_type ) = system_predicates[ 'mime' ]
self._file_system_predicate_mime_media.SetSelection( media )
self.EventFileSystemPredicateMime( None )
self._file_system_predicate_mime_type.SetSelection( type )
self._file_system_predicate_mime_type.SetSelection( media_type )
( sign, num_tags ) = system_predicates[ 'num_tags' ]
@ -3134,6 +3153,22 @@ class DialogManageOptions( ClientGUIDialogs.Dialog ):
self._file_system_predicate_num_words_sign.SetSelection( sign )
self._file_system_predicate_num_words.SetValue( num_words )
#
for ( name, ato ) in HC.options[ 'default_advanced_tag_options' ].items():
if name == 'default': pretty_name = 'default'
elif type( name ) == int: pretty_name = HC.site_type_string_lookup[ name ]
else:
( booru_id, booru_name ) = name
pretty_name = 'booru: ' + booru_name
self._advanced_tag_options.Append( pretty_name, ( name, ato ) )
#
self._local_port.SetValue( HC.options[ 'local_port' ] )
@ -3358,6 +3393,22 @@ class DialogManageOptions( ClientGUIDialogs.Dialog ):
vbox = wx.BoxSizer( wx.VERTICAL )
vbox.AddF( self._advanced_tag_options, FLAGS_EXPAND_BOTH_WAYS )
hbox = wx.BoxSizer( wx.HORIZONTAL )
hbox.AddF( self._advanced_tag_options_add, FLAGS_BUTTON_SIZERS )
hbox.AddF( self._advanced_tag_options_edit, FLAGS_BUTTON_SIZERS )
hbox.AddF( self._advanced_tag_options_delete, FLAGS_BUTTON_SIZERS )
vbox.AddF( hbox, FLAGS_EXPAND_PERPENDICULAR )
self._advanced_tag_options_page.SetSizer( vbox )
#
vbox = wx.BoxSizer( wx.VERTICAL )
hbox = wx.BoxSizer( wx.HORIZONTAL )
hbox.AddF( wx.StaticText( self._server_page, label = 'local server port: ' ), FLAGS_MIXED )
@ -3462,6 +3513,84 @@ class DialogManageOptions( ClientGUIDialogs.Dialog ):
def _SortListCtrl( self ): self._shortcuts.SortListItems( 2 )
def EventATOAdd( self, event ):
pretty_names_to_names = {}
for ( k, v ) in HC.site_type_string_lookup.items(): pretty_names_to_names[ v ] = k
boorus = HC.app.Read( 'remote_boorus' )
for ( booru_name, booru ) in boorus.items(): pretty_names_to_names[ 'booru: ' + booru_name ] = ( HC.SITE_TYPE_BOORU, booru_name )
names = pretty_names_to_names.keys()
names.sort()
pretty_names_to_names[ 'default' ] = 'default'
names.insert( 0, 'default' )
with ClientGUIDialogs.DialogSelectFromListOfStrings( self, 'select tag domain', names ) as dlg:
if dlg.ShowModal() == wx.ID_OK:
pretty_name = dlg.GetString()
for i in range( self._advanced_tag_options.GetCount() ):
if pretty_name == self._advanced_tag_options.GetString( i ):
wx.MessageBox( 'You already have default advanced tag options set up for that domain!' )
return
name = pretty_names_to_names[ pretty_name ]
with ClientGUIDialogs.DialogInputAdvancedTagOptions( self, pretty_name, name, {} ) as ato_dlg:
if ato_dlg.ShowModal() == wx.ID_OK:
ato = ato_dlg.GetATO()
self._advanced_tag_options.Append( pretty_name, ( name, ato ) )
def EventATODelete( self, event ):
selection = self._advanced_tag_options.GetSelection()
if selection != wx.NOT_FOUND: self._advanced_tag_options.Delete( selection )
def EventATOEdit( self, event ):
selection = self._advanced_tag_options.GetSelection()
if selection != wx.NOT_FOUND:
pretty_name = self._advanced_tag_options.GetString( selection )
( name, ato ) = self._advanced_tag_options.GetClientData( selection )
with ClientGUIDialogs.DialogInputAdvancedTagOptions( self, pretty_name, name, ato ) as dlg:
if dlg.ShowModal() == wx.ID_OK:
ato = dlg.GetATO()
self._advanced_tag_options.SetClientData( selection, ( name, ato ) )
def EventEditNamespaceColour( self, event ):
result = self._namespace_colours.GetSelectedNamespaceColour()
@ -3635,6 +3764,15 @@ class DialogManageOptions( ClientGUIDialogs.Dialog ):
HC.options[ 'file_system_predicates' ] = system_predicates
default_advanced_tag_options = {}
for ( name, ato ) in [ self._advanced_tag_options.GetClientData( i ) for i in range( self._advanced_tag_options.GetCount() ) ]:
default_advanced_tag_options[ name ] = ato
HC.options[ 'default_advanced_tag_options' ] = default_advanced_tag_options
shortcuts = {}
shortcuts[ wx.ACCEL_NORMAL ] = {}
@ -4288,9 +4426,9 @@ class DialogManageServer( ClientGUIDialogs.Dialog ):
self.SetInitialSize( ( 680, y ) )
service = HC.app.GetManager( 'services' ).GetService( service_key )
self._service = HC.app.GetManager( 'services' ).GetService( service_key )
ClientGUIDialogs.Dialog.__init__( self, parent, 'manage ' + service.GetName() + ' services' )
ClientGUIDialogs.Dialog.__init__( self, parent, 'manage ' + self._service.GetName() + ' services' )
InitialiseControls()
@ -5620,6 +5758,7 @@ class DialogManageSubscriptions( ClientGUIDialogs.Dialog ):
self._query = wx.TextCtrl( self._query_panel )
self._booru_selector = wx.ListBox( self._query_panel )
self._booru_selector.Bind( wx.EVT_LISTBOX, self.EventBooruSelected )
self._query_type = ClientGUICommon.BetterChoice( self._query_panel )
self._query_type.Append( 'artist', 'artist' )
@ -5708,7 +5847,14 @@ class DialogManageSubscriptions( ClientGUIDialogs.Dialog ):
info[ 'url_cache' ] = set()
info[ 'paused' ] = False
else: info = HC.app.Read( 'subscription', name )
self._new_subscription = True
else:
info = HC.app.Read( 'subscription', name )
self._new_subscription = False
self._original_name = name
self._original_info = info
@ -5726,6 +5872,47 @@ class DialogManageSubscriptions( ClientGUIDialogs.Dialog ):
self.SetMinSize( ( 540, 620 ) )
def _ConfigureAdvancedTagOptions( self ):
site_type = self._site_type.GetChoice()
lookup = site_type
if site_type == HC.SITE_TYPE_BOORU:
selection = self._booru_selector.GetSelection()
booru_name = self._booru_selector.GetString( selection )
booru = HC.app.Read( 'remote_booru', booru_name )
namespaces = booru.GetNamespaces()
lookup = ( HC.SITE_TYPE_BOORU, booru.GetName() )
elif site_type == HC.SITE_TYPE_DEVIANT_ART: namespaces = [ 'creator', 'title', '' ]
elif site_type == HC.SITE_TYPE_GIPHY: namespaces = [ '' ]
elif site_type == HC.SITE_TYPE_HENTAI_FOUNDRY: namespaces = [ 'creator', 'title', '' ]
elif site_type == HC.SITE_TYPE_PIXIV: namespaces = [ 'creator', 'title', '' ]
elif site_type == HC.SITE_TYPE_TUMBLR: namespaces = [ '' ]
elif site_type == HC.SITE_TYPE_NEWGROUNDS: namespaces = [ 'creator', 'title', '' ]
ato = HC.GetDefaultAdvancedTagOptions( lookup )
if not self._new_subscription:
( name, info ) = self.GetSubscription()
same_site = info[ 'site_type' ] == self._original_info[ 'site_type' ]
same_type_of_query = info[ 'query_type' ] == self._original_info[ 'query_type' ]
if same_site and same_type_of_query: ato = self._original_info[ 'advanced_tag_options' ]
self._advanced_tag_options.SetNamespaces( namespaces )
self._advanced_tag_options.SetInfo( ato )
def _PresentForSiteType( self ):
site_type = self._site_type.GetChoice()
@ -5748,15 +5935,7 @@ class DialogManageSubscriptions( ClientGUIDialogs.Dialog ):
else: self._booru_selector.Hide()
if site_type == HC.SITE_TYPE_BOORU: namespaces = [ 'creator', 'series', 'character', '' ]
elif site_type == HC.SITE_TYPE_DEVIANT_ART: namespaces = [ 'creator', 'title', '' ]
elif site_type == HC.SITE_TYPE_GIPHY: namespaces = [ '' ]
elif site_type == HC.SITE_TYPE_HENTAI_FOUNDRY: namespaces = [ 'creator', 'title', '' ]
elif site_type == HC.SITE_TYPE_PIXIV: namespaces = [ 'creator', 'title', '' ]
elif site_type == HC.SITE_TYPE_TUMBLR: namespaces = [ '' ]
elif site_type == HC.SITE_TYPE_NEWGROUNDS: namespaces = [ 'creator', 'title', '' ]
self._advanced_tag_options.SetNamespaces( namespaces )
wx.CallAfter( self._ConfigureAdvancedTagOptions )
self.Layout()
@ -5825,6 +6004,8 @@ class DialogManageSubscriptions( ClientGUIDialogs.Dialog ):
self._advanced_import_options.SetInfo( advanced_import_options )
def EventBooruSelected( self, event ): self._ConfigureAdvancedTagOptions()
def EventResetCache( self, event ):
@ -5842,10 +6023,7 @@ class DialogManageSubscriptions( ClientGUIDialogs.Dialog ):
def EventSiteChanged( self, event ):
self._PresentForSiteType()
def EventSiteChanged( self, event ): self._PresentForSiteType()
def GetSubscription( self ):
@ -6108,7 +6286,7 @@ class DialogManageTagParents( ClientGUIDialogs.Dialog ):
account = service.GetInfo( 'account' )
if account.HasPermission( HC.POST_DATA ):
if account.HasPermission( HC.POST_DATA ) or account.HasNoPermissions():
name = service.GetName()
service_key = service.GetKey()
@ -6577,7 +6755,7 @@ class DialogManageTagSiblings( ClientGUIDialogs.Dialog ):
account = service.GetInfo( 'account' )
if account.HasPermission( HC.POST_DATA ):
if account.HasPermission( HC.POST_DATA ) or account.HasNoPermissions():
name = service.GetName()
service_key = service.GetKey()
@ -7395,7 +7573,7 @@ class DialogManageTags( ClientGUIDialogs.Dialog ):
if self._i_am_local_tag_service: self._modify_mappers.Hide()
else:
if not self._account.HasPermission( HC.POST_DATA ): self._add_tag_box.Hide()
if not ( self._account.HasPermission( HC.POST_DATA ) or self._account.HasNoPermissions() ): self._add_tag_box.Hide()
if not self._account.HasPermission( HC.MANAGE_USERS ): self._modify_mappers.Hide()
@ -7599,7 +7777,7 @@ class DialogManageTags( ClientGUIDialogs.Dialog ):
def SetTagBoxFocus( self ):
if self._i_am_local_tag_service or self._account.HasPermission( HC.POST_DATA ): self._add_tag_box.SetFocus()
if self._i_am_local_tag_service or self._account.HasPermission( HC.POST_DATA ) or self._account.HasNoPermissions(): self._add_tag_box.SetFocus()

View File

@ -1583,10 +1583,11 @@ class ManagementPanelImports( ManagementPanelImport ):
class ManagementPanelImportsGallery( ManagementPanelImports ):
def __init__( self, parent, page, page_key, import_controller, name, namespaces, initial_search_value, starting_from_session = False ):
def __init__( self, parent, page, page_key, import_controller, name, namespaces, ato, initial_search_value, starting_from_session = False ):
self._name = name
self._namespaces = namespaces
self._ato = ato
self._initial_search_value = initial_search_value
ManagementPanelImports.__init__( self, parent, page, page_key, import_controller, starting_from_session = starting_from_session )
@ -1603,6 +1604,7 @@ class ManagementPanelImportsGallery( ManagementPanelImports ):
#
self._advanced_tag_options = ClientGUICommon.AdvancedTagOptions( self, self._namespaces )
self._advanced_tag_options.SetInfo( self._ato )
vbox.AddF( self._advanced_tag_options, FLAGS_EXPAND_PERPENDICULAR )

View File

@ -1705,10 +1705,10 @@ class MediaPanelThumbnails( MediaPanel ):
i_can_post_ratings = len( local_ratings_services ) > 0
downloadable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.GET_DATA ) }
uploadable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.POST_DATA ) }
downloadable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.GET_DATA ) or repository.GetInfo( 'account' ).HasNoPermissions() }
uploadable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.POST_DATA ) or repository.GetInfo( 'account' ).HasNoPermissions() }
petition_resolvable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.RESOLVE_PETITIONS ) }
petitionable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.POST_PETITIONS ) } - petition_resolvable_file_services
petitionable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.POST_PETITIONS ) } - petition_resolvable_file_service_keys
user_manageable_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.MANAGE_USERS ) }
admin_file_service_keys = { repository.GetKey() for repository in file_repositories if repository.GetInfo( 'account' ).HasPermission( HC.GENERAL_ADMIN ) }
@ -1801,26 +1801,20 @@ class MediaPanelThumbnails( MediaPanel ):
selection_uploadable_file_service_keys = set()
selection_downloadable_file_service_keys = set()
selection_petitionable_file_service_keys = set()
for locations_manager in all_locations_managers:
# we can upload (set pending) to a repo_id when we have permission, a file is local, not current, not pending, and either ( not deleted or admin )
if locations_manager.HasLocal(): selection_uploadable_file_service_keys.update( uploadable_file_service_keys - locations_manager.GetCurrentRemote() - locations_manager.GetPendingRemote() - ( locations_manager.GetDeletedRemote() - admin_file_service_keys ) )
selection_downloadable_file_service_keys = set()
for locations_manager in all_service_keys:
# we can download (set pending to local) when we have permission, a file is not local and not already downloading and current
if not locations_manager.HasLocal() and not locations_manager.HasDownloading(): selection_downloadable_file_service_keys.update( downloadable_file_service_keys & locations_manager.GetCurrentRemote() )
selection_petitionable_file_service_keys = set()
for locations_manager in all_locations_managers:
# we can petition when we have permission and a file is current
# we can re-petition an already petitioned file

View File

@ -523,7 +523,9 @@ class PageImportGallery( PageImport ):
if self._gallery_type == 'artist': initial_search_value = 'artist username'
elif self._gallery_type == 'tags': initial_search_value = 'search tags'
self._management_panel = ClientGUIManagement.ManagementPanelImportsGalleryHentaiFoundry( self._search_preview_split, self, self._page_key, self._import_controller, name, namespaces, initial_search_value, starting_from_session = self._starting_from_session )
ato = HC.GetDefaultAdvancedTagOptions( HC.SITE_TYPE_HENTAI_FOUNDRY )
self._management_panel = ClientGUIManagement.ManagementPanelImportsGalleryHentaiFoundry( self._search_preview_split, self, self._page_key, self._import_controller, name, namespaces, ato, initial_search_value, starting_from_session = self._starting_from_session )
else:
@ -535,6 +537,8 @@ class PageImportGallery( PageImport ):
namespaces = booru.GetNamespaces()
initial_search_value = 'search tags'
ato = HC.GetDefaultAdvancedTagOptions( ( HC.SITE_TYPE_BOORU, name ) )
elif self._gallery_name == 'deviant art':
if self._gallery_type == 'artist':
@ -544,6 +548,8 @@ class PageImportGallery( PageImport ):
initial_search_value = 'artist username'
ato = HC.GetDefaultAdvancedTagOptions( HC.SITE_TYPE_DEVIANT_ART )
elif self._gallery_name == 'giphy':
name = 'giphy'
@ -551,12 +557,16 @@ class PageImportGallery( PageImport ):
initial_search_value = 'search tag'
ato = HC.GetDefaultAdvancedTagOptions( HC.SITE_TYPE_GIPHY )
elif self._gallery_name == 'newgrounds':
name = 'newgrounds'
namespaces = [ 'creator', 'title', '' ]
initial_search_value = 'artist username'
ato = HC.GetDefaultAdvancedTagOptions( HC.SITE_TYPE_NEWGROUNDS )
elif self._gallery_name == 'pixiv':
name = 'pixiv'
@ -565,14 +575,18 @@ class PageImportGallery( PageImport ):
if self._gallery_type == 'artist': initial_search_value = 'artist username'
elif self._gallery_type == 'tag': initial_search_value = 'search tag'
ato = HC.GetDefaultAdvancedTagOptions( HC.SITE_TYPE_PIXIV )
elif self._gallery_name == 'tumblr':
name = 'tumblr'
namespaces = [ '' ]
initial_search_value = 'username'
ato = HC.GetDefaultAdvancedTagOptions( HC.SITE_TYPE_TUMBLR )
self._management_panel = ClientGUIManagement.ManagementPanelImportsGallery( self._search_preview_split, self, self._page_key, self._import_controller, name, namespaces, initial_search_value, starting_from_session = self._starting_from_session )
self._management_panel = ClientGUIManagement.ManagementPanelImportsGallery( self._search_preview_split, self, self._page_key, self._import_controller, name, namespaces, ato, initial_search_value, starting_from_session = self._starting_from_session )

View File

@ -64,7 +64,7 @@ options = {}
# Misc
NETWORK_VERSION = 14
SOFTWARE_VERSION = 127
SOFTWARE_VERSION = 128
UNSCALED_THUMBNAIL_DIMENSIONS = ( 200, 200 )
@ -413,6 +413,16 @@ SITE_TYPE_TUMBLR = 4
SITE_TYPE_HENTAI_FOUNDRY = 5
SITE_TYPE_NEWGROUNDS = 6
site_type_string_lookup = {}
site_type_string_lookup[ SITE_TYPE_BOORU ] = 'booru'
site_type_string_lookup[ SITE_TYPE_DEVIANT_ART ] = 'deviant art'
site_type_string_lookup[ SITE_TYPE_GIPHY ] = 'giphy'
site_type_string_lookup[ SITE_TYPE_HENTAI_FOUNDRY ] = 'hentai foundry'
site_type_string_lookup[ SITE_TYPE_NEWGROUNDS ] = 'newgrounds'
site_type_string_lookup[ SITE_TYPE_PIXIV ] = 'pixiv'
site_type_string_lookup[ SITE_TYPE_TUMBLR ] = 'tumblr'
SYSTEM_PREDICATE_TYPE_EVERYTHING = 0
SYSTEM_PREDICATE_TYPE_INBOX = 1
SYSTEM_PREDICATE_TYPE_ARCHIVE = 2
@ -1082,6 +1092,26 @@ def ConvertZoomToPercentage( zoom ):
return pretty_zoom
def GetDefaultAdvancedTagOptions( lookup ):
backup_lookup = None
if type( lookup ) == tuple:
( site_type, site_name ) = lookup
if site_type == SITE_TYPE_BOORU: backup_lookup = SITE_TYPE_BOORU
ato_options = options[ 'default_advanced_tag_options' ]
if lookup in ato_options: ato = ato_options[ lookup ]
elif backup_lookup is not None and backup_lookup in ato_options: ato = ato_options[ backup_lookup ]
elif 'default' in ato_options: ato = ato_options[ 'default' ]
else: ato = {}
return ato
def GetEmptyDataDict():
data = collections.defaultdict( default_dict_list )
@ -1354,6 +1384,8 @@ class Account( HydrusYAMLBase ):
def GetUsedData( self ): return self._used_data
def HasNoPermissions( self ): return self._account_type.HasNoPermissions()
def HasPermission( self, permission ):
if self._IsBanned(): return False
@ -1492,6 +1524,8 @@ class AccountType( HydrusYAMLBase ):
return result_string
def HasNoPermissions( self ): return len( self._permissions ) == 0
def HasPermission( self, permission ): return permission in self._permissions
UNKNOWN_ACCOUNT_TYPE = AccountType( 'unknown account', [], ( None, None ) )

View File

@ -14,7 +14,7 @@
height="1052.3622047"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.48.1 "
inkscape:version="0.48.2 r9819"
sodipodi:docname="Icons.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="C:\projects\code\Hydrus\static\Hydrus Icon.png"
@ -145,11 +145,11 @@
<filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter3839-40-1">
id="filter3839-17">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.5184367"
id="feGaussianBlur3841-9-7" />
id="feGaussianBlur3841-4" />
</filter>
</defs>
<sodipodi:namedview
@ -169,7 +169,7 @@
inkscape:current-layer="layer1"
inkscape:window-width="1200"
inkscape:window-height="1904"
inkscape:window-x="1916"
inkscape:window-x="-4"
inkscape:window-y="-4"
showgrid="false"
inkscape:window-maximized="1" />
@ -322,5 +322,40 @@
id="tspan2162-0-8"
x="403.60165"
y="555.62262">ψ</tspan></text>
<rect
style="color:#000000;fill:#efefef;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect2164-9-48"
width="199.00005"
height="199.00005"
x="43.941639"
y="617.49152"
inkscape:export-filename="C:\code\Hydrus\static\hydrus_non-transparent.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<text
xml:space="preserve"
style="font-size:219.01309204px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter3839-17);font-family:Cambria"
x="403.60165"
y="555.62262"
id="text2160-4-0"
transform="matrix(0.80588956,0,0,0.80588956,-245.03108,310.20053)"
inkscape:export-filename="C:\projects\code\Hydrus\static\Content Icon.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan2162-0-9"
x="403.60165"
y="555.62262">ψ</tspan></text>
<text
xml:space="preserve"
style="font-size:18px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
x="75.761436"
y="838.2099"
id="text3820"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3822"
x="75.761436"
y="838.2099">non-transparent</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB