Exemple #1
0
        public void SetViewController(WPF.TimeEntryEditViewController timeEntryEditViewController)
        {
            this.controller = timeEntryEditViewController;

            timeEntryEditViewController.MouseDown += (sender, args) => this.mouseDown(args);
            timeEntryEditViewController.MouseMove += (sender, args) => this.mouseMove(args);
        }
Exemple #2
0
        public void SetViewController(WPF.TimeEntryEditViewController timeEntryEditViewController)
        {
            this.controller = timeEntryEditViewController;

            timeEntryEditViewController.MouseDown += (sender, args) => this.mouseDown(args);
            timeEntryEditViewController.MouseMove += (sender, args) => this.mouseMove(args);
        }
Exemple #3
0
 public void SetEditPopup(WPF.TimeEntryEditViewController editView)
 {
     editView.SetTimer(this.timerEditViewController);
 }
        private void MainWindowController_Load(object sender, EventArgs e)
        {
            troubleBox.BackColor = Color.FromArgb(239, 226, 121);
            contentPanel.Location = defaultContentPosition;

            loadStatusIcons();

            Toggl.OnApp += OnApp;
            Toggl.OnError += OnError;
            Toggl.OnLogin += OnLogin;
            Toggl.OnTimeEntryList += OnTimeEntryList;
            Toggl.OnTimeEntryEditor += OnTimeEntryEditor;
            Toggl.OnOnlineState += OnOnlineState;
            Toggl.OnReminder += OnReminder;
            Toggl.OnURL += OnURL;
            Toggl.OnRunningTimerState += OnRunningTimerState;
            Toggl.OnStoppedTimerState += OnStoppedTimerState;
            Toggl.OnSettings += OnSettings;
            Toggl.OnIdleNotification += OnIdleNotification;

            loginViewController = new LoginViewController();
            timeEntryListViewController = new TimeEntryListViewController();
            timeEntryEditViewController = new WPF.TimeEntryEditViewController();

            aboutWindowController = new AboutWindowController();
            preferencesWindowController = new PreferencesWindow();
            feedbackWindowController = new FeedbackWindowController();
            idleNotificationWindowController = new IdleNotificationWindowController();

            initEditForm();
            timeEntryListViewController.SetEditPopup(timeEntryEditViewController);
            editForm.Owner = aboutWindowController.Owner = feedbackWindowController.Owner = this;

            var windowInteropHelper = new WindowInteropHelper(this.preferencesWindowController);
            windowInteropHelper.Owner = this.Handle;
            ElementHost.EnableModelessKeyboardInterop(this.preferencesWindowController);

            if (!Toggl.StartUI(TogglDesktop.Program.Version()))
            {
            try
            {
                DisableTop();
                MessageBox.Show("Missing callback. See the log file for details");
            } finally {
                EnableTop();
            }
            TogglDesktop.Program.Shutdown(1);
            }

            Utils.LoadWindowLocation(this, editForm);

            setCorrectMinimumSize();

            aboutWindowController.initAndCheck();

            runScriptTimer = new Timer();
            runScriptTimer.Interval = 1000;
            runScriptTimer.Tick += runScriptTimer_Tick;
            runScriptTimer.Start();
        }
Exemple #5
0
        private void MainWindowController_Load(object sender, EventArgs e)
        {
            troubleBox.BackColor  = Color.FromArgb(239, 226, 121);
            contentPanel.Location = defaultContentPosition;

            loadStatusIcons();

            Toggl.OnApp               += OnApp;
            Toggl.OnError             += OnError;
            Toggl.OnLogin             += OnLogin;
            Toggl.OnTimeEntryList     += OnTimeEntryList;
            Toggl.OnTimeEntryEditor   += OnTimeEntryEditor;
            Toggl.OnOnlineState       += OnOnlineState;
            Toggl.OnReminder          += OnReminder;
            Toggl.OnURL               += OnURL;
            Toggl.OnRunningTimerState += OnRunningTimerState;
            Toggl.OnStoppedTimerState += OnStoppedTimerState;
            Toggl.OnSettings          += OnSettings;
            Toggl.OnIdleNotification  += OnIdleNotification;

            loginViewController         = new LoginViewController();
            timeEntryListViewController = new TimeEntryListViewController();
            timeEntryEditViewController = new WPF.TimeEntryEditViewController();

            aboutWindowController            = new AboutWindowController();
            preferencesWindowController      = new PreferencesWindow();
            feedbackWindowController         = new FeedbackWindowController();
            idleNotificationWindowController = new IdleNotificationWindowController();

            initEditForm();
            timeEntryListViewController.SetEditPopup(timeEntryEditViewController);
            editForm.Owner = aboutWindowController.Owner = feedbackWindowController.Owner = this;

            var windowInteropHelper = new WindowInteropHelper(this.preferencesWindowController);

            windowInteropHelper.Owner = this.Handle;
            ElementHost.EnableModelessKeyboardInterop(this.preferencesWindowController);

            if (!Toggl.StartUI(TogglDesktop.Program.Version()))
            {
                try
                {
                    DisableTop();
                    MessageBox.Show("Missing callback. See the log file for details");
                } finally {
                    EnableTop();
                }
                TogglDesktop.Program.Shutdown(1);
            }

            Utils.LoadWindowLocation(this, editForm);

            setCorrectMinimumSize();

            aboutWindowController.initAndCheck();

            runScriptTimer          = new Timer();
            runScriptTimer.Interval = 1000;
            runScriptTimer.Tick    += runScriptTimer_Tick;
            runScriptTimer.Start();
        }