diff options
Diffstat (limited to 'ch23/23_a_1/PodMainGUI.hs')
| -rw-r--r-- | ch23/23_a_1/PodMainGUI.hs | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/ch23/23_a_1/PodMainGUI.hs b/ch23/23_a_1/PodMainGUI.hs index 6c7190d..b9badf3 100644 --- a/ch23/23_a_1/PodMainGUI.hs +++ b/ch23/23_a_1/PodMainGUI.hs @@ -1,6 +1,7 @@ {-- snippet imports --}
-module PodMainGUI where
+module Main where
+import PodMain
import PodDownload
import PodDB
import PodTypes
@@ -39,8 +40,9 @@ data GUI = GUI { {-- /snippet type --}
{-- snippet main --}
-main :: FilePath -> IO ()
-main gladepath = withSocketsDo $ handleSqlError $
+gladepath = "podresources.glade"
+
+main = withSocketsDo $ handleSqlError $
do initGUI -- Initialize GTK+ engine
-- Every so often, we try to run other threads.
@@ -193,33 +195,3 @@ guiFetch gui dbh = statusWindow gui dbh "Pod: Fetch"
(\logf -> update dbh logf >> download dbh logf)
{-- /snippet statusWindowFuncs --}
-
-{-- snippet workerFuncs --}
-addUrl dbh url =
- do addPodcast dbh pc
- commit dbh
- where pc = Podcast {castId = 0, castURL = url}
-
-update :: IConnection conn => conn -> (String -> IO ()) -> IO ()
-update dbh logf =
- do pclist <- getPodcasts dbh
- mapM_ procPodcast pclist
- logf "Update complete."
- where procPodcast pc =
- do logf $ "Updating from " ++ (castURL pc)
- updatePodcastFromFeed dbh pc
-
-download dbh logf =
- do pclist <- getPodcasts dbh
- mapM_ procPodcast pclist
- logf "Download complete."
- where procPodcast pc =
- do logf $ "Considering " ++ (castURL pc)
- episodelist <- getPodcastEpisodes dbh pc
- let dleps = filter (\ep -> epDone ep == False)
- episodelist
- mapM_ procEpisode dleps
- procEpisode ep =
- do logf $ "Downloading " ++ (epURL ep)
- getEpisode dbh ep
-{-- /snippet workerFuncs --}
|
