Exemple #1
0
        public QuickGett()
        {

            // Create a tray menu
            trayMenu = new ContextMenu();

            trayMenu.MenuItems.Add(new MenuItem("Upload...", OnMenuUpload));
            trayMenu.MenuItems.Add(new MenuItem("Switch User", Configure));
            trayMenu.MenuItems.Add(new MenuItem("Exit", OnExit));

            trayIcon = new NotifyIcon();
            trayIcon.Icon = Properties.Resources.favicon;

            // Add menu to tray icon and show it.
            trayIcon.ContextMenu = trayMenu;
            trayIcon.Visible = true;

            //create a client
            client = new GettClient(trayIcon);

            //check for user/pass credentials in settings
            //if missing, prompt for them.

            if (!CredentialManager.ValidCredentials())
            {
                LoginForm lf = new LoginForm(client);
                lf.Show();
                client.Notify("You need to log in to ge.tt!");
            }
            else
            {
                //credentials exist, auto login
                client.Notify("Logging into ge.tt with saved credentials...");
                client.Login();
            }

            //start status updating thread
            running = true;
            Thread statusThread = new Thread(new ThreadStart(this.UpdateSysTrayStatusThread));
            statusThread.Start();
        }
Exemple #2
0
 public void Configure(Object sender, EventArgs e)
 {
     CredentialManager.ClearCredentials();
     LoginForm lf = new LoginForm(client);
     lf.Show();
 }