mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
wip: adds call priority and non-recordable editors to the alias
multi-select editor. Changes example hyperlink to 'Help'. Ensures editor only allows 1 instance of call priority or non-recordable can be added to any alias.
This commit is contained in:
@@ -135,9 +135,35 @@ public class AliasIdentifierEditor extends Editor<Alias>
|
||||
menu.add( new AddAliasIdentifierItem( AliasIDType.Site ) );
|
||||
menu.add( new AddAliasIdentifierItem( AliasIDType.Status ) );
|
||||
menu.add( new AddAliasIdentifierItem( AliasIDType.Talkgroup ) );
|
||||
menu.addSeparator();
|
||||
menu.add( new AddAliasIdentifierItem( AliasIDType.Priority ) );
|
||||
menu.add( new AddAliasIdentifierItem( AliasIDType.NonRecordable ) );
|
||||
|
||||
boolean separatorAdded = false;
|
||||
|
||||
if( hasItem() )
|
||||
{
|
||||
Alias alias = getItem();
|
||||
|
||||
if( !alias.hasCallPriority() )
|
||||
{
|
||||
if( !separatorAdded )
|
||||
{
|
||||
menu.addSeparator();
|
||||
separatorAdded = true;
|
||||
}
|
||||
|
||||
menu.add( new AddAliasIdentifierItem( AliasIDType.Priority ) );
|
||||
}
|
||||
|
||||
if( alias.isRecordable() )
|
||||
{
|
||||
if( !separatorAdded )
|
||||
{
|
||||
menu.addSeparator();
|
||||
separatorAdded = true;
|
||||
}
|
||||
|
||||
menu.add( new AddAliasIdentifierItem( AliasIDType.NonRecordable ) );
|
||||
}
|
||||
}
|
||||
|
||||
menu.show( e.getComponent(), e.getX(), e.getY() );
|
||||
}
|
||||
@@ -238,9 +264,14 @@ public class AliasIdentifierEditor extends Editor<Alias>
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
if( mEditorContainer.isModified() )
|
||||
if( isModified() || mEditorContainer.isModified() )
|
||||
{
|
||||
mEditorContainer.save();
|
||||
if( mEditorContainer.isModified() )
|
||||
{
|
||||
mEditorContainer.save();
|
||||
}
|
||||
|
||||
setModified( false );
|
||||
|
||||
if( hasItem() )
|
||||
{
|
||||
@@ -326,6 +357,8 @@ public class AliasIdentifierEditor extends Editor<Alias>
|
||||
setItem( alias );
|
||||
|
||||
mAliasIDList.setSelectedValue( id, true );
|
||||
|
||||
AliasIdentifierEditor.this.setModified( true );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user