Version 97

This commit is contained in:
Hydrus 2013-12-18 16:49:24 -06:00
parent 73286abeeb
commit b9302ace87
12 changed files with 148 additions and 58 deletions

View File

@ -8,6 +8,12 @@
<div class="content"> <div class="content">
<h3>changelog</h3> <h3>changelog</h3>
<ul> <ul>
<li><h3>version 97</h3></li>
<ul>
<li>initial os x test build</li>
<li>collect typo fixed</li>
<li>'remove all mappings with specific namespace' added to advanced content update dialog</li>
</ul>
<li><h3>version 96</h3></li> <li><h3>version 96</h3></li>
<ul> <ul>
<li>went over _all_ my help (about 200KB of text!), cutting down waffly paragraphs, rewritting bits that were stiff or unclear, updating screenshots, and adding several new sections people suggested</li> <li>went over _all_ my help (about 200KB of text!), cutting down waffly paragraphs, rewritting bits that were stiff or unclear, updating screenshots, and adding several new sections people suggested</li>

View File

@ -312,11 +312,27 @@ def AddPaddingToDimensions( dimensions, padding ):
def CatchExceptionClient( etype, value, tb ): def CatchExceptionClient( etype, value, tb ):
trace_list = traceback.format_tb( tb ) try:
trace = ''.join( trace_list ) trace_list = traceback.format_tb( tb )
HC.pubsub.pub( 'message', HC.Message( HC.MESSAGE_TYPE_ERROR, ( etype, value, trace ) ) ) trace = ''.join( trace_list )
HC.pubsub.pub( 'message', HC.Message( HC.MESSAGE_TYPE_ERROR, ( etype, value, trace ) ) )
except:
message = 'Encountered an error I could not parse:'
message += os.linesep
message += HC.u( ( etype, value, tb ) )
try: message += traceback.format_exc()
except: pass
HC.pubsub.pub( 'message', HC.Message( HC.MESSAGE_TYPE_TEXT, message ) )
def GenerateCollectByChoices( sort_by_choices ): def GenerateCollectByChoices( sort_by_choices ):

View File

@ -265,7 +265,7 @@ class Controller( wx.App ):
self.SetSplashText( 'starting daemons' ) self.SetSplashText( 'starting daemons' )
if HC.is_first_start: self._gui.DoFirstStart() if HC.is_first_start: self._gui.DoFirstStart()
if HC.is_db_updated: wx.CallLater( 0, HC.pubsub.pub, 'message', HC.Message( HC.MESSAGE_TYPE_TEXT, 'The client has updated to version ' + HC.u( HC.SOFTWARE_VERSION ) + '!' ) ) if HC.is_db_updated: wx.CallLater( 1, HC.pubsub.pub, 'message', HC.Message( HC.MESSAGE_TYPE_TEXT, 'The client has updated to version ' + HC.u( HC.SOFTWARE_VERSION ) + '!' ) )
self.RestartServer() self.RestartServer()
self._db.StartDaemons() self._db.StartDaemons()

View File

@ -3221,7 +3221,7 @@ class ServiceDB( FileDB, MessageDB, TagDB, RatingDB ):
predicates = [ 'service_id = ' + str( service_id ) ] predicates = [ 'service_id = ' + str( service_id ) ]
( sub_action, sub_row ) = row ( sub_action, sub_row ) = row
print( sub_action )
if sub_action == 'copy': if sub_action == 'copy':
( tag, hashes, service_identifier_target ) = sub_row ( tag, hashes, service_identifier_target ) = sub_row
@ -3245,10 +3245,21 @@ class ServiceDB( FileDB, MessageDB, TagDB, RatingDB ):
if tag is not None: if tag is not None:
( namespace_id, tag_id ) = self._GetNamespaceIdTagId( c, tag ) ( tag_type, tag ) = tag
predicates.append( 'namespace_id = ' + str( namespace_id ) ) if tag_type == 'tag':
predicates.append( 'tag_id = ' + str( tag_id ) )
( namespace_id, tag_id ) = self._GetNamespaceIdTagId( c, tag )
predicates.append( 'namespace_id = ' + str( namespace_id ) )
predicates.append( 'tag_id = ' + str( tag_id ) )
elif tag_type == 'namespace':
namespace_id = self._GetNamespaceId( c, tag )
predicates.append( 'namespace_id = ' + str( namespace_id ) )
if hashes is not None: if hashes is not None:

View File

@ -119,13 +119,13 @@ class FrameGUI( ClientGUICommon.FrameThatResizes ):
if HC.options[ 'default_gui_session' ] == 'just a blank page': if HC.options[ 'default_gui_session' ] == 'just a blank page':
wx.CallLater( 0, self._NewPageQuery, HC.LOCAL_FILE_SERVICE_IDENTIFIER ) wx.CallLater( 1, self._NewPageQuery, HC.LOCAL_FILE_SERVICE_IDENTIFIER )
else: else:
name = HC.options[ 'default_gui_session' ] name = HC.options[ 'default_gui_session' ]
wx.CallLater( 0, self._LoadGUISession, name ) wx.CallLater( 1, self._LoadGUISession, name )

View File

@ -15,9 +15,10 @@ import time
import traceback import traceback
import urllib import urllib
import wx import wx
import wx.lib.flashwin
import wx.media import wx.media
if HC.PLATFORM_WINDOWS: import wx.lib.flashwin
ID_TIMER_ANIMATED = wx.NewId() ID_TIMER_ANIMATED = wx.NewId()
ID_TIMER_FLASH = wx.NewId() ID_TIMER_FLASH = wx.NewId()
ID_TIMER_SLIDESHOW = wx.NewId() ID_TIMER_SLIDESHOW = wx.NewId()
@ -676,6 +677,8 @@ class CanvasFullscreenMediaList( ClientGUIMixins.ListeningMediaList, Canvas, Cli
HC.pubsub.pub( 'set_focus', self._page_key, None ) HC.pubsub.pub( 'set_focus', self._page_key, None )
self.t = 0
def _DoManualPan( self, delta_x, delta_y ): def _DoManualPan( self, delta_x, delta_y ):
@ -1017,7 +1020,8 @@ class CanvasFullscreenMediaList( ClientGUIMixins.ListeningMediaList, Canvas, Cli
def EventDrag( self, event ): def EventDrag( self, event ):
CC.CAN_HIDE_MOUSE = True CC.CAN_HIDE_MOUSE = True
self.t += 1
print( self.t )
self._focus_holder.SetFocus() self._focus_holder.SetFocus()
if event.Dragging() and self._last_drag_coordinates is not None: if event.Dragging() and self._last_drag_coordinates is not None:
@ -1028,7 +1032,12 @@ class CanvasFullscreenMediaList( ClientGUIMixins.ListeningMediaList, Canvas, Cli
( delta_x, delta_y ) = ( x - old_x, y - old_y ) ( delta_x, delta_y ) = ( x - old_x, y - old_y )
try: self.WarpPointer( old_x, old_y ) try:
if HC.PLATFORM_OSX: raise Exception() # can't warppointer in os x
self.WarpPointer( old_x, old_y )
except: self._last_drag_coordinates = ( x, y ) except: self._last_drag_coordinates = ( x, y )
( old_delta_x, old_delta_y ) = self._total_drag_delta ( old_delta_x, old_delta_y ) = self._total_drag_delta
@ -1041,7 +1050,7 @@ class CanvasFullscreenMediaList( ClientGUIMixins.ListeningMediaList, Canvas, Cli
self.SetCursor( wx.StockCursor( wx.CURSOR_ARROW ) ) self.SetCursor( wx.StockCursor( wx.CURSOR_ARROW ) )
self._timer_cursor_hide.Start( 800, wx.TIMER_ONE_SHOT ) self._timer_cursor_hide.Start( 800, wx.TIMER_ONE_SHOT )
self.t-=1
def EventDragBegin( self, event ): def EventDragBegin( self, event ):
@ -1062,6 +1071,8 @@ class CanvasFullscreenMediaList( ClientGUIMixins.ListeningMediaList, Canvas, Cli
if x > client_x - 20: better_x = client_x - 20 if x > client_x - 20: better_x = client_x - 20
if y > client_y - 20: better_y = client_y - 20 if y > client_y - 20: better_y = client_y - 20
if HC.PLATFORM_OSX: raise Exception() # can't warppointer in os x
self.WarpPointer( better_x, better_y ) self.WarpPointer( better_x, better_y )
x = better_x x = better_x
@ -3254,7 +3265,12 @@ class RatingsFilterFrameNumerical( ClientGUICommon.FrameThatResizes ):
( delta_x, delta_y ) = ( x - old_x, y - old_y ) ( delta_x, delta_y ) = ( x - old_x, y - old_y )
try: self.WarpPointer( old_x, old_y ) try:
if HC.PLATFORM_OSX: raise Exception() # can't warppointer in os x
self.WarpPointer( old_x, old_y )
except: self._last_drag_coordinates = ( x, y ) except: self._last_drag_coordinates = ( x, y )
( old_delta_x, old_delta_y ) = self._total_drag_delta ( old_delta_x, old_delta_y ) = self._total_drag_delta
@ -3290,6 +3306,8 @@ class RatingsFilterFrameNumerical( ClientGUICommon.FrameThatResizes ):
if x > client_x - 20: better_x = client_x - 20 if x > client_x - 20: better_x = client_x - 20
if y > client_y - 20: better_y = client_y - 20 if y > client_y - 20: better_y = client_y - 20
if HC.PLATFORM_OSX: raise Exception() # can't warppointer in os x
self.WarpPointer( better_x, better_y ) self.WarpPointer( better_x, better_y )
x = better_x x = better_x

View File

@ -1044,7 +1044,7 @@ class CheckboxCollect( wx.combo.ComboCtrl ):
def EventChanged( self, event ): def EventChanged( self, event ):
( collect_types, collect_type_strings ) = self.GeValue() ( collect_types, collect_type_strings ) = self.GetValue()
self._special_parent.SetCollectTypes( collect_types, collect_type_strings ) self._special_parent.SetCollectTypes( collect_types, collect_type_strings )
@ -1271,7 +1271,7 @@ class ListBook( wx.Panel ):
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) )
self._list_box = wx.ListBox( self, style = wx.LB_SINGLE | wx.LB_SORT ) self._list_box = self.LB( self, style = wx.LB_SINGLE | wx.LB_SORT )
self._empty_panel = wx.Panel( self ) self._empty_panel = wx.Panel( self )
@ -1297,6 +1297,23 @@ class ListBook( wx.Panel ):
self.Bind( wx.EVT_MENU, self.EventMenu ) self.Bind( wx.EVT_MENU, self.EventMenu )
class LB( wx.ListBox ):
def FindString( self, name ):
if HC.PLATFORM_WINDOWS: return wx.ListBox.FindString( self, name )
else:
for i in range( self.GetCount() ):
if self.GetString( i ) == name: return i
return wx.NOT_FOUND
def _RecalcListBoxWidth( self ): self.Layout() def _RecalcListBoxWidth( self ): self.Layout()
def _Select( self, selection ): def _Select( self, selection ):
@ -1504,39 +1521,6 @@ class ListBook( wx.Panel ):
class ListCtrlAutoWidth( wx.ListCtrl, ListCtrlAutoWidthMixin ):
def __init__( self, parent, height ):
wx.ListCtrl.__init__( self, parent, size=( -1, height ), style=wx.LC_REPORT )
ListCtrlAutoWidthMixin.__init__( self )
def GetAllSelected( self ):
indices = []
i = self.GetFirstSelected()
while i != -1:
indices.append( i )
i = self.GetNextSelected( i )
return indices
def RemoveAllSelected( self ):
indices = self.GetAllSelected()
indices.reverse() # so we don't screw with the indices of deletees below
for index in indices: self.DeleteItem( index )
class ListBox( wx.ScrolledWindow ): class ListBox( wx.ScrolledWindow ):
def __init__( self, parent, min_height = 250 ): def __init__( self, parent, min_height = 250 ):
@ -2043,6 +2027,39 @@ class ListBoxMessagesPredicates( ListBoxMessages ):
self._TextsHaveChanged() self._TextsHaveChanged()
class ListCtrlAutoWidth( wx.ListCtrl, ListCtrlAutoWidthMixin ):
def __init__( self, parent, height ):
wx.ListCtrl.__init__( self, parent, size=( -1, height ), style=wx.LC_REPORT )
ListCtrlAutoWidthMixin.__init__( self )
def GetAllSelected( self ):
indices = []
i = self.GetFirstSelected()
while i != -1:
indices.append( i )
i = self.GetNextSelected( i )
return indices
def RemoveAllSelected( self ):
indices = self.GetAllSelected()
indices.reverse() # so we don't screw with the indices of deletees below
for index in indices: self.DeleteItem( index )
class NoneableSpinCtrl( wx.Panel ): class NoneableSpinCtrl( wx.Panel ):
def __init__( self, parent, message, none_phrase = 'no limit', max = 1000000, multiplier = 1, num_dimensions = 1 ): def __init__( self, parent, message, none_phrase = 'no limit', max = 1000000, multiplier = 1, num_dimensions = 1 ):

View File

@ -126,6 +126,7 @@ class DialogAdvancedContentUpdate( Dialog ):
ALL_MAPPINGS = 0 ALL_MAPPINGS = 0
SPECIFIC_MAPPINGS = 1 SPECIFIC_MAPPINGS = 1
SPECIFIC_NAMESPACE = 2
def __init__( self, parent, service_identifier, hashes = None ): def __init__( self, parent, service_identifier, hashes = None ):
@ -160,6 +161,7 @@ class DialogAdvancedContentUpdate( Dialog ):
self._tag_type_dropdown.Append( 'all mappings', self.ALL_MAPPINGS ) self._tag_type_dropdown.Append( 'all mappings', self.ALL_MAPPINGS )
self._tag_type_dropdown.Append( 'specific tag\'s mappings', self.SPECIFIC_MAPPINGS ) self._tag_type_dropdown.Append( 'specific tag\'s mappings', self.SPECIFIC_MAPPINGS )
self._tag_type_dropdown.Append( 'specific namespace\'s mappings', self.SPECIFIC_NAMESPACE )
self._tag_type_dropdown.Select( 0 ) self._tag_type_dropdown.Select( 0 )
@ -243,7 +245,15 @@ class DialogAdvancedContentUpdate( Dialog ):
tag_type = self._tag_type_dropdown.GetChoice() tag_type = self._tag_type_dropdown.GetChoice()
if tag_type == self.ALL_MAPPINGS: tag = None if tag_type == self.ALL_MAPPINGS: tag = None
else: tag = self._tag elif tag_type == self.SPECIFIC_MAPPINGS: tag = ( 'tag', self._tag )
elif tag_type == self.SPECIFIC_NAMESPACE:
tag = self._tag
if tag.endswith( ':' ): tag = tag[:-1]
tag = ( 'namespace', tag )
if tag == '': return if tag == '': return

View File

@ -1144,7 +1144,7 @@ class MediaPanelThumbnails( MediaPanel ):
''' '''
self._thumbnails_being_faded_in[ hash ] = ( bmp, None, canvas_bmp, x, y, 0 ) self._thumbnails_being_faded_in[ hash ] = ( bmp, None, canvas_bmp, x, y, 0 )
if not self._timer_animation.IsRunning(): self._timer_animation.Start( 0, wx.TIMER_ONE_SHOT ) if not self._timer_animation.IsRunning(): self._timer_animation.Start( 1, wx.TIMER_ONE_SHOT )
@ -1913,7 +1913,8 @@ class MediaPanelThumbnails( MediaPanel ):
image = original_bmp.ConvertToImage() image = original_bmp.ConvertToImage()
image.InitAlpha() try: image.InitAlpha()
except: pass
image = image.AdjustChannels( 1, 1, 1, 0.25 ) image = image.AdjustChannels( 1, 1, 1, 0.25 )

View File

@ -4,13 +4,14 @@ import hsaudiotag.flac
import hsaudiotag.mpeg import hsaudiotag.mpeg
import hsaudiotag.ogg import hsaudiotag.ogg
import HydrusConstants as HC import HydrusConstants as HC
import mp3play
import os import os
import threading import threading
import time import time
import traceback import traceback
import wx import wx
if HC.PLATFORM_WINDOWS: import mp3play
parsed_noises = {} parsed_noises = {}
def GetFLACDuration( path ): def GetFLACDuration( path ):
@ -63,6 +64,8 @@ def GetWMADuration( path ):
def PlayNoise( name ): def PlayNoise( name ):
if HC.PLATFORM_OSX: return
if name not in parsed_noises: if name not in parsed_noises:
if name == 'success': filename = 'success.mp3' if name == 'success': filename = 'success.mp3'

View File

@ -19,6 +19,12 @@ import urlparse
import wx import wx
import yaml import yaml
PLATFORM_WINDOWS = False
PLATFORM_OSX = False
if sys.platform == 'win32': PLATFORM_WINDOWS = True
elif sys.platform == 'darwin': PLATFORM_OSX = True
options = {} options = {}
# dirs # dirs
@ -39,7 +45,7 @@ TEMP_DIR = BASE_DIR + os.path.sep + 'temp'
# Misc # Misc
NETWORK_VERSION = 12 NETWORK_VERSION = 12
SOFTWARE_VERSION = 96 SOFTWARE_VERSION = 97
UNSCALED_THUMBNAIL_DIMENSIONS = ( 200, 200 ) UNSCALED_THUMBNAIL_DIMENSIONS = ( 200, 200 )

View File

@ -1,6 +1,8 @@
import HydrusConstants as HC
import os import os
import socket import socket
import win32com.client
if HC.PLATFORM_WINDOWS: import win32com.client
def GetLocalIP(): return socket.gethostbyname( socket.gethostname() ) def GetLocalIP(): return socket.gethostbyname( socket.gethostname() )