Example #1
0
 void hookShowKeyPressed(object sender, KeyPressedEventArgs e)
 {
     if (Visible)
     {
         Hide();
         if (editForm.Visible)
         {
             editForm.ClosePopup();
         }
         feedbackWindowController.Close();
         aboutWindowController.Close();
         preferencesWindowController.Hide();
     }
     else
     {
         show();
     }
 }
Example #2
0
        private void MainWindowController_FormClosing(object sender, FormClosingEventArgs e)
        {
            Utils.SaveWindowLocation(this, editForm);

            if (!TogglDesktop.Program.ShuttingDown)
            {
                Hide();
                e.Cancel = true;
            }

            if (editForm.Visible)
            {
                if (editableEntry.GetType() == typeof(TimeEntryCell))
                {
                    ((TimeEntryCell)editableEntry).opened = false;
                }
                editForm.ClosePopup();
            }
        }
Example #3
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            if (buttonStart.Text != "Start")
            {
                Toggl.Stop();
                if (editForm.Visible)
                {
                    editForm.ClosePopup();
                }
                return;
            }

            string description = descriptionTextBox.Text;

            if (defaultDescription == description)
            {
                description = "";
            }

            string duration = textBoxDuration.Text;

            if (defaultDuration == duration)
            {
                duration = "";
            }

            if (Toggl.Start(
                    description,
                    duration,
                    task_id,
                    project_id) == null)
            {
                task_id    = 0;
                project_id = 0;
                return;
            }

            descriptionTextBox.Text = defaultDescription;

            if (!textBoxDuration.Focused)
            {
                textBoxDuration.Text = defaultDuration;
            }
            else
            {
                textBoxDuration.Text = "";
            }
            labelClearProject.Visible = false;

            task_id    = 0;
            project_id = 0;
        }