Skip to content

Commit

Permalink
JPQ: Don't add old button anymore #24
Browse files Browse the repository at this point in the history
  • Loading branch information
guruz committed Apr 21, 2020
1 parent 365628a commit 1b354ed
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions quassel-for-ios/quassel-for-ios/vcs/BufferViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ @implementation BufferViewController
@synthesize rewindButton;
@synthesize forwardButton;

@synthesize jpqButton;
@synthesize jpqButton; // Not used anymore, can re-use for something else

@synthesize actionSheet;
@synthesize messageClipboardString;
Expand Down Expand Up @@ -122,7 +122,7 @@ - (void)viewDidLoad

jpqButton = [[UIBarButtonItem alloc] initWithTitle:@"J/P/Q" style:UIBarButtonItemStylePlain target:self action:@selector(jpqPressed)];
jpqButton.style = UIBarButtonItemStyleBordered;

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:)
name:UIKeyboardWillShowNotification object:nil];

Expand Down Expand Up @@ -302,7 +302,8 @@ - (void) viewWillAppear:(BOOL)animated
} else {
}

self.toolbarItems = [NSArray arrayWithObjects:jpqButton,[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],rewindButton,forwardButton,nil];
// jpqButton not being added anymore, can re-use for something else
self.toolbarItems = [NSArray arrayWithObjects:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],rewindButton,forwardButton,nil];

}

Expand All @@ -325,9 +326,6 @@ - (void) viewDidAppear:(BOOL)animated
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
}

BOOL jpqShown = [[AppDelegate instance] isJpqShown:bufferId];
if (jpqShown) jpqButton.tintColor = [UIColor systemPurpleColor]; else jpqButton.tintColor = [UIColor systemGrayColor];
}

- (void) setCurrentBufferId:(BufferId*)bI
Expand All @@ -346,10 +344,6 @@ - (void) setCurrentBufferId:(BufferId*)bI
self.bufferType = [[quasselCoreConnection.bufferIdBufferInfoMap objectForKey:bI] bufferType];
self.messages = [quasselCoreConnection.bufferIdMessageListMap objectForKey:bI];

// Note: Sometimes no jpqButton yet, then it's dine in viewDidAppear
BOOL jpqShown = [[AppDelegate instance] isJpqShown:bufferId];
if (jpqShown) jpqButton.tintColor = [UIColor systemPurpleColor]; else jpqButton.tintColor = [UIColor systemGrayColor];

[self.tableView reloadData];

// Scroll down
Expand Down Expand Up @@ -707,8 +701,6 @@ - (void) jpqPressed
// FIXME: Try to remember where we were and then scroll back there?

[self.tableView flashScrollIndicators];

if (jpqShown) jpqButton.tintColor = [UIColor systemPurpleColor]; else jpqButton.tintColor = [UIColor systemGrayColor];
}

- (void) disconnectPressed
Expand Down

0 comments on commit 1b354ed

Please sign in to comment.