Skip to content

Commit

Permalink
Fix missing menu item on right click of tab that has yet to be visible
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxPaper committed Oct 9, 2023
1 parent c951e2f commit 0525d8d
Showing 1 changed file with 35 additions and 17 deletions.
52 changes: 35 additions & 17 deletions uis/src/com/biglybt/ui/swt/views/DownloadActivityView.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
import com.biglybt.core.util.average.AverageFactory;
import com.biglybt.core.util.average.MovingImmediateAverage;
import com.biglybt.ui.common.ToolBarItem;
import com.biglybt.ui.common.viewtitleinfo.ViewTitleInfo2;
import com.biglybt.ui.mdi.MdiEntry;
import com.biglybt.ui.mdi.MultipleDocumentInterface;
import com.biglybt.ui.selectedcontent.SelectedContent;
import com.biglybt.ui.selectedcontent.SelectedContentManager;
import com.biglybt.ui.swt.Messages;
Expand All @@ -65,7 +67,8 @@
*/
public class
DownloadActivityView
implements UISWTViewCoreEventListener, UIPluginViewToolBarListener, MdiSWTMenuHackListener, ParameterListener
implements UISWTViewCoreEventListener, UIPluginViewToolBarListener,
MdiSWTMenuHackListener, ParameterListener, ViewTitleInfo2
{
public static final String MSGID_PREFIX = "DownloadActivityView";

Expand Down Expand Up @@ -103,6 +106,11 @@
return( MessageText.getString(MSGID_PREFIX + ".title.full" ));
}

@Override
public Object getTitleInfoProperty(int propertyID) {
return null;
}

public void
initialize(
Composite parent )
Expand Down Expand Up @@ -741,22 +749,30 @@
private void
create()
{
swtView.setTitle(getFullTitle());

swtView.setToolBarListener(this);

COConfigurationManager.addParameterListener( "DownloadActivity.show.eta", this );

show_time = COConfigurationManager.getBooleanParameter( "DownloadActivity.show.eta" );

}

private void setSwtView(UISWTView swtView) {
if (this.swtView == swtView) {
return;
}
this.swtView = swtView;

swtView.setTitle(getFullTitle());

swtView.setToolBarListener(this);

if (swtView instanceof TabbedEntry) {

TabbedEntry tabView = (TabbedEntry)swtView;

tabView.addListener( this );

legend_at_bottom = tabView.getMDI().getAllowSubViews();
}

}

private void
Expand All @@ -779,13 +795,6 @@

eta = null;
}

if ( swtView instanceof TabbedEntry ){

TabbedEntry tabView = (TabbedEntry)swtView;

tabView.removeListener( this );
}
}

@Override
Expand All @@ -795,7 +804,8 @@
{
switch( event.getType()){
case UISWTViewEvent.TYPE_CREATE:{
swtView = event.getView();

setSwtView(event.getView());

create();

Expand Down Expand Up @@ -880,6 +890,14 @@
return( true );
}

@Override
public void titleInfoLinked(MultipleDocumentInterface mdi,
MdiEntry mdiEntry) {
if (mdiEntry instanceof UISWTView) {
setSwtView((UISWTView) mdiEntry);
}
}

/* (non-Javadoc)
* @see com.biglybt.pif.ui.toolbar.UIToolBarActivationListener#toolBarItemActivated(ToolBarItem, long, java.lang.Object)
*/
Expand Down

0 comments on commit 0525d8d

Please sign in to comment.