GTK: add about dialog
This commit is contained in:
parent
b657756e37
commit
f64f2a975c
@ -16,6 +16,7 @@ data-files: data/Gtk/builder.xml
|
||||
data/Gtk/icons/gtk-directory.png
|
||||
data/Gtk/icons/gtk-file.png
|
||||
data/Gtk/icons/hsfm.png
|
||||
LICENSE
|
||||
|
||||
|
||||
library
|
||||
|
@ -110,6 +110,10 @@ setCallbacks mygui myview = do
|
||||
_ <- menubarEditCut mygui `on` menuItemActivated $
|
||||
liftIO $ withRow mygui myview moveInit
|
||||
|
||||
-- menubar-help
|
||||
_ <- menubarHelpAbout mygui `on` menuItemActivated $
|
||||
liftIO showAboutDialog
|
||||
|
||||
-- righ-click
|
||||
_ <- treeView mygui `on` buttonPressEvent $ do
|
||||
eb <- eventButton
|
||||
|
@ -75,6 +75,28 @@ showCopyModeChooserDialog = do
|
||||
ResponseUser 2 -> return Replace
|
||||
|
||||
|
||||
-- |Shows the about dialog from the help menu.
|
||||
showAboutDialog :: IO ()
|
||||
showAboutDialog = do
|
||||
ad <- aboutDialogNew
|
||||
licensestr <- readFile "LICENSE"
|
||||
hsfmicon <- pixbufNewFromFile "data/Gtk/icons/hsfm.png"
|
||||
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 <hasufell@hasufell.de>"]
|
||||
, aboutDialogLogo := Just hsfmicon
|
||||
, aboutDialogWrapLicense := True
|
||||
]
|
||||
_ <- dialogRun ad
|
||||
widgetDestroy ad
|
||||
|
||||
|
||||
-- |Carry out an IO action with a confirmation dialog.
|
||||
-- If the user presses "No", then do nothing.
|
||||
withConfirmationDialog :: String -> IO () -> IO ()
|
||||
|
Loading…
Reference in New Issue
Block a user