private void ReadPreferences()
        {
            _username = _settings.ServiceUsername;
            _password = _settings.ServicePassword;

            _tempoTracker = new TempoTracker(_username, _password, _settings.CustomApiUrl);

            if (string.IsNullOrEmpty(_username) || string.IsNullOrEmpty(_password) || string.IsNullOrEmpty(_settings.CustomApiUrl))
            {
                var optionsWindow = new OptionsWindow(this);

                var result = optionsWindow.ShowDialog();

                if (result.HasValue && !result.Value)
                {
                    MessageBox.Show("Please configure API information.", TempoTrackerWPF.Resources.Language.Error, MessageBoxButton.OK, MessageBoxImage.Error);
                }

                ReadPreferences();
            }

            ShowInTaskbar = _settings.ShowInTaskbar;

            _idleTimer.Interval = 1000;

            if (_settings.IdleTimeout)
            {
                _idleTimer.Enabled = true;

                _idleTimer.Start();
            }
            else
            {
                _idleTimer.Enabled = false;

                _idleTimer.Stop();
            }

            // Handle notify icon preferences
            _notifyIcon.Visible = _settings.NotifyShow;
        }
        private void optionsButton_Click(object sender, RoutedEventArgs e)
        {
            var optionsWindow = new OptionsWindow(this);

            var result = optionsWindow.ShowDialog();

            if (result.HasValue && result.Value)
            {
                ReadPreferences();
            }
        }