GTK: use Cabal to construct the about dialog information
This commit is contained in:
parent
1ea20efe49
commit
bd448644d2
@ -7,6 +7,7 @@ license-file: LICENSE
|
|||||||
author: Julian Ospald
|
author: Julian Ospald
|
||||||
maintainer: hasufell@hasufell.de
|
maintainer: hasufell@hasufell.de
|
||||||
copyright: Copyright: (c) 2015 Julian Ospald
|
copyright: Copyright: (c) 2015 Julian Ospald
|
||||||
|
homepage: https://github.com/hasufell/hsfm
|
||||||
category: Desktop
|
category: Desktop
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
@ -61,6 +62,7 @@ executable hsfm-gtk
|
|||||||
|
|
||||||
build-depends: hsfm,
|
build-depends: hsfm,
|
||||||
base >= 4.7,
|
base >= 4.7,
|
||||||
|
Cabal >= 1.22.0.0,
|
||||||
containers,
|
containers,
|
||||||
data-default,
|
data-default,
|
||||||
gtk3 >= 0.14.1,
|
gtk3 >= 0.14.1,
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
module GUI.Gtk.Dialogs where
|
module GUI.Gtk.Dialogs where
|
||||||
|
|
||||||
|
|
||||||
|
import Control.Applicative
|
||||||
|
(
|
||||||
|
(<$>)
|
||||||
|
)
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
(
|
(
|
||||||
try
|
try
|
||||||
@ -13,7 +17,28 @@ import Control.Monad
|
|||||||
when
|
when
|
||||||
, void
|
, void
|
||||||
)
|
)
|
||||||
|
import Data.Version
|
||||||
|
(
|
||||||
|
showVersion
|
||||||
|
)
|
||||||
|
import Distribution.Package
|
||||||
|
(
|
||||||
|
PackageIdentifier(..)
|
||||||
|
, PackageName(..)
|
||||||
|
)
|
||||||
|
import Distribution.PackageDescription
|
||||||
|
(
|
||||||
|
GenericPackageDescription(..)
|
||||||
|
, PackageDescription(..)
|
||||||
|
)
|
||||||
|
import Distribution.PackageDescription.Parse
|
||||||
|
(
|
||||||
|
readPackageDescription
|
||||||
|
)
|
||||||
|
import Distribution.Verbosity
|
||||||
|
(
|
||||||
|
silent
|
||||||
|
)
|
||||||
import Graphics.UI.Gtk
|
import Graphics.UI.Gtk
|
||||||
import GUI.Gtk.Data
|
import GUI.Gtk.Data
|
||||||
import IO.File
|
import IO.File
|
||||||
@ -79,17 +104,18 @@ showCopyModeChooserDialog = do
|
|||||||
showAboutDialog :: IO ()
|
showAboutDialog :: IO ()
|
||||||
showAboutDialog = do
|
showAboutDialog = do
|
||||||
ad <- aboutDialogNew
|
ad <- aboutDialogNew
|
||||||
licensestr <- readFile "LICENSE"
|
lstr <- readFile "LICENSE"
|
||||||
hsfmicon <- pixbufNewFromFile "data/Gtk/icons/hsfm.png"
|
hsfmicon <- pixbufNewFromFile "data/Gtk/icons/hsfm.png"
|
||||||
|
pdesc <- packageDescription <$> readPackageDescription silent "hsfm.cabal"
|
||||||
set ad
|
set ad
|
||||||
[ aboutDialogProgramName := "hsfm"
|
[ aboutDialogProgramName := (unPackageName . pkgName . package) pdesc
|
||||||
, aboutDialogName := "hsfm"
|
, aboutDialogName := (unPackageName . pkgName . package) pdesc
|
||||||
, aboutDialogVersion := "0.0.0.1"
|
, aboutDialogVersion := (showVersion . pkgVersion . package) pdesc
|
||||||
, aboutDialogCopyright := "Copyright: (c) 2015 Julian Ospald"
|
, aboutDialogCopyright := copyright pdesc
|
||||||
, aboutDialogComments := "A file manager written in Haskell"
|
, aboutDialogComments := description pdesc
|
||||||
, aboutDialogLicense := Just licensestr
|
, aboutDialogLicense := Just lstr
|
||||||
, aboutDialogWebsite := "https://github.com/hasufell/hsfm"
|
, aboutDialogWebsite := homepage pdesc
|
||||||
, aboutDialogAuthors := ["Julian Ospald <hasufell@hasufell.de>"]
|
, aboutDialogAuthors := [author pdesc]
|
||||||
, aboutDialogLogo := Just hsfmicon
|
, aboutDialogLogo := Just hsfmicon
|
||||||
, aboutDialogWrapLicense := True
|
, aboutDialogWrapLicense := True
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user