Added logout with status and without.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@4958 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2006-08-18 03:00:42 +00:00
committed by derek
parent dc58eb5ce4
commit 5a5da35240
4 changed files with 19 additions and 5 deletions

View File

@ -179,6 +179,7 @@
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/../../../com/plugins/fastpath/Fastpath.iml" filepath="$PROJECT_DIR$/../../../com/plugins/fastpath/Fastpath.iml" />
<module fileurl="file://$PROJECT_DIR$/../../plugins/fastpath/Fastpath.iml" filepath="$PROJECT_DIR$/../../plugins/fastpath/Fastpath.iml" />
<module fileurl="file://$PROJECT_DIR$/Spark/Spark.iml" filepath="$PROJECT_DIR$/Spark/Spark.iml" />
<module fileurl="file://$PROJECT_DIR$/Spark/Spark.iml" filepath="$PROJECT_DIR$/Spark/Spark.iml" />

View File

@ -241,11 +241,11 @@ public final class MainWindow extends JFrame implements ActionListener {
* Prepares Spark for shutting down by first calling all {@link MainWindowListener}s and
* setting the Agent to be offline.
*/
public void logout() {
public void logout(boolean sendStatus) {
final XMPPConnection con = SparkManager.getConnection();
if (con.isConnected()) {
if (con.isConnected() && sendStatus) {
final InputTextAreaDialog inputTextDialog = new InputTextAreaDialog();
String status = inputTextDialog.getInput("Status Message", "Let others know your current status or activity.",
SparkRes.getImageIcon(SparkRes.USER1_MESSAGE_24x24), this);
@ -348,12 +348,25 @@ public final class MainWindow extends JFrame implements ActionListener {
ResourceUtils.resButton(logoutMenuItem, "L&og Out");
logoutMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
logout();
logout(false);
}
});
JMenuItem logoutWithStatus = new JMenuItem("Log Out");
ResourceUtils.resButton(logoutWithStatus, "Log out with status");
logoutWithStatus.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
logout(true);
}
});
if (Spark.isWindows()) {
connectMenu.add(logoutMenuItem);
connectMenu.add(logoutWithStatus);
}
connectMenu.addSeparator();

View File

@ -115,7 +115,7 @@ public final class Notifications implements ActionListener, MainWindowListener {
Action logoutAction = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
SparkManager.getMainWindow().logout();
SparkManager.getMainWindow().logout(false);
}
};

View File

@ -214,7 +214,7 @@ public class RetryPanel extends JPanel {
private void logout() {
SparkManager.getMainWindow().setVisible(false);
SparkManager.getMainWindow().logout();
SparkManager.getMainWindow().logout(false);
}
/**