Ejemplo n.º 1
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 TimeEntryEditViewController();
            aboutWindowController            = new AboutWindowController();
            preferencesWindowController      = new PreferencesWindowController();
            feedbackWindowController         = new FeedbackWindowController();
            idleNotificationWindowController = new IdleNotificationWindowController();

            initEditForm();
            timeEntryListViewController.setEditPopup(editForm);

            FlowLayoutPanel listing = timeEntryListViewController.getListing();

            if (listing != null)
            {
                listing.Scroll     += MainWindowControllerEntries_Scroll;
                listing.MouseWheel += MainWindowControllerEntries_Scroll;
            }

            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);

            aboutWindowController.initAndCheck();

            runScriptTimer          = new Timer();
            runScriptTimer.Interval = 1000;
            runScriptTimer.Tick    += runScriptTimer_Tick;
            runScriptTimer.Start();
        }
Ejemplo n.º 2
0
        public MainWindowController()
        {
            InitializeComponent();

            loginViewController         = new LoginViewController();
            timeEntryListViewController = new TimeEntryListViewController();
            timeEntryEditViewController = new TimeEntryEditViewController();
            aboutWindowController       = new AboutWindowController();
            preferencesWindowController = new PreferencesWindowController();
            feedbackWindowController    = new FeedbackWindowController();
        }
        public MainWindowController()
        {
            InitializeComponent();

            loginViewController = new LoginViewController();
            timeEntryListViewController = new TimeEntryListViewController();
            timeEntryEditViewController = new TimeEntryEditViewController();
            aboutWindowController = new AboutWindowController();
            preferencesWindowController = new PreferencesWindowController();
            feedbackWindowController = new FeedbackWindowController();
        }
        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();
        }
        private void MainWindowController_Load(object sender, EventArgs e)
        {
            troubleBox.BackColor = Color.FromArgb(239, 226, 121);
            contentPanel.Location = defaultContentPosition;

            Utils.LoadWindowLocation(this);

            Toggl.OnApp += OnApp;
            Toggl.OnError += OnError;
            Toggl.OnUpdate += OnUpdate;
            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 TimeEntryEditViewController();
            aboutWindowController = new AboutWindowController();
            preferencesWindowController = new PreferencesWindowController();
            feedbackWindowController = new FeedbackWindowController();
            idleNotificationWindowController = new IdleNotificationWindowController();
            initEditForm();

            if (!Toggl.Start(TogglDesktop.Program.Version()))
            {
                try
                {
                    DisableTop();
                    MessageBox.Show("Missing callback. See the log file for details");
                } finally {
                    EnableTop();
                }
                TogglDesktop.Program.Shutdown(1);
            }
        }
Ejemplo n.º 6
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();
        }