mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-1103 - option to register with room
SPARK-1306 - fixed rendering issue with the "X"-button
reworked user.kicked and user.banned listener
changed locale string:
message.user.kicked.from.room = {0} has been kicked out of the room by {1}. Reason: {2}
-> {0}=username,{1}=adminname,{2}=reason
message.user.banned = {0} has been banned from this room. Reason: {1}
-> {0}=username,{1}=reason
new locale:
message.groupchat.registered.member = Successfully registered with {0}
->{0}=roomname
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12324 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
committed by
wolf.posdorfer
parent
3d8188fbc3
commit
e18803d66d
@ -327,6 +327,7 @@ public class SparkRes {
|
||||
public static final String COLOR_ICON = "COLOR_ICON";
|
||||
public static final String SETTINGS_IMAGE_16x16 = "SETTINGS_IMAGE_16x16";
|
||||
public static final String SETTINGS_IMAGE_24x24 = "SETTINGS_IMAGE_24x24";
|
||||
public static final String PEOPLE_IMAGE = "PEOPLE_IMAGE";
|
||||
|
||||
static ClassLoader cl = SparkRes.class.getClassLoader();
|
||||
|
||||
|
||||
@ -229,6 +229,7 @@ PROFILE_ICON = images/profile.png
|
||||
SEND_FILE_ICON = images/document_into.png
|
||||
ADD_CONTACT_IMAGE = images/add_contact.png
|
||||
JOIN_GROUPCHAT_IMAGE = images/join_groupchat.png
|
||||
PEOPLE_IMAGE = images/people-icon.png
|
||||
DOWN_ARROW_IMAGE = images/down_arrow.gif
|
||||
PRINTER_IMAGE_16x16 = images/printer.png
|
||||
SEND_MAIL_IMAGE_16x16 = images/sendmail.png
|
||||
|
||||
@ -35,6 +35,7 @@ import javax.swing.JScrollPane;
|
||||
* @author Derek DeMoro
|
||||
*/
|
||||
public class CheckBoxList extends JPanel {
|
||||
private static final long serialVersionUID = 4145933151755357313L;
|
||||
private Map<JCheckBox, String> valueMap = new HashMap<JCheckBox, String>();
|
||||
private JPanel internalPanel = new JPanel();
|
||||
|
||||
@ -63,7 +64,7 @@ public class CheckBoxList extends JPanel {
|
||||
*
|
||||
* @return list of selected checkbox values.
|
||||
*/
|
||||
public List getSelectedValues() {
|
||||
public List<String> getSelectedValues() {
|
||||
List<String> list = new ArrayList<String>();
|
||||
for (JCheckBox checkbox : valueMap.keySet()) {
|
||||
if (checkbox.isSelected()) {
|
||||
|
||||
@ -360,119 +360,124 @@ public class SparkTabbedPane extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
private class TabPanel extends JPanel {
|
||||
private static final long serialVersionUID = -8249981130816404360L;
|
||||
private final BorderLayout layout = new BorderLayout(5,5);
|
||||
private final Font defaultFont = new Font("Dialog", Font.PLAIN, 11);
|
||||
private JLabel iconLabel;
|
||||
private JLabel titleLabel;
|
||||
private class TabPanel extends JPanel {
|
||||
private static final long serialVersionUID = -8249981130816404360L;
|
||||
private final BorderLayout layout = new BorderLayout(5, 5);
|
||||
private final Font defaultFontPlain = new Font("Dialog", Font.PLAIN, 11);
|
||||
private final Font defaultFontBold = new Font("Dialog", Font.BOLD, 11);
|
||||
private JLabel iconLabel;
|
||||
private JLabel titleLabel;
|
||||
private JLabel tabCloseButton = new JLabel(closeInactiveButtonIcon);
|
||||
|
||||
public TabPanel(final SparkTab sparktab, String title, Icon icon) {
|
||||
setOpaque(false);
|
||||
this.setLayout(layout);
|
||||
|
||||
titleLabel = new JLabel(title);
|
||||
titleLabel.setFont(defaultFont);
|
||||
if (icon != null)
|
||||
{
|
||||
iconLabel = new JLabel(icon);
|
||||
add(iconLabel, BorderLayout.WEST);
|
||||
public TabPanel(final SparkTab sparktab, String title, Icon icon) {
|
||||
setOpaque(false);
|
||||
this.setLayout(layout);
|
||||
titleLabel = new JLabel(title);
|
||||
|
||||
titleLabel.setFont(closeEnabled ? defaultFontBold
|
||||
: defaultFontPlain);
|
||||
if (icon != null) {
|
||||
iconLabel = new JLabel(icon);
|
||||
add(iconLabel, BorderLayout.WEST);
|
||||
}
|
||||
|
||||
add(titleLabel, BorderLayout.CENTER);
|
||||
if (closeEnabled) {
|
||||
tabCloseButton.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent mouseEvent) {
|
||||
if (Spark.isWindows()) {
|
||||
tabCloseButton.setIcon(closeActiveButtonIcon);
|
||||
}
|
||||
|
||||
add(titleLabel, BorderLayout.CENTER);
|
||||
if (closeEnabled) {
|
||||
final JLabel tabCloseButton = new JLabel(
|
||||
closeInactiveButtonIcon);
|
||||
tabCloseButton.addMouseListener(new MouseAdapter() {
|
||||
public void mouseEntered(MouseEvent mouseEvent) {
|
||||
if (Spark.isWindows()) {
|
||||
tabCloseButton.setIcon(closeActiveButtonIcon);
|
||||
}
|
||||
setCursor(HAND_CURSOR);
|
||||
}
|
||||
setCursor(HAND_CURSOR);
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent mouseEvent) {
|
||||
if (Spark.isWindows()) {
|
||||
tabCloseButton.setIcon(closeInactiveButtonIcon);
|
||||
}
|
||||
setCursor(DEFAULT_CURSOR);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent mouseEvent) {
|
||||
final SwingWorker closeTimerThread = new SwingWorker() {
|
||||
public Object construct() {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
Log.error(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void finished() {
|
||||
close(sparktab);
|
||||
}
|
||||
};
|
||||
closeTimerThread.start();
|
||||
}
|
||||
});
|
||||
add(tabCloseButton, BorderLayout.EAST);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension dim = super.getPreferredSize();
|
||||
if (closeEnabled && titleLabel.getText().length() < 6) {
|
||||
return new Dimension(80, dim.height);
|
||||
|
||||
} else
|
||||
return super.getPreferredSize();
|
||||
|
||||
}
|
||||
|
||||
public Font getDefaultFont() {
|
||||
return defaultFont;
|
||||
}
|
||||
|
||||
public void setIcon(Icon icon) {
|
||||
iconLabel.setIcon(icon);
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
titleLabel.setText(title);
|
||||
}
|
||||
|
||||
public void setTitleColor(Color color) {
|
||||
titleLabel.setForeground(color);
|
||||
titleLabel.validate();
|
||||
titleLabel.repaint();
|
||||
}
|
||||
|
||||
public void setTitleBold(boolean bold) {
|
||||
Font oldFont = titleLabel.getFont();
|
||||
Font newFont;
|
||||
if (bold) {
|
||||
newFont = new Font(oldFont.getFontName(), Font.BOLD, oldFont
|
||||
.getSize());
|
||||
} else {
|
||||
newFont = new Font(oldFont.getFontName(), Font.PLAIN, oldFont
|
||||
.getSize());
|
||||
public void mouseExited(MouseEvent mouseEvent) {
|
||||
if (Spark.isWindows()) {
|
||||
tabCloseButton.setIcon(closeInactiveButtonIcon);
|
||||
}
|
||||
setCursor(DEFAULT_CURSOR);
|
||||
}
|
||||
|
||||
titleLabel.setFont(newFont);
|
||||
titleLabel.validate();
|
||||
titleLabel.repaint();
|
||||
}
|
||||
public void mousePressed(MouseEvent mouseEvent) {
|
||||
final SwingWorker closeTimerThread = new SwingWorker() {
|
||||
public Object construct() {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
Log.error(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setTitleFont(Font font) {
|
||||
titleLabel.setFont(font);
|
||||
titleLabel.validate();
|
||||
titleLabel.repaint();
|
||||
}
|
||||
public void finished() {
|
||||
close(sparktab);
|
||||
}
|
||||
};
|
||||
closeTimerThread.start();
|
||||
}
|
||||
});
|
||||
add(tabCloseButton, BorderLayout.EAST);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension dim = super.getPreferredSize();
|
||||
|
||||
if (closeEnabled && titleLabel.getText().length() < 6
|
||||
&& dim.getWidth() < 80) {
|
||||
return new Dimension(80, dim.height);
|
||||
|
||||
} else {
|
||||
return dim;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Font getDefaultFont() {
|
||||
return defaultFontPlain;
|
||||
}
|
||||
|
||||
public void setIcon(Icon icon) {
|
||||
iconLabel.setIcon(icon);
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
titleLabel.setText(title);
|
||||
}
|
||||
|
||||
public void setTitleColor(Color color) {
|
||||
titleLabel.setForeground(color);
|
||||
titleLabel.validate();
|
||||
titleLabel.repaint();
|
||||
}
|
||||
|
||||
public void setTitleBold(boolean bold) {
|
||||
Font oldFont = titleLabel.getFont();
|
||||
Font newFont;
|
||||
if (bold) {
|
||||
newFont = new Font(oldFont.getFontName(), Font.BOLD,
|
||||
oldFont.getSize());
|
||||
} else {
|
||||
newFont = new Font(oldFont.getFontName(), Font.PLAIN,
|
||||
oldFont.getSize());
|
||||
}
|
||||
|
||||
titleLabel.setFont(newFont);
|
||||
titleLabel.validate();
|
||||
titleLabel.repaint();
|
||||
titleLabel.revalidate();
|
||||
}
|
||||
|
||||
public void setTitleFont(Font font) {
|
||||
titleLabel.setFont(font);
|
||||
titleLabel.validate();
|
||||
titleLabel.repaint();
|
||||
titleLabel.revalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Drag and Drop
|
||||
*/
|
||||
|
||||
@ -853,7 +853,7 @@ public class ConferenceRoomBrowser extends JPanel implements ActionListener,
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the room is password protected
|
||||
* Returns true if the room is password protected or Members only
|
||||
*
|
||||
* @param roomjid
|
||||
* @return
|
||||
@ -862,7 +862,8 @@ public class ConferenceRoomBrowser extends JPanel implements ActionListener,
|
||||
boolean result = false;
|
||||
try {
|
||||
|
||||
RoomInfo rif = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomjid);
|
||||
RoomInfo rif = MultiUserChat.getRoomInfo(
|
||||
SparkManager.getConnection(), roomjid);
|
||||
|
||||
result = rif.isMembersOnly() || rif.isPasswordProtected();
|
||||
|
||||
|
||||
@ -76,6 +76,7 @@ import org.jivesoftware.spark.ui.ChatFrame;
|
||||
import org.jivesoftware.spark.ui.ChatRoom;
|
||||
import org.jivesoftware.spark.ui.ChatRoomNotFoundException;
|
||||
import org.jivesoftware.spark.ui.GroupChatRoomTransferHandler;
|
||||
import org.jivesoftware.spark.ui.conferences.AnswerFormDialog;
|
||||
import org.jivesoftware.spark.ui.conferences.ConferenceUtils;
|
||||
import org.jivesoftware.spark.ui.conferences.DataFormDialog;
|
||||
import org.jivesoftware.spark.ui.conferences.GroupChatParticipantList;
|
||||
@ -822,10 +823,11 @@ public final class GroupChatRoom extends ChatRoom {
|
||||
*/
|
||||
private void setupListeners() {
|
||||
chat.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void kicked(String participant) {
|
||||
|
||||
public void kicked(String participant, String actor, String reason) {
|
||||
String nickname = StringUtils.parseResource(participant);
|
||||
insertText(Res.getString("message.user.kicked.from.room",
|
||||
nickname));
|
||||
nickname,actor,reason));
|
||||
}
|
||||
|
||||
public void voiceGranted(String participant) {
|
||||
@ -839,9 +841,9 @@ public final class GroupChatRoom extends ChatRoom {
|
||||
.getString("message.user.voice.revoked", nickname));
|
||||
}
|
||||
|
||||
public void banned(String participant) {
|
||||
public void banned(String participant, String actor, String reason) {
|
||||
String nickname = StringUtils.parseResource(participant);
|
||||
insertText(Res.getString("message.user.banned", nickname));
|
||||
insertText(Res.getString("message.user.banned", nickname, reason));
|
||||
}
|
||||
|
||||
public void membershipGranted(String participant) {
|
||||
@ -1351,14 +1353,20 @@ public final class GroupChatRoom extends ChatRoom {
|
||||
RolloverButton settings = new RolloverButton(
|
||||
SparkRes.getImageIcon(SparkRes.SETTINGS_IMAGE_16x16));
|
||||
settings.setToolTipText(Res.getString("title.configure.room"));
|
||||
|
||||
RolloverButton thema = new RolloverButton(
|
||||
SparkRes.getImageIcon(SparkRes.TYPING_TRAY));
|
||||
thema.setToolTipText(Res.getString("menuitem.change.subject"));
|
||||
|
||||
RolloverButton register = new RolloverButton(
|
||||
SparkRes.getImageIcon(SparkRes.PEOPLE_IMAGE));
|
||||
register.setToolTipText(Res.getString("button.register").replace("&",""));
|
||||
|
||||
JPanel bar = room.getRoomControllerBar();
|
||||
|
||||
bar.add(thema);
|
||||
bar.add(settings);
|
||||
bar.add(settings,0);
|
||||
bar.add(thema,0);
|
||||
bar.add(register,0);
|
||||
|
||||
settings.addActionListener(new AbstractAction() {
|
||||
private static final long serialVersionUID = 6780230647854132857L;
|
||||
@ -1399,6 +1407,24 @@ public final class GroupChatRoom extends ChatRoom {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
register.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Form form = chat.getRegistrationForm();
|
||||
ChatFrame chatFrame = SparkManager.getChatManager()
|
||||
.getChatContainer().getChatFrame();
|
||||
|
||||
new AnswerFormDialog(chatFrame, chat, form);
|
||||
|
||||
} catch (XMPPException xmpe) {
|
||||
getTranscriptWindow().insertNotificationMessage(
|
||||
xmpe.getMessage(), ChatManager.ERROR_COLOR);
|
||||
scrollToBottom();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -785,7 +785,7 @@ message.unable.to.send.file = You were unable to send the file to {0}
|
||||
message.unrecoverable.error = Invalid username or password
|
||||
message.update.room.list = Update room list
|
||||
message.updating.cancelled = Updating has been canceled
|
||||
message.user.banned = {0} has been banned from this room
|
||||
message.user.banned = {0} has been banned from this room. Reason: {1}
|
||||
message.user.given.voice = {0} has been given a voice in this room
|
||||
message.user.granted.admin = {0} has been granted administrator privileges
|
||||
message.user.granted.membership = {0} has been given membership privileges
|
||||
@ -793,7 +793,7 @@ message.user.granted.moderator = {0} has been granted moderator privileges
|
||||
message.user.granted.owner = {0} has been granted owner privileges
|
||||
message.user.is.sending.you.a.file = {0} is sending you a file
|
||||
message.user.joined.room = {0} has joined the room
|
||||
message.user.kicked.from.room = {0} has been kicked out of the room
|
||||
message.user.kicked.from.room = {0} has been kicked out of the room by {1}. Reason: {2}
|
||||
message.user.left.room = {0} has left the room
|
||||
message.user.nickname.changed = {0} is now known as {1}
|
||||
message.user.now.available.to.chat = {0} is online at {1}
|
||||
@ -825,6 +825,7 @@ message.your.revoked.granted = Your admin privileges have been revoked
|
||||
message.your.voice.granted = You have been given a voice in this chat
|
||||
message.your.voice.revoked = Your voice has been revoked
|
||||
message.groupchat.require.password = This group chat room requires a password to enter
|
||||
message.groupchat.registered.member = Successfully registered with {0}
|
||||
message.search.for.history = Search conversation history
|
||||
|
||||
status.away = Away
|
||||
|
||||
@ -425,10 +425,10 @@ message.subject.change.error = Sie haben keine Rechte das Konferenzthema in dies
|
||||
message.forbidden.error = Sie haben nicht die Rechte f<>r diese Aktion.
|
||||
message.room.destroyed = Dieser Raum wurde aus dem folgenden Grund gel<65>scht: {0}
|
||||
message.subject.has.been.changed.to = Das Thema der Konferenz wurde von {1} in "{0}" ge<67>ndert.
|
||||
message.user.kicked.from.room = {0} wurde aus dem Raum ausgeladen.
|
||||
message.user.kicked.from.room = {0} wurde von {1} aus dem Raum geworfen. Grund: {2}
|
||||
message.user.given.voice = {0} hat jetzt Schreibenrechte.
|
||||
message.user.voice.revoked = Schreibrechte wurde {0} entzogen.
|
||||
message.user.banned = {0} ist f<>r diesen Raum gesperrt.
|
||||
message.user.banned = {0} wurde f<>r diesen Raum gesperrt. Grund: {2}
|
||||
message.user.granted.membership = {0} ist jetzt Mitglied.
|
||||
message.user.revoked.membership = Mitgliedschaft f<>r {0} wurde widerufen.
|
||||
message.user.granted.moderator = {0} ist jetzt Moderator.
|
||||
@ -682,7 +682,7 @@ menuitem.send.a.message = Nachricht senden...
|
||||
menuitem.show.empty.groups = Leere Gruppen anzeigen
|
||||
menuitem.send.a.file = Datei senden
|
||||
menuitem.view.last.activity = Letzte Aktivit<69>t sehen
|
||||
menuitem.unban = Verbannung r<>ckg<6B>ngig machen
|
||||
menuitem.unban = Teilnehmer entsperren
|
||||
menuitem.ban = Verbannen
|
||||
menuitem.browse.service = Services anzeigen
|
||||
menuitem.remove.service = Service entfernen
|
||||
@ -862,6 +862,7 @@ message.unrecoverable.error = Ung
|
||||
message.waiting.for.user.to.join = Warte auf {0} zum Beitritt
|
||||
message.your.voice.granted = Du hast Schreibrechte in diesem Chat bekommen
|
||||
message.groupchat.require.password = Dieser GruppenChat ben<65>tigt ein Passwort
|
||||
message.groupchat.registered.member = Registrierung mit {0} erfolgreich
|
||||
message.search.for.history = Durchsuche Gespr<70>chsverlauf
|
||||
status.extended.away = Nicht verf<72>gbar
|
||||
status.free.to.chat = Bereit zu chatten
|
||||
|
||||
BIN
src/resources/images/people-icon.png
Normal file
BIN
src/resources/images/people-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 495 B |
Reference in New Issue
Block a user