From e3054c238f0eec33c1ce091081dbc18948388f8b Mon Sep 17 00:00:00 2001 From: travis-ci Date: Wed, 8 Jun 2016 20:00:34 +0000 Subject: [PATCH] Lastest docs updated travis build: 37 commit: e3a840b051dccf31ed8d5139baad18d53420359b auto-pushed to gh-pages --- HSFM-GUI-Gtk-Callbacks.html | 4 +- HSFM-GUI-Gtk-Data.html | 4 +- HSFM-GUI-Gtk-Plugins.html | 12 +- HSFM-GUI-Gtk-Utils.html | 2 +- Paths_hsfm.html | 2 +- doc-index-A.html | 2 +- doc-index-All.html | 2 +- doc-index-D.html | 2 +- doc-index-R.html | 2 +- doc-index-S.html | 2 +- hsfm.haddock | Bin 50312 -> 50605 bytes mini_HSFM-GUI-Gtk-Callbacks.html | 2 +- mini_HSFM-GUI-Gtk-Plugins.html | 2 +- src/HSFM-GUI-Gtk-Callbacks.html | 1246 ++++++++++++++++-------------- src/HSFM-GUI-Gtk-Data.html | 119 ++- src/HSFM-GUI-Gtk-MyView.html | 478 ++++++------ src/HSFM-GUI-Gtk-Plugins.html | 159 ++-- src/HSFM-GUI-Gtk-Utils.html | 4 +- 18 files changed, 1050 insertions(+), 994 deletions(-) diff --git a/HSFM-GUI-Gtk-Callbacks.html b/HSFM-GUI-Gtk-Callbacks.html index 8cabe97..8f183ea 100644 --- a/HSFM-GUI-Gtk-Callbacks.html +++ b/HSFM-GUI-Gtk-Callbacks.html @@ -1,5 +1,5 @@ HSFM.GUI.Gtk.Callbacks

hsfm-gtk

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Callbacks

Synopsis

Documentation

setGUICallbacks :: MyGUI -> IO () Source #

Set callbacks for the whole gui, on hotkeys, events and stuff.

setViewCallbacks :: MyGUI -> MyView -> IO () Source #

Set callbacks specific to a given view, on hotkeys, events and stuff.

closeTab :: MyGUI -> MyView -> IO () Source #

Closes the current tab, but only if there is more than one tab.

del :: [Item] -> MyGUI -> MyView -> IO () Source #

Supposed to be used with withRows. Deletes a file or directory.

moveInit :: [Item] -> MyGUI -> MyView -> IO () Source #

Initializes a file move operation.

copyInit :: [Item] -> MyGUI -> MyView -> IO () Source #

Supposed to be used with withRows. Initializes a file copy operation.

operationFinal :: MyGUI -> MyView -> Maybe Item -> IO () Source #

Finalizes a file operation, such as copy or move.

newFile :: MyGUI -> MyView -> IO () Source #

Create a new file.

newDir :: MyGUI -> MyView -> IO () Source #

Create a new directory.

renameF :: [Item] -> MyGUI -> MyView -> IO () Source #

urlGoTo :: MyGUI -> MyView -> IO () Source #

Go to the url given at the urlBar and visualize it in the given - treeView.

If the url is invalid, does nothing.

execute :: [Item] -> MyGUI -> MyView -> IO () Source #

Execute a given file.

open :: [Item] -> MyGUI -> MyView -> IO () Source #

Supposed to be used with withRows. Opens a file or directory.

upDir :: MyGUI -> MyView -> IO () Source #

Go up one directory and visualize it in the treeView.

goHistoryBack :: MyGUI -> MyView -> IO (Path Abs) Source #

Go "back" in the history.

goHistoryForward :: MyGUI -> MyView -> IO (Path Abs) Source #

Go "forward" in the history.

mkHistoryMenuB :: MyGUI -> MyView -> [Path Abs] -> IO Menu Source #

Show backwards history in a drop-down menu, depending on the input.

mkHistoryMenuF :: MyGUI -> MyView -> [Path Abs] -> IO Menu Source #

Show forward history in a drop-down menu, depending on the input.

\ No newline at end of file +

hsfm-gtk

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Callbacks

Synopsis

Documentation

setGUICallbacks :: MyGUI -> IO () Source #

Set callbacks for the whole gui, on hotkeys, events and stuff.

setViewCallbacks :: MyGUI -> MyView -> IO () Source #

Set callbacks specific to a given view, on hotkeys, events and stuff.

closeTab :: MyGUI -> MyView -> IO () Source #

Closes the current tab, but only if there is more than one tab.

del :: [Item] -> MyGUI -> MyView -> IO () Source #

Supposed to be used with withRows. Deletes a file or directory.

moveInit :: [Item] -> MyGUI -> MyView -> IO () Source #

Initializes a file move operation.

copyInit :: [Item] -> MyGUI -> MyView -> IO () Source #

Supposed to be used with withRows. Initializes a file copy operation.

operationFinal :: MyGUI -> MyView -> Maybe Item -> IO () Source #

Finalizes a file operation, such as copy or move.

newFile :: MyGUI -> MyView -> IO () Source #

Create a new file.

newDir :: MyGUI -> MyView -> IO () Source #

Create a new directory.

renameF :: [Item] -> MyGUI -> MyView -> IO () Source #

urlGoTo :: MyGUI -> MyView -> IO () Source #

Go to the url given at the urlBar and visualize it in the given + treeView.

If the url is invalid, does nothing.

execute :: [Item] -> MyGUI -> MyView -> IO () Source #

Execute a given file.

open :: [Item] -> MyGUI -> MyView -> IO () Source #

Supposed to be used with withRows. Opens a file or directory.

upDir :: MyGUI -> MyView -> IO () Source #

Go up one directory and visualize it in the treeView.

goHistoryBack :: MyGUI -> MyView -> IO (Path Abs) Source #

Go "back" in the history.

goHistoryForward :: MyGUI -> MyView -> IO (Path Abs) Source #

Go "forward" in the history.

mkHistoryMenuB :: MyGUI -> MyView -> [Path Abs] -> IO Menu Source #

Show backwards history in a drop-down menu, depending on the input.

mkHistoryMenuF :: MyGUI -> MyView -> [Path Abs] -> IO Menu Source #

Show forward history in a drop-down menu, depending on the input.

showPopup :: MyGUI -> MyView -> TimeStamp -> IO () Source #

TODO: hopefully this does not leak

\ No newline at end of file diff --git a/HSFM-GUI-Gtk-Data.html b/HSFM-GUI-Gtk-Data.html index fae1dab..a46ea50 100644 --- a/HSFM-GUI-Gtk-Data.html +++ b/HSFM-GUI-Gtk-Data.html @@ -1,8 +1,8 @@ HSFM.GUI.Gtk.Data

hsfm-gtk

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Data

Synopsis

Documentation

data MyGUI Source #

Monolithic object passed to various GUI functions in order +

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Data

Synopsis

Documentation

data MyGUI Source #

Monolithic object passed to various GUI functions in order to keep the API stable and not alter the parameters too much. This only holds GUI widgets that are needed to be read during runtime.

Constructors

MkMyGUI 

Fields

data MyView Source #

This describes the contents of the current view and is separated from MyGUI, - because we might want to have multiple views.

Constructors

MkMyView 

Fields

data MenuBar Source #

Constructors

MkMenuBar 

Fields

data RightClickMenu Source #

Constructors

MkRightClickMenu 

Fields

data FilePropertyGrid Source #

Constructors

MkFilePropertyGrid 

Fields

data FMSettings Source #

FM-wide settings.

Constructors

MkFMSettings 

Fields

data FMView Source #

Constructors

FMTreeView !TreeView 
FMIconView !IconView 
\ No newline at end of file + because we might want to have multiple views.

Constructors

MkMyView 

Fields

data MenuBar Source #

Constructors

MkMenuBar 

Fields

data RightClickMenu Source #

Constructors

MkRightClickMenu 

Fields

data FilePropertyGrid Source #

Constructors

MkFilePropertyGrid 

Fields

data FMSettings Source #

FM-wide settings.

Constructors

MkFMSettings 

Fields

data FMView Source #

Constructors

FMTreeView !TreeView 
FMIconView !IconView 
\ No newline at end of file diff --git a/HSFM-GUI-Gtk-Plugins.html b/HSFM-GUI-Gtk-Plugins.html index 4bd255a..32279d3 100644 --- a/HSFM-GUI-Gtk-Plugins.html +++ b/HSFM-GUI-Gtk-Plugins.html @@ -1,9 +1,9 @@ HSFM.GUI.Gtk.Plugins

hsfm-gtk

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Plugins

Synopsis

Documentation

addPlugins :: MyGUI -> MyView -> IO () Source #

Usually, you don't want to overwrite this method. It - adds plugins from myplugins and initializes the callbacks - automatically.

insertPos :: Int Source #

Where to start inserting plugins.

myplugins :: [(IO MenuItem, [Item] -> MyGUI -> MyView -> IO ())] Source #

A list of plugins to add to the right-click menu at position - insertPos. The left part of the tuple is the menuitem, the right - part the callback. - Plugins are added in order of this list.

diffPlugin :: IO MenuItem Source #

\ No newline at end of file +

hsfm-gtk

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Plugins

Synopsis

Documentation

insertPos :: Int Source #

Where to start inserting plugins.

myplugins :: [(IO MenuItem, [Item] -> MyGUI -> MyView -> IO Bool, [Item] -> MyGUI -> MyView -> IO ())] Source #

A list of plugins to add to the right-click menu at position + insertPos.

The left part of the triple is the menuitem. + The middle part of the triple is a filter function that + decides whether the item is shown. + The right part of the triple is the callback, which is invoked + when the menu item is clicked.

Plugins are added in order of this list.

diffItem :: IO MenuItem Source #

\ No newline at end of file diff --git a/HSFM-GUI-Gtk-Utils.html b/HSFM-GUI-Gtk-Utils.html index f79f683..dd15339 100644 --- a/HSFM-GUI-Gtk-Utils.html +++ b/HSFM-GUI-Gtk-Utils.html @@ -1,7 +1,7 @@ HSFM.GUI.Gtk.Utils

hsfm-gtk

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Utils

Synopsis

Documentation

getSelectedItems :: MyGUI -> MyView -> IO [Item] Source #

Gets the currently selected item of the treeView, if any.

withItems Source #

Arguments

:: MyGUI 
-> MyView 
-> ([Item] -> MyGUI -> MyView -> IO ())

action to carry out

-> IO () 

Carry out an action on the currently selected item.

If there is no item selected, does nothing.

fileListStore Source #

Arguments

:: Item

current dir

-> MyView 
-> IO (ListStore Item) 

Create the ListStore of files/directories from the current directory. +

Safe HaskellNone
LanguageHaskell2010

HSFM.GUI.Gtk.Utils

Synopsis

Documentation

getSelectedItems :: MyGUI -> MyView -> IO [Item] Source #

Gets the currently selected item of the treeView, if any.

withItems Source #

Arguments

:: MyGUI 
-> MyView 
-> ([Item] -> MyGUI -> MyView -> IO a)

action to carry out

-> IO a 

Carry out an action on the currently selected item.

If there is no item selected, does nothing.

fileListStore Source #

Arguments

:: Item

current dir

-> MyView 
-> IO (ListStore Item) 

Create the ListStore of files/directories from the current directory. This is the function which maps the Data.DirTree data structures into the GTK+ data structures.

getFirstItem :: MyView -> IO Item Source #

Currently unsafe. This is used to obtain any item, which will fail if there is none.

getCurrentDir :: MyView -> IO Item Source #

Reads the current directory from MyView.

This reads the MVar and may block the main thread if it's diff --git a/Paths_hsfm.html b/Paths_hsfm.html index 9edbce3..0bd468a 100644 --- a/Paths_hsfm.html +++ b/Paths_hsfm.html @@ -1,4 +1,4 @@ Paths_hsfm

\ No newline at end of file + \ No newline at end of file diff --git a/doc-index-A.html b/doc-index-A.html index 5ed57fe..012247b 100644 --- a/doc-index-A.html +++ b/doc-index-A.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - A) \ No newline at end of file + \ No newline at end of file diff --git a/doc-index-All.html b/doc-index-All.html index f983732..6e53c88 100644 --- a/doc-index-All.html +++ b/doc-index-All.html @@ -1,4 +1,4 @@ hsfm-gtk (Index)

Index

accessTimeHSFM.FileSystem.FileType
accessTimeHiResHSFM.FileSystem.FileType
addPluginsHSFM.GUI.Gtk.Plugins
backViewBHSFM.GUI.Gtk.Data
backwardsHistoryHSFM.History
BlockDevHSFM.FileSystem.FileType
BrokenSymlinkHSFM.FileSystem.FileType
brokenSymlinkHSFM.FileSystem.FileType
BrowsingHistory 
1 (Type/Class)HSFM.History
2 (Data Constructor)HSFM.History
CharDevHSFM.FileSystem.FileType
clearStatusBarHSFM.GUI.Gtk.Data
closeTabHSFM.GUI.Gtk.Callbacks
CloseTabKeyHSFM.GUI.Gtk.Settings
CloseTabModifierHSFM.GUI.Gtk.Settings
comparingConstrHSFM.FileSystem.FileType
constructViewHSFM.GUI.Gtk.MyView
Copy 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
copyInitHSFM.GUI.Gtk.Callbacks
CopyKeyHSFM.GUI.Gtk.Settings
CopyModifierHSFM.GUI.Gtk.Settings
createIconViewHSFM.GUI.Gtk.MyView
createMyGUIHSFM.GUI.Gtk.MyGUI
createMyViewHSFM.GUI.Gtk.MyView
createTreeViewHSFM.GUI.Gtk.MyView
currentDirHSFM.History
cwdHSFM.GUI.Gtk.Data
c_strlenHSFM.GUI.Glib.GlibString
delHSFM.GUI.Gtk.Callbacks
DeleteKeyHSFM.GUI.Gtk.Settings
DeleteModifierHSFM.GUI.Gtk.Settings
destroyViewHSFM.GUI.Gtk.MyView
deviceIDHSFM.FileSystem.FileType
diffCallbackHSFM.GUI.Gtk.Plugins
diffPluginHSFM.GUI.Gtk.Plugins
DirHSFM.FileSystem.FileType
DirListHSFM.FileSystem.FileType
DirOrSymHSFM.FileSystem.FileType
DirSymHSFM.FileSystem.FileType
dirSymHSFM.FileSystem.FileType
doFileOperationHSFM.GUI.Gtk.Callbacks.Utils
epochToStringHSFM.FileSystem.FileType
executeHSFM.GUI.Gtk.Callbacks
FCollisonModeHSFM.FileSystem.UtilTypes
FCopyHSFM.FileSystem.UtilTypes
FDeleteHSFM.FileSystem.UtilTypes
FExecuteHSFM.FileSystem.UtilTypes
FileHSFM.FileSystem.FileType
fileCollisionDialogHSFM.GUI.Gtk.Dialogs
fileGroupHSFM.FileSystem.FileType
fileIDHSFM.FileSystem.FileType
FileInfo 
1 (Type/Class)HSFM.FileSystem.FileType
2 (Data Constructor)HSFM.FileSystem.FileType
FileLikeHSFM.FileSystem.FileType
fileLikeHSFM.FileSystem.FileType
FileLikeListHSFM.FileSystem.FileType
FileLikeOrSymHSFM.FileSystem.FileType
FileLikeSymHSFM.FileSystem.FileType
fileLikeSymHSFM.FileSystem.FileType
fileListStoreHSFM.GUI.Gtk.Utils
fileModeHSFM.FileSystem.FileType
FileOperationHSFM.FileSystem.UtilTypes
fileOwnerHSFM.FileSystem.FileType
FilePropertyGridHSFM.GUI.Gtk.Data
fileSizeHSFM.FileSystem.FileType
filteredModelHSFM.GUI.Gtk.Data
FMIconViewHSFM.GUI.Gtk.Data
FMoveHSFM.FileSystem.UtilTypes
FMSettingsHSFM.GUI.Gtk.Data
FMTreeViewHSFM.GUI.Gtk.Data
FMViewHSFM.GUI.Gtk.Data
fmViewToContainerHSFM.GUI.Gtk.Data
FOpenHSFM.FileSystem.UtilTypes
forwardHistoryHSFM.History
forwardViewBHSFM.GUI.Gtk.Data
fpropHSFM.GUI.Gtk.Data
fpropAcEntryHSFM.GUI.Gtk.Data
fpropFnEntryHSFM.GUI.Gtk.Data
fpropFTEntryHSFM.GUI.Gtk.Data
fpropGridHSFM.GUI.Gtk.Data
fpropLDEntryHSFM.GUI.Gtk.Data
fpropLocEntryHSFM.GUI.Gtk.Data
fpropModEntryHSFM.GUI.Gtk.Data
fpropPermEntryHSFM.GUI.Gtk.Data
fpropTsEntryHSFM.GUI.Gtk.Data
fromFreeVarHSFM.FileSystem.FileType
fvarHSFM.FileSystem.FileType
getBinDirPaths_hsfm
getContentsHSFM.FileSystem.FileType
getCurrentDirHSFM.GUI.Gtk.Utils
getDataDirPaths_hsfm
getDataFileNamePaths_hsfm
getFileInfoHSFM.FileSystem.FileType
getFirstItemHSFM.GUI.Gtk.Utils
getFPasStrHSFM.FileSystem.FileType
getFreeVarHSFM.FileSystem.FileType
getIconHSFM.GUI.Gtk.Icons
getLibDirPaths_hsfm
getLibexecDirPaths_hsfm
getSelectedItemsHSFM.GUI.Gtk.Utils
getSelectedTreePathsHSFM.GUI.Gtk.Utils
getSymlinkIconHSFM.GUI.Gtk.Icons
getSysconfDirPaths_hsfm
goDirHSFM.GUI.Gtk.Callbacks.Utils
goHistoryBackHSFM.GUI.Gtk.Callbacks
goHistoryForwardHSFM.GUI.Gtk.Callbacks
goHomeHSFM.GUI.Gtk.Callbacks
goUpHSFM.FileSystem.FileType
goUp'HSFM.FileSystem.FileType
GtkExceptionHSFM.GUI.Gtk.Errors
GtkIconHSFM.GUI.Gtk.Icons
historyHSFM.GUI.Gtk.Data
historyBackHSFM.History
HistoryBackKeyHSFM.GUI.Gtk.Settings
HistoryBackModifierHSFM.GUI.Gtk.Settings
historyForwardHSFM.History
HistoryForwardKeyHSFM.GUI.Gtk.Settings
HistoryForwardModifierHSFM.GUI.Gtk.Settings
historyNewPathHSFM.History
homeHSFM.Settings
homeViewBHSFM.GUI.Gtk.Data
iconSizeHSFM.GUI.Gtk.Data
IErrorHSFM.GUI.Gtk.Icons
IFileHSFM.GUI.Gtk.Icons
IFolderHSFM.GUI.Gtk.Icons
inotifyHSFM.GUI.Gtk.Data
insertPosHSFM.GUI.Gtk.Plugins
isBlockCHSFM.FileSystem.FileType
isBrokenSymlinkHSFM.FileSystem.FileType
isCharCHSFM.FileSystem.FileType
isDirCHSFM.FileSystem.FileType
isFileCHSFM.FileSystem.FileType
isLazyHSFM.GUI.Gtk.Data
isNamedCHSFM.FileSystem.FileType
isSocketCHSFM.FileSystem.FileType
isSymCHSFM.FileSystem.FileType
ItemHSFM.GUI.Gtk.Data
linkCountHSFM.FileSystem.FileType
listIndicesHSFM.Utils.MyPrelude
mainMain
maxSizeHSFM.History
maybeDHSFM.Utils.MyPrelude
MenuBarHSFM.GUI.Gtk.Data
menubarHSFM.GUI.Gtk.Data
menubarFileQuitHSFM.GUI.Gtk.Data
menubarHelpAboutHSFM.GUI.Gtk.Data
MkFilePropertyGridHSFM.GUI.Gtk.Data
MkFMSettingsHSFM.GUI.Gtk.Data
mkHistoryMenuBHSFM.GUI.Gtk.Callbacks
mkHistoryMenuFHSFM.GUI.Gtk.Callbacks
MkMenuBarHSFM.GUI.Gtk.Data
MkMyGUIHSFM.GUI.Gtk.Data
MkMyViewHSFM.GUI.Gtk.Data
MkRightClickMenuHSFM.GUI.Gtk.Data
modificationTimeHSFM.FileSystem.FileType
modificationTimeHiResHSFM.FileSystem.FileType
modifyTVarIOHSFM.Utils.IO
Move 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
moveInitHSFM.GUI.Gtk.Callbacks
MoveKeyHSFM.GUI.Gtk.Settings
MoveModifierHSFM.GUI.Gtk.Settings
MyGUIHSFM.GUI.Gtk.Data
mypluginsHSFM.GUI.Gtk.Plugins
MyViewHSFM.GUI.Gtk.Data
NamedPipeHSFM.FileSystem.FileType
newDirHSFM.GUI.Gtk.Callbacks
newFileHSFM.GUI.Gtk.Callbacks
newTabHSFM.GUI.Gtk.MyView
newTab'HSFM.GUI.Gtk.Callbacks
NewTabKeyHSFM.GUI.Gtk.Settings
NewTabModifierHSFM.GUI.Gtk.Settings
NoneHSFM.FileSystem.UtilTypes
noNullPtrsHSFM.GUI.Glib.GlibString
notebookHSFM.GUI.Gtk.Data
opeInNewTabHSFM.GUI.Gtk.Callbacks
openHSFM.GUI.Gtk.Callbacks
OpenKeyHSFM.GUI.Gtk.Settings
OpenModifierHSFM.GUI.Gtk.Settings
openTerminalHereHSFM.GUI.Gtk.Callbacks
OpenTerminalKeyHSFM.GUI.Gtk.Settings
OpenTerminalModifierHSFM.GUI.Gtk.Settings
operationBufferHSFM.GUI.Gtk.Data
operationFinalHSFM.GUI.Gtk.Callbacks
OverwriteHSFM.FileSystem.UtilTypes
OverwriteAllHSFM.FileSystem.UtilTypes
packAccessTimeHSFM.FileSystem.FileType
packFileTypeHSFM.FileSystem.FileType
packLinkDestinationHSFM.FileSystem.FileType
packModTimeHSFM.FileSystem.FileType
packPermissionsHSFM.FileSystem.FileType
PartialCopyHSFM.FileSystem.UtilTypes
PartialMoveHSFM.FileSystem.UtilTypes
PasteKeyHSFM.GUI.Gtk.Settings
PasteModifierHSFM.GUI.Gtk.Settings
pathHSFM.FileSystem.FileType
popStatusbarHSFM.GUI.Gtk.Utils
pushStatusBarHSFM.GUI.Gtk.Utils
QuitKeyHSFM.GUI.Gtk.Settings
QuitModifierHSFM.GUI.Gtk.Settings
rawdestHSFM.FileSystem.FileType
rawModelHSFM.GUI.Gtk.Data
rawPathToItemHSFM.GUI.Gtk.Utils
rawPathToIterHSFM.GUI.Gtk.Utils
rcFileCopyHSFM.GUI.Gtk.Data
rcFileCutHSFM.GUI.Gtk.Data
rcFileDeleteHSFM.GUI.Gtk.Data
rcFileExecuteHSFM.GUI.Gtk.Data
rcFileIconViewHSFM.GUI.Gtk.Data
rcFileNewDirHSFM.GUI.Gtk.Data
rcFileNewRegFileHSFM.GUI.Gtk.Data
rcFileNewTabHSFM.GUI.Gtk.Data
rcFileNewTermHSFM.GUI.Gtk.Data
rcFileOpenHSFM.GUI.Gtk.Data
rcFilePasteHSFM.GUI.Gtk.Data
rcFilePropertyHSFM.GUI.Gtk.Data
rcFileRenameHSFM.GUI.Gtk.Data
rcFileTreeViewHSFM.GUI.Gtk.Data
rcMenuHSFM.GUI.Gtk.Data
rcmenuHSFM.GUI.Gtk.Data
readDirectoryContentsHSFM.FileSystem.FileType
readFileHSFM.FileSystem.FileType
refreshViewHSFM.GUI.Gtk.MyView
refreshViewBHSFM.GUI.Gtk.Data
RegFileHSFM.FileSystem.FileType
RenameHSFM.FileSystem.UtilTypes
renameDialogHSFM.GUI.Gtk.Dialogs
renameFHSFM.GUI.Gtk.Callbacks
RightClickMenuHSFM.GUI.Gtk.Data
rootWinHSFM.GUI.Gtk.Data
scrollHSFM.GUI.Gtk.Data
sdestHSFM.FileSystem.FileType
sdirHSFM.FileSystem.FileType
setGUICallbacksHSFM.GUI.Gtk.Callbacks
settingsHSFM.GUI.Gtk.Data
setViewCallbacksHSFM.GUI.Gtk.Callbacks
sfileLikeHSFM.FileSystem.FileType
showAboutDialogHSFM.GUI.Gtk.Dialogs
showConfirmationDialogHSFM.GUI.Gtk.Dialogs
showErrorDialogHSFM.GUI.Gtk.Dialogs
showFilePropertyDialogHSFM.GUI.Gtk.Dialogs
showHiddenHSFM.GUI.Gtk.Data
ShowHiddenKeyHSFM.GUI.Gtk.Settings
ShowHiddenModifierHSFM.GUI.Gtk.Settings
SkipHSFM.FileSystem.UtilTypes
SocketHSFM.FileSystem.FileType
sortedModelHSFM.GUI.Gtk.Data
specialDeviceIDHSFM.FileSystem.FileType
statusBarHSFM.GUI.Gtk.Data
statusChangeTimeHSFM.FileSystem.FileType
statusChangeTimeHiResHSFM.FileSystem.FileType
StrictHSFM.FileSystem.UtilTypes
switchViewHSFM.GUI.Gtk.MyView
SymLHSFM.GUI.Gtk.Icons
SymLinkHSFM.FileSystem.FileType
terminalCommandHSFM.Settings
textInputDialogHSFM.GUI.Gtk.Dialogs
UnknownDialogButtonHSFM.GUI.Gtk.Errors
upDirHSFM.GUI.Gtk.Callbacks
UpDirKeyHSFM.GUI.Gtk.Settings
UpDirModifierHSFM.GUI.Gtk.Settings
upViewBHSFM.GUI.Gtk.Data
urlBarHSFM.GUI.Gtk.Data
urlGoToHSFM.GUI.Gtk.Callbacks
versionPaths_hsfm
viewHSFM.GUI.Gtk.Data
viewBoxHSFM.GUI.Gtk.Data
withConfirmationDialogHSFM.GUI.Gtk.Dialogs
withErrorDialogHSFM.GUI.Gtk.Dialogs
withItemsHSFM.GUI.Gtk.Utils
writeTVarIOHSFM.Utils.IO
_doFileOperationHSFM.GUI.Gtk.Callbacks.Utils
\ No newline at end of file +

Index

accessTimeHSFM.FileSystem.FileType
accessTimeHiResHSFM.FileSystem.FileType
backViewBHSFM.GUI.Gtk.Data
backwardsHistoryHSFM.History
BlockDevHSFM.FileSystem.FileType
BrokenSymlinkHSFM.FileSystem.FileType
brokenSymlinkHSFM.FileSystem.FileType
BrowsingHistory 
1 (Type/Class)HSFM.History
2 (Data Constructor)HSFM.History
CharDevHSFM.FileSystem.FileType
clearStatusBarHSFM.GUI.Gtk.Data
closeTabHSFM.GUI.Gtk.Callbacks
CloseTabKeyHSFM.GUI.Gtk.Settings
CloseTabModifierHSFM.GUI.Gtk.Settings
comparingConstrHSFM.FileSystem.FileType
constructViewHSFM.GUI.Gtk.MyView
Copy 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
copyInitHSFM.GUI.Gtk.Callbacks
CopyKeyHSFM.GUI.Gtk.Settings
CopyModifierHSFM.GUI.Gtk.Settings
createIconViewHSFM.GUI.Gtk.MyView
createMyGUIHSFM.GUI.Gtk.MyGUI
createMyViewHSFM.GUI.Gtk.MyView
createTreeViewHSFM.GUI.Gtk.MyView
currentDirHSFM.History
cwdHSFM.GUI.Gtk.Data
c_strlenHSFM.GUI.Glib.GlibString
delHSFM.GUI.Gtk.Callbacks
DeleteKeyHSFM.GUI.Gtk.Settings
DeleteModifierHSFM.GUI.Gtk.Settings
destroyViewHSFM.GUI.Gtk.MyView
deviceIDHSFM.FileSystem.FileType
diffCallbackHSFM.GUI.Gtk.Plugins
diffFilterHSFM.GUI.Gtk.Plugins
diffItemHSFM.GUI.Gtk.Plugins
DirHSFM.FileSystem.FileType
DirListHSFM.FileSystem.FileType
DirOrSymHSFM.FileSystem.FileType
DirSymHSFM.FileSystem.FileType
dirSymHSFM.FileSystem.FileType
doFileOperationHSFM.GUI.Gtk.Callbacks.Utils
epochToStringHSFM.FileSystem.FileType
executeHSFM.GUI.Gtk.Callbacks
FCollisonModeHSFM.FileSystem.UtilTypes
FCopyHSFM.FileSystem.UtilTypes
FDeleteHSFM.FileSystem.UtilTypes
FExecuteHSFM.FileSystem.UtilTypes
FileHSFM.FileSystem.FileType
fileCollisionDialogHSFM.GUI.Gtk.Dialogs
fileGroupHSFM.FileSystem.FileType
fileIDHSFM.FileSystem.FileType
FileInfo 
1 (Type/Class)HSFM.FileSystem.FileType
2 (Data Constructor)HSFM.FileSystem.FileType
FileLikeHSFM.FileSystem.FileType
fileLikeHSFM.FileSystem.FileType
FileLikeListHSFM.FileSystem.FileType
FileLikeOrSymHSFM.FileSystem.FileType
FileLikeSymHSFM.FileSystem.FileType
fileLikeSymHSFM.FileSystem.FileType
fileListStoreHSFM.GUI.Gtk.Utils
fileModeHSFM.FileSystem.FileType
FileOperationHSFM.FileSystem.UtilTypes
fileOwnerHSFM.FileSystem.FileType
FilePropertyGridHSFM.GUI.Gtk.Data
fileSizeHSFM.FileSystem.FileType
filteredModelHSFM.GUI.Gtk.Data
FMIconViewHSFM.GUI.Gtk.Data
FMoveHSFM.FileSystem.UtilTypes
FMSettingsHSFM.GUI.Gtk.Data
FMTreeViewHSFM.GUI.Gtk.Data
FMViewHSFM.GUI.Gtk.Data
fmViewToContainerHSFM.GUI.Gtk.Data
FOpenHSFM.FileSystem.UtilTypes
forwardHistoryHSFM.History
forwardViewBHSFM.GUI.Gtk.Data
fpropHSFM.GUI.Gtk.Data
fpropAcEntryHSFM.GUI.Gtk.Data
fpropFnEntryHSFM.GUI.Gtk.Data
fpropFTEntryHSFM.GUI.Gtk.Data
fpropGridHSFM.GUI.Gtk.Data
fpropLDEntryHSFM.GUI.Gtk.Data
fpropLocEntryHSFM.GUI.Gtk.Data
fpropModEntryHSFM.GUI.Gtk.Data
fpropPermEntryHSFM.GUI.Gtk.Data
fpropTsEntryHSFM.GUI.Gtk.Data
fromFreeVarHSFM.FileSystem.FileType
fvarHSFM.FileSystem.FileType
getBinDirPaths_hsfm
getContentsHSFM.FileSystem.FileType
getCurrentDirHSFM.GUI.Gtk.Utils
getDataDirPaths_hsfm
getDataFileNamePaths_hsfm
getFileInfoHSFM.FileSystem.FileType
getFirstItemHSFM.GUI.Gtk.Utils
getFPasStrHSFM.FileSystem.FileType
getFreeVarHSFM.FileSystem.FileType
getIconHSFM.GUI.Gtk.Icons
getLibDirPaths_hsfm
getLibexecDirPaths_hsfm
getSelectedItemsHSFM.GUI.Gtk.Utils
getSelectedTreePathsHSFM.GUI.Gtk.Utils
getSymlinkIconHSFM.GUI.Gtk.Icons
getSysconfDirPaths_hsfm
goDirHSFM.GUI.Gtk.Callbacks.Utils
goHistoryBackHSFM.GUI.Gtk.Callbacks
goHistoryForwardHSFM.GUI.Gtk.Callbacks
goHomeHSFM.GUI.Gtk.Callbacks
goUpHSFM.FileSystem.FileType
goUp'HSFM.FileSystem.FileType
GtkExceptionHSFM.GUI.Gtk.Errors
GtkIconHSFM.GUI.Gtk.Icons
historyHSFM.GUI.Gtk.Data
historyBackHSFM.History
HistoryBackKeyHSFM.GUI.Gtk.Settings
HistoryBackModifierHSFM.GUI.Gtk.Settings
historyForwardHSFM.History
HistoryForwardKeyHSFM.GUI.Gtk.Settings
HistoryForwardModifierHSFM.GUI.Gtk.Settings
historyNewPathHSFM.History
homeHSFM.Settings
homeViewBHSFM.GUI.Gtk.Data
iconSizeHSFM.GUI.Gtk.Data
IErrorHSFM.GUI.Gtk.Icons
IFileHSFM.GUI.Gtk.Icons
IFolderHSFM.GUI.Gtk.Icons
inotifyHSFM.GUI.Gtk.Data
insertPosHSFM.GUI.Gtk.Plugins
isBlockCHSFM.FileSystem.FileType
isBrokenSymlinkHSFM.FileSystem.FileType
isCharCHSFM.FileSystem.FileType
isDirCHSFM.FileSystem.FileType
isFileCHSFM.FileSystem.FileType
isLazyHSFM.GUI.Gtk.Data
isNamedCHSFM.FileSystem.FileType
isSocketCHSFM.FileSystem.FileType
isSymCHSFM.FileSystem.FileType
ItemHSFM.GUI.Gtk.Data
linkCountHSFM.FileSystem.FileType
listIndicesHSFM.Utils.MyPrelude
mainMain
maxSizeHSFM.History
maybeDHSFM.Utils.MyPrelude
MenuBarHSFM.GUI.Gtk.Data
menubarHSFM.GUI.Gtk.Data
menubarFileQuitHSFM.GUI.Gtk.Data
menubarHelpAboutHSFM.GUI.Gtk.Data
MkFilePropertyGridHSFM.GUI.Gtk.Data
MkFMSettingsHSFM.GUI.Gtk.Data
mkHistoryMenuBHSFM.GUI.Gtk.Callbacks
mkHistoryMenuFHSFM.GUI.Gtk.Callbacks
MkMenuBarHSFM.GUI.Gtk.Data
MkMyGUIHSFM.GUI.Gtk.Data
MkMyViewHSFM.GUI.Gtk.Data
MkRightClickMenuHSFM.GUI.Gtk.Data
modificationTimeHSFM.FileSystem.FileType
modificationTimeHiResHSFM.FileSystem.FileType
modifyTVarIOHSFM.Utils.IO
Move 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
moveInitHSFM.GUI.Gtk.Callbacks
MoveKeyHSFM.GUI.Gtk.Settings
MoveModifierHSFM.GUI.Gtk.Settings
MyGUIHSFM.GUI.Gtk.Data
mypluginsHSFM.GUI.Gtk.Plugins
MyViewHSFM.GUI.Gtk.Data
NamedPipeHSFM.FileSystem.FileType
newDirHSFM.GUI.Gtk.Callbacks
newFileHSFM.GUI.Gtk.Callbacks
newTabHSFM.GUI.Gtk.MyView
newTab'HSFM.GUI.Gtk.Callbacks
NewTabKeyHSFM.GUI.Gtk.Settings
NewTabModifierHSFM.GUI.Gtk.Settings
NoneHSFM.FileSystem.UtilTypes
noNullPtrsHSFM.GUI.Glib.GlibString
notebookHSFM.GUI.Gtk.Data
opeInNewTabHSFM.GUI.Gtk.Callbacks
openHSFM.GUI.Gtk.Callbacks
OpenKeyHSFM.GUI.Gtk.Settings
OpenModifierHSFM.GUI.Gtk.Settings
openTerminalHereHSFM.GUI.Gtk.Callbacks
OpenTerminalKeyHSFM.GUI.Gtk.Settings
OpenTerminalModifierHSFM.GUI.Gtk.Settings
operationBufferHSFM.GUI.Gtk.Data
operationFinalHSFM.GUI.Gtk.Callbacks
OverwriteHSFM.FileSystem.UtilTypes
OverwriteAllHSFM.FileSystem.UtilTypes
packAccessTimeHSFM.FileSystem.FileType
packFileTypeHSFM.FileSystem.FileType
packLinkDestinationHSFM.FileSystem.FileType
packModTimeHSFM.FileSystem.FileType
packPermissionsHSFM.FileSystem.FileType
PartialCopyHSFM.FileSystem.UtilTypes
PartialMoveHSFM.FileSystem.UtilTypes
PasteKeyHSFM.GUI.Gtk.Settings
PasteModifierHSFM.GUI.Gtk.Settings
pathHSFM.FileSystem.FileType
popStatusbarHSFM.GUI.Gtk.Utils
pushStatusBarHSFM.GUI.Gtk.Utils
QuitKeyHSFM.GUI.Gtk.Settings
QuitModifierHSFM.GUI.Gtk.Settings
rawdestHSFM.FileSystem.FileType
rawModelHSFM.GUI.Gtk.Data
rawPathToItemHSFM.GUI.Gtk.Utils
rawPathToIterHSFM.GUI.Gtk.Utils
rcFileCopyHSFM.GUI.Gtk.Data
rcFileCutHSFM.GUI.Gtk.Data
rcFileDeleteHSFM.GUI.Gtk.Data
rcFileExecuteHSFM.GUI.Gtk.Data
rcFileIconViewHSFM.GUI.Gtk.Data
rcFileNewDirHSFM.GUI.Gtk.Data
rcFileNewRegFileHSFM.GUI.Gtk.Data
rcFileNewTabHSFM.GUI.Gtk.Data
rcFileNewTermHSFM.GUI.Gtk.Data
rcFileOpenHSFM.GUI.Gtk.Data
rcFilePasteHSFM.GUI.Gtk.Data
rcFilePropertyHSFM.GUI.Gtk.Data
rcFileRenameHSFM.GUI.Gtk.Data
rcFileTreeViewHSFM.GUI.Gtk.Data
rcMenuHSFM.GUI.Gtk.Data
readDirectoryContentsHSFM.FileSystem.FileType
readFileHSFM.FileSystem.FileType
refreshViewHSFM.GUI.Gtk.MyView
refreshViewBHSFM.GUI.Gtk.Data
RegFileHSFM.FileSystem.FileType
RenameHSFM.FileSystem.UtilTypes
renameDialogHSFM.GUI.Gtk.Dialogs
renameFHSFM.GUI.Gtk.Callbacks
RightClickMenuHSFM.GUI.Gtk.Data
rootWinHSFM.GUI.Gtk.Data
scrollHSFM.GUI.Gtk.Data
sdestHSFM.FileSystem.FileType
sdirHSFM.FileSystem.FileType
setGUICallbacksHSFM.GUI.Gtk.Callbacks
settingsHSFM.GUI.Gtk.Data
setViewCallbacksHSFM.GUI.Gtk.Callbacks
sfileLikeHSFM.FileSystem.FileType
showAboutDialogHSFM.GUI.Gtk.Dialogs
showConfirmationDialogHSFM.GUI.Gtk.Dialogs
showErrorDialogHSFM.GUI.Gtk.Dialogs
showFilePropertyDialogHSFM.GUI.Gtk.Dialogs
showHiddenHSFM.GUI.Gtk.Data
ShowHiddenKeyHSFM.GUI.Gtk.Settings
ShowHiddenModifierHSFM.GUI.Gtk.Settings
showPopupHSFM.GUI.Gtk.Callbacks
SkipHSFM.FileSystem.UtilTypes
SocketHSFM.FileSystem.FileType
sortedModelHSFM.GUI.Gtk.Data
specialDeviceIDHSFM.FileSystem.FileType
statusBarHSFM.GUI.Gtk.Data
statusChangeTimeHSFM.FileSystem.FileType
statusChangeTimeHiResHSFM.FileSystem.FileType
StrictHSFM.FileSystem.UtilTypes
switchViewHSFM.GUI.Gtk.MyView
SymLHSFM.GUI.Gtk.Icons
SymLinkHSFM.FileSystem.FileType
terminalCommandHSFM.Settings
textInputDialogHSFM.GUI.Gtk.Dialogs
UnknownDialogButtonHSFM.GUI.Gtk.Errors
upDirHSFM.GUI.Gtk.Callbacks
UpDirKeyHSFM.GUI.Gtk.Settings
UpDirModifierHSFM.GUI.Gtk.Settings
upViewBHSFM.GUI.Gtk.Data
urlBarHSFM.GUI.Gtk.Data
urlGoToHSFM.GUI.Gtk.Callbacks
versionPaths_hsfm
viewHSFM.GUI.Gtk.Data
viewBoxHSFM.GUI.Gtk.Data
withConfirmationDialogHSFM.GUI.Gtk.Dialogs
withErrorDialogHSFM.GUI.Gtk.Dialogs
withItemsHSFM.GUI.Gtk.Utils
writeTVarIOHSFM.Utils.IO
_doFileOperationHSFM.GUI.Gtk.Callbacks.Utils
\ No newline at end of file diff --git a/doc-index-D.html b/doc-index-D.html index d422dae..b2c5a4f 100644 --- a/doc-index-D.html +++ b/doc-index-D.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - D) \ No newline at end of file + \ No newline at end of file diff --git a/doc-index-R.html b/doc-index-R.html index 331861d..9cc836b 100644 --- a/doc-index-R.html +++ b/doc-index-R.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - R) \ No newline at end of file + \ No newline at end of file diff --git a/doc-index-S.html b/doc-index-S.html index bd9d41f..ca705ab 100644 --- a/doc-index-S.html +++ b/doc-index-S.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - S) \ No newline at end of file + \ No newline at end of file diff --git a/hsfm.haddock b/hsfm.haddock index 8a8e32c9b773f2383a9ad8eb4ddb0b04a4ee9d32..a2c04a51c1c4518ae9c43cf60d404831da389720 100644 GIT binary patch delta 2326 zcmZ`)dr*{B6#ve*`{6!emtA?ZA`7T!D5GgcfhmQhhRJA69Kku;X#4zh>+cOLKtJM z#5#fsM|B462;6Nd2OFBrez0S$IUOSLusI(b7;i}et9aUC)njwiI6VBYmZ5SZ9$3*U zY%_GsrNJ_&QU`W0C-fB^79@?rTw6MXq1_%=Ag3YoH*$c9D>GLXIm0lrID{iOfc@;Y zusD#@A_HiaKr2QeJjkHnAeicm#xsNMXi0fi`o zI`|Qra>v3{aWwa3pikmlCwMJ|| z-QvRH0{~ZWM`Zx6;)trva7`Sl$_KbEqL#i3=JPzn1+FgQk?MJH35WVJ@MoV(BaGe)7D6Kx2MT6N5(xpKh?= zm>TB*<8$8aUOj#hXTjSwHW-a_%j0EFIe{U@P!4{yXFD)^nhhIQI74F%63$|74ew1!G=>`UE=8>MY+M%?_B-C)lEgCnmz1bo#mSYilBz%|MY_P zl?B=@I#B6!bX=I1XTVf6plPTL+g5%Aw?*-)0Kgq_{k4$*cZF;9NuBm5g%6hDQMDP` zJz|c3G+tLb4E_=y*3JNf(yIWS%Y|6BYO+XM|2)tyyK%#OP;V)CdSjBtm)0#zsT*?N ziVKq(yN3sVQU{&<1l(OW6BKc|E?xx{t$`cz3IzT&iCZ?UPiBj#yhx-h$$cuF9Q(

|5AL2iV4dIe83nr7+B}R?@HZGPJJ{B9JGK?9!=FL0!?|_&N6F|0$szP$0<8= zSYgINQkiXf&_rz8X@_w3vc^RPJhW^0YL*liS5zdCuS|%Np+MmStC+_|vAxQMx z9j^r!J?*ZNB+Vch#)J>L9z=fgS)+@?&#*|v!r@)g|nT6Bz|tz;pFy2mtj$9aq)Ct5nqm6Ow6Att?(5s Z6&3Ays>xVgQt8jBtXftjj(+(S{0*5w-4Fl( delta 2181 zcmaJ?YfMyE5WaKoF7DmCyX*q8B2qxGXfX!*N{!fRF+{Bo)S6O}hl0EWMOfTcQLEUB zSqg>07LBM$+aF3P;7R(YjfC3tkEyo7G_g$=wAG4FEJCTZ+L^n%W)p2sGIQsfnKLtI z&bjAwdX)P8ip^@dcUGDrNuL!-7Vy;>fGVXP$q!bQ5pYQSIZ=^$g0BPO2% zO9o~}W+BY4i((h{UQ%89JFySDum^WAl&k$uBgkBz z%1eCGV@~!0=*ONl;nNg+sc;T^<5i#rs9c z+7JQXuyY|QxBohA>TKH7Bs^AS!0xh1Ev55ND=CBNZ3t$-cZ}z|)oLJcee~3>j^8iMKvFaFT*ErdAW;d|AdM(^Ut1Atc zxgxonBa#_QU5Q-kh%RxdBOsgclq&^B@R}5xH6>Cq=PhE71m`Dk8W4TZ-ozoEW;@GPlBSb;W;ITabc!2 z+Q^AU@wFO{JSK??H2}(}T!Ve(;n+3PgyUNmsyw%ns2qD1I&sQIJ9fJbn6}M=d);=J zi5DxQar)bKM<5^ja{MZ6-V&{EY2_9JdK)LHoJ;q@hHal@-z6lCG8<#|C$n+=I$;YN zSkLNl-l4~oAP3ZsMM2N@eB)nqtmfbkb;%fA`wiR^gS8%jzeV}Z=>Ye|fn7f<@DFaO z%Z3N|UEL~pDB|}n20GQE;#~y#0bySbU_pHxofM#}4UgBy7)a6uqfeDzpFmv)32)WE z1t5y|$I77KKF?i^W=O!lI^p*k-c2RU5EME-@CfL448wpgNxosFzayRw-)tja69eMo z_oD#}*xUFJLPT$q0-$1UOCzpmt_3rmZEgZhC=lZ+Z|xzr8$|= zkR|--$h2MDA}N{~4IStYL;%F-dU^-=uX`#0xM8uuATAih2ZN~rz~6*mkjQ{fkU~&aM9zs@5FBEw%Rd|F5tx-#nj)E z9Z%EadZA+hyvmD%6#onzqy~d$gTZsb;Q0W+yv_prrE?~hblLFxPODHqKLeQ7eGAWb zm5670Y}N@ORRt9rHr0sKQ(=l`URPL{Szc3Ix~Uq|`etb6!qTE5pF+ITmn)0gr%%DZ DPh`L& diff --git a/mini_HSFM-GUI-Gtk-Callbacks.html b/mini_HSFM-GUI-Gtk-Callbacks.html index f9ccc53..71cc9e3 100644 --- a/mini_HSFM-GUI-Gtk-Callbacks.html +++ b/mini_HSFM-GUI-Gtk-Callbacks.html @@ -1,4 +1,4 @@ HSFM.GUI.Gtk.Callbacks

HSFM.GUI.Gtk.Callbacks

\ No newline at end of file +

HSFM.GUI.Gtk.Callbacks

\ No newline at end of file diff --git a/mini_HSFM-GUI-Gtk-Plugins.html b/mini_HSFM-GUI-Gtk-Plugins.html index 7525f8c..fa9961c 100644 --- a/mini_HSFM-GUI-Gtk-Plugins.html +++ b/mini_HSFM-GUI-Gtk-Plugins.html @@ -1,4 +1,4 @@ HSFM.GUI.Gtk.Plugins

HSFM.GUI.Gtk.Plugins

\ No newline at end of file +

HSFM.GUI.Gtk.Plugins

\ No newline at end of file diff --git a/src/HSFM-GUI-Gtk-Callbacks.html b/src/HSFM-GUI-Gtk-Callbacks.html index 9376e45..e6eab8b 100644 --- a/src/HSFM-GUI-Gtk-Callbacks.html +++ b/src/HSFM-GUI-Gtk-Callbacks.html @@ -26,615 +26,691 @@ --} {-# LANGUAGE OverloadedStrings #-} -{-# OPTIONS_HADDOCK ignore-exports #-} - -module HSFM.GUI.Gtk.Callbacks where - +{-# LANGUAGE TupleSections #-} +{-# OPTIONS_HADDOCK ignore-exports #-} + +module HSFM.GUI.Gtk.Callbacks where -import Control.Concurrent.STM - ( - readTVarIO - ) -import Control.Exception - ( - throwIO - ) -import Control.Monad - ( - forM - , forM_ - , join - , void - , when - ) -import Control.Monad.IO.Class - ( - liftIO - ) -import Control.Monad.Loops - ( - iterateUntil - ) -import Data.ByteString - ( - ByteString - ) -import Data.ByteString.UTF8 - ( - fromString - , toString - ) -import Data.Foldable - ( - for_ - ) -import Graphics.UI.Gtk -import qualified HPath as P -import HPath - ( - fromAbs - , Abs - , Path - ) -import HPath.IO -import HPath.IO.Errors -import HPath.IO.Utils -import HSFM.FileSystem.FileType -import HSFM.FileSystem.UtilTypes -import HSFM.GUI.Gtk.Callbacks.Utils -import HSFM.GUI.Gtk.Data -import HSFM.GUI.Gtk.Dialogs -import HSFM.GUI.Gtk.MyView -import HSFM.GUI.Gtk.Settings -import HSFM.GUI.Gtk.Utils -import HSFM.History -import HSFM.Settings -import HSFM.Utils.IO -import Prelude hiding(readFile) -import System.Glib.UTFString - ( - glibToString - ) -import qualified System.Posix.Process.ByteString as SPP -import System.Posix.Types - ( - ProcessID - ) -import Control.Concurrent.MVar - ( - putMVar - , readMVar - , takeMVar - ) - - - - - - ----------------- - --[ Callbacks ]-- - ----------------- + +import Control.Concurrent.STM + ( + readTVarIO + ) +import Control.Exception + ( + throwIO + ) +import Control.Monad + ( + forM + , forM_ + , join + , void + , when + ) +import Control.Monad.IO.Class + ( + liftIO + ) +import Control.Monad.Loops + ( + iterateUntil + ) +import Data.ByteString + ( + ByteString + ) +import Data.ByteString.UTF8 + ( + fromString + , toString + ) +import Data.Foldable + ( + for_ + ) +import Graphics.UI.Gtk +import qualified HPath as P +import HPath + ( + fromAbs + , Abs + , Path + ) +import HPath.IO +import HPath.IO.Errors +import HPath.IO.Utils +import HSFM.FileSystem.FileType +import HSFM.FileSystem.UtilTypes +import HSFM.GUI.Gtk.Callbacks.Utils +import HSFM.GUI.Gtk.Data +import HSFM.GUI.Gtk.Dialogs +import HSFM.GUI.Gtk.MyView +import HSFM.GUI.Gtk.Plugins +import HSFM.GUI.Gtk.Settings +import HSFM.GUI.Gtk.Utils +import HSFM.History +import HSFM.Settings +import HSFM.Utils.IO +import Prelude hiding(readFile) +import System.Glib.UTFString + ( + glibToString + ) +import qualified System.Posix.Process.ByteString as SPP +import System.Posix.Types + ( + ProcessID + ) +import Control.Concurrent.MVar + ( + putMVar + , readMVar + , takeMVar + ) +import Paths_hsfm + ( + getDataFileName + ) + + - - ----- MAIN CALLBACK ENTRYPOINT ---- + ----------------- + --[ Callbacks ]-- + ----------------- --- |Set callbacks for the whole gui, on hotkeys, events and stuff. -setGUICallbacks :: MyGUI -> IO () -setGUICallbacks mygui = do + + +---- MAIN CALLBACK ENTRYPOINT ---- - _ <- clearStatusBar mygui `on` buttonActivated $ do - popStatusbar mygui - writeTVarIO (operationBuffer mygui) None - - -- menubar-file - _ <- (menubarFileQuit . menubar) mygui `on` menuItemActivated $ - mainQuit - - -- menubar-help - _ <- (menubarHelpAbout . menubar) mygui `on` menuItemActivated $ - liftIO showAboutDialog - return () + +-- |Set callbacks for the whole gui, on hotkeys, events and stuff. +setGUICallbacks :: MyGUI -> IO () +setGUICallbacks mygui = do + + _ <- clearStatusBar mygui `on` buttonActivated $ do + popStatusbar mygui + writeTVarIO (operationBuffer mygui) None + + -- menubar-file + _ <- (menubarFileQuit . menubar) mygui `on` menuItemActivated $ + mainQuit - -- key events - _ <- rootWin mygui `on` keyPressEvent $ tryEvent $ do - QuitModifier <- eventModifier - QuitKey <- fmap glibToString eventKeyName - liftIO mainQuit - - return () - - --- |Set callbacks specific to a given view, on hotkeys, events and stuff. -setViewCallbacks :: MyGUI -> MyView -> IO () -setViewCallbacks mygui myview = do - view' <- readTVarIO $ view myview - case view' of - fmv@(FMTreeView treeView) -> do - _ <- treeView `on` rowActivated - $ (\_ _ -> withItems mygui myview open) - - -- drag events - _ <- treeView `on` dragBegin $ - \_ -> withItems mygui myview moveInit - _ <- treeView `on` dragDrop $ - \dc p ts -> do - p' <- treeViewConvertWidgetToTreeCoords treeView p - mpath <- treeViewGetPathAtPos treeView p' - case mpath of - Nothing -> do - dragFinish dc False False ts - return False - Just _ -> do - atom <- atomNew ("HSFM" :: String) - dragGetData treeView dc atom ts - return True - _ <- treeView `on` dragDataReceived $ - \dc p _ ts -> - liftIO $ do - signalStopEmission treeView "drag_data_received" - p' <- treeViewConvertWidgetToTreeCoords treeView p - mpath <- treeViewGetPathAtPos treeView p' - case mpath of - Nothing -> dragFinish dc False False ts - Just (tp, _, _) -> do - mitem <- rawPathToItem myview tp - forM_ mitem $ \item -> - operationFinal mygui myview (Just item) - dragFinish dc True False ts - - commonGuiEvents fmv - return () - fmv@(FMIconView iconView) -> do - _ <- iconView `on` itemActivated - $ (\_ -> withItems mygui myview open) + -- menubar-help + _ <- (menubarHelpAbout . menubar) mygui `on` menuItemActivated $ + liftIO showAboutDialog + return () + + -- key events + _ <- rootWin mygui `on` keyPressEvent $ tryEvent $ do + QuitModifier <- eventModifier + QuitKey <- fmap glibToString eventKeyName + liftIO mainQuit + + return () + + +-- |Set callbacks specific to a given view, on hotkeys, events and stuff. +setViewCallbacks :: MyGUI -> MyView -> IO () +setViewCallbacks mygui myview = do + view' <- readTVarIO $ view myview + case view' of + fmv@(FMTreeView treeView) -> do + _ <- treeView `on` rowActivated + $ (\_ _ -> withItems mygui myview open) + + -- drag events + _ <- treeView `on` dragBegin $ + \_ -> withItems mygui myview moveInit + _ <- treeView `on` dragDrop $ + \dc p ts -> do + p' <- treeViewConvertWidgetToTreeCoords treeView p + mpath <- treeViewGetPathAtPos treeView p' + case mpath of + Nothing -> do + dragFinish dc False False ts + return False + Just _ -> do + atom <- atomNew ("HSFM" :: String) + dragGetData treeView dc atom ts + return True + _ <- treeView `on` dragDataReceived $ + \dc p _ ts -> + liftIO $ do + signalStopEmission treeView "drag_data_received" + p' <- treeViewConvertWidgetToTreeCoords treeView p + mpath <- treeViewGetPathAtPos treeView p' + case mpath of + Nothing -> dragFinish dc False False ts + Just (tp, _, _) -> do + mitem <- rawPathToItem myview tp + forM_ mitem $ \item -> + operationFinal mygui myview (Just item) + dragFinish dc True False ts + commonGuiEvents fmv return () - where - commonGuiEvents fmv = do - let view = fmViewToContainer fmv - - -- GUI events - _ <- backViewB myview `on` buttonPressEvent $ do - eb <- eventButton - t <- eventTime - case eb of - LeftButton -> do - liftIO $ void $ goHistoryBack mygui myview - return True - RightButton -> do - his <- liftIO $ readMVar (history myview) - menu <- liftIO $ mkHistoryMenuB mygui myview - (backwardsHistory his) - _ <- liftIO $ menuPopup menu $ Just (RightButton, t) - return True - _ -> return False - _ <- forwardViewB myview `on` buttonPressEvent $ do - eb <- eventButton - t <- eventTime - case eb of - LeftButton -> do - liftIO $ void $ goHistoryForward mygui myview - return True - RightButton -> do - his <- liftIO $ readMVar (history myview) - menu <- liftIO $ mkHistoryMenuF mygui myview - (forwardHistory his) - _ <- liftIO $ menuPopup menu $ Just (RightButton, t) - return True - _ -> return False - _ <- urlBar myview `on` entryActivated $ urlGoTo mygui myview - _ <- upViewB myview `on` buttonActivated $ - upDir mygui myview - _ <- homeViewB myview `on` buttonActivated $ - goHome mygui myview - _ <- refreshViewB myview `on` buttonActivated $ do - cdir <- liftIO $ getCurrentDir myview - refreshView mygui myview cdir - - -- key events - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - ShowHiddenModifier <- eventModifier - ShowHiddenKey <- fmap glibToString eventKeyName - cdir <- liftIO $ getCurrentDir myview - liftIO $ modifyTVarIO (settings mygui) - (\x -> x { showHidden = not . showHidden $ x}) - >> refreshView mygui myview cdir - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - UpDirModifier <- eventModifier - UpDirKey <- fmap glibToString eventKeyName - liftIO $ upDir mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - HistoryBackModifier <- eventModifier - HistoryBackKey <- fmap glibToString eventKeyName - liftIO $ void $ goHistoryBack mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - HistoryForwardModifier <- eventModifier - HistoryForwardKey <- fmap glibToString eventKeyName - liftIO $ void $ goHistoryForward mygui myview - _ <- view `on` keyPressEvent $ tryEvent $ do - DeleteModifier <- eventModifier - DeleteKey <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview del - _ <- view `on` keyPressEvent $ tryEvent $ do - OpenModifier <- eventModifier - OpenKey <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview open - _ <- view `on` keyPressEvent $ tryEvent $ do - CopyModifier <- eventModifier - CopyKey <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview copyInit - _ <- view `on` keyPressEvent $ tryEvent $ do - MoveModifier <- eventModifier - MoveKey <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview moveInit - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - PasteModifier <- eventModifier - PasteKey <- fmap glibToString eventKeyName - liftIO $ operationFinal mygui myview Nothing - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - NewTabModifier <- eventModifier - NewTabKey <- fmap glibToString eventKeyName - liftIO $ void $ newTab' mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - CloseTabModifier <- eventModifier - CloseTabKey <- fmap glibToString eventKeyName - liftIO $ void $ closeTab mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - OpenTerminalModifier <- eventModifier - OpenTerminalKey <- fmap glibToString eventKeyName - liftIO $ void $ openTerminalHere myview - - -- mouse button click - _ <- view `on` buttonPressEvent $ do - eb <- eventButton - t <- eventTime - case eb of - RightButton -> do - _ <- liftIO $ menuPopup (rcMenu . rcmenu $ myview) - $ Just (RightButton, t) - -- this is just to not screw with current selection - -- on right-click - -- TODO: this misbehaves under IconView - (x, y) <- eventCoordinates - mpath <- liftIO $ getPathAtPos fmv (x, y) - case mpath of - -- item under the cursor, only pass on the signal - -- if the item under the cursor is not within the current - -- selection - (Just tp) -> do - selectedTps <- liftIO $ getSelectedTreePaths mygui myview - return $ elem tp selectedTps - -- no item under the cursor, pass on the signal - Nothing -> return False - MiddleButton -> do - (x, y) <- eventCoordinates - mitem <- liftIO $ (getPathAtPos fmv (x, y)) - >>= \mpos -> fmap join - $ forM mpos (rawPathToItem myview) - - case mitem of - -- item under the cursor, only pass on the signal - -- if the item under the cursor is not within the current - -- selection - (Just item) -> do - liftIO $ opeInNewTab mygui item - return True - -- no item under the cursor, pass on the signal - Nothing -> return False - - OtherButton 8 -> do - liftIO $ void $ goHistoryBack mygui myview - return False - OtherButton 9 -> do - liftIO $ void $ goHistoryForward mygui myview - return False - -- not right-click, so pass on the signal - _ -> return False - - -- right click menu - _ <- (rcFileOpen . rcmenu) myview `on` menuItemActivated $ - liftIO $ withItems mygui myview open - _ <- (rcFileExecute . rcmenu) myview `on` menuItemActivated $ - liftIO $ withItems mygui myview execute - _ <- (rcFileNewRegFile . rcmenu) myview `on` menuItemActivated $ - liftIO $ newFile mygui myview - _ <- (rcFileNewDir . rcmenu) myview `on` menuItemActivated $ - liftIO $ newDir mygui myview - _ <- (rcFileNewTab . rcmenu) myview `on` menuItemActivated $ - liftIO $ newTab' mygui myview - _ <- (rcFileNewTerm . rcmenu) myview `on` menuItemActivated $ - liftIO $ void $ openTerminalHere myview - _ <- (rcFileCopy . rcmenu) myview `on` menuItemActivated $ - liftIO $ withItems mygui myview copyInit - _ <- (rcFileRename . rcmenu) myview `on` menuItemActivated $ - liftIO $ withItems mygui myview renameF - _ <- (rcFilePaste . rcmenu) myview `on` menuItemActivated $ - liftIO $ operationFinal mygui myview Nothing - _ <- (rcFileDelete . rcmenu) myview `on` menuItemActivated $ - liftIO $ withItems mygui myview del - _ <- (rcFileProperty . rcmenu) myview `on` menuItemActivated $ - liftIO $ withItems mygui myview showFilePropertyDialog - _ <- (rcFileCut . rcmenu) myview `on` menuItemActivated $ - liftIO $ withItems mygui myview moveInit - _ <- (rcFileIconView . rcmenu) myview `on` menuItemActivated $ - liftIO $ switchView mygui myview createIconView - _ <- (rcFileTreeView . rcmenu) myview `on` menuItemActivated $ - liftIO $ switchView mygui myview createTreeView - return () + fmv@(FMIconView iconView) -> do + _ <- iconView `on` itemActivated + $ (\_ -> withItems mygui myview open) + commonGuiEvents fmv + return () + where + commonGuiEvents fmv = do + let view = fmViewToContainer fmv + + -- GUI events + _ <- backViewB myview `on` buttonPressEvent $ do + eb <- eventButton + t <- eventTime + case eb of + LeftButton -> do + liftIO $ void $ goHistoryBack mygui myview + return True + RightButton -> do + his <- liftIO $ readMVar (history myview) + menu <- liftIO $ mkHistoryMenuB mygui myview + (backwardsHistory his) + _ <- liftIO $ menuPopup menu $ Just (RightButton, t) + return True + _ -> return False + _ <- forwardViewB myview `on` buttonPressEvent $ do + eb <- eventButton + t <- eventTime + case eb of + LeftButton -> do + liftIO $ void $ goHistoryForward mygui myview + return True + RightButton -> do + his <- liftIO $ readMVar (history myview) + menu <- liftIO $ mkHistoryMenuF mygui myview + (forwardHistory his) + _ <- liftIO $ menuPopup menu $ Just (RightButton, t) + return True + _ -> return False + _ <- urlBar myview `on` entryActivated $ urlGoTo mygui myview + _ <- upViewB myview `on` buttonActivated $ + upDir mygui myview + _ <- homeViewB myview `on` buttonActivated $ + goHome mygui myview + _ <- refreshViewB myview `on` buttonActivated $ do + cdir <- liftIO $ getCurrentDir myview + refreshView mygui myview cdir + + -- key events + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + ShowHiddenModifier <- eventModifier + ShowHiddenKey <- fmap glibToString eventKeyName + cdir <- liftIO $ getCurrentDir myview + liftIO $ modifyTVarIO (settings mygui) + (\x -> x { showHidden = not . showHidden $ x}) + >> refreshView mygui myview cdir + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + UpDirModifier <- eventModifier + UpDirKey <- fmap glibToString eventKeyName + liftIO $ upDir mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + HistoryBackModifier <- eventModifier + HistoryBackKey <- fmap glibToString eventKeyName + liftIO $ void $ goHistoryBack mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + HistoryForwardModifier <- eventModifier + HistoryForwardKey <- fmap glibToString eventKeyName + liftIO $ void $ goHistoryForward mygui myview + _ <- view `on` keyPressEvent $ tryEvent $ do + DeleteModifier <- eventModifier + DeleteKey <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview del + _ <- view `on` keyPressEvent $ tryEvent $ do + OpenModifier <- eventModifier + OpenKey <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview open + _ <- view `on` keyPressEvent $ tryEvent $ do + CopyModifier <- eventModifier + CopyKey <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview copyInit + _ <- view `on` keyPressEvent $ tryEvent $ do + MoveModifier <- eventModifier + MoveKey <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview moveInit + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + PasteModifier <- eventModifier + PasteKey <- fmap glibToString eventKeyName + liftIO $ operationFinal mygui myview Nothing + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + NewTabModifier <- eventModifier + NewTabKey <- fmap glibToString eventKeyName + liftIO $ void $ newTab' mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + CloseTabModifier <- eventModifier + CloseTabKey <- fmap glibToString eventKeyName + liftIO $ void $ closeTab mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + OpenTerminalModifier <- eventModifier + OpenTerminalKey <- fmap glibToString eventKeyName + liftIO $ void $ openTerminalHere myview + + -- mouse button click + _ <- view `on` buttonPressEvent $ do + eb <- eventButton + t <- eventTime + case eb of + RightButton -> do + _ <- liftIO $ showPopup mygui myview t + -- this is just to not screw with current selection + -- on right-click + -- TODO: this misbehaves under IconView + (x, y) <- eventCoordinates + mpath <- liftIO $ getPathAtPos fmv (x, y) + case mpath of + -- item under the cursor, only pass on the signal + -- if the item under the cursor is not within the current + -- selection + (Just tp) -> do + selectedTps <- liftIO $ getSelectedTreePaths mygui myview + return $ elem tp selectedTps + -- no item under the cursor, pass on the signal + Nothing -> return False + MiddleButton -> do + (x, y) <- eventCoordinates + mitem <- liftIO $ (getPathAtPos fmv (x, y)) + >>= \mpos -> fmap join + $ forM mpos (rawPathToItem myview) + + case mitem of + -- item under the cursor, only pass on the signal + -- if the item under the cursor is not within the current + -- selection + (Just item) -> do + liftIO $ opeInNewTab mygui item + return True + -- no item under the cursor, pass on the signal + Nothing -> return False + + OtherButton 8 -> do + liftIO $ void $ goHistoryBack mygui myview + return False + OtherButton 9 -> do + liftIO $ void $ goHistoryForward mygui myview + return False + -- not right-click, so pass on the signal + _ -> return False + + return () + getPathAtPos fmv (x, y) = + case fmv of + FMTreeView treeView -> do + mp <- treeViewGetPathAtPos treeView (round x, round y) + return $ fmap (\(p, _, _) -> p) mp + FMIconView iconView -> + fmap (\tp -> if null tp then Nothing else Just tp) + $ iconViewGetPathAtPos iconView (round x) (round y) + + + + +---- OTHER ---- + + +openTerminalHere :: MyView -> IO ProcessID +openTerminalHere myview = do + cwd <- (P.fromAbs . path) <$> getCurrentDir myview + SPP.forkProcess $ terminalCommand cwd + + + + +---- TAB OPERATIONS ---- + - getPathAtPos fmv (x, y) = - case fmv of - FMTreeView treeView -> do - mp <- treeViewGetPathAtPos treeView (round x, round y) - return $ fmap (\(p, _, _) -> p) mp - FMIconView iconView -> - fmap (\tp -> if null tp then Nothing else Just tp) - $ iconViewGetPathAtPos iconView (round x) (round y) - - - +-- |Closes the current tab, but only if there is more than one tab. +closeTab :: MyGUI -> MyView -> IO () +closeTab mygui myview = do + n <- notebookGetNPages (notebook mygui) + when (n > 1) $ void $ destroyView mygui myview + + +newTab' :: MyGUI -> MyView -> IO () +newTab' mygui myview = do + cwd <- getCurrentDir myview + void $ withErrorDialog $ newTab mygui createTreeView cwd (-1) ----- OTHER ---- - - -openTerminalHere :: MyView -> IO ProcessID -openTerminalHere myview = do - cwd <- (P.fromAbs . path) <$> getCurrentDir myview - SPP.forkProcess $ terminalCommand cwd + +opeInNewTab :: MyGUI -> Item -> IO () +opeInNewTab mygui item@(DirOrSym _) = + void $ withErrorDialog $ newTab mygui createTreeView item (-1) +opeInNewTab _ _ = return () + + - +---- FILE OPERATION CALLBACKS (COPY, MOVE, ...) ---- ----- TAB OPERATIONS ---- - - --- |Closes the current tab, but only if there is more than one tab. -closeTab :: MyGUI -> MyView -> IO () -closeTab mygui myview = do - n <- notebookGetNPages (notebook mygui) - when (n > 1) $ void $ destroyView mygui myview - - -newTab' :: MyGUI -> MyView -> IO () -newTab' mygui myview = do - cwd <- getCurrentDir myview - void $ withErrorDialog $ newTab mygui createTreeView cwd (-1) +-- |Supposed to be used with 'withRows'. Deletes a file or directory. +del :: [Item] -> MyGUI -> MyView -> IO () +del [item] _ _ = withErrorDialog $ do + let cmsg = "Really delete \"" ++ getFPasStr item ++ "\"?" + withConfirmationDialog cmsg + $ easyDelete . path $ item +-- this throws on the first error that occurs +del items@(_:_) _ _ = withErrorDialog $ do + let cmsg = "Really delete " ++ show (length items) ++ " files?" + withConfirmationDialog cmsg + $ forM_ items $ \item -> easyDelete . path $ item +del _ _ _ = withErrorDialog + . throwIO $ InvalidOperation + "Operation not supported on multiple files" -opeInNewTab :: MyGUI -> Item -> IO () -opeInNewTab mygui item@(DirOrSym _) = - void $ withErrorDialog $ newTab mygui createTreeView item (-1) -opeInNewTab _ _ = return () - - - ----- FILE OPERATION CALLBACKS (COPY, MOVE, ...) ---- - - --- |Supposed to be used with 'withRows'. Deletes a file or directory. -del :: [Item] -> MyGUI -> MyView -> IO () -del [item] _ _ = withErrorDialog $ do - let cmsg = "Really delete \"" ++ getFPasStr item ++ "\"?" - withConfirmationDialog cmsg - $ easyDelete . path $ item --- this throws on the first error that occurs -del items@(_:_) _ _ = withErrorDialog $ do - let cmsg = "Really delete " ++ show (length items) ++ " files?" - withConfirmationDialog cmsg - $ forM_ items $ \item -> easyDelete . path $ item -del _ _ _ = withErrorDialog - . throwIO $ InvalidOperation - "Operation not supported on multiple files" - - --- |Initializes a file move operation. -moveInit :: [Item] -> MyGUI -> MyView -> IO () -moveInit items@(_:_) mygui _ = do - writeTVarIO (operationBuffer mygui) (FMove . PartialMove . map path $ items) - let sbmsg = case items of - (item:[]) -> "Move buffer: " ++ getFPasStr item - _ -> "Move buffer: " ++ (show . length $ items) - ++ " items" - popStatusbar mygui - void $ pushStatusBar mygui sbmsg -moveInit _ _ _ = withErrorDialog - . throwIO $ InvalidOperation - "No file selected!" - --- |Supposed to be used with 'withRows'. Initializes a file copy operation. -copyInit :: [Item] -> MyGUI -> MyView -> IO () -copyInit items@(_:_) mygui _ = do - writeTVarIO (operationBuffer mygui) (FCopy . PartialCopy . map path $ items) - let sbmsg = case items of - (item:[]) -> "Copy buffer: " ++ getFPasStr item - _ -> "Copy buffer: " ++ (show . length $ items) - ++ " items" - popStatusbar mygui - void $ pushStatusBar mygui sbmsg -copyInit _ _ _ = withErrorDialog - . throwIO $ InvalidOperation - "No file selected!" - +-- |Initializes a file move operation. +moveInit :: [Item] -> MyGUI -> MyView -> IO () +moveInit items@(_:_) mygui _ = do + writeTVarIO (operationBuffer mygui) (FMove . PartialMove . map path $ items) + let sbmsg = case items of + (item:[]) -> "Move buffer: " ++ getFPasStr item + _ -> "Move buffer: " ++ (show . length $ items) + ++ " items" + popStatusbar mygui + void $ pushStatusBar mygui sbmsg +moveInit _ _ _ = withErrorDialog + . throwIO $ InvalidOperation + "No file selected!" + +-- |Supposed to be used with 'withRows'. Initializes a file copy operation. +copyInit :: [Item] -> MyGUI -> MyView -> IO () +copyInit items@(_:_) mygui _ = do + writeTVarIO (operationBuffer mygui) (FCopy . PartialCopy . map path $ items) + let sbmsg = case items of + (item:[]) -> "Copy buffer: " ++ getFPasStr item + _ -> "Copy buffer: " ++ (show . length $ items) + ++ " items" + popStatusbar mygui + void $ pushStatusBar mygui sbmsg +copyInit _ _ _ = withErrorDialog + . throwIO $ InvalidOperation + "No file selected!" + + +-- |Finalizes a file operation, such as copy or move. +operationFinal :: MyGUI -> MyView -> Maybe Item -> IO () +operationFinal mygui myview mitem = withErrorDialog $ do + op <- readTVarIO (operationBuffer mygui) + cdir <- case mitem of + Nothing -> path <$> getCurrentDir myview + Just x -> return $ path x + case op of + FMove (PartialMove s) -> do + let cmsg = "Really move " ++ imsg s + ++ " to \"" ++ toString (P.fromAbs cdir) + ++ "\"?" + withConfirmationDialog cmsg $ doFileOperation (FMove $ Move s cdir) + popStatusbar mygui + writeTVarIO (operationBuffer mygui) None + FCopy (PartialCopy s) -> do + let cmsg = "Really copy " ++ imsg s + ++ " to \"" ++ toString (P.fromAbs cdir) + ++ "\"?" + withConfirmationDialog cmsg $ doFileOperation (FCopy $ Copy s cdir) + _ -> return () + where + imsg s = case s of + (item:[]) -> "\"" ++ toString (P.fromAbs item) ++ "\"" + items -> (show . length $ items) ++ " items" --- |Finalizes a file operation, such as copy or move. -operationFinal :: MyGUI -> MyView -> Maybe Item -> IO () -operationFinal mygui myview mitem = withErrorDialog $ do - op <- readTVarIO (operationBuffer mygui) - cdir <- case mitem of - Nothing -> path <$> getCurrentDir myview - Just x -> return $ path x - case op of - FMove (PartialMove s) -> do - let cmsg = "Really move " ++ imsg s - ++ " to \"" ++ toString (P.fromAbs cdir) - ++ "\"?" - withConfirmationDialog cmsg $ doFileOperation (FMove $ Move s cdir) - popStatusbar mygui - writeTVarIO (operationBuffer mygui) None - FCopy (PartialCopy s) -> do - let cmsg = "Really copy " ++ imsg s - ++ " to \"" ++ toString (P.fromAbs cdir) - ++ "\"?" - withConfirmationDialog cmsg $ doFileOperation (FCopy $ Copy s cdir) - _ -> return () - where - imsg s = case s of - (item:[]) -> "\"" ++ toString (P.fromAbs item) ++ "\"" - items -> (show . length $ items) ++ " items" - - --- |Create a new file. -newFile :: MyGUI -> MyView -> IO () -newFile _ myview = withErrorDialog $ do - mfn <- textInputDialog "Enter file name" ("" :: String) - let pmfn = P.parseFn =<< fromString <$> mfn - for_ pmfn $ \fn -> do - cdir <- getCurrentDir myview - createRegularFile newFilePerms (path cdir P.</> fn) - - --- |Create a new directory. -newDir :: MyGUI -> MyView -> IO () -newDir _ myview = withErrorDialog $ do - mfn <- textInputDialog "Enter directory name" ("" :: String) - let pmfn = P.parseFn =<< fromString <$> mfn - for_ pmfn $ \fn -> do - cdir <- getCurrentDir myview - createDir newDirPerms (path cdir P.</> fn) - - -renameF :: [Item] -> MyGUI -> MyView -> IO () -renameF [item] _ _ = withErrorDialog $ do - iname <- P.fromRel <$> (P.basename $ path item) - mfn <- textInputDialog "Enter new file name" (iname :: ByteString) - let pmfn = P.parseFn =<< fromString <$> mfn - for_ pmfn $ \fn -> do - let cmsg = "Really rename \"" ++ getFPasStr item - ++ "\"" ++ " to \"" - ++ toString (P.fromAbs $ (P.dirname . path $ item) - P.</> fn) ++ "\"?" - withConfirmationDialog cmsg $ - HPath.IO.renameFile (path item) - ((P.dirname $ path item) P.</> fn) -renameF _ _ _ = withErrorDialog - . throwIO $ InvalidOperation - "Operation not supported on multiple files" + +-- |Create a new file. +newFile :: MyGUI -> MyView -> IO () +newFile _ myview = withErrorDialog $ do + mfn <- textInputDialog "Enter file name" ("" :: String) + let pmfn = P.parseFn =<< fromString <$> mfn + for_ pmfn $ \fn -> do + cdir <- getCurrentDir myview + createRegularFile newFilePerms (path cdir P.</> fn) + + +-- |Create a new directory. +newDir :: MyGUI -> MyView -> IO () +newDir _ myview = withErrorDialog $ do + mfn <- textInputDialog "Enter directory name" ("" :: String) + let pmfn = P.parseFn =<< fromString <$> mfn + for_ pmfn $ \fn -> do + cdir <- getCurrentDir myview + createDir newDirPerms (path cdir P.</> fn) + + +renameF :: [Item] -> MyGUI -> MyView -> IO () +renameF [item] _ _ = withErrorDialog $ do + iname <- P.fromRel <$> (P.basename $ path item) + mfn <- textInputDialog "Enter new file name" (iname :: ByteString) + let pmfn = P.parseFn =<< fromString <$> mfn + for_ pmfn $ \fn -> do + let cmsg = "Really rename \"" ++ getFPasStr item + ++ "\"" ++ " to \"" + ++ toString (P.fromAbs $ (P.dirname . path $ item) + P.</> fn) ++ "\"?" + withConfirmationDialog cmsg $ + HPath.IO.renameFile (path item) + ((P.dirname $ path item) P.</> fn) +renameF _ _ _ = withErrorDialog + . throwIO $ InvalidOperation + "Operation not supported on multiple files" + + + + +---- DIRECTORY TRAVERSAL AND FILE OPENING CALLBACKS ---- + + +-- |Go to the url given at the 'urlBar' and visualize it in the given +-- treeView. +-- +-- If the url is invalid, does nothing. +urlGoTo :: MyGUI -> MyView -> IO () +urlGoTo mygui myview = withErrorDialog $ do + fp <- entryGetText (urlBar myview) + forM_ (P.parseAbs fp :: Maybe (Path Abs)) $ \fp' -> + whenM (canOpenDirectory fp') + (goDir True mygui myview =<< (readFile getFileInfo $ fp')) + + +goHome :: MyGUI -> MyView -> IO () +goHome mygui myview = withErrorDialog $ do + homedir <- home + forM_ (P.parseAbs homedir :: Maybe (Path Abs)) $ \fp' -> + whenM (canOpenDirectory fp') + (goDir True mygui myview =<< (readFile getFileInfo $ fp')) + - - - ----- DIRECTORY TRAVERSAL AND FILE OPENING CALLBACKS ---- - - --- |Go to the url given at the 'urlBar' and visualize it in the given --- treeView. --- --- If the url is invalid, does nothing. -urlGoTo :: MyGUI -> MyView -> IO () -urlGoTo mygui myview = withErrorDialog $ do - fp <- entryGetText (urlBar myview) - forM_ (P.parseAbs fp :: Maybe (Path Abs)) $ \fp' -> - whenM (canOpenDirectory fp') - (goDir True mygui myview =<< (readFile getFileInfo $ fp')) - - -goHome :: MyGUI -> MyView -> IO () -goHome mygui myview = withErrorDialog $ do - homedir <- home - forM_ (P.parseAbs homedir :: Maybe (Path Abs)) $ \fp' -> - whenM (canOpenDirectory fp') - (goDir True mygui myview =<< (readFile getFileInfo $ fp')) +-- |Execute a given file. +execute :: [Item] -> MyGUI -> MyView -> IO () +execute [item] _ _ = withErrorDialog $ + void $ executeFile (path item) [] +execute _ _ _ = withErrorDialog + . throwIO $ InvalidOperation + "Operation not supported on multiple files" + + +-- |Supposed to be used with 'withRows'. Opens a file or directory. +open :: [Item] -> MyGUI -> MyView -> IO () +open [item] mygui myview = withErrorDialog $ + case item of + DirOrSym r -> do + nv <- readFile getFileInfo $ path r + goDir True mygui myview nv + r -> + void $ openFile . path $ r +open items mygui _ = do + let dirs = filter (fst . sdir) items + files = filter (fst . sfileLike) items + forM_ dirs (withErrorDialog . opeInNewTab mygui) + forM_ files (withErrorDialog . openFile . path) + - --- |Execute a given file. -execute :: [Item] -> MyGUI -> MyView -> IO () -execute [item] _ _ = withErrorDialog $ - void $ executeFile (path item) [] -execute _ _ _ = withErrorDialog - . throwIO $ InvalidOperation - "Operation not supported on multiple files" +-- |Go up one directory and visualize it in the treeView. +upDir :: MyGUI -> MyView -> IO () +upDir mygui myview = withErrorDialog $ do + cdir <- getCurrentDir myview + nv <- goUp cdir + goDir True mygui myview nv + + --- |Supposed to be used with 'withRows'. Opens a file or directory. -open :: [Item] -> MyGUI -> MyView -> IO () -open [item] mygui myview = withErrorDialog $ - case item of - DirOrSym r -> do - nv <- readFile getFileInfo $ path r - goDir True mygui myview nv - r -> - void $ openFile . path $ r -open items mygui _ = do - let dirs = filter (fst . sdir) items - files = filter (fst . sfileLike) items - forM_ dirs (withErrorDialog . opeInNewTab mygui) - forM_ files (withErrorDialog . openFile . path) - - --- |Go up one directory and visualize it in the treeView. -upDir :: MyGUI -> MyView -> IO () -upDir mygui myview = withErrorDialog $ do - cdir <- getCurrentDir myview - nv <- goUp cdir - goDir True mygui myview nv - +---- HISTORY CALLBACKS ---- + + +-- |Go "back" in the history. +goHistoryBack :: MyGUI -> MyView -> IO (Path Abs) +goHistoryBack mygui myview = do + hs <- takeMVar (history myview) + let nhs = historyBack hs + putMVar (history myview) nhs + nv <- readFile getFileInfo $ currentDir nhs + goDir False mygui myview nv + return $ currentDir nhs + + +-- |Go "forward" in the history. +goHistoryForward :: MyGUI -> MyView -> IO (Path Abs) +goHistoryForward mygui myview = do + hs <- takeMVar (history myview) + let nhs = historyForward hs + putMVar (history myview) nhs + nv <- readFile getFileInfo $ currentDir nhs + goDir False mygui myview nv + return $ currentDir nhs - ----- HISTORY CALLBACKS ---- - - --- |Go "back" in the history. -goHistoryBack :: MyGUI -> MyView -> IO (Path Abs) -goHistoryBack mygui myview = do - hs <- takeMVar (history myview) - let nhs = historyBack hs - putMVar (history myview) nhs - nv <- readFile getFileInfo $ currentDir nhs - goDir False mygui myview nv - return $ currentDir nhs +-- |Show backwards history in a drop-down menu, depending on the input. +mkHistoryMenuB :: MyGUI -> MyView -> [Path Abs] -> IO Menu +mkHistoryMenuB mygui myview hs = do + menu <- menuNew + menuitems <- forM hs $ \p -> do + item <- menuItemNewWithLabel (fromAbs p) + _ <- item `on` menuItemActivated $ + void $ iterateUntil (== p) (goHistoryBack mygui myview) + return item + forM_ menuitems $ \item -> menuShellAppend menu item + widgetShowAll menu + return menu + - --- |Go "forward" in the history. -goHistoryForward :: MyGUI -> MyView -> IO (Path Abs) -goHistoryForward mygui myview = do - hs <- takeMVar (history myview) - let nhs = historyForward hs - putMVar (history myview) nhs - nv <- readFile getFileInfo $ currentDir nhs - goDir False mygui myview nv - return $ currentDir nhs - - --- |Show backwards history in a drop-down menu, depending on the input. -mkHistoryMenuB :: MyGUI -> MyView -> [Path Abs] -> IO Menu -mkHistoryMenuB mygui myview hs = do - menu <- menuNew - menuitems <- forM hs $ \p -> do - item <- menuItemNewWithLabel (fromAbs p) - _ <- item `on` menuItemActivated $ - void $ iterateUntil (== p) (goHistoryBack mygui myview) - return item - forM_ menuitems $ \item -> menuShellAppend menu item - widgetShowAll menu - return menu +-- |Show forward history in a drop-down menu, depending on the input. +mkHistoryMenuF :: MyGUI -> MyView -> [Path Abs] -> IO Menu +mkHistoryMenuF mygui myview hs = do + menu <- menuNew + menuitems <- forM hs $ \p -> do + item <- menuItemNewWithLabel (fromAbs p) + _ <- item `on` menuItemActivated $ + void $ iterateUntil (== p) (goHistoryForward mygui myview) + return item + forM_ menuitems $ \item -> menuShellAppend menu item + widgetShowAll menu + return menu + + + + +---- RIGHTCLICK CALLBACKS ---- + + +-- |TODO: hopefully this does not leak +showPopup :: MyGUI -> MyView -> TimeStamp -> IO () +showPopup mygui myview t + | null myplugins = return () + | otherwise = do - --- |Show forward history in a drop-down menu, depending on the input. -mkHistoryMenuF :: MyGUI -> MyView -> [Path Abs] -> IO Menu -mkHistoryMenuF mygui myview hs = do - menu <- menuNew - menuitems <- forM hs $ \p -> do - item <- menuItemNewWithLabel (fromAbs p) - _ <- item `on` menuItemActivated $ - void $ iterateUntil (== p) (goHistoryForward mygui myview) - return item - forM_ menuitems $ \item -> menuShellAppend menu item - widgetShowAll menu - return menu - + rcmenu <- doRcMenu + + -- add common callbacks + _ <- (\_ -> rcFileOpen rcmenu) myview `on` menuItemActivated $ + liftIO $ withItems mygui myview open + _ <- (rcFileExecute rcmenu) `on` menuItemActivated $ + liftIO $ withItems mygui myview execute + _ <- (rcFileNewRegFile rcmenu) `on` menuItemActivated $ + liftIO $ newFile mygui myview + _ <- (rcFileNewDir rcmenu) `on` menuItemActivated $ + liftIO $ newDir mygui myview + _ <- (rcFileNewTab rcmenu) `on` menuItemActivated $ + liftIO $ newTab' mygui myview + _ <- (rcFileNewTerm rcmenu) `on` menuItemActivated $ + liftIO $ void $ openTerminalHere myview + _ <- (rcFileCopy rcmenu) `on` menuItemActivated $ + liftIO $ withItems mygui myview copyInit + _ <- (rcFileRename rcmenu) `on` menuItemActivated $ + liftIO $ withItems mygui myview renameF + _ <- (rcFilePaste rcmenu) `on` menuItemActivated $ + liftIO $ operationFinal mygui myview Nothing + _ <- (rcFileDelete rcmenu) `on` menuItemActivated $ + liftIO $ withItems mygui myview del + _ <- (rcFileProperty rcmenu) `on` menuItemActivated $ + liftIO $ withItems mygui myview showFilePropertyDialog + _ <- (rcFileCut rcmenu) `on` menuItemActivated $ + liftIO $ withItems mygui myview moveInit + _ <- (rcFileIconView rcmenu) `on` menuItemActivated $ + liftIO $ switchView mygui myview createIconView + _ <- (rcFileTreeView rcmenu) `on` menuItemActivated $ + liftIO $ switchView mygui myview createTreeView + + + -- add another plugin separator after the existing one + -- where we want to place our plugins + sep2 <- separatorMenuItemNew + widgetShow sep2 + + menuShellInsert (rcMenu rcmenu) sep2 insertPos + + plugins <- forM myplugins $ \(ma, mb, mc) -> fmap (, mb, mc) ma + -- need to reverse plugins list so the order is right + forM_ (reverse plugins) $ \(plugin, filter', cb) -> do + showItem <- withItems mygui myview filter' + + menuShellInsert (rcMenu rcmenu) plugin insertPos + when showItem $ widgetShow plugin + -- init callback + plugin `on` menuItemActivated $ withItems mygui myview cb + + menuPopup (rcMenu rcmenu) $ Just (RightButton, t) + where + doRcMenu = do + builder <- builderNew + builderAddFromFile builder =<< getDataFileName "data/Gtk/builder.xml" + + -- create static right-click menu + rcMenu <- builderGetObject builder castToMenu + (fromString "rcMenu") + rcFileOpen <- builderGetObject builder castToImageMenuItem + (fromString "rcFileOpen") + rcFileExecute <- builderGetObject builder castToImageMenuItem + (fromString "rcFileExecute") + rcFileNewRegFile <- builderGetObject builder castToImageMenuItem + (fromString "rcFileNewRegFile") + rcFileNewDir <- builderGetObject builder castToImageMenuItem + (fromString "rcFileNewDir") + rcFileNewTab <- builderGetObject builder castToImageMenuItem + (fromString "rcFileNewTab") + rcFileNewTerm <- builderGetObject builder castToImageMenuItem + (fromString "rcFileNewTerm") + rcFileCut <- builderGetObject builder castToImageMenuItem + (fromString "rcFileCut") + rcFileCopy <- builderGetObject builder castToImageMenuItem + (fromString "rcFileCopy") + rcFileRename <- builderGetObject builder castToImageMenuItem + (fromString "rcFileRename") + rcFilePaste <- builderGetObject builder castToImageMenuItem + (fromString "rcFilePaste") + rcFileDelete <- builderGetObject builder castToImageMenuItem + (fromString "rcFileDelete") + rcFileProperty <- builderGetObject builder castToImageMenuItem + (fromString "rcFileProperty") + rcFileIconView <- builderGetObject builder castToImageMenuItem + (fromString "rcFileIconView") + rcFileTreeView <- builderGetObject builder castToImageMenuItem + (fromString "rcFileTreeView") + + return $ MkRightClickMenu {..} + diff --git a/src/HSFM-GUI-Gtk-Data.html b/src/HSFM-GUI-Gtk-Data.html index 686653f..1f881c7 100644 --- a/src/HSFM-GUI-Gtk-Data.html +++ b/src/HSFM-GUI-Gtk-Data.html @@ -93,69 +93,68 @@ -- sub-widgets , scroll :: !ScrolledWindow , viewBox :: !Box - , rcmenu :: !RightClickMenu - , backViewB :: !Button - , upViewB :: !Button - , forwardViewB :: !Button - , homeViewB :: !Button - , refreshViewB :: !Button - , urlBar :: !Entry -} + , backViewB :: !Button + , upViewB :: !Button + , forwardViewB :: !Button + , homeViewB :: !Button + , refreshViewB :: !Button + , urlBar :: !Entry +} + - -data MenuBar = MkMenuBar { - menubarFileQuit :: !ImageMenuItem - , menubarHelpAbout :: !ImageMenuItem -} - -data RightClickMenu = MkRightClickMenu { - rcMenu :: !Menu - , rcFileOpen :: !ImageMenuItem - , rcFileExecute :: !ImageMenuItem - , rcFileNewRegFile :: !ImageMenuItem - , rcFileNewDir :: !ImageMenuItem - , rcFileNewTab :: !ImageMenuItem - , rcFileNewTerm :: !ImageMenuItem - , rcFileCut :: !ImageMenuItem - , rcFileCopy :: !ImageMenuItem - , rcFileRename :: !ImageMenuItem - , rcFilePaste :: !ImageMenuItem - , rcFileDelete :: !ImageMenuItem - , rcFileProperty :: !ImageMenuItem - , rcFileIconView :: !ImageMenuItem - , rcFileTreeView :: !ImageMenuItem -} - -data FilePropertyGrid = MkFilePropertyGrid { - fpropGrid :: !Grid - , fpropFnEntry :: !Entry - , fpropLocEntry :: !Entry - , fpropTsEntry :: !Entry - , fpropModEntry :: !Entry - , fpropAcEntry :: !Entry - , fpropFTEntry :: !Entry - , fpropPermEntry :: !Entry - , fpropLDEntry :: !Entry -} +data MenuBar = MkMenuBar { + menubarFileQuit :: !ImageMenuItem + , menubarHelpAbout :: !ImageMenuItem +} + +data RightClickMenu = MkRightClickMenu { + rcMenu :: !Menu + , rcFileOpen :: !ImageMenuItem + , rcFileExecute :: !ImageMenuItem + , rcFileNewRegFile :: !ImageMenuItem + , rcFileNewDir :: !ImageMenuItem + , rcFileNewTab :: !ImageMenuItem + , rcFileNewTerm :: !ImageMenuItem + , rcFileCut :: !ImageMenuItem + , rcFileCopy :: !ImageMenuItem + , rcFileRename :: !ImageMenuItem + , rcFilePaste :: !ImageMenuItem + , rcFileDelete :: !ImageMenuItem + , rcFileProperty :: !ImageMenuItem + , rcFileIconView :: !ImageMenuItem + , rcFileTreeView :: !ImageMenuItem +} + +data FilePropertyGrid = MkFilePropertyGrid { + fpropGrid :: !Grid + , fpropFnEntry :: !Entry + , fpropLocEntry :: !Entry + , fpropTsEntry :: !Entry + , fpropModEntry :: !Entry + , fpropAcEntry :: !Entry + , fpropFTEntry :: !Entry + , fpropPermEntry :: !Entry + , fpropLDEntry :: !Entry +} + - --- |FM-wide settings. -data FMSettings = MkFMSettings { - showHidden :: !Bool - , isLazy :: !Bool - , iconSize :: !Int -} - -data FMView = FMTreeView !TreeView - | FMIconView !IconView - -type Item = File FileInfo +-- |FM-wide settings. +data FMSettings = MkFMSettings { + showHidden :: !Bool + , isLazy :: !Bool + , iconSize :: !Int +} + +data FMView = FMTreeView !TreeView + | FMIconView !IconView + +type Item = File FileInfo + - -fmViewToContainer :: FMView -> Container -fmViewToContainer (FMTreeView x) = castToContainer . toGObject $ x -fmViewToContainer (FMIconView x) = castToContainer . toGObject $ x - +fmViewToContainer :: FMView -> Container +fmViewToContainer (FMTreeView x) = castToContainer . toGObject $ x +fmViewToContainer (FMIconView x) = castToContainer . toGObject $ x + diff --git a/src/HSFM-GUI-Gtk-MyView.html b/src/HSFM-GUI-Gtk-MyView.html index 22fc785..c211907 100644 --- a/src/HSFM-GUI-Gtk-MyView.html +++ b/src/HSFM-GUI-Gtk-MyView.html @@ -217,258 +217,256 @@ let rcmenu = MkRightClickMenu {..} let myview = MkMyView {..} - addPlugins mygui myview - - -- set the bindings - setViewCallbacks mygui myview - - -- add the treeview to the scroll container - let oview = fmViewToContainer view' - containerAdd scroll oview + -- set the bindings + setViewCallbacks mygui myview + + -- add the treeview to the scroll container + let oview = fmViewToContainer view' + containerAdd scroll oview + + widgetShowAll viewBox - widgetShowAll viewBox + return myview - return myview - - --- |Switch the existing view in `MyView` with the one that the --- io action returns. -switchView :: MyGUI -> MyView -> IO FMView -> IO () -switchView mygui myview iofmv = do - cwd <- getCurrentDir myview + +-- |Switch the existing view in `MyView` with the one that the +-- io action returns. +switchView :: MyGUI -> MyView -> IO FMView -> IO () +switchView mygui myview iofmv = do + cwd <- getCurrentDir myview + + oldpage <- destroyView mygui myview - oldpage <- destroyView mygui myview - - -- create new view and tab page where the previous one was - nview <- newTab mygui iofmv cwd oldpage - - page <- fromJust <$> notebookPageNum (notebook mygui) (viewBox nview) - notebookSetCurrentPage (notebook mygui) page + -- create new view and tab page where the previous one was + nview <- newTab mygui iofmv cwd oldpage + + page <- fromJust <$> notebookPageNum (notebook mygui) (viewBox nview) + notebookSetCurrentPage (notebook mygui) page + + refreshView mygui nview cwd - refreshView mygui nview cwd - - --- |Destroys the given view by disconnecting the watcher --- and destroying the active FMView container. --- --- Everything that needs to be done in order to forget about a --- view needs to be done here. --- --- Returns the page in the tab list this view corresponds to. -destroyView :: MyGUI -> MyView -> IO Int -destroyView mygui myview = do - -- disconnect watcher - mi <- tryTakeMVar (inotify myview) - for_ mi $ \i -> killINotify i + +-- |Destroys the given view by disconnecting the watcher +-- and destroying the active FMView container. +-- +-- Everything that needs to be done in order to forget about a +-- view needs to be done here. +-- +-- Returns the page in the tab list this view corresponds to. +destroyView :: MyGUI -> MyView -> IO Int +destroyView mygui myview = do + -- disconnect watcher + mi <- tryTakeMVar (inotify myview) + for_ mi $ \i -> killINotify i + + page <- fromJust <$> notebookPageNum (notebook mygui) (viewBox myview) - page <- fromJust <$> notebookPageNum (notebook mygui) (viewBox myview) - - -- destroy old view and tab page - view' <- readTVarIO $ view myview - widgetDestroy (fmViewToContainer view') - notebookRemovePage (notebook mygui) page + -- destroy old view and tab page + view' <- readTVarIO $ view myview + widgetDestroy (fmViewToContainer view') + notebookRemovePage (notebook mygui) page + + return page - return page - - --- |Createss an IconView. -createIconView :: IO FMView -createIconView = do - iconv <- iconViewNew - iconViewSetSelectionMode iconv SelectionMultiple - iconViewSetColumns iconv (-1) - iconViewSetSpacing iconv 2 - iconViewSetMargin iconv 0 - {- set iconv [ iconViewItemOrientation := OrientationHorizontal ] -} - {- set iconv [ iconViewOrientation := OrientationHorizontal ] -} + +-- |Createss an IconView. +createIconView :: IO FMView +createIconView = do + iconv <- iconViewNew + iconViewSetSelectionMode iconv SelectionMultiple + iconViewSetColumns iconv (-1) + iconViewSetSpacing iconv 2 + iconViewSetMargin iconv 0 + {- set iconv [ iconViewItemOrientation := OrientationHorizontal ] -} + {- set iconv [ iconViewOrientation := OrientationHorizontal ] -} + + return $ FMIconView iconv - return $ FMIconView iconv - - --- |Creates a TreeView. -createTreeView :: IO FMView -createTreeView = do - -- create the final view - treeView <- treeViewNew - -- set selection mode - tvs <- treeViewGetSelection treeView - treeSelectionSetMode tvs SelectionMultiple - - -- set drag and drop - tl <- targetListNew - atom <- atomNew ("HSFM" :: String) - targetListAdd tl atom [TargetSameApp] 0 - treeViewEnableModelDragDest treeView tl [ActionCopy] - treeViewEnableModelDragSource treeView [Button1] tl [ActionCopy] - - -- create final tree model columns - renderTxt <- cellRendererTextNew - renderPix <- cellRendererPixbufNew - let ct = cellText :: (CellRendererTextClass cr) => Attr cr String - cp = cellPixbuf :: (CellRendererPixbufClass self) => Attr self Pixbuf - - -- filename column - cF <- treeViewColumnNew - treeViewColumnSetTitle cF ("Filename" :: String) - treeViewColumnSetResizable cF True - treeViewColumnSetClickable cF True - treeViewColumnSetSortColumnId cF 1 - cellLayoutPackStart cF renderPix False - cellLayoutPackStart cF renderTxt True - _ <- treeViewAppendColumn treeView cF - cellLayoutAddColumnAttribute cF renderPix cp $ makeColumnIdPixbuf 0 - cellLayoutAddColumnAttribute cF renderTxt ct $ makeColumnIdString 1 - - -- date column - cMD <- treeViewColumnNew - treeViewColumnSetTitle cMD ("Date" :: String) - treeViewColumnSetResizable cMD True - treeViewColumnSetClickable cMD True - treeViewColumnSetSortColumnId cMD 2 - cellLayoutPackStart cMD renderTxt True - _ <- treeViewAppendColumn treeView cMD - cellLayoutAddColumnAttribute cMD renderTxt ct $ makeColumnIdString 2 - - -- permissions column - cP <- treeViewColumnNew - treeViewColumnSetTitle cP ("Permission" :: String) - treeViewColumnSetResizable cP True - treeViewColumnSetClickable cP True - treeViewColumnSetSortColumnId cP 3 - cellLayoutPackStart cP renderTxt True - _ <- treeViewAppendColumn treeView cP - cellLayoutAddColumnAttribute cP renderTxt ct $ makeColumnIdString 3 + +-- |Creates a TreeView. +createTreeView :: IO FMView +createTreeView = do + -- create the final view + treeView <- treeViewNew + -- set selection mode + tvs <- treeViewGetSelection treeView + treeSelectionSetMode tvs SelectionMultiple + + -- set drag and drop + tl <- targetListNew + atom <- atomNew ("HSFM" :: String) + targetListAdd tl atom [TargetSameApp] 0 + treeViewEnableModelDragDest treeView tl [ActionCopy] + treeViewEnableModelDragSource treeView [Button1] tl [ActionCopy] + + -- create final tree model columns + renderTxt <- cellRendererTextNew + renderPix <- cellRendererPixbufNew + let ct = cellText :: (CellRendererTextClass cr) => Attr cr String + cp = cellPixbuf :: (CellRendererPixbufClass self) => Attr self Pixbuf + + -- filename column + cF <- treeViewColumnNew + treeViewColumnSetTitle cF ("Filename" :: String) + treeViewColumnSetResizable cF True + treeViewColumnSetClickable cF True + treeViewColumnSetSortColumnId cF 1 + cellLayoutPackStart cF renderPix False + cellLayoutPackStart cF renderTxt True + _ <- treeViewAppendColumn treeView cF + cellLayoutAddColumnAttribute cF renderPix cp $ makeColumnIdPixbuf 0 + cellLayoutAddColumnAttribute cF renderTxt ct $ makeColumnIdString 1 + + -- date column + cMD <- treeViewColumnNew + treeViewColumnSetTitle cMD ("Date" :: String) + treeViewColumnSetResizable cMD True + treeViewColumnSetClickable cMD True + treeViewColumnSetSortColumnId cMD 2 + cellLayoutPackStart cMD renderTxt True + _ <- treeViewAppendColumn treeView cMD + cellLayoutAddColumnAttribute cMD renderTxt ct $ makeColumnIdString 2 + + -- permissions column + cP <- treeViewColumnNew + treeViewColumnSetTitle cP ("Permission" :: String) + treeViewColumnSetResizable cP True + treeViewColumnSetClickable cP True + treeViewColumnSetSortColumnId cP 3 + cellLayoutPackStart cP renderTxt True + _ <- treeViewAppendColumn treeView cP + cellLayoutAddColumnAttribute cP renderTxt ct $ makeColumnIdString 3 + + return $ FMTreeView treeView - return $ FMTreeView treeView - - --- |Refreshes the View based on the given directory. + +-- |Refreshes the View based on the given directory. +-- +-- Throws: -- --- Throws: --- --- - `userError` on inappropriate type -refreshView :: MyGUI - -> MyView - -> Item - -> IO () -refreshView mygui myview SymLink { sdest = Just d@Dir{} } = - refreshView mygui myview d -refreshView mygui myview item@Dir{} = do - newRawModel <- fileListStore item myview - writeTVarIO (rawModel myview) newRawModel +-- - `userError` on inappropriate type +refreshView :: MyGUI + -> MyView + -> Item + -> IO () +refreshView mygui myview SymLink { sdest = Just d@Dir{} } = + refreshView mygui myview d +refreshView mygui myview item@Dir{} = do + newRawModel <- fileListStore item myview + writeTVarIO (rawModel myview) newRawModel + + view' <- readTVarIO $ view myview - view' <- readTVarIO $ view myview - - _ <- tryTakeMVar (cwd myview) - putMVar (cwd myview) item - - -- get selected items - tps <- getSelectedTreePaths mygui myview - trs <- catMaybes <$> mapM (treeRowReferenceNew newRawModel) tps + _ <- tryTakeMVar (cwd myview) + putMVar (cwd myview) item + + -- get selected items + tps <- getSelectedTreePaths mygui myview + trs <- catMaybes <$> mapM (treeRowReferenceNew newRawModel) tps + + constructView mygui myview - constructView mygui myview - - -- reselect selected items - -- TODO: not implemented for icon view yet - case view' of - FMTreeView treeView -> do - tvs <- treeViewGetSelection treeView - ntps <- mapM treeRowReferenceGetPath trs - mapM_ (treeSelectionSelectPath tvs) ntps - _ -> return () -refreshView _ _ _ = ioError $ userError "Inappropriate type!" - - --- |Constructs the visible View with the current underlying mutable models, --- which are retrieved from 'MyGUI'. --- --- This sort of merges the components mygui and myview and fires up --- the actual models. -constructView :: MyGUI - -> MyView - -> IO () -constructView mygui myview = do - settings' <- readTVarIO $ settings mygui - - -- pix stuff - iT <- iconThemeGetDefault - folderPix <- getIcon IFolder iT (iconSize settings') - folderSymPix <- getSymlinkIcon IFolder iT (iconSize settings') - filePix <- getIcon IFile iT (iconSize settings') - fileSymPix <- getSymlinkIcon IFile iT (iconSize settings') - errorPix <- getIcon IError iT (iconSize settings') - let dirtreePix Dir{} = folderPix - dirtreePix FileLike{} = filePix - dirtreePix DirSym{} = folderSymPix - dirtreePix FileLikeSym{} = fileSymPix - dirtreePix BrokenSymlink{} = errorPix - dirtreePix _ = errorPix - + -- reselect selected items + -- TODO: not implemented for icon view yet + case view' of + FMTreeView treeView -> do + tvs <- treeViewGetSelection treeView + ntps <- mapM treeRowReferenceGetPath trs + mapM_ (treeSelectionSelectPath tvs) ntps + _ -> return () +refreshView _ _ _ = ioError $ userError "Inappropriate type!" + + +-- |Constructs the visible View with the current underlying mutable models, +-- which are retrieved from 'MyGUI'. +-- +-- This sort of merges the components mygui and myview and fires up +-- the actual models. +constructView :: MyGUI + -> MyView + -> IO () +constructView mygui myview = do + settings' <- readTVarIO $ settings mygui + + -- pix stuff + iT <- iconThemeGetDefault + folderPix <- getIcon IFolder iT (iconSize settings') + folderSymPix <- getSymlinkIcon IFolder iT (iconSize settings') + filePix <- getIcon IFile iT (iconSize settings') + fileSymPix <- getSymlinkIcon IFile iT (iconSize settings') + errorPix <- getIcon IError iT (iconSize settings') + let dirtreePix Dir{} = folderPix + dirtreePix FileLike{} = filePix + dirtreePix DirSym{} = folderSymPix + dirtreePix FileLikeSym{} = fileSymPix + dirtreePix BrokenSymlink{} = errorPix + dirtreePix _ = errorPix + + + view' <- readTVarIO $ view myview - view' <- readTVarIO $ view myview - - cdir <- getCurrentDir myview - let cdirp = path cdir - - -- update urlBar - entrySetText (urlBar myview) (P.fromAbs cdirp) + cdir <- getCurrentDir myview + let cdirp = path cdir + + -- update urlBar + entrySetText (urlBar myview) (P.fromAbs cdirp) + + rawModel' <- readTVarIO $ rawModel myview - rawModel' <- readTVarIO $ rawModel myview - - -- filtering - filteredModel' <- treeModelFilterNew rawModel' [] - writeTVarIO (filteredModel myview) filteredModel' - treeModelFilterSetVisibleFunc filteredModel' $ \iter -> do - hidden <- showHidden <$> readTVarIO (settings mygui) - item <- treeModelGetRow rawModel' iter >>= (P.basename . path) - if hidden - then return True - else return . not . hiddenFile . P.fromRel $ item - - -- sorting - sortedModel' <- treeModelSortNewWithModel filteredModel' - writeTVarIO (sortedModel myview) sortedModel' - treeSortableSetSortFunc sortedModel' 1 $ \iter1 iter2 -> do - cIter1 <- treeModelFilterConvertIterToChildIter filteredModel' iter1 - cIter2 <- treeModelFilterConvertIterToChildIter filteredModel' iter2 - item1 <- treeModelGetRow rawModel' cIter1 - item2 <- treeModelGetRow rawModel' cIter2 - return $ compare item1 item2 - treeSortableSetSortColumnId sortedModel' 1 SortAscending - - -- set values - treeModelSetColumn rawModel' (makeColumnIdPixbuf 0) - dirtreePix - treeModelSetColumn rawModel' (makeColumnIdString 1) - (P.toFilePath . fromJust . P.basename . path) - treeModelSetColumn rawModel' (makeColumnIdString 2) - packModTime - treeModelSetColumn rawModel' (makeColumnIdString 3) - packPermissions - - -- update model of view - case view' of - FMTreeView treeView -> do - treeViewSetModel treeView sortedModel' - treeViewSetRubberBanding treeView True - FMIconView iconView -> do - iconViewSetModel iconView (Just sortedModel') - iconViewSetPixbufColumn iconView - (makeColumnIdPixbuf 0 :: ColumnId item Pixbuf) - iconViewSetTextColumn iconView - (makeColumnIdString 1 :: ColumnId item String) - - -- add watcher - mi <- tryTakeMVar (inotify myview) - for_ mi $ \i -> killINotify i - newi <- initINotify - _ <- addWatch - newi - [Move, MoveIn, MoveOut, MoveSelf, Create, Delete, DeleteSelf] - (P.fromAbs cdirp) - (\_ -> postGUIAsync $ refreshView mygui myview cdir) - putMVar (inotify myview) newi - - return () + -- filtering + filteredModel' <- treeModelFilterNew rawModel' [] + writeTVarIO (filteredModel myview) filteredModel' + treeModelFilterSetVisibleFunc filteredModel' $ \iter -> do + hidden <- showHidden <$> readTVarIO (settings mygui) + item <- treeModelGetRow rawModel' iter >>= (P.basename . path) + if hidden + then return True + else return . not . hiddenFile . P.fromRel $ item + + -- sorting + sortedModel' <- treeModelSortNewWithModel filteredModel' + writeTVarIO (sortedModel myview) sortedModel' + treeSortableSetSortFunc sortedModel' 1 $ \iter1 iter2 -> do + cIter1 <- treeModelFilterConvertIterToChildIter filteredModel' iter1 + cIter2 <- treeModelFilterConvertIterToChildIter filteredModel' iter2 + item1 <- treeModelGetRow rawModel' cIter1 + item2 <- treeModelGetRow rawModel' cIter2 + return $ compare item1 item2 + treeSortableSetSortColumnId sortedModel' 1 SortAscending + + -- set values + treeModelSetColumn rawModel' (makeColumnIdPixbuf 0) + dirtreePix + treeModelSetColumn rawModel' (makeColumnIdString 1) + (P.toFilePath . fromJust . P.basename . path) + treeModelSetColumn rawModel' (makeColumnIdString 2) + packModTime + treeModelSetColumn rawModel' (makeColumnIdString 3) + packPermissions + + -- update model of view + case view' of + FMTreeView treeView -> do + treeViewSetModel treeView sortedModel' + treeViewSetRubberBanding treeView True + FMIconView iconView -> do + iconViewSetModel iconView (Just sortedModel') + iconViewSetPixbufColumn iconView + (makeColumnIdPixbuf 0 :: ColumnId item Pixbuf) + iconViewSetTextColumn iconView + (makeColumnIdString 1 :: ColumnId item String) + + -- add watcher + mi <- tryTakeMVar (inotify myview) + for_ mi $ \i -> killINotify i + newi <- initINotify + _ <- addWatch + newi + [Move, MoveIn, MoveOut, MoveSelf, Create, Delete, DeleteSelf] + (P.fromAbs cdirp) + (\_ -> postGUIAsync $ refreshView mygui myview cdir) + putMVar (inotify myview) newi + + return () diff --git a/src/HSFM-GUI-Gtk-Plugins.html b/src/HSFM-GUI-Gtk-Plugins.html index 1ac2c44..4e32def 100644 --- a/src/HSFM-GUI-Gtk-Plugins.html +++ b/src/HSFM-GUI-Gtk-Plugins.html @@ -26,36 +26,36 @@ --} -{-# LANGUAGE TupleSections #-} -{-# OPTIONS_HADDOCK ignore-exports #-} +{-# OPTIONS_HADDOCK ignore-exports #-} + - -module HSFM.GUI.Gtk.Plugins where +module HSFM.GUI.Gtk.Plugins where + - -import Graphics.UI.Gtk -import HPath -import HSFM.FileSystem.FileType -import HSFM.GUI.Gtk.Data -import HSFM.GUI.Gtk.Settings -import HSFM.GUI.Gtk.Utils -import HSFM.Settings -import Control.Monad - ( - forM - , forM_ - , void - ) -import System.Posix.Process.ByteString - ( - executeFile - , forkProcess - ) -import Data.ByteString.UTF8 - ( - fromString - ) -import qualified Data.ByteString as BS +import Graphics.UI.Gtk +import HPath +import HSFM.FileSystem.FileType +import HSFM.GUI.Gtk.Data +import HSFM.GUI.Gtk.Settings +import HSFM.GUI.Gtk.Utils +import HSFM.Settings +import Control.Monad + ( + forM + , forM_ + , void + ) +import System.Posix.Process.ByteString + ( + executeFile + , forkProcess + ) +import Data.ByteString.UTF8 + ( + fromString + ) +import qualified Data.ByteString as BS + @@ -66,73 +66,56 @@ ----- Init functions ---- - + +---- Global settings ---- --- |Usually, you don't want to overwrite this method. It --- adds plugins from `myplugins` and initializes the callbacks --- automatically. -addPlugins :: MyGUI -> MyView -> IO () -addPlugins mygui myview - | null myplugins = return () - | otherwise = do - -- add another plugin separator after the existing one - -- where we want to place our plugins - sep2 <- separatorMenuItemNew - widgetShow sep2 - - menuShellInsert (rcMenu . rcmenu $ myview) sep2 insertPos - - plugins <- forM myplugins $ \(ma,mb) -> fmap (,mb) ma - -- need to reverse plugins list so the order is right - forM_ (reverse plugins) $ \(plugin, cb) -> do - menuShellInsert (rcMenu . rcmenu $ myview) plugin insertPos - widgetShow plugin - -- init callback - plugin `on` menuItemActivated $ withItems mygui myview cb - - return () + + +-- |Where to start inserting plugins. +insertPos :: Int +insertPos = 4 + + +-- |A list of plugins to add to the right-click menu at position +-- `insertPos`. +-- +-- The left part of the triple is the menuitem. +-- The middle part of the triple is a filter function that +-- decides whether the item is shown. +-- The right part of the triple is the callback, which is invoked +-- when the menu item is clicked. +-- +-- Plugins are added in order of this list. +myplugins :: [(IO MenuItem + ,[Item] -> MyGUI -> MyView -> IO Bool + ,[Item] -> MyGUI -> MyView -> IO ())] +myplugins = [(diffItem, diffFilter, diffCallback) + ] + - ----- Global settings ---- +---- The plugins ---- + - --- |Where to start inserting plugins. -insertPos :: Int -insertPos = 4 - - --- |A list of plugins to add to the right-click menu at position --- `insertPos`. The left part of the tuple is the menuitem, the right --- part the callback. --- Plugins are added in order of this list. -myplugins :: [(IO MenuItem, [Item] -> MyGUI -> MyView -> IO ())] -myplugins = [(diffPlugin, diffCallback) - ] - - - +diffItem :: IO MenuItem +diffItem = menuItemNewWithLabel "diff" + +diffFilter :: [Item] -> MyGUI -> MyView -> IO Bool +diffFilter items _ _ + | length items > 1 = return $ and $ fmap isFileC items + | otherwise = return False + +diffCallback :: [Item] -> MyGUI -> MyView -> IO () +diffCallback items _ _ = void $ + forkProcess $ + executeFile + (fromString "meld") + True + ([fromString "--diff"] ++ fmap (fromAbs . path) items) + Nothing - ----- The plugins ---- - - - -diffPlugin :: IO MenuItem -diffPlugin = menuItemNewWithLabel "diff" - -diffCallback :: [Item] -> MyGUI -> MyView -> IO () -diffCallback items _ _ = void $ - forkProcess $ - executeFile - (fromString "meld") - True - ([fromString "--diff"] ++ fmap (fromAbs . path) items) - Nothing - diff --git a/src/HSFM-GUI-Gtk-Utils.html b/src/HSFM-GUI-Gtk-Utils.html index 94135ed..810ac12 100644 --- a/src/HSFM-GUI-Gtk-Utils.html +++ b/src/HSFM-GUI-Gtk-Utils.html @@ -87,8 +87,8 @@ -> ( [Item] -> MyGUI -> MyView - -> IO ()) -- ^ action to carry out - -> IO () + -> IO a) -- ^ action to carry out + -> IO a withItems mygui myview io = do items <- getSelectedItems mygui myview io items mygui myview