diff --git a/src/net/java/sip/communicator/impl/gui/main/call/RecordButton.java b/src/net/java/sip/communicator/impl/gui/main/call/RecordButton.java index d83b769ae..5544dd13a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/RecordButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/RecordButton.java @@ -69,7 +69,7 @@ public class RecordButton /** * Maximum allowed file name length. */ - private static final int MAX_FILENAME_LENGTH = 64; + private static final int MAX_FILENAME_LENGTH = 255; /** * The full filename of the saved call on the file system. @@ -125,6 +125,12 @@ public RecordButton(Call call, boolean selected) if ((saveDir != null) && (saveDir.length() != 0)) toolTip += " (" + saveDir + ")"; setToolTipText(toolTip); + + if(configuration.getString( + "net.java.sip.communicator.impl.neomedia.AUTORECORD", "false"). + equals("true")) { + this.doClick(); + } } /** @@ -244,12 +250,13 @@ private String getCallPeerName(int maxLength) List callPeers = call.getConference().getCallPeers(); CallPeer callPeer = null; String peerName = ""; + if (!callPeers.isEmpty()) { callPeer = callPeers.get(0); if (callPeer != null) { - peerName = callPeer.getDisplayName(); + peerName = "" + callPeer.getAddress() + "-" + callPeer.getDisplayName(); peerName = peerName.replaceAll("[^\\da-zA-Z\\_\\-@\\.]",""); if(peerName.length() > maxLength) { diff --git a/src/net/java/sip/communicator/impl/neomedia/CallRecordingConfigForm.java b/src/net/java/sip/communicator/impl/neomedia/CallRecordingConfigForm.java index bb34246a9..412e94359 100644 --- a/src/net/java/sip/communicator/impl/neomedia/CallRecordingConfigForm.java +++ b/src/net/java/sip/communicator/impl/neomedia/CallRecordingConfigForm.java @@ -74,6 +74,7 @@ public class CallRecordingConfigForm private final SipCommFileChooser dirChooser; private JComboBox formatsComboBox; private JCheckBox saveCallsToCheckBox; + private JCheckBox autoRecordCheckBox; /** * Directory where calls are stored. Default is SC_HOME/calls. */ @@ -109,6 +110,16 @@ public CallRecordingConfigForm() public void actionPerformed(ActionEvent e) { Object source = e.getSource(); + if (source == autoRecordCheckBox) { + boolean selected = autoRecordCheckBox.isSelected(); + + NeomediaActivator + .getConfigurationService() + .setProperty( + "net.java.sip.communicator.impl.neomedia.AUTORECORD", + selected); + + } if (source == saveCallsToCheckBox) { boolean selected = saveCallsToCheckBox.isSelected(); @@ -239,6 +250,14 @@ private void initComponents() labelsPanel.add(formatsLabel); labelsPanel.add(saveCallsToCheckBox); + JPanel autoRecordPanel = new TransparentPanel(new GridLayout(1, 1)); + + autoRecordCheckBox + = new SIPCommCheckBox("Enble Autorecording"); + autoRecordCheckBox.addActionListener(this); + + autoRecordPanel.add(autoRecordCheckBox); + // saved calls directory panel JPanel callDirPanel = new TransparentPanel(new BorderLayout()); @@ -266,6 +285,7 @@ private void initComponents() mainPanel.add(labelsPanel, BorderLayout.WEST); mainPanel.add(valuesPanel, BorderLayout.CENTER); + mainPanel.add(autoRecordPanel, BorderLayout.PAGE_END); this.add(mainPanel, BorderLayout.NORTH); } @@ -293,6 +313,9 @@ private void loadValues() = NeomediaActivator.getConfigurationService(); String format = configuration.getString(Recorder.FORMAT); + boolean autoRecord = + configuration.getString("net.java.sip.communicator.impl.neomedia.AUTORECORD", "false").equals("true"); + formatsComboBox.setSelectedItem( (format == null) ? SoundFileUtils.DEFAULT_CALL_RECORDING_FORMAT @@ -304,6 +327,7 @@ private void loadValues() callDirTextField.setEnabled(saveCallsToCheckBox.isSelected()); callDirTextField.getDocument().addDocumentListener(this); callDirChooseButton.setEnabled(saveCallsToCheckBox.isSelected()); + autoRecordCheckBox.setSelected(autoRecord); } /**