Skip to content

Commit

Permalink
Fixes #330
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyLB committed Aug 26, 2019
1 parent cb78db7 commit 0c0b6a4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
19 changes: 16 additions & 3 deletions piwigo/Albums/Image/Image Move/MoveImageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -396,31 +396,41 @@ -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSI
// Category contains selected image?
if ([self.selectedImage.categoryIds containsObject:@(categoryData.albumId)])
{
cell.userInteractionEnabled = NO;
cell.categoryLabel.textColor = [UIColor piwigoRightLabelColor];
cell.userInteractionEnabled = NO;
}

// Switch between Open/Close cell disclosure
cell.categoryDelegate = self;
if([self.categoriesThatShowSubCategories containsObject:@(categoryData.albumId)]) {
cell.upDownImage.image = [UIImage imageNamed:@"cellClose"];
cell.userInteractionEnabled = YES;
} else {
cell.upDownImage.image = [UIImage imageNamed:@"cellOpen"];
cell.userInteractionEnabled = YES;
}

cell.isAccessibilityElement = YES;
return cell;
}

- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath
{
PiwigoAlbumData *categoryData = [self.categories objectAtIndex:indexPath.row];
if ([self.selectedImage.categoryIds containsObject:@(categoryData.albumId)])
return NO;

return YES;
}


#pragma mark - UITableViewDelegate Methods

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];

PiwigoAlbumData *categoryData;
categoryData = [self.categories objectAtIndex:indexPath.row];
PiwigoAlbumData *categoryData = [self.categories objectAtIndex:indexPath.row];

// User cannot move/copy image at current place
if ([self.selectedImage.categoryIds containsObject:@(categoryData.albumId)]) return;
Expand Down Expand Up @@ -540,6 +550,9 @@ -(void)addImageToCategoryId:(NSInteger)categoryId
[[[CategoriesData sharedInstance] getCategoryById:self.categoryIdOfSelectedImages] deincrementImageSizeByOne];
}

// Notify album/image view of modification
[[NSNotificationCenter defaultCenter] postNotificationName:kPiwigoNotificationCategoryDataUpdated object:nil];

// When called from image preview, return to image or album
if (self.selectedImages.count <= 0) {
// Hide HUD
Expand Down
1 change: 0 additions & 1 deletion piwigo/Data Cache/Categories Data/CategoriesData.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

FOUNDATION_EXPORT NSString * const kPiwigoNotificationGetCategoryData;
FOUNDATION_EXPORT NSString * const kPiwigoNotificationCategoryDataUpdated;
FOUNDATION_EXPORT NSString * const kPiwigoNotificationCategoryImageUpdated;
FOUNDATION_EXPORT NSString * const kPiwigoNotificationChangedCurrentCategory;

@interface CategoriesData : NSObject
Expand Down
1 change: 0 additions & 1 deletion piwigo/Data Cache/Categories Data/CategoriesData.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

NSString * const kPiwigoNotificationGetCategoryData = @"kPiwigoNotificationGetCategoryData";
NSString * const kPiwigoNotificationCategoryDataUpdated = @"kPiwigoNotificationCategoryDataUpdated";
NSString * const kPiwigoNotificationCategoryImageUpdated = @"kPiwigoNotificationCategoryImageUpdated";
NSString * const kPiwigoNotificationChangedCurrentCategory = @"kPiwigoNotificationChangedCurrentCategory";

@interface CategoriesData()
Expand Down
2 changes: 1 addition & 1 deletion piwigo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>213</string>
<string>214</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down

0 comments on commit 0c0b6a4

Please sign in to comment.