From 56767b6b8f356ebb471b9685fcb42dc609f07397 Mon Sep 17 00:00:00 2001 From: Steven Scott Date: Fri, 28 Jul 2006 22:10:50 +0000 Subject: [PATCH] changed all references from iTunesAlarm to iSnooze, except for file & class names. added the ability to disable single alarms without deleting them. icon now turns red whenever it's not going to go off, not just when it is explicitly disabled. --- AboutDlg.cpp | 10 +-- AboutDlg.h | 8 +-- ChildView.cpp | 8 +-- ChildView.h | 8 +-- ConfigDlg.cpp | 24 +++++--- ConfigDlg.h | 9 +-- DayTime.cpp | 27 ++++++--- DayTime.h | 33 +++++++--- GroupControl.cpp | 8 +-- GroupControl.h | 8 +-- ITI.cpp | 8 +-- ITI.h | 8 +-- LimitSingleInstance.h | 8 +-- MainFrm.cpp | 131 ++++++++++++++++++++++++++++------------ MainFrm.h | 13 ++-- RegMap.cpp | 8 +-- RegMap.h | 8 +-- Resource.h | 5 +- SnoozeDlg.cpp | 8 +-- SnoozeDlg.h | 8 +-- SystemTray.cpp | 8 +-- SystemTray.h | 8 +-- ToolTipBitmapButton.cpp | 8 +-- ToolTipBitmapButton.h | 8 +-- ToolTipButton.cpp | 8 +-- ToolTipButton.h | 8 +-- iTunesAlarm.cpp | 8 +-- iTunesAlarm.h | 10 +-- iTunesAlarm.rc | 71 +++++++++++----------- iTunesAlarm.vcproj | 2 + iTunesCOMInterface.h | 8 +-- iTunesCOMInterface_i.c | 8 +-- installer.nsi | 32 +++++----- stdafx.cpp | 8 +-- stdafx.h | 8 +-- t.h | 8 +-- utf8.h | 8 +-- wrterror.h | 8 +-- 38 files changed, 333 insertions(+), 242 deletions(-) diff --git a/AboutDlg.cpp b/AboutDlg.cpp index 3275d10..42859f1 100644 --- a/AboutDlg.cpp +++ b/AboutDlg.cpp @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" @@ -64,6 +64,6 @@ BOOL CAboutDlg::OnInitDialog(void) void CAboutDlg::OnBnClickedPaypal() { - ShellExecute( GetSafeHwnd(), _T("open"), _T("https://www.paypal.com/xclick/business=progoth%40gmail.com&no_shipping=1&item_name=Donation%20to%20iTunesAlarm!&no_note=1&tax=0¤cy_code=USD"), + ShellExecute( GetSafeHwnd(), _T("open"), _T("https://www.paypal.com/xclick/business=progoth%40gmail.com&no_shipping=1&item_name=Donation%20to%20iSnooze!&no_note=1&tax=0¤cy_code=USD"), NULL, NULL, 0 ); } diff --git a/AboutDlg.h b/AboutDlg.h index 3d83ec0..701e80b 100644 --- a/AboutDlg.h +++ b/AboutDlg.h @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once diff --git a/ChildView.cpp b/ChildView.cpp index b0d24a9..63344fd 100644 --- a/ChildView.cpp +++ b/ChildView.cpp @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" diff --git a/ChildView.h b/ChildView.h index 4fc5961..c0ad282 100644 --- a/ChildView.h +++ b/ChildView.h @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA diff --git a/ConfigDlg.cpp b/ConfigDlg.cpp index 72258ec..e1db2f2 100644 --- a/ConfigDlg.cpp +++ b/ConfigDlg.cpp @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" @@ -164,7 +164,7 @@ void CConfigDlg::LoadFromReg() CButton *runatstartup = (CButton*)GetDlgItem( IDC_STARTUP_CHECK ); RegMap t(HKEY_CURRENT_USER); t = t[_T("Software")][_T("Microsoft")][_T("Windows")][_T("CurrentVersion")][_T("Run")]; - runatstartup->SetCheck( ((t.has_key(_T("iTunesAlarm")))?BST_CHECKED:BST_UNCHECKED) ); + runatstartup->SetCheck( ((t.has_key(_T("iSnooze")))?BST_CHECKED:BST_UNCHECKED) ); long st = 0xff & (long)m_reg[_T("SnoozeTime")]; if( st < 1 ) st = 1; if( st > 60 ) st = 60; @@ -202,6 +202,7 @@ void CConfigDlg::SetDlgTimeFromTAD( const DayTime::TimeAndDays &in ) ((CButton*)GetDlgItem(IDC_THURSDAY_CHECK))->SetCheck( ((in.day & DayTime::THURSDAY)?BST_CHECKED:BST_UNCHECKED) ); ((CButton*)GetDlgItem(IDC_FRIDAY_CHECK))->SetCheck( ((in.day & DayTime::FRIDAY)?BST_CHECKED:BST_UNCHECKED) ); ((CButton*)GetDlgItem(IDC_SATURDAY_CHECK))->SetCheck( ((in.day & DayTime::SATURDAY)?BST_CHECKED:BST_UNCHECKED) ); + ((CButton*)GetDlgItem(IDC_SINGLE_ENABLE))->SetCheck( ((in.day & DayTime::ALARM_ENABLED)?BST_CHECKED:BST_UNCHECKED) ); } void CConfigDlg::SaveTimeToReg() @@ -227,6 +228,7 @@ void CConfigDlg::GetTADFromDlgTime( DayTime::TimeAndDays &out ) if( ((CButton*)GetDlgItem(IDC_THURSDAY_CHECK))->GetCheck() == BST_CHECKED ) out.day |= DayTime::THURSDAY; if( ((CButton*)GetDlgItem(IDC_FRIDAY_CHECK))->GetCheck() == BST_CHECKED ) out.day |= DayTime::FRIDAY; if( ((CButton*)GetDlgItem(IDC_SATURDAY_CHECK))->GetCheck() == BST_CHECKED ) out.day |= DayTime::SATURDAY; + if( ((CButton*)GetDlgItem(IDC_SINGLE_ENABLE))->GetCheck() == BST_CHECKED ) out.day |= DayTime::ALARM_ENABLED; } void CConfigDlg::SelectPlaylist() @@ -300,6 +302,7 @@ BEGIN_MESSAGE_MAP(CConfigDlg, CDialog) ON_BN_CLICKED(IDC_THURSDAY_CHECK, OnBnClickedThursdayCheck) ON_BN_CLICKED(IDC_FRIDAY_CHECK, OnBnClickedFridayCheck) ON_BN_CLICKED(IDC_SATURDAY_CHECK, OnBnClickedSaturdayCheck) + ON_BN_CLICKED(IDC_SINGLE_ENABLE, OnBnClickedSingleEnable) END_MESSAGE_MAP() // CConfigDlg message handlers @@ -372,12 +375,12 @@ void CConfigDlg::OnBnClickedOk() { TCHAR f[MAX_PATH]; GetModuleFileName( NULL, f, MAX_PATH ); - t[_T("iTunesAlarm")] = f; + t[_T("iSnooze")] = f; } else { - if( t.has_key( _T("iTunesAlarm") ) ) - t.deleteValue( _T("iTunesAlarm") ); + if( t.has_key( _T("iSnooze") ) ) + t.deleteValue( _T("iSnooze") ); } m_reg[_T("BeenRun")] = true; @@ -527,3 +530,8 @@ void CConfigDlg::OnBnClickedSaturdayCheck() { DoDayCheck( IDC_SATURDAY_CHECK, DayTime::SATURDAY ); } + +void CConfigDlg::OnBnClickedSingleEnable() +{ + DoDayCheck( IDC_SINGLE_ENABLE, DayTime::ALARM_ENABLED ); +} diff --git a/ConfigDlg.h b/ConfigDlg.h index bc54b3d..d73de4e 100644 --- a/ConfigDlg.h +++ b/ConfigDlg.h @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once @@ -118,4 +118,5 @@ class CConfigDlg : public CDialog afx_msg void OnBnClickedThursdayCheck(); afx_msg void OnBnClickedFridayCheck(); afx_msg void OnBnClickedSaturdayCheck(); + afx_msg void OnBnClickedSingleEnable(); }; diff --git a/DayTime.cpp b/DayTime.cpp index 8c09014..3e1a6ec 100644 --- a/DayTime.cpp +++ b/DayTime.cpp @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "StdAfx.h" @@ -24,15 +24,15 @@ using namespace DayTime; const TCHAR *DayTime::DayNames[7] = { _T("Sun"), _T("Mon"), _T("Tue"), _T("Wed"), _T("Thu"), _T("Fri"), _T("Sat") }; -TimeAndDays::TimeAndDays( int hour, int minute, BYTE days ) +TimeAndDays::TimeAndDays( int hour, int minute, BYTE days, bool enabled /*= true*/ ) { - this->day = days; + this->day = days | ( enabled ? ALARM_ENABLED : 0); setTime( hour, minute ); } -TimeAndDays::TimeAndDays( const SYSTEMTIME &st ) +TimeAndDays::TimeAndDays( const SYSTEMTIME &st, bool enabled /*= true*/ ) { - this->day = Win2DayTime[ st.wDayOfWeek ]; + this->day = Win2DayTime[ st.wDayOfWeek ] | ( enabled ? ALARM_ENABLED : 0); setTime( st.wHour, st.wMinute ); } @@ -63,10 +63,12 @@ tstring TimeAndDays::getString() const tstringstream str; int hour, minute; getTime( hour, minute ); + if( !( day & ALARM_ENABLED ) ) + str << _T("(D!) "); str << hour << _T(":") << std::setw(2) << std::setfill(_T('0')) << minute << _T(" "); - if( day == ALL_DAYS ) + if( (0x7f & day) == ALL_DAYS ) str << _T("Every day"); - else if( day == WEEKDAYS ) + else if( (0x7f & day) == WEEKDAYS ) str << _T("Mon-Fri"); else { @@ -110,6 +112,11 @@ void DayTime::addSorted( const TimeAndDays &tm, std::list< TimeAndDays* > &list { std::list< TimeAndDays* >::iterator i, end = list.end(); + if( !tm.isEnabled() ) + { + list.push_back( new TimeAndDays( tm ) ); + return; + } for( i = list.begin(); i != end; ++i ) { if( (**i) > tm ) diff --git a/DayTime.h b/DayTime.h index 539d8bd..4e8a105 100644 --- a/DayTime.h +++ b/DayTime.h @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //#pragma once @@ -37,6 +37,8 @@ namespace DayTime { const unsigned char ALL_DAYS = 127; const unsigned char WEEKDAYS = 62; + const unsigned char ALARM_ENABLED = 128; + const unsigned char Win2DayTime[] = {SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY}; extern const TCHAR *DayNames[7]; @@ -44,9 +46,9 @@ namespace DayTime { class TimeAndDays { public: - TimeAndDays():time(0), day(0){} - TimeAndDays( int hour, int minute, BYTE days ); - TimeAndDays( const SYSTEMTIME &st ); + TimeAndDays():time(0), day(ALARM_ENABLED){} + TimeAndDays( int hour, int minute, BYTE days, bool enabled = true ); + TimeAndDays( const SYSTEMTIME &st, bool enabled = true ); void setTime( int hour, int minute ); @@ -60,13 +62,13 @@ namespace DayTime { void getToBinary( BYTE *data ) const { ((unsigned short*)data)[0] = 0x07ff & time; - ((unsigned char*)data)[2] = 0x7f & day; + ((unsigned char*)data)[2] = day; } void setFromBinary( const char *data ) { time = 0x07ff & ((unsigned short*)data)[0]; - day = 0x7f & ((unsigned char*)data)[2]; + day = ((unsigned char*)data)[2]; } bool isIncluded( const SYSTEMTIME &o ) const @@ -76,6 +78,19 @@ namespace DayTime { return ( (minute == o.wMinute) && (hour == o.wHour) ); } + bool isEnabled() const + { + return (day & ALARM_ENABLED) != 0; + } + + void isEnabled( bool e ) + { + if( e ) + day |= ALARM_ENABLED; + else + day &= ~ALARM_ENABLED; + } + tstring getString() const; unsigned short time; diff --git a/GroupControl.cpp b/GroupControl.cpp index eaacfce..c44ef84 100644 --- a/GroupControl.cpp +++ b/GroupControl.cpp @@ -37,20 +37,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // diff --git a/GroupControl.h b/GroupControl.h index c832583..0f07cc5 100644 --- a/GroupControl.h +++ b/GroupControl.h @@ -37,20 +37,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // diff --git a/ITI.cpp b/ITI.cpp index 10744b0..f962773 100644 --- a/ITI.cpp +++ b/ITI.cpp @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "StdAfx.h" diff --git a/ITI.h b/ITI.h index 341ff24..b90d60d 100644 --- a/ITI.h +++ b/ITI.h @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once diff --git a/LimitSingleInstance.h b/LimitSingleInstance.h index 25d9a50..96ee53c 100644 --- a/LimitSingleInstance.h +++ b/LimitSingleInstance.h @@ -1,17 +1,17 @@ -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef LimitSingleInstance_H diff --git a/MainFrm.cpp b/MainFrm.cpp index 8b962ac..e185c44 100644 --- a/MainFrm.cpp +++ b/MainFrm.cpp @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" @@ -74,7 +74,7 @@ DWORD WINAPI TimerThread( LPVOID param ) DWORD WINAPI VolumeThread( LPVOID param ) { CMainFrame *caller = (CMainFrame*)param; - int begin = 0; + int begin = 30; int end = 100; int increaseStep = 1; int wait = (increaseStep * 1000 * caller->getVolumeLength()) / (end - begin); @@ -142,9 +142,12 @@ CMainFrame::CMainFrame() : m_config(NULL), m_snoozing(false), m_alarms(7) { m_reg = RegMap( HKEY_CURRENT_USER )[_T("Software")]; - if( !m_reg.has_key( _T("iTunesAlarm") ) ) - m_reg[_T("iTunesAlarm")] = RegMap(); - m_reg = m_reg[_T("iTunesAlarm")]; + if( !m_reg.has_key( _T("progoth.com") ) ) + m_reg[_T("progoth.com")] = RegMap(); + m_reg = m_reg[_T("progoth.com")]; + if( !m_reg.has_key( _T("iSnooze") ) ) + m_reg[_T("iSnooze")] = RegMap(); + m_reg = m_reg[_T("iSnooze")]; m_mainThread = GetCurrentThreadId(); @@ -385,14 +388,22 @@ void CMainFrame::LoadReg() DayTime::AlarmList al; DayTime::binToCont( ((binary)m_reg[_T("Alarms")]).data, al ); + m_oneAlarmEnabled = m_oneAlarmExists = false; DayTime::AlarmList::const_iterator i, end = al.end(); for( UINT j = 0; j < 7; j++ ) { DayTime::cleanList( m_alarms[j] ); for( i = al.begin(); i != end; ++i ) { - if( DayTime::Win2DayTime[j] & (*i).day ) - DayTime::addSorted( *i, m_alarms[j] ); + m_oneAlarmExists = true; + if( i->isEnabled() ) //we won't even add the alarm to our list if it's disabled + { + m_oneAlarmEnabled = true; + if( DayTime::Win2DayTime[j] & (*i).day ) + { + DayTime::addSorted( *i, m_alarms[j] ); + } + } } } SYSTEMTIME tst; @@ -429,16 +440,15 @@ void CMainFrame::LoadReg() m_systray.CheckMenuItem( ID_APP_ALARMENABLED, MF_UNCHECKED ); SetToolTip(); + SetIcon(); } -void CMainFrame::SetToolTip() +void CMainFrame::SetIcon() { - static TCHAR buf[1024]; - if( m_alarmEnabled ) + if( !m_alarmEnabled || !m_oneAlarmEnabled || !m_oneAlarmExists ) + m_systray.SetIcon( IDI_DISABLED ); + else { - int hour, minute; - - bool found = false; SYSTEMTIME st; GetLocalTime( &st ); @@ -446,27 +456,9 @@ void CMainFrame::SetToolTip() { if( m_alarms[ (i + st.wDayOfWeek) % 7 ].empty() ) continue; - m_alarms[ (i + st.wDayOfWeek) % 7 ].front()->getTime( hour, minute ); - if( i == 0 && *(m_alarms[ (i + st.wDayOfWeek) % 7 ].front()) > DayTime::TimeAndDays( st ) ) + if( (i != 0) || (i == 0 && *(m_alarms[ (i + st.wDayOfWeek) % 7 ].front()) > DayTime::TimeAndDays( st )) ) { - if( m_snoozing && m_snoozeAlarmTime < *(m_alarms[ (i + st.wDayOfWeek) % 7 ].front()) ) - { - m_snoozeAlarmTime.getTime( hour, minute ); - _stprintf( buf, _T("iTooonz Alaaarrrm!!\nSnoozing until %d:%02d"), hour, minute ); - } - else - _stprintf( buf, _T("iTooonz Alaaarrrm!!\nNext alarm set for %d:%02d"), hour, minute ); - } - else if( i != 0 ) - { - if( m_snoozing ) - { - m_snoozeAlarmTime.getTime( hour, minute ); - _stprintf( buf, _T("iTooonz Alaaarrrm!!\nSnoozing until %d:%02d"), hour, minute ); - } - else - _stprintf( buf, _T("iTooonz Alaaarrrm!!\nNext alarm set for %s, %d:%02d"), - DayTime::DayNames[ (i + st.wDayOfWeek) % 7 ], hour, minute ); + m_systray.SetIcon( IDR_MAINFRAME ); } else continue; @@ -474,11 +466,69 @@ void CMainFrame::SetToolTip() break; } if( !found ) - _stprintf( buf, _T("iTooonz Alaaarrrm!!\nNo alarms set") ); + m_systray.SetIcon( IDI_DISABLED ); + } +} + +void CMainFrame::SetToolTip() +{ + static TCHAR buf[1024]; + if( m_alarmEnabled ) + { + if( !m_oneAlarmExists ) + { + _tcscpy( buf, _T("iSnooze\nNo alarms have been scheduled") ); + } + else if( !m_oneAlarmEnabled ) + { + _tcscpy( buf, _T("iSnooze\nAll alarms have been disabled") ); + } + else + { + int hour, minute; + + + bool found = false; + SYSTEMTIME st; + GetLocalTime( &st ); + for( int i = 0; i < 8; i++ ) + { + if( m_alarms[ (i + st.wDayOfWeek) % 7 ].empty() ) + continue; + m_alarms[ (i + st.wDayOfWeek) % 7 ].front()->getTime( hour, minute ); + if( i == 0 && *(m_alarms[ (i + st.wDayOfWeek) % 7 ].front()) > DayTime::TimeAndDays( st ) ) + { + if( m_snoozing && m_snoozeAlarmTime < *(m_alarms[ (i + st.wDayOfWeek) % 7 ].front()) ) + { + m_snoozeAlarmTime.getTime( hour, minute ); + _stprintf( buf, _T("iSnooze\nSnoozing until %d:%02d"), hour, minute ); + } + else + _stprintf( buf, _T("iSnooze\nNext alarm set for %d:%02d"), hour, minute ); + } + else if( i != 0 ) + { + if( m_snoozing ) + { + m_snoozeAlarmTime.getTime( hour, minute ); + _stprintf( buf, _T("iSnooze\nSnoozing until %d:%02d"), hour, minute ); + } + else + _stprintf( buf, _T("iSnooze\nNext alarm set for %s, %d:%02d"), + DayTime::DayNames[ (i + st.wDayOfWeek) % 7 ], hour, minute ); + } + else + continue; + found = true; + break; + } + if( !found ) + _stprintf( buf, _T("iSnooze\nNo alarms have any days selected!") ); + } } else - _tcscpy( buf, _T("iTooonz Alaaarrrm!!\nAlarm disabled") ); + _tcscpy( buf, _T("iSnooze\nAlarm disabled") ); m_systray.SetTooltipText( buf ); } @@ -530,7 +580,7 @@ void CMainFrame::StartTray() //HICON ico = ::LoadIcon( AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME) ); HICON ico = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR ); - m_systray.Create( this, WM_ICON_NOTIFY, _T("iTooonz Alaaarrrm!!"), ico, IDR_POPUP_MENU ); + m_systray.Create( this, WM_ICON_NOTIFY, _T("iSnooze"), ico, IDR_POPUP_MENU ); InitReg(); LoadReg(); @@ -618,7 +668,8 @@ void CMainFrame::OnAlarmEnabled() { m_reg[_T("AlarmEnabled")] = m_alarmEnabled = true; m_systray.CheckMenuItem( ID_APP_ALARMENABLED, MF_CHECKED ); - m_systray.SetIcon( IDR_MAINFRAME ); + //m_systray.SetIcon( IDR_MAINFRAME ); + SetIcon(); } SetToolTip(); } diff --git a/MainFrm.h b/MainFrm.h index 55a444f..8b39b18 100644 --- a/MainFrm.h +++ b/MainFrm.h @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once @@ -105,6 +105,9 @@ class CMainFrame : public CFrameWnd bool m_alarmEnabled; + bool m_oneAlarmExists; + bool m_oneAlarmEnabled; + DWORD m_mainThread; std::vector< std::list > m_alarms; @@ -113,6 +116,8 @@ class CMainFrame : public CFrameWnd void InitReg(); void SetToolTip(); + void SetIcon(); + afx_msg void OnFileClose(); afx_msg void OnClose(); DECLARE_MESSAGE_MAP() diff --git a/RegMap.cpp b/RegMap.cpp index c8a4cc3..c79ee33 100644 --- a/RegMap.cpp +++ b/RegMap.cpp @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "regmap.h" diff --git a/RegMap.h b/RegMap.h index 102b5f5..1454add 100644 --- a/RegMap.h +++ b/RegMap.h @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _REGMAP_H diff --git a/Resource.h b/Resource.h index 82e51a9..6e5dd56 100644 --- a/Resource.h +++ b/Resource.h @@ -17,7 +17,6 @@ #define IDS_DELETE_TIP 133 #define IDS_PAYPAL_TIP 134 #define IDD_SNOOZE_DIALOG 136 -#define IDI_ICON1 143 #define IDI_DISABLED 143 #define IDC_CHECK1 1000 #define IDC_CHECK_SHUFFLE 1000 @@ -52,6 +51,8 @@ #define IDC_COLON_LABEL 1033 #define IDC_DAYS_GROUP 1034 #define IDC_PAYPAL 1035 +#define IDC_CHECK2 1036 +#define IDC_SINGLE_ENABLE 1036 #define ID_POOP_TEST 32773 #define ID_APP_CONFIGURE 32774 #define ID_POOP_TESTBUBBLE 32775 @@ -66,7 +67,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 144 #define _APS_NEXT_COMMAND_VALUE 32786 -#define _APS_NEXT_CONTROL_VALUE 1036 +#define _APS_NEXT_CONTROL_VALUE 1037 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/SnoozeDlg.cpp b/SnoozeDlg.cpp index 90041d7..0c8b867 100644 --- a/SnoozeDlg.cpp +++ b/SnoozeDlg.cpp @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" diff --git a/SnoozeDlg.h b/SnoozeDlg.h index 1002a63..afccd33 100644 --- a/SnoozeDlg.h +++ b/SnoozeDlg.h @@ -1,19 +1,19 @@ // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once diff --git a/SystemTray.cpp b/SystemTray.cpp index 990440e..e6c12da 100644 --- a/SystemTray.cpp +++ b/SystemTray.cpp @@ -64,20 +64,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ///////////////////////////////////////////////////////////////////////////// diff --git a/SystemTray.h b/SystemTray.h index 6782209..508a183 100644 --- a/SystemTray.h +++ b/SystemTray.h @@ -12,20 +12,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ///////////////////////////////////////////////////////////////////////////// diff --git a/ToolTipBitmapButton.cpp b/ToolTipBitmapButton.cpp index 024d00c..ac80f7f 100644 --- a/ToolTipBitmapButton.cpp +++ b/ToolTipBitmapButton.cpp @@ -11,20 +11,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // diff --git a/ToolTipBitmapButton.h b/ToolTipBitmapButton.h index 835cc2b..1dfd5fc 100644 --- a/ToolTipBitmapButton.h +++ b/ToolTipBitmapButton.h @@ -9,20 +9,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // diff --git a/ToolTipButton.cpp b/ToolTipButton.cpp index 93b4236..505f613 100644 --- a/ToolTipButton.cpp +++ b/ToolTipButton.cpp @@ -11,20 +11,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // diff --git a/ToolTipButton.h b/ToolTipButton.h index 606b38f..1581ef9 100644 --- a/ToolTipButton.h +++ b/ToolTipButton.h @@ -9,20 +9,20 @@ // above link for the original. // // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // diff --git a/iTunesAlarm.cpp b/iTunesAlarm.cpp index 1eb98d2..bb186f6 100644 --- a/iTunesAlarm.cpp +++ b/iTunesAlarm.cpp @@ -2,20 +2,20 @@ // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" diff --git a/iTunesAlarm.h b/iTunesAlarm.h index a49800f..7aebce5 100644 --- a/iTunesAlarm.h +++ b/iTunesAlarm.h @@ -1,21 +1,21 @@ -// iTunesAlarm.h : main header file for the iTunesAlarm application +// iTunesAlarm.h : main header file for the iSnooze application // // Copyright (c) 2004, Steven Scott (progoth@gmail.com) // -// This file is part of iTunesAlarm. +// This file is part of iSnooze. // -// iTunesAlarm is free software; you can redistribute it and/or modify +// iSnooze is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// iTunesAlarm is distributed in the hope that it will be useful, +// iSnooze is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with iTunesAlarm; if not, write to the Free Software +// along with iSnooze; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma once diff --git a/iTunesAlarm.rc b/iTunesAlarm.rc index 7261b86..1864797 100644 --- a/iTunesAlarm.rc +++ b/iTunesAlarm.rc @@ -136,12 +136,11 @@ END IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About iTunesAlarm" +CAPTION "About iSnooze" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 - LTEXT "iTunesAlarm Version 1.2.1",IDC_STATIC,40,10,119,8, - SS_NOPREFIX + LTEXT "iSnooze Version 1.3",IDC_STATIC,40,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) Steven Scott, 2004",IDC_STATIC,40,25,119, 8 DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP @@ -149,7 +148,7 @@ BEGIN WS_TABSTOP,182,25,41,19 END -IDD_CONFIG_DIALOG DIALOGEX 0, 0, 199, 244 +IDD_CONFIG_DIALOG DIALOGEX 0, 0, 199, 264 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Configure Alarms" @@ -159,14 +158,14 @@ BEGIN WS_VSCROLL | WS_TABSTOP PUSHBUTTON "A&dd",IDC_ADD,22,26,44,13 PUSHBUTTON "De&lete",IDC_DELETE,77,26,46,13 - GROUPBOX "Sc&hedule",IDC_DAYS_GROUP,16,41,168,57 - LTEXT "&Time: ",IDC_TIME_LABEL,29,53,20,8,0,WS_EX_RIGHT + GROUPBOX "Sc&hedule",IDC_DAYS_GROUP,16,41,168,75 + LTEXT "&Time: ",IDC_TIME_LABEL,27,53,20,8,0,WS_EX_RIGHT COMBOBOX IDC_HOURS,49,51,27,94,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_MINS,80,51,27,94,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - CONTROL ":",IDC_COLON_LABEL,"Static",SS_SIMPLE | WS_GROUP,77,53, + CONTROL ":",IDC_COLON_LABEL,"Static",SS_SIMPLE | WS_GROUP,81,53, 8,8,WS_EX_TRANSPARENT + COMBOBOX IDC_MINS,88,51,27,94,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP CONTROL "Sunday",IDC_SUNDAY_CHECK,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,126,51,40,10 CONTROL "Monday",IDC_MONDAY_CHECK,"Button",BS_AUTOCHECKBOX | @@ -181,35 +180,37 @@ BEGIN WS_TABSTOP,76,85,36,10 CONTROL "Saturday",IDC_SATURDAY_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,126,85,45,10 - COMBOBOX IDC_PLAYLISTS,12,101,175,69,CBS_DROPDOWNLIST | + CONTROL "E&nable this Alarm?",IDC_SINGLE_ENABLE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,62,101,74,10 + COMBOBOX IDC_PLAYLISTS,12,123,175,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "&Shuffle Play",IDC_CHECK_SHUFFLE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,40,120,55,11 - PUSHBUTTON "Re&fresh",IDC_BUTTON1,108,119,50,14 + BS_AUTOCHECKBOX | WS_TABSTOP,40,142,55,11 + PUSHBUTTON "Re&fresh",IDC_BUTTON1,108,141,50,14 CONTROL "&Increase\nVolume",IDC_INCREASE_CHECK,"Button", - BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,15,141,47,19 + BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,15,163,47,19 CONTROL "",IDC_SECONDS_SLIDER,"msctls_trackbar32",TBS_BOTH | - TBS_TOOLTIPS | WS_TABSTOP,70,139,122,27 + TBS_TOOLTIPS | WS_TABSTOP,70,161,122,27 CONTROL "&Minimize iTunes\non Alarm",IDC_MINIMIZE_CHECK,"Button", - BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,15,169,67,20 - CONTROL "&Run iTunesAlarm\nat Startup",IDC_STARTUP_CHECK,"Button", - BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,107,169,67, + BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,15,191,67,20 + CONTROL "&Run iSnooze\nat Startup",IDC_STARTUP_CHECK,"Button", + BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,107,191,67, 20 CONTROL "&Enable Snooze",IDC_ENABLE_SNOOZE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,196,63,10 + BS_AUTOCHECKBOX | WS_TABSTOP,15,218,63,10 CONTROL "Pause on \nComputer &Access",IDC_DO_MUTE,"Button", - BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,107,193,73, + BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,107,215,73, 16 - LTEXT "S&nooze Time:",IDC_SNOOZE_LABEL,45,221,46,8,0, + LTEXT "Snoo&ze Time:",IDC_SNOOZE_LABEL,45,243,46,8,0, WS_EX_RIGHT - EDITTEXT IDC_SNOOZE_TIME,94,219,30,14,ES_RIGHT | ES_AUTOHSCROLL | + EDITTEXT IDC_SNOOZE_TIME,94,241,30,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER CONTROL "",IDC_SNOOZE_SPIN,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,124,219, + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,124,241, 11,14 DEFPUSHBUTTON "&OK",IDOK,142,7,50,14 PUSHBUTTON "&Cancel",IDCANCEL,142,24,50,14 - LTEXT "minutes",IDC_SNOOZE_LABEL2,127,221,26,8 + LTEXT "minutes",IDC_SNOOZE_LABEL2,127,243,26,8 END IDD_SNOOZE_DIALOG DIALOGEX 0, 0, 154, 74 @@ -230,8 +231,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,1,41 - PRODUCTVERSION 1,2,1,41 + FILEVERSION 1,3,0,44 + PRODUCTVERSION 1,3,0,44 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -247,13 +248,13 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "Progoth.com" - VALUE "FileDescription", "iTunesAlarm Executable" - VALUE "FileVersion", "1.2.1.41" - VALUE "InternalName", "iTunesAlarm.exe" + VALUE "FileDescription", "iSnooze Executable" + VALUE "FileVersion", "1.3.0.44" + VALUE "InternalName", "iSnooze.exe" VALUE "LegalCopyright", "(c) 2004, Steven Scott. All rights reserved." - VALUE "OriginalFilename", "iTunesAlarm.exe" - VALUE "ProductName", "iTunes Alarm" - VALUE "ProductVersion", "1.2.1.41" + VALUE "OriginalFilename", "iSnooze.exe" + VALUE "ProductName", "iSnooze" + VALUE "ProductVersion", "1.3.0.44" END END BLOCK "VarFileInfo" @@ -284,7 +285,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 192 TOPMARGIN, 7 - BOTTOMMARGIN, 237 + BOTTOMMARGIN, 257 END IDD_SNOOZE_DIALOG, DIALOG @@ -501,8 +502,8 @@ PAYPALF BITMAP "res\\paypalfocus.bmp" STRINGTABLE BEGIN - IDR_MAINFRAME "iTunesAlarm" - IDS_INCREASE_TIP "This increases iTunes' volume from 0% to 100% in the specified number of seconds." + IDR_MAINFRAME "iSnooze" + IDS_INCREASE_TIP "This increases iTunes' volume from 30% to 100% in the specified number of seconds." IDS_MINIMIZE_TIP "Minimize iTunes when alarm goes off to reduce chances of bleary-eyed Stop-hitting" IDS_PAUSE_TIP "Temporarily pauses iTunes, allowing you to snooze/stop in silence. Unpauses after 10 seconds of inactivity." IDS_ADD_TIP "Add a new alarm" @@ -512,7 +513,7 @@ END STRINGTABLE BEGIN - AFX_IDS_APP_TITLE "iTunesAlarm" + AFX_IDS_APP_TITLE "iSnooze" AFX_IDS_IDLEMESSAGE "Ready" END diff --git a/iTunesAlarm.vcproj b/iTunesAlarm.vcproj index ef51415..9e66945 100644 --- a/iTunesAlarm.vcproj +++ b/iTunesAlarm.vcproj @@ -33,6 +33,7 @@ Name="VCCustomBuildTool"/>