mirror of https://github.com/sipwise/jitsi.git
Improved the text of Exception messages in OpSetBasicTelephonySipImpl Cosmetic fixes in the media package Reduced default logging levelcusax-fix
parent
d17710826a
commit
4b27759c9f
@ -1,200 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.plugin.statusupdate;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import net.java.sip.communicator.service.configuration.*;
|
||||
|
||||
/**
|
||||
* The configuration Dialog for the Mail Notification Plugin
|
||||
*
|
||||
* @author Thomas Hofer
|
||||
*
|
||||
*/
|
||||
public class ConfigurationDialog extends JDialog
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3850044618335728627L;
|
||||
|
||||
private JCheckBox enable;
|
||||
private JSpinner timer;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public ConfigurationDialog()
|
||||
{
|
||||
super();
|
||||
init();
|
||||
initValues();
|
||||
|
||||
getContentPane().setPreferredSize(new Dimension(400, 200));
|
||||
getContentPane().setLayout(new GridLayout(1, 1));
|
||||
|
||||
// move window to middle of screen
|
||||
setLocationRelativeTo(null);
|
||||
|
||||
// Set title
|
||||
setTitle(Resources.getString("menuEntry"));
|
||||
|
||||
// Set closing system
|
||||
addWindowListener(new WindowAdapter()
|
||||
{
|
||||
public void windowClosing(WindowEvent e)
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the ui-components
|
||||
*/
|
||||
private void init()
|
||||
{
|
||||
// Main panel
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setLayout(new GridBagLayout());
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||
|
||||
// Description
|
||||
JTextArea infoLabel = new JTextArea(Resources.getString("infotext"));
|
||||
infoLabel.setBorder(BorderFactory.createTitledBorder(Resources
|
||||
.getString("info")));
|
||||
infoLabel.setEditable(false);
|
||||
infoLabel.setWrapStyleWord(true);
|
||||
infoLabel.setLineWrap(true);
|
||||
|
||||
// Checkbox
|
||||
enable = new JCheckBox(Resources.getString("enable"));
|
||||
enable.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
timer.setEnabled(enable.isSelected());
|
||||
}
|
||||
});
|
||||
|
||||
// Spinner
|
||||
timer = new JSpinner(new SpinnerNumberModel(15, 1, 180, 1));
|
||||
|
||||
// Button panel : OK and Cancel button
|
||||
JPanel okCancelPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
|
||||
JButton ok = new JButton(Resources.getString("ok"));
|
||||
ok.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
saveData();
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
JButton cancel = new JButton(Resources.getString("cancel"));
|
||||
cancel.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
|
||||
okCancelPanel.add(ok);
|
||||
okCancelPanel.add(cancel);
|
||||
|
||||
GridBagConstraints mainGBC = new GridBagConstraints();
|
||||
mainGBC.gridx = 0;
|
||||
mainGBC.gridy = 0;
|
||||
mainGBC.weightx = 1;
|
||||
mainGBC.fill = GridBagConstraints.BOTH;
|
||||
mainGBC.anchor = GridBagConstraints.NORTHWEST;
|
||||
mainGBC.weighty = 1;
|
||||
mainGBC.gridwidth = 3;
|
||||
|
||||
mainPanel.add(infoLabel, mainGBC);
|
||||
|
||||
mainGBC.fill = GridBagConstraints.HORIZONTAL;
|
||||
mainGBC.gridwidth = 1;
|
||||
mainGBC.gridy++;
|
||||
mainGBC.weightx = 1;
|
||||
mainGBC.weighty = 0;
|
||||
mainGBC.gridx = 0;
|
||||
mainPanel.add(enable, mainGBC);
|
||||
|
||||
mainGBC.weightx = 0;
|
||||
mainGBC.gridx++;
|
||||
mainPanel.add(timer, mainGBC);
|
||||
mainGBC.weightx = 1;
|
||||
mainGBC.gridx++;
|
||||
mainPanel.add(new JLabel(Resources.getString("minutes")), mainGBC);
|
||||
|
||||
mainGBC.gridwidth = 3;
|
||||
mainGBC.gridx = 0;
|
||||
mainGBC.gridy++;
|
||||
mainGBC.weighty = 0;
|
||||
mainPanel.add(okCancelPanel, mainGBC);
|
||||
|
||||
this.getContentPane().add(mainPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* (Re-)Initializes the values of the settings dependent on the selected
|
||||
* account
|
||||
*/
|
||||
private void initValues()
|
||||
{
|
||||
ConfigurationService configService = StatusUpdateActivator
|
||||
.getConfigService();
|
||||
|
||||
String e = (String) configService.getProperty(Preferences.ENABLE);
|
||||
if (e != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
enable.setSelected(Boolean.parseBoolean(e));
|
||||
timer.setEnabled(Boolean.parseBoolean(e));
|
||||
} catch (NumberFormatException ex)
|
||||
{
|
||||
enable.setSelected(false);
|
||||
timer.setEnabled(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
enable.setSelected(false);
|
||||
timer.setEnabled(false);
|
||||
}
|
||||
|
||||
String t = (String) configService.getString(Preferences.TIMER);
|
||||
if (t != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
timer.setValue(Integer.parseInt(t));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveData()
|
||||
{
|
||||
ConfigurationService configService = StatusUpdateActivator
|
||||
.getConfigService();
|
||||
|
||||
configService.setProperty(Preferences.ENABLE, Boolean
|
||||
.toString(enable.isSelected()));
|
||||
Integer interval = (Integer) timer.getValue();
|
||||
configService.setProperty(Preferences.TIMER, interval);
|
||||
}
|
||||
}
|
||||
@ -1,68 +0,0 @@
|
||||
package net.java.sip.communicator.plugin.statusupdate;
|
||||
|
||||
import java.awt.Dialog.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
import net.java.sip.communicator.service.contactlist.*;
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
|
||||
public class SettingsWindowMenuEntry implements PluginComponent
|
||||
{
|
||||
|
||||
private JMenuItem settingsMenuEntry = new JMenuItem(Resources
|
||||
.getString("menuEntry"));
|
||||
|
||||
private Container container;
|
||||
|
||||
public SettingsWindowMenuEntry(Container container)
|
||||
{
|
||||
settingsMenuEntry.addActionListener(new ActionListener()
|
||||
{
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
ConfigurationDialog dialog = new ConfigurationDialog();
|
||||
dialog.pack();
|
||||
dialog.setModal(true);
|
||||
dialog.setVisible(true);
|
||||
|
||||
StatusUpdateActivator.startThread();
|
||||
}
|
||||
});
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
public Object getComponent()
|
||||
{
|
||||
return settingsMenuEntry;
|
||||
}
|
||||
|
||||
public String getConstraints()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public Container getContainer()
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return Resources.getString("aboutMenuEntry");
|
||||
}
|
||||
|
||||
public void setCurrentContact(MetaContact metaContact)
|
||||
{
|
||||
}
|
||||
|
||||
public void setCurrentContactGroup(MetaContactGroup metaGroup)
|
||||
{
|
||||
}
|
||||
|
||||
public int getPositionIndex()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,189 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.plugin.statusupdate;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.*;
|
||||
|
||||
import net.java.sip.communicator.service.configuration.*;
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
|
||||
/**
|
||||
* The <tt>ConfigurationForm</tt> that would be added in the user interface
|
||||
* configuration window.
|
||||
*
|
||||
* @author ROTH Damien
|
||||
*/
|
||||
public class StatusConfigForm
|
||||
extends JPanel
|
||||
implements ConfigurationForm
|
||||
{
|
||||
private JPanel mainPanel;
|
||||
|
||||
private JCheckBox enable;
|
||||
|
||||
private JSpinner timer;
|
||||
|
||||
/**
|
||||
* Create an instance of <tt>StatusConfigForm</tt>
|
||||
*/
|
||||
public StatusConfigForm()
|
||||
{
|
||||
super(new BorderLayout(10, 10));
|
||||
|
||||
mainPanel = new JPanel();
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
|
||||
init();
|
||||
initValues();
|
||||
|
||||
this.add(mainPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init the widgets
|
||||
*/
|
||||
private void init()
|
||||
{
|
||||
JPanel autoStatusPanel = new JPanel(new BorderLayout());
|
||||
|
||||
// Title : automatic status
|
||||
JLabel autoStatusLabel = new JLabel(Resources.getString("automaticStatus"));
|
||||
|
||||
|
||||
Font bold = autoStatusLabel.getFont().deriveFont(Font.BOLD);
|
||||
autoStatusLabel.setFont(bold);
|
||||
|
||||
JPanel fieldsPanel = new JPanel(new BorderLayout(5, 5));
|
||||
fieldsPanel.setBorder(BorderFactory.createEmptyBorder(10,30,0,0));
|
||||
|
||||
enable = new JCheckBox(Resources.getString("enableChangeStatus"));
|
||||
fieldsPanel.add(enable, BorderLayout.NORTH);
|
||||
enable.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
timer.setEnabled(enable.isSelected());
|
||||
saveData();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
JPanel timerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
|
||||
// Texte
|
||||
timerPanel.add(new JLabel(Resources.getString("awayMinutes")));
|
||||
// Spinner
|
||||
timer = new JSpinner(new SpinnerNumberModel(15, 1, 180, 1));
|
||||
timerPanel.add(timer);
|
||||
timer.addChangeListener(new ChangeListener()
|
||||
{
|
||||
public void stateChanged(ChangeEvent e)
|
||||
{
|
||||
saveData();
|
||||
}
|
||||
});
|
||||
|
||||
fieldsPanel.add(timerPanel, BorderLayout.WEST);
|
||||
autoStatusPanel.add(autoStatusLabel, BorderLayout.NORTH);
|
||||
autoStatusPanel.add(fieldsPanel, BorderLayout.CENTER);
|
||||
|
||||
mainPanel.add(autoStatusPanel, BorderLayout.NORTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init the values of the widgets
|
||||
*/
|
||||
private void initValues()
|
||||
{
|
||||
ConfigurationService configService = StatusUpdateActivator
|
||||
.getConfigService();
|
||||
|
||||
String e = (String) configService.getProperty(Preferences.ENABLE);
|
||||
if (e != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.enable.setSelected(Boolean.parseBoolean(e));
|
||||
this.timer.setEnabled(Boolean.parseBoolean(e));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
this.enable.setSelected(false);
|
||||
this.timer.setEnabled(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.enable.setSelected(false);
|
||||
this.timer.setEnabled(false);
|
||||
}
|
||||
|
||||
String t = (String) configService.getString(Preferences.TIMER);
|
||||
if (t != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.timer.setValue(Integer.parseInt(t));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save data in the configuration file
|
||||
*/
|
||||
private void saveData()
|
||||
{
|
||||
ConfigurationService configService = StatusUpdateActivator
|
||||
.getConfigService();
|
||||
|
||||
configService.setProperty(Preferences.ENABLE, Boolean
|
||||
.toString(enable.isSelected()));
|
||||
Integer interval = (Integer) timer.getValue();
|
||||
configService.setProperty(Preferences.TIMER, interval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getForm()</tt> method. Returns the
|
||||
* component corresponding to this configuration form.
|
||||
*/
|
||||
public Object getForm()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getIcon()</tt> method. Returns the
|
||||
* icon of this configuration form.
|
||||
*/
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getIndex()</tt> method.
|
||||
*/
|
||||
public int getIndex()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getIcon()</tt> method. Returns the
|
||||
* icon of this configuration form.
|
||||
*/
|
||||
public String getTitle()
|
||||
{
|
||||
return Resources.getString("automaticStatus");
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue