Skip to content

Commit

Permalink
Version 1.7
Browse files Browse the repository at this point in the history
Changes:
Scan Information in duplicate display
Changed how mulitvalue fields are calculated and asked for. It should work better now.
Renamed Directory to Folder through out the UI

Bugfix:
Fix for unicode characters in move mode (saving undo.dat file)
Fixed path too long checking
Fixed startyear calculation (I think)

New:
Illegal Character replacements are now user defineable
Month text is now user definable
Added language field
Added import and export for profiles
  • Loading branch information
Stonepaw committed Jun 21, 2011
1 parent 02775ed commit 9958824
Show file tree
Hide file tree
Showing 11 changed files with 850 additions and 563 deletions.
28 changes: 19 additions & 9 deletions DuplicateForm.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Duplicate found" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="593" Width="450" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" Topmost="True" WindowStartupLocation="CenterOwner">
Title="Duplicate found" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="601" Width="450" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" Topmost="True" WindowStartupLocation="CenterOwner">
<Window.Resources>
<!-- Hover Brushes -->
<!-- This stuff to make the buttons look right was borrowed from http://blog.codenaked.com/post/2011/03/31/WPF-and-Windows-7-Theme.aspx -->
Expand Down Expand Up @@ -111,7 +111,7 @@
</Window.Resources>
<Grid Height="558">
<Label Content="There is already a file with the same name in this location" Height="31" HorizontalAlignment="Left" Margin="12,0,0,0" VerticalAlignment="Top" FontSize="16" Foreground="Navy" />
<Button x:Name="ReplaceButton" Margin="12,60,12,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="183" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Style="{StaticResource ResourceKey=BigButton}">
<Button x:Name="ReplaceButton" Margin="12,50,12,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Style="{StaticResource ResourceKey=BigButton}">
<Grid Height="Auto" Width="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -123,6 +123,7 @@
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="15*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -167,14 +168,18 @@
<Label Content="Added to Library:" Foreground="Navy" HorizontalAlignment="Left" Padding="2" />
<Label Name="NewAddedDate" Content="Added to library" Height="20" HorizontalAlignment="Left" Padding="2" />
</StackPanel>
<StackPanel Grid.Column="2" Grid.Row="6" Grid.ColumnSpan="3" Grid.RowSpan="3" Orientation="Horizontal" >
<StackPanel Grid.Column="2" Grid.Row="6" Grid.ColumnSpan="3" Orientation="Horizontal" >
<Label Content="Scan Information:" Foreground="Navy" HorizontalAlignment="Left" Padding="2" />
<Label Name="NewScanInfo" Content="Scan Information" Height="20" HorizontalAlignment="Left" Padding="2" />
</StackPanel>
<StackPanel Grid.Column="2" Grid.Row="7" Grid.ColumnSpan="3" Grid.RowSpan="3" Orientation="Horizontal" >
<Label Content="Path:" Foreground="Navy" Height="Auto" HorizontalAlignment="Left" Padding="2" VerticalAlignment="Top" />
<TextBlock Name="NewPath" FontSize="10" TextWrapping="Wrap" Padding="2" Width="248">File Path</TextBlock>
</StackPanel>
<Image Name="NewCover" Grid.Row="2" Grid.RowSpan="6" Height="113" HorizontalAlignment="Center" Stretch="Uniform" VerticalAlignment="Center" Width="97" Margin="15,7,0,0" Grid.Column="1" />
</Grid>
</Button>
<Button x:Name="CancelButton" Margin="12,250,12,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="183" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Style="{StaticResource ResourceKey=BigButton}">
<Button x:Name="CancelButton" Margin="12,255,12,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Style="{StaticResource ResourceKey=BigButton}">
<Grid Height="Auto" Width="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -186,6 +191,7 @@
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="15*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -230,14 +236,18 @@
<Label Content="Added to Library:" Foreground="Navy" HorizontalAlignment="Left" Padding="2" />
<Label Name="OldAddedDate" Height="20" HorizontalAlignment="Left" Padding="2" />
</StackPanel>
<StackPanel Grid.Column="2" Grid.Row="6" Grid.ColumnSpan="3" Grid.RowSpan="3" Orientation="Horizontal">
<StackPanel Grid.Column="2" Grid.Row="6" Grid.ColumnSpan="3" Orientation="Horizontal">
<Label Content="Scan Information:" Foreground="Navy" HorizontalAlignment="Left" Padding="2" />
<Label Name="OldScanInfo" Height="20" HorizontalAlignment="Left" Padding="2" />
</StackPanel>
<StackPanel Grid.Column="2" Grid.Row="7" Grid.ColumnSpan="3" Grid.RowSpan="3" Orientation="Horizontal">
<Label Content="Path:" Foreground="Navy" Height="Auto" HorizontalAlignment="Left" Padding="2" VerticalAlignment="Top" />
<TextBlock Name="OldPath" TextWrapping="Wrap" FontSize="10" HorizontalAlignment="Left" Padding="2" VerticalAlignment="Top" Height="59" Width="247" />
</StackPanel>
<Image Name="OldCover" Grid.Row="2" Grid.RowSpan="6" Height="113" HorizontalAlignment="Center" Stretch="Uniform" VerticalAlignment="Center" Width="97" Margin="15,7,0,0" Grid.Column="1" />
</Grid>
</Button>
<Button x:Name="RenameButton" Margin="12,440,12,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="70" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Style="{StaticResource ResourceKey=BigButton}">
<Button x:Name="RenameButton" Margin="12,460,12,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="70" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Style="{StaticResource ResourceKey=BigButton}">
<Grid Height="69" Width="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -250,8 +260,8 @@
<TextBlock Name="RenameText" Padding="0" TextWrapping="Wrap" Text='The file you are moving will be renamed: ' HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Width="376" Foreground="Navy" Grid.Row="1" Height="43" />
</Grid>
</Button>
<Button Name="Cancel" Content="Cancel" Height="23" HorizontalAlignment="Left" Margin="338,528,0,0" VerticalAlignment="Top" Width="75" />
<Label Name="Subtitle" Content="Click the file you want to keep" Height="28" HorizontalAlignment="Left" Margin="12,29,0,0" VerticalAlignment="Top" />
<CheckBox Name="DoAll" Content="Do this for all conficts" Height="16" HorizontalAlignment="Left" Margin="18,532,0,0" VerticalAlignment="Top" />
<Button Name="Cancel" Content="Cancel" Height="23" HorizontalAlignment="Left" Margin="338,535,0,0" VerticalAlignment="Top" Width="75" />
<Label Name="Subtitle" Content="Click the file you want to keep" Height="28" HorizontalAlignment="Left" Margin="12,22,0,0" VerticalAlignment="Top" />
<CheckBox Name="DoAll" Content="Do this for all conficts" Height="16" HorizontalAlignment="Left" Margin="16,539,0,0" VerticalAlignment="Top" />
</Grid>
</Window>
2 changes: 1 addition & 1 deletion Package.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name=Library Organizer
Author=Stonepaw
Version=1.6
Version=1.7
Description=A file and folder organizer with GUI that helps build you file and folder paths.
Image=lopackagelogo.png
KeepFiles= losettingsx.dat
34 changes: 15 additions & 19 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
Bug fix:
Unicode characters in comic file will no longer error
Folder rules are now saved
Progress bar will now correctly update

Change:
Cancel button in Progress bar and tag selection forms
Text should now reflect what mode you are using
All text will now reflect when mode you are using

New Features:
Path to long exception is now caught and gives you the option to shorten it
Better duplicate form

Add age rating, file name fileformat, filepath and scan information to exclude rules options
Added Age Rating and scan information tags

Option to automaticly insert any of Characters, Genre, Scan Information, Tags, Teams or Writers without asking when there is only one value
Option to automaticly use the selected tags, characters etc when an issue in the operation has them
Changes:
Scan Information in duplicate display
Changed how mulitvalue fields are calculated and asked for. It should work better now.
Renamed Directory to Folder through out the UI

Bugfix:
Fix for unicode characters in move mode (saving undo.dat file)
Fixed path too long checking
Fixed startyear calculation (I think)

New:
Illegal Character replacements are now user defineable
Month text is now user definable
Added language field
Added import and export for profiles
41 changes: 14 additions & 27 deletions libraryorganizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
The main script file. Some code is this file is based off of wadegiles's Guided eComic file renaming script. Credit is very much due to him
Version 1.6:
Added configscript hook script
Version 1.7
Author: Stonepaw
Expand Down Expand Up @@ -57,14 +55,9 @@ def LibraryOrganizer(books):
print "Creating config form"
config = ConfigForm(books, settings, lastused)
result = config.ShowDialog()
if result == DialogResult.Cancel:
#Dont save settings and quit the script
return
else:

if result != DialogResult.Cancel:
config.SaveSettings()
lastused = config._cmbProfiles.SelectedItem
#Now save the settings
SaveSettings(settings, lastused)
#Create a worker form
#Note that all the moving files code is in the background worker of the worker
#form, It would be better it this could be done elsewhere but I don't have a
Expand All @@ -73,6 +66,8 @@ def LibraryOrganizer(books):
workerForm = WorkerForm(books, settings[lastused])
workerForm.ShowDialog()
workerForm.Dispose()
lastused = config._cmbProfiles.SelectedItem
SaveSettings(settings, lastused)

except Exception, ex:
print "The following error occured"
Expand Down Expand Up @@ -127,14 +122,11 @@ def ConfigureLibraryOrganizer(books):
settings, lastused = LoadSettings()
config = ConfigForm(books, settings, lastused)
result = config.ShowDialog()
if result == DialogResult.Cancel:
#Dont save settings and quit the script
return
else:
if result != DialogResult.Cancel:
config.SaveSettings()
lastused = config._cmbProfiles.SelectedItem
#Now save the settings
SaveSettings(settings, lastused)
lastused = config._cmbProfiles.SelectedItem
#Now save the settings
SaveSettings(settings, lastused)
except Exception, ex:
print "The Following error occured"
print Exception
Expand Down Expand Up @@ -169,15 +161,6 @@ def LibraryOrganizerUndo(books):
def LoadSettings():
settings = {}
lastused = ""
#Clean up old settings
if File.Exists(OLDSETTINGSFILE):
f = open(OLDSETTINGSFILE, 'r')
settings["Default"] = cPickle.load(f)
f.close()
lastused = "Default"
settings["Default"].Update()
File.Delete(OLDSETTINGSFILE)
return settings, lastused

if File.Exists(SETTINGSFILE):
try:
Expand All @@ -189,7 +172,11 @@ def LoadSettings():
for i in nodes:
settings[i.Attributes["Name"].Value] = losettings.settings()
settings[i.Attributes["Name"].Value].Name = i.Attributes["Name"].Value
settings[i.Attributes["Name"].Value].Load(i)
r = settings[i.Attributes["Name"].Value].Load(i)
if r == False:
print "An error occured loading a profile. That profile has been deleted"
del(settings[i.Attributes["Name"].Value])

lu = xml.SelectSingleNode("Settings")
if lu.Attributes.Count > 0:
lastused = lu.Attributes["LastUsed"].Value
Expand Down
Loading

0 comments on commit 9958824

Please sign in to comment.