ChangeScreen2: Show number of related changes in the tab title
If the number of related changes is shown in the tab title a user can immediately see that there are related changes even if another tab is currently selected. Change-Id: I8aa4ce6fea89fb4e05fbd4053f97095c06e96dcf Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
		
				
					committed by
					
						
						Edwin Kempin
					
				
			
			
				
	
			
			
			
						parent
						
							292593145e
						
					
				
				
					commit
					3bf14bf539
				
			@@ -27,5 +27,6 @@ interface Constants extends com.google.gwt.i18n.client.Constants {
 | 
			
		||||
  String draft();
 | 
			
		||||
  String draftCommentsTooltip();
 | 
			
		||||
 | 
			
		||||
  String notAvailable();
 | 
			
		||||
  String relatedChangesTooltip();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -10,4 +10,5 @@ author = Author / Committer
 | 
			
		||||
draft = (DRAFT)
 | 
			
		||||
draftCommentsTooltip = Draft comment(s) inside
 | 
			
		||||
 | 
			
		||||
notAvailable = N/A
 | 
			
		||||
relatedChangesTooltip = Same branch changes connected by Git history
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,20 @@
 | 
			
		||||
// Copyright (C) 2013 The Android Open Source Project
 | 
			
		||||
//
 | 
			
		||||
// Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
// you may not use this file except in compliance with the License.
 | 
			
		||||
// You may obtain a copy of the License at
 | 
			
		||||
//
 | 
			
		||||
// http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
//
 | 
			
		||||
// Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
// distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
// See the License for the specific language governing permissions and
 | 
			
		||||
// limitations under the License.
 | 
			
		||||
 | 
			
		||||
package com.google.gerrit.client.change;
 | 
			
		||||
 | 
			
		||||
public interface Messages extends com.google.gwt.i18n.client.Messages {
 | 
			
		||||
  String relatedChanges(int count);
 | 
			
		||||
  String relatedChanges(String count);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
relatedChanges = Related Changes ({0})
 | 
			
		||||
@@ -127,11 +127,14 @@ class RelatedChanges extends Composite {
 | 
			
		||||
      .get(new AsyncCallback<RelatedInfo>() {
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onSuccess(RelatedInfo result) {
 | 
			
		||||
          tabPanel.getTabBar().setTabText(0, Resources.M.relatedChanges(result.changes().length()));
 | 
			
		||||
          render(revision, result.changes());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onFailure(Throwable err) {
 | 
			
		||||
          tabPanel.getTabBar().setTabText(0,
 | 
			
		||||
              Resources.M.relatedChanges(Resources.C.notAvailable()));
 | 
			
		||||
          progress.setVisible(false);
 | 
			
		||||
          scroll.setVisible(false);
 | 
			
		||||
          UIObject.setVisible(error, true);
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ import com.google.gwt.resources.client.ImageResource;
 | 
			
		||||
public interface Resources extends ClientBundle {
 | 
			
		||||
  public static final Resources I = GWT.create(Resources.class);
 | 
			
		||||
  static final Constants C = GWT.create(Constants.class);
 | 
			
		||||
  static final Messages M = GWT.create(Messages.class);
 | 
			
		||||
 | 
			
		||||
  @Source("star_open.png") ImageResource star_open();
 | 
			
		||||
  @Source("star_filled.png") ImageResource star_filled();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user