Пример #1
0
        public SettingsForm(Settings settings)
        {
            this.settings = settings;

            InitializeComponent();

            tbJiraBaseUrl.Text = this.settings.JiraBaseUrl;
            numIssueCount.Value = this.settings.IssueCount;
            cbAlwaysOnTop.Checked = this.settings.AlwaysOnTop;
            cbMinimizeToTray.Checked = this.settings.MinimizeToTray;
            cbTimerEditable.Checked = this.settings.TimerEditable;

            cbSaveTimerState.DisplayMember = "Text";
            cbSaveTimerState.ValueMember = "Value";
            cbSaveTimerState.DataSource = new[]
            {
                new { Text = "Reset all timers on exit", Value = SaveTimerSetting.NoSave },
                new { Text = "Save current timetracking, pause active timer", Value = SaveTimerSetting.SavePause },
                new { Text = "Save current timetracking, active timer continues", Value = SaveTimerSetting.SaveRunActive }
            };
            cbSaveTimerState.SelectedValue = this.settings.SaveTimerState;

            cbPauseOnSessionLock.DisplayMember = "Text";
            cbPauseOnSessionLock.ValueMember = "Value";
            cbPauseOnSessionLock.DataSource = new[]
            {
                new { Text = "No pause", Value = PauseAndResumeSetting.NoPause },
                new { Text = "Pause active timer", Value = PauseAndResumeSetting.Pause },
                new { Text = "Pause and resume on unlock", Value = PauseAndResumeSetting.PauseAndResume }
            };
            cbPauseOnSessionLock.SelectedValue = this.settings.PauseOnSessionLock;
        }
Пример #2
0
        public IssueControl(JiraClient jiraClient, Settings settings)
            : base()
        {
            InitializeComponent();

            Comment = null;
            EstimateUpdateMethod = EstimateUpdateMethods.Auto;
            EstimateUpdateValue = null;

            this.settings = settings;

            this.jiraClient = jiraClient;
            this.WatchTimer = new WatchTimer();
        }
Пример #3
0
        public SettingsForm(Settings settings)
        {
            this.settings = settings;

            InitializeComponent();

            // Mono for MacOSX and Linux do not implement the notifyIcon
            // so ignore this feature if we are not running on Windows
            cbMinimizeToTray.Visible = CrossPlatformHelpers.IsWindowsEnvironment();

            tbJiraBaseUrl.Text = this.settings.JiraBaseUrl;
            cbAlwaysOnTop.Checked = this.settings.AlwaysOnTop;
            cbMinimizeToTray.Checked = this.settings.MinimizeToTray;
            cbAllowMultipleTimers.Checked = this.settings.AllowMultipleTimers;
            cbAllowManualEstimateAdjustments.Checked = this.settings.AllowManualEstimateAdjustments;

            cbSaveTimerState.DisplayMember = "Text";
            cbSaveTimerState.ValueMember = "Value";
            cbSaveTimerState.DataSource = new[]
            {
                new { Text = "Reset all timers on exit", Value = SaveTimerSetting.NoSave },
                new { Text = "Save current timetracking, pause active timer", Value = SaveTimerSetting.SavePause },
                new { Text = "Save current timetracking, active timer continues", Value = SaveTimerSetting.SaveRunActive }
            };
            cbSaveTimerState.SelectedValue = this.settings.SaveTimerState;

            cbPauseOnSessionLock.DisplayMember = "Text";
            cbPauseOnSessionLock.ValueMember = "Value";
            cbPauseOnSessionLock.DataSource = new[]
            {
                new { Text = "No pause", Value = PauseAndResumeSetting.NoPause },
                new { Text = "Pause active timer", Value = PauseAndResumeSetting.Pause },
                new { Text = "Pause and resume on unlock", Value = PauseAndResumeSetting.PauseAndResume }
            };
            cbPauseOnSessionLock.SelectedValue = this.settings.PauseOnSessionLock;

            cbPostWorklogComment.DisplayMember = "Text";
            cbPostWorklogComment.ValueMember = "Value";
            cbPostWorklogComment.DataSource = new[]
            {
                new { Text = "Post only as part of worklog", Value = WorklogCommentSetting.WorklogOnly },
                new { Text = "Post only as a comment", Value = WorklogCommentSetting.CommentOnly },
                new { Text = "Post as both worklog and comment", Value = WorklogCommentSetting.WorklogAndComment }
            };
            cbPostWorklogComment.SelectedValue = this.settings.PostWorklogComment;

            tbStartTransitions.Text = this.settings.StartTransitions;

            cbLoggingEnabbled.Checked = this.settings.LoggingEnabled;
        }
Пример #4
0
        public SettingsForm(Settings settings)
        {
            this.settings = settings;

            InitializeComponent();

            rbNoSave.Tag = SaveTimerSetting.NoSave;
            rbSavePause.Tag = SaveTimerSetting.SavePause;
            rbSaveRunActive.Tag = SaveTimerSetting.SaveRunActive;

            tbJiraBaseUrl.Text = this.settings.JiraBaseUrl;
            numIssueCount.Value = this.settings.IssueCount;
            cbAlwaysOnTop.Checked = this.settings.AlwaysOnTop;

            RadioButton choice = gbSaveTimerState.Controls.OfType<RadioButton>().FirstOrDefault(x => (SaveTimerSetting)x.Tag == settings.SaveTimerState);
            choice.Checked = true;
        }
Пример #5
0
        public MainForm()
        {
            InitializeComponent();

            settings = new Settings();
            jiraClient = new JiraClient();

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            LoadSettings();

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick += ticker_Tick;
        }
Пример #6
0
        public MainForm()
        {
            InitializeComponent();

            settings = new Settings();
            jiraClient = new JiraClient();

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            LoadSettings();

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick += ticker_Tick;

            Microsoft.Win32.SystemEvents.SessionSwitch += new Microsoft.Win32.SessionSwitchEventHandler(SystemEvents_SessionSwitch);
        }
Пример #7
0
        public MainForm()
        {
            settings = new Settings();
            settings.Load();

            Logger.Instance.LogfilePath = Path.Combine(Application.UserAppDataPath, "jirastopwatch.log");
            Logger.Instance.Enabled = settings.LoggingEnabled;

            restRequestFactory = new RestRequestFactory();
            jiraApiRequestFactory = new JiraApiRequestFactory(restRequestFactory);

            restClientFactory = new RestClientFactory();
            restClientFactory.BaseUrl = this.settings.JiraBaseUrl;

            jiraApiRequester = new JiraApiRequester(restClientFactory, jiraApiRequestFactory);

            jiraClient = new JiraClient(jiraApiRequestFactory, jiraApiRequester);

            InitializeComponent();

            Text = string.Format("{0} v. {1}", Application.ProductName, Application.ProductVersion);

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick += ticker_Tick;
        }