コード例 #1
0
ファイル: TimerItem.cs プロジェクト: zozolaw/RemindMe
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (popupDate <= DateTime.Now)//Let's make the popup
            {
                timer.Stop();

                Reminder rem = new Reminder();
                rem.Date       = popupDate.ToShortDateString() + " " + popupDate.ToShortTimeString();
                rem.RepeatType = ReminderRepeatType.NONE.ToString();
                rem.Id         = -1; //Set it to our "Invalid id" number. It is not a real reminder after all.
                rem.Name       = "Timer";
                rem.Note       = timerText;

                Settings set = BLSettings.GetSettings();
                rem.SoundFilePath = set.DefaultTimerSound;

                Popup pop = new Popup(rem);
                pop.Show();

                //Let's remove this timer. It's served its purpose
                ucTimer.RemoveTimer(this);

                this.Dispose();
            }
        }
コード例 #2
0
        /// <summary>
        /// Looks for key combinations to launch the timer form (to set a timer quickly)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">The keyeventargs which contains the pressed keys</param>
        private void GlobalKeyPress(object sender, KeyEventArgs e)
        {
            if (BLSettings.GetSettings().EnableQuickTimer != 1) //Not enabled? don't do anything
            {
                return;
            }

            if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return.
            {
                return;
            }

            //Good! now let's check if the KeyCode is not alt shift or ctr
            if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey)
            {
                return;
            }

            timerHotkey = BLHotkeys.TimerPopup;

            if (e.Modifiers.ToString().Replace(" ", string.Empty) == timerHotkey.Modifiers && e.KeyCode.ToString() == timerHotkey.Key)
            {
                BLIO.Log("Timer hotkey combination pressed!");
                TimerPopup quickTimer = new TimerPopup();
                quickTimer.Show();
            }
        }
コード例 #3
0
ファイル: UCReminders.cs プロジェクト: zozolaw/RemindMe
        private void HideOrShowEnableHideWarning()
        {
            //The option
            enableWarningToolStripMenuItem.Visible = BLSettings.GetSettings().HideReminderConfirmation == 1;

            BLIO.Log("Showing enable hide warning option from right click menu: " + (BLSettings.GetSettings().HideReminderConfirmation == 1));
        }
コード例 #4
0
        private void btnRemoveSong_Click(object sender, EventArgs e)
        {
            cbSound.SelectedItem = null;
            cbSound.Text         = "";
            Settings set = BLSettings.GetSettings();

            set.DefaultTimerSound = "";
            BLSettings.UpdateSettings(set);
        }
コード例 #5
0
        private void cbAdvancedReminders_OnChange(object sender, EventArgs e)
        {
            BLIO.Log("Checkbox change (Advanced Reminder)");
            Settings set = BLSettings.GetSettings();

            set.EnableAdvancedReminders = cbAdvancedReminders.Checked ? 1 : 0;

            BLSettings.UpdateSettings(set);
            BLIO.Log("Advanced Reminder setting changed to: " + cbAdvancedReminders.Checked.ToString());
        }
コード例 #6
0
        private void cbEnableQuicktimer_OnChange(object sender, EventArgs e)
        {
            BLIO.Log("Checkbox change (Quick timer)");
            Settings set = BLSettings.GetSettings();

            set.EnableQuickTimer = cbQuicktimer.Checked ? 1 : 0;

            BLSettings.UpdateSettings(set);
            BLIO.Log("Quick timer setting changed to: " + cbQuicktimer.Checked.ToString());
        }
コード例 #7
0
 private void btnYes_Click(object sender, EventArgs e)
 {
     result = DialogResult.Yes;
     if (cbDontRemind.Checked)
     {
         Settings settingsObject = BLSettings.GetSettings();
         settingsObject.HideReminderConfirmation = 1;
         BLSettings.UpdateSettings(settingsObject);
     }
     newMessageBox.Close();
 }
コード例 #8
0
        private void cbSound_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBoxItem selectedItem = (ComboBoxItem)cbSound.SelectedItem;

            if (selectedItem != null)
            {
                Songs    selectedSong = (Songs)selectedItem.Value;
                Settings set          = BLSettings.GetSettings();
                set.DefaultTimerSound = selectedSong.SongFilePath;
                BLSettings.UpdateSettings(set);
            }
        }
コード例 #9
0
        private void pbVideoPath_Click(object sender, EventArgs e)
        {
            string path = FSManager.Folders.GetSelectedFolderPath();

            if (!string.IsNullOrEmpty(path))
            {
                tbVideoPath.Text = path;
                Settings set = BLSettings.GetSettings();
                set.VideoPath = path;
                BLSettings.UpdateSettings(set);
            }
        }
コード例 #10
0
        private void pbSoundFile_Click(object sender, EventArgs e)
        {
            string file = FSManager.Files.GetSelectedFileWithPath("Wave File", "*.wav");

            if (!string.IsNullOrEmpty(file))
            {
                //Get the current settings
                Settings set = BLSettings.GetSettings();
                //Alter the sound file of the settings
                set.SoundFile = file;
                //Write it to the database
                BLSettings.UpdateSettings(set);

                tbSoundFile.Text = file;
            }
        }
コード例 #11
0
        private void cbEnableOneHourBeforeNotification_OnChange(object sender, EventArgs e)
        {
            BLIO.Log("Checkbox change (Enable 1h before)");
            Settings set = BLSettings.GetSettings();

            if (cbOneHourBeforeNotification.Checked)
            {
                set.EnableHourBeforeReminder = 1;
            }
            else
            {
                set.EnableHourBeforeReminder = 0;
            }

            BLSettings.UpdateSettings(set);
            BLIO.Log("1 hour before reminder setting changed to: " + cbOneHourBeforeNotification.Checked.ToString());
        }
コード例 #12
0
        private void cbEnableRemindMeMessages_OnChange(object sender, EventArgs e)
        {
            BLIO.Log("Checkbox change (todays reminder popup)");
            Settings set = BLSettings.GetSettings();

            if (cbRemindMeMessages.Checked)
            {
                set.EnableReminderCountPopup = 1;
            }
            else
            {
                set.EnableReminderCountPopup = 0;
            }


            BLSettings.UpdateSettings(set);
            BLIO.Log("Today's reminder popup setting changed to: " + cbRemindMeMessages.Checked.ToString());
        }
コード例 #13
0
ファイル: UCReminders.cs プロジェクト: zozolaw/RemindMe
        private void enableWarningToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BLIO.Log("Attempting to re-enable the hide warning on reminders....");

            //Get the current settings from the database
            Settings currentSettings = BLSettings.GetSettings();

            //Set the hiding of the confirmation on hiding a reminder to false
            currentSettings.HideReminderConfirmation = 0;

            //Make the right-click menu option invisible
            enableWarningToolStripMenuItem.Visible = false;

            //Push the updated settings to the database
            BLSettings.UpdateSettings(currentSettings);

            BLIO.Log("Re-enabled the hide warning on reminders!");
        }
コード例 #14
0
        private void cbPopupType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbPopupType.SelectedItem.ToString() == "Always on top (Recommended)")
            {
                alwaysOnTop = 1;
                BLIO.Log("Popup type selected index changed to always on top.");
            }
            else
            {
                alwaysOnTop = 0;
                BLIO.Log("Popup type selected index changed to minimized.");
            }

            Settings set = BLSettings.GetSettings();

            set.AlwaysOnTop = alwaysOnTop;

            BLSettings.UpdateSettings(set);
            BLIO.Log("Updated popup type.");
        }
コード例 #15
0
        private void UCWindowOverlay_Load(object sender, EventArgs e)
        {
            if (BLSettings.GetSettings() == null)
            {
                Settings set = new Settings();
                set.AlwaysOnTop = alwaysOnTop;
                set.StickyForm  = 0;
                set.EnableHourBeforeReminder = 1;
                set.EnableReminderCountPopup = 1;
                set.EnableQuickTimer         = 1;
                BLSettings.UpdateSettings(set);
            }

            //Since we're not going to change the contents of this combobox anyway, we're just going to do it like this
            if (BLSettings.IsAlwaysOnTop())
            {
                cbPopupType.SelectedItem = cbPopupType.Items[0];
            }
            else
            {
                cbPopupType.SelectedItem = cbPopupType.Items[1];
            }

            cbRemindMeMessages.Checked          = BLSettings.IsReminderCountPopupEnabled();
            cbOneHourBeforeNotification.Checked = BLSettings.IsHourBeforeNotificationEnabled();
            cbQuicktimer.Checked        = BLSettings.GetSettings().EnableQuickTimer == 1;
            cbAdvancedReminders.Checked = BLSettings.GetSettings().EnableAdvancedReminders == 1;

            Hotkeys timerKey = BLHotkeys.TimerPopup;

            foreach (string m in timerKey.Modifiers.Split(','))
            {
                tbTimerHotkey.Text += m + " + ";
            }
            tbTimerHotkey.Text += timerKey.Key;

            //Fill the combobox to select a timer popup sound with data
            FillSoundCombobox();
            //Set the item the user selected as text
            string def = BLSettings.GetSettings().DefaultTimerSound;

            if (def == null) //User has no default sound combobox
            {
                foreach (ComboBoxItem itm in cbSound.Items)
                {
                    if (itm.Text.ToLower().Contains("unlock")) //Set the default timer sound to windows unlock
                    {
                        Songs    sng = (Songs)itm.Value;
                        Settings set = BLSettings.GetSettings();
                        set.DefaultTimerSound = sng.SongFilePath;
                        BLSettings.UpdateSettings(set);
                    }
                }
            }
            if (BLSettings.GetSettings().DefaultTimerSound == null)//Still null? well damn.
            {
                return;
            }

            cbSound.Items.Add(new ComboBoxItem(Path.GetFileNameWithoutExtension(BLSettings.GetSettings().DefaultTimerSound), BLSongs.GetSongByFullPath(BLSettings.GetSettings().DefaultTimerSound)));
            cbSound.Text = Path.GetFileNameWithoutExtension(BLSettings.GetSettings().DefaultTimerSound);
        }
コード例 #16
0
        /// <summary>
        /// Alternative Form_load method since form_load doesnt get called until you first double-click the RemindMe icon due to override SetVisibleCore
        /// </summary>
        private async Task formLoadAsync()
        {
            BLIO.Log("RemindMe_Load");

            BLIO.WriteUpdateBatch(Application.StartupPath);

            lblVersion.Text = "Version " + IOVariables.RemindMeVersion;



            Settings set = BLSettings.GetSettings();

            if (set.LastVersion != null && (new Version(set.LastVersion) < new Version(IOVariables.RemindMeVersion)))
            {
                //User has a new RemindMe version!
                string releaseNotesString = "";

                foreach (KeyValuePair <string, string> entry in UpdateInformation.ReleaseNotes)
                {
                    if (new Version(entry.Key) > new Version(set.LastVersion))
                    {
                        releaseNotesString += "Version " + entry.Key + "\r\n" + entry.Value + "\r\n\r\n\r\n";
                    }
                }
                WhatsNew wn = new WhatsNew(set.LastVersion, releaseNotesString);
                wn.Show();

                //Update lastVersion
                set.LastVersion = IOVariables.RemindMeVersion;
                BLSettings.UpdateSettings(set);
            }

            //Default view should be reminders
            pnlMain.Controls.Add(ucReminders);

            MessageFormManager.MakeTodaysRemindersPopup();
            BLIO.Log("Today's reminders popup created");

            //Create an shortcut in the windows startup folder if it doesn't already exist
            if (!File.Exists(IOVariables.startupFolderPath + "\\RemindMe" + ".lnk"))
            {
                FSManager.Shortcuts.CreateShortcut(IOVariables.startupFolderPath, "RemindMe", System.Windows.Forms.Application.StartupPath + "\\" + "RemindMe.exe", "Shortcut of RemindMe");
            }


            if (Debugger.IsAttached)
            {//Debugging ? show extra option
                btnDebugMode.Visible = true;
            }


            BLSongs.InsertWindowsSystemSounds();

            BLIO.Log("RemindMe loaded");
            Cleanup();

            tmrUpdateRemindMe.Start();

            //If the setup still exists, delete it
            File.Delete(IOVariables.rootFolder + "SetupRemindMe.msi");

            //Call the timer once
            Thread tr = new Thread(() =>
            {
                //wait a bit, then call the update timer once. It then runs every 5 minutes
                Thread.Sleep(5000);
                tmrUpdateRemindMe_Tick(null, null);
            });

            tr.Start();


            this.Opacity       = 0;
            this.ShowInTaskbar = true;
            this.Show();
            tmrInitialHide.Start();
        }