public void openLoginShell() {
		if (loginShell == null || loginShell.isDisposed()) {
			loginShell = new Shell();
			loginShell.setSize(330, 240);
			loginShell.setText("QQ");
			loginShell.setImage(ImageManager.getImage(ImageManager.MINI_QQ));
			loginShell.setLayout(new FormLayout());
			ShellManager.add(loginShell);

			FormData formData = null;
			// login Button
			Button loginButton = new Button(loginShell, SWT.PUSH);
			loginButton.setText("login");
			formData = new FormData();
			formData.left = new FormAttachment(0, 60);
			formData.right = new FormAttachment(0, 135);
			formData.top = new FormAttachment(0, 150);
			formData.bottom = new FormAttachment(0, 180);
			loginButton.setLayoutData(formData);

			// register Button
			Button registerButton = new Button(loginShell, SWT.PUSH);
			registerButton.setText("register");
			formData = new FormData();
			formData.left = new FormAttachment(0, 195);
			formData.right = new FormAttachment(100, -60);
			formData.top = new FormAttachment(0, 150);
			formData.bottom = new FormAttachment(0, 180);
			registerButton.setLayoutData(formData);

			// password label
			Label passwordLabel = new Label(loginShell, SWT.NORMAL);
			passwordLabel.setText("password");
			formData = new FormData();
			formData.left = new FormAttachment(0, 30);
			formData.right = new FormAttachment(0, 95);
			formData.top = new FormAttachment(0, 105);
			formData.bottom = new FormAttachment(0, 135);
			passwordLabel.setLayoutData(formData);

			// passwordText

			final Text passwordText = new Text(loginShell, SWT.BORDER
					| SWT.PASSWORD);
			formData = new FormData();
			formData.left = new FormAttachment(0, 120);
			formData.right = new FormAttachment(100, -30);
			formData.top = new FormAttachment(0, 105);
			formData.bottom = new FormAttachment(0, 135);
			passwordText.setLayoutData(formData);

			// QQNumber label
			Label userLabel = new Label(loginShell, SWT.NORMAL);
			userLabel.setText("QQ");
			formData = new FormData();
			formData.left = new FormAttachment(0, 30);
			formData.right = new FormAttachment(0, 95);
			formData.top = new FormAttachment(0, 60);
			formData.bottom = new FormAttachment(0, 90);
			userLabel.setLayoutData(formData);

			// QQNumberText
			final Combo qqNumberText = new Combo(loginShell, SWT.BORDER);

			// final Text qqNumberText = new Text(loginShell, SWT.BORDER);
			formData = new FormData();
			formData.left = new FormAttachment(0, 120);
			formData.right = new FormAttachment(100, -30);
			formData.top = new FormAttachment(0, 60);
			formData.bottom = new FormAttachment(0, 90);
			qqNumberText.setLayoutData(formData);

			// main label
			Label mainLabel = new Label(loginShell, SWT.CENTER);
			mainLabel.setText("Welcome to Linux QQ");
			formData = new FormData();
			formData.top = new FormAttachment(0, 5);
			formData.left = new FormAttachment(0, 5);
			formData.right = new FormAttachment(100, -5);
			formData.bottom = new FormAttachment(userLabel, -5);
			mainLabel.setLayoutData(formData);
			// event
			
			//login listener
			class loginListener extends SelectionAdapter {

				@Override
				public void widgetSelected(SelectionEvent e) {
					String qqNumberStr = qqNumberText.getText();
					String password = passwordText.getText();
					loginUser = new User(qqNumberStr, password, null);
					loginUser = loginService.CheckLoginInfo(loginUser,
							clientSocket);
					if (loginUser != null) {
						isLogin = true;
						loginShell.dispose();
						trayItem.setToolTipText(loginUser.getQQnumber());
						trayItem.setText(loginUser.getQQnumber());
						openListShell();
						
					} else {
						MessageDialog messageDialog = new MessageDialog(null,
								"login error", ImageManager
										.getImage(ImageManager.MINI_QQ),
								"error", 0, new String[] { "ok" }, 0);
						messageDialog.open();
					}
				}

				@Override
				public void widgetDefaultSelected(SelectionEvent e) {
					// TODO Auto-generated method stub
					super.widgetDefaultSelected(e);
				}

				
			};
			loginListener listener = new loginListener();
			loginButton.addSelectionListener(listener);

			loginShell.addDisposeListener(new DisposeListener() {

				@Override
				public void widgetDisposed(DisposeEvent e) {
					if (openedShellCount > 0)
						openedShellCount--;
					Logger.log("loginShell..dispose..active shell: "
							+ openedShellCount);

				}
			});
			openedShellCount++;
			Logger.log("open loginShell...active shell: " + openedShellCount);
			loginShell.open();

		}

	}