Changeset View
Changeset View
Standalone View
Standalone View
src/rsiwidget.cpp
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | 152 | if ( newIcon != m_currentIcon ) { | |||
---|---|---|---|---|---|
155 | m_currentIcon = newIcon; | 155 | m_currentIcon = newIcon; | ||
156 | } | 156 | } | ||
157 | } | 157 | } | ||
158 | 158 | | |||
159 | // ------------------- Popup for skipping break ------------- // | 159 | // ------------------- Popup for skipping break ------------- // | ||
160 | 160 | | |||
161 | void RSIObject::tinyBreakSkipped() | 161 | void RSIObject::tinyBreakSkipped() | ||
162 | { | 162 | { | ||
163 | KNotification::event( "short timer reset", | 163 | m_notificator.onShortTimerReset(); | ||
164 | i18n( "Timer for the short break has now been reset" ), | | |||
165 | KIconLoader::global()->loadIcon( "rsibreak0", KIconLoader::Desktop ) ); | | |||
166 | } | 164 | } | ||
167 | 165 | | |||
168 | void RSIObject::bigBreakSkipped() | 166 | void RSIObject::bigBreakSkipped() | ||
169 | { | 167 | { | ||
170 | KNotification::event( "timers reset", | 168 | m_notificator.onTimersReset(); | ||
171 | i18n( "The timers have now been reset" ), | | |||
172 | KIconLoader::global()->loadIcon( "rsibreak0", KIconLoader::Desktop ) ); | | |||
173 | } | 169 | } | ||
174 | 170 | | |||
175 | //--------------------------- CONFIG ----------------------------// | 171 | //--------------------------- CONFIG ----------------------------// | ||
176 | 172 | | |||
177 | void RSIObject::configureTimer() | 173 | void RSIObject::configureTimer() | ||
178 | { | 174 | { | ||
179 | if (m_timer != nullptr) { | 175 | if (m_timer != nullptr) { | ||
180 | m_timer->updateConfig(); | 176 | m_timer->updateConfig(); | ||
181 | return; | 177 | return; | ||
182 | } | 178 | } | ||
183 | m_timer = new RSITimer(this); | 179 | m_timer = new RSITimer(this); | ||
184 | 180 | | |||
185 | connect(m_timer, &RSITimer::breakNow, this, &RSIObject::maximize, Qt::QueuedConnection ); | 181 | connect(m_timer, &RSITimer::breakNow, this, &RSIObject::maximize, Qt::QueuedConnection ); | ||
186 | connect(m_timer, &RSITimer::updateWidget, this, &RSIObject::setCounters, Qt::QueuedConnection ); | 182 | connect(m_timer, &RSITimer::updateWidget, this, &RSIObject::setCounters, Qt::QueuedConnection ); | ||
187 | connect(m_timer, &RSITimer::updateToolTip, m_tray, &RSIDock::setCounters, Qt::QueuedConnection ); | 183 | connect(m_timer, &RSITimer::updateToolTip, m_tray, &RSIDock::setCounters, Qt::QueuedConnection ); | ||
188 | connect(m_timer, &RSITimer::updateIdleAvg, this, &RSIObject::updateIdleAvg, Qt::QueuedConnection ); | 184 | connect(m_timer, &RSITimer::updateIdleAvg, this, &RSIObject::updateIdleAvg, Qt::QueuedConnection ); | ||
189 | connect(m_timer, &RSITimer::minimize, this, &RSIObject::minimize, Qt::QueuedConnection ); | 185 | connect(m_timer, &RSITimer::minimize, this, &RSIObject::minimize, Qt::QueuedConnection ); | ||
190 | connect(m_timer, &RSITimer::relax, m_relaxpopup, &RSIRelaxPopup::relax, Qt::QueuedConnection ); | 186 | connect(m_timer, &RSITimer::relax, m_relaxpopup, &RSIRelaxPopup::relax, Qt::QueuedConnection ); | ||
191 | connect(m_timer, &RSITimer::tinyBreakSkipped, this, &RSIObject::tinyBreakSkipped, Qt::QueuedConnection ); | 187 | connect(m_timer, &RSITimer::tinyBreakSkipped, this, &RSIObject::tinyBreakSkipped, Qt::QueuedConnection ); | ||
192 | connect(m_timer, &RSITimer::bigBreakSkipped, this, &RSIObject::bigBreakSkipped, Qt::QueuedConnection ); | 188 | connect(m_timer, &RSITimer::bigBreakSkipped, this, &RSIObject::bigBreakSkipped, Qt::QueuedConnection ); | ||
189 | connect(m_timer, &RSITimer::startLongBreak, &m_notificator, &Notificator::onStartLongBreak ); | ||||
190 | connect(m_timer, &RSITimer::endLongBreak, &m_notificator, &Notificator::onEndLongBreak ); | ||||
191 | connect(m_timer, &RSITimer::startShortBreak, &m_notificator, &Notificator::onStartShortBreak ); | ||||
192 | connect(m_timer, &RSITimer::endShortBreak, &m_notificator, &Notificator::onEndShortBreak ); | ||||
193 | 193 | | |||
194 | connect(m_tray, &RSIDock::configChanged, m_timer, &RSITimer::updateConfig); | 194 | connect(m_tray, &RSIDock::configChanged, m_timer, &RSITimer::updateConfig); | ||
195 | connect(m_tray, &RSIDock::dialogEntered, m_timer, &RSITimer::slotStop); | 195 | connect(m_tray, &RSIDock::dialogEntered, m_timer, &RSITimer::slotStop); | ||
196 | connect(m_tray, &RSIDock::dialogLeft, m_timer, &RSITimer::slotStart); | 196 | connect(m_tray, &RSIDock::dialogLeft, m_timer, &RSITimer::slotStart); | ||
197 | connect(m_tray, &RSIDock::suspend, m_timer, &RSITimer::slotSuspended); | 197 | connect(m_tray, &RSIDock::suspend, m_timer, &RSITimer::slotSuspended); | ||
198 | 198 | | |||
199 | connect(m_relaxpopup, &RSIRelaxPopup::skip, m_timer, &RSITimer::skipBreak); | 199 | connect(m_relaxpopup, &RSIRelaxPopup::skip, m_timer, &RSITimer::skipBreak); | ||
200 | connect(m_relaxpopup, &RSIRelaxPopup::postpone, m_timer, &RSITimer::postponeBreak); | 200 | connect(m_relaxpopup, &RSIRelaxPopup::postpone, m_timer, &RSITimer::postponeBreak); | ||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |