mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 17:17:29 -05:00
Interim checkin for call recording.
This commit is contained in:
19
src/alias/record/NonRecordable.java
Normal file
19
src/alias/record/NonRecordable.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package alias.record;
|
||||
|
||||
import alias.AliasID;
|
||||
import alias.AliasIDType;
|
||||
|
||||
public class NonRecordable extends AliasID
|
||||
{
|
||||
@Override
|
||||
public AliasIDType getType()
|
||||
{
|
||||
return AliasIDType.NonRecordable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches( AliasID id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
75
src/alias/record/NonRecordableEditor.java
Normal file
75
src/alias/record/NonRecordableEditor.java
Normal file
@@ -0,0 +1,75 @@
|
||||
/*******************************************************************************
|
||||
* SDR Trunk
|
||||
* Copyright (C) 2014 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package alias.record;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextArea;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
public class NonRecordableEditor extends JPanel implements ActionListener
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private NonRecordableNode mNode;
|
||||
|
||||
public NonRecordableEditor( NonRecordableNode node )
|
||||
{
|
||||
mNode = node;
|
||||
initGUI();
|
||||
}
|
||||
|
||||
private void initGUI()
|
||||
{
|
||||
setLayout( new MigLayout( "fill", "[left]", "[grow]" ) );
|
||||
|
||||
JTextArea description = new JTextArea( "Non-Recordable. Any audio where"
|
||||
+ "this alias is a participant in the call will not be recorded." );
|
||||
|
||||
description.setLineWrap( true );
|
||||
description.setBackground( getBackground() );
|
||||
|
||||
add( description, "growx,span" );
|
||||
|
||||
JButton btnSave = new JButton( "Save" );
|
||||
btnSave.addActionListener( NonRecordableEditor.this );
|
||||
add( btnSave, "growx,push" );
|
||||
|
||||
JButton btnReset = new JButton( "Reset" );
|
||||
btnReset.addActionListener( NonRecordableEditor.this );
|
||||
add( btnReset, "growx,push" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent e )
|
||||
{
|
||||
String command = e.getActionCommand();
|
||||
|
||||
if( command.contentEquals( "Save" ) )
|
||||
{
|
||||
mNode.save();
|
||||
mNode.show();
|
||||
}
|
||||
|
||||
mNode.refresh();
|
||||
}
|
||||
}
|
||||
88
src/alias/record/NonRecordableNode.java
Normal file
88
src/alias/record/NonRecordableNode.java
Normal file
@@ -0,0 +1,88 @@
|
||||
/*******************************************************************************
|
||||
* SDR Trunk
|
||||
* Copyright (C) 2014 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package alias.record;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
|
||||
import alias.AliasID;
|
||||
import alias.AliasIDNode;
|
||||
import alias.AliasNode;
|
||||
|
||||
public class NonRecordableNode extends AliasIDNode
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public NonRecordableNode( NonRecordable id )
|
||||
{
|
||||
super( id );
|
||||
}
|
||||
|
||||
@Override
|
||||
public JPanel getEditor()
|
||||
{
|
||||
return new NonRecordableEditor( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIconPath()
|
||||
{
|
||||
return "images/non_recordable.png";
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "Non-Recordable";
|
||||
}
|
||||
|
||||
public JPopupMenu getContextMenu()
|
||||
{
|
||||
JPopupMenu retVal = new JPopupMenu();
|
||||
|
||||
JMenuItem addSystemItem = new JMenuItem( "Delete" );
|
||||
addSystemItem.addActionListener( new ActionListener()
|
||||
{
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent e )
|
||||
{
|
||||
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
|
||||
"Are you sure you want to permanently delete this node?" );
|
||||
|
||||
if( n == JOptionPane.YES_OPTION )
|
||||
{
|
||||
AliasNode parent = (AliasNode)getParent();
|
||||
|
||||
parent.getAlias().removeAliasID( (AliasID)getUserObject() );
|
||||
|
||||
save();
|
||||
|
||||
getModel().removeNodeFromParent( NonRecordableNode.this );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
retVal.add( addSystemItem );
|
||||
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user