diff --git a/hsfm.cabal b/hsfm.cabal index 862e05a..1c28586 100644 --- a/hsfm.cabal +++ b/hsfm.cabal @@ -7,6 +7,7 @@ license-file: LICENSE author: Julian Ospald maintainer: hasufell@hasufell.de copyright: Copyright: (c) 2015 Julian Ospald +homepage: https://github.com/hasufell/hsfm category: Desktop build-type: Simple cabal-version: >=1.10 @@ -61,6 +62,7 @@ executable hsfm-gtk build-depends: hsfm, base >= 4.7, + Cabal >= 1.22.0.0, containers, data-default, gtk3 >= 0.14.1, diff --git a/src/GUI/Gtk/Dialogs.hs b/src/GUI/Gtk/Dialogs.hs index 4fc838d..e00c1ba 100644 --- a/src/GUI/Gtk/Dialogs.hs +++ b/src/GUI/Gtk/Dialogs.hs @@ -3,6 +3,10 @@ module GUI.Gtk.Dialogs where +import Control.Applicative + ( + (<$>) + ) import Control.Exception ( try @@ -13,7 +17,28 @@ import Control.Monad when , 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 GUI.Gtk.Data import IO.File @@ -78,18 +103,19 @@ showCopyModeChooserDialog = do -- |Shows the about dialog from the help menu. showAboutDialog :: IO () showAboutDialog = do - ad <- aboutDialogNew - licensestr <- readFile "LICENSE" + ad <- aboutDialogNew + lstr <- readFile "LICENSE" hsfmicon <- pixbufNewFromFile "data/Gtk/icons/hsfm.png" + pdesc <- packageDescription <$> readPackageDescription silent "hsfm.cabal" set ad - [ aboutDialogProgramName := "hsfm" - , aboutDialogName := "hsfm" - , aboutDialogVersion := "0.0.0.1" - , aboutDialogCopyright := "Copyright: (c) 2015 Julian Ospald" - , aboutDialogComments := "A file manager written in Haskell" - , aboutDialogLicense := Just licensestr - , aboutDialogWebsite := "https://github.com/hasufell/hsfm" - , aboutDialogAuthors := ["Julian Ospald "] + [ aboutDialogProgramName := (unPackageName . pkgName . package) pdesc + , aboutDialogName := (unPackageName . pkgName . package) pdesc + , aboutDialogVersion := (showVersion . pkgVersion . package) pdesc + , aboutDialogCopyright := copyright pdesc + , aboutDialogComments := description pdesc + , aboutDialogLicense := Just lstr + , aboutDialogWebsite := homepage pdesc + , aboutDialogAuthors := [author pdesc] , aboutDialogLogo := Just hsfmicon , aboutDialogWrapLicense := True ]