diff options
author | Roopesh Chander <roop@forwardbias.in> | 2009-11-04 16:26:49 +0530 |
---|---|---|
committer | Roopesh Chander <roop@forwardbias.in> | 2009-11-04 16:26:49 +0530 |
commit | 5e1a2b52fcb38921036eb2414e95ac6546382a9b (patch) | |
tree | a1340a8edd5355fb9216765e59e7937375e12e4a /mainwindow.cpp | |
parent | 5d8947cb82bf95a7b56e1b36a0c4fe49a6d75494 (diff) |
remember refresh interval across sessions
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r-- | mainwindow.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 20de640..80c5551 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -41,9 +41,12 @@ void MainWindow::initScrapBoard() { createScrapsToolbar(gs); } -void MainWindow::addScrap(QUrl url, QRect scrapRect, QPoint position, qreal xScale, qreal yScale) { +void MainWindow::addScrap(QUrl url, + QRect scrapRect, QPoint position, + qreal xScale, qreal yScale, + int refreshIntervalMins) { WebScrap *webscrap = new WebScrap(url, scrapRect); - webscrap->setRefreshInterval(1000 * 60 * 60); // 1 hour + webscrap->setRefreshInterval(refreshIntervalMins * 60 * 1000); // milliseconds WebScrapContainer *container = new WebScrapContainer(webscrap, scene(), xScale, yScale); container->setPos(position - webscrap->pos()); connect(container, SIGNAL(frameClicked()), SLOT(bubbleUpScrap())); @@ -348,6 +351,7 @@ void MainWindow::saveSettings() { m_settings->setValue("pos", containerPos + scrap->pos()); m_settings->setValue("xScale", container->scrapScale()->xScale()); m_settings->setValue("yScale", container->scrapScale()->yScale()); + m_settings->setValue("refreshIntervalMinutes", int(scrap->refreshInterval() / 60000)); } } m_settings->endArray(); @@ -370,7 +374,8 @@ void MainWindow::loadSettings() { QPoint pos = m_settings->value("pos").toPoint(); qreal xScale = m_settings->value("xScale", 1.0).toReal(); qreal yScale = m_settings->value("yScale", 1.0).toReal(); - addScrap(url, scrapRect, pos, xScale, yScale); + int refreshMins = m_settings->value("refreshIntervalMinutes", 60).toInt(); + addScrap(url, scrapRect, pos, xScale, yScale, refreshMins); } } else { addScrap(QUrl("http://www.gocomics.com/calvinandhobbes/"), |