diff --git a/HSFM-GUI-Gtk-Callbacks.html b/HSFM-GUI-Gtk-Callbacks.html index 70b07a9..7158ce4 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.

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

Go "back" in the history.

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

Go "forth" in the history.

\ 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 () Source #

Go "back" in the history.

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

Go "forward" in the history.

\ No newline at end of file diff --git a/HSFM-GUI-Gtk-Data.html b/HSFM-GUI-Gtk-Data.html index 32f4efc..ee0b424 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-Utils.html b/HSFM-GUI-Gtk-Utils.html index 50481c6..f79f683 100644 --- a/HSFM-GUI-Gtk-Utils.html +++ b/HSFM-GUI-Gtk-Utils.html @@ -1,11 +1,10 @@ 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 ())

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. 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 empty.

pushStatusBar :: MyGUI -> String -> IO (ContextId, MessageId) Source #

Push a message to the status bar.

popStatusbar :: MyGUI -> IO () Source #

Pop a message from the status bar.

rawPathToIter :: MyView -> TreePath -> IO (Maybe TreeIter) Source #

Turn a path on the rawModel into a path that we can use at the outermost model layer.

rawPathToItem :: MyView -> TreePath -> IO (Maybe Item) Source #

Turn a path on the rawModel into the corresponding item - that we can use at the outermost model layer.

addHistory :: Eq a => a -> [a] -> [a] Source #

Makes sure the list is max 5. This is probably not very efficient - but we don't care, since it's a small list anyway.

\ No newline at end of file + that we can use at the outermost model layer.

\ No newline at end of file diff --git a/HSFM-History.html b/HSFM-History.html new file mode 100644 index 0000000..8862cee --- /dev/null +++ b/HSFM-History.html @@ -0,0 +1,6 @@ +HSFM.History

hsfm-gtk

Safe HaskellSafe
LanguageHaskell2010

HSFM.History

Synopsis

Documentation

data BrowsingHistory Source #

Browsing history. For forwardHistory and backwardsHistory + the first item is the most recent one.

Constructors

BrowsingHistory 

Fields

goNewPath :: Path Abs -> BrowsingHistory -> BrowsingHistory Source #

This is meant to be called after e.g. a new path is entered + (not navigated to via the history) and the history needs updating.

goBack :: BrowsingHistory -> BrowsingHistory Source #

Go back in the history.

goForward :: BrowsingHistory -> BrowsingHistory Source #

Go forward in the history.

\ No newline at end of file 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

hsfm-gtk

Safe HaskellSafe
LanguageHaskell2010

Paths_hsfm

Documentation

\ No newline at end of file +

hsfm-gtk

Safe HaskellSafe
LanguageHaskell2010

Paths_hsfm

Documentation

\ No newline at end of file diff --git a/doc-index-A.html b/doc-index-A.html index 3796004..6c80e30 100644 --- a/doc-index-A.html +++ b/doc-index-A.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - A)

hsfm-gtk

Index - A

accessTimeHSFM.FileSystem.FileType
accessTimeHiResHSFM.FileSystem.FileType
addHistoryHSFM.GUI.Gtk.Utils
\ No newline at end of file +

hsfm-gtk

Index - A

accessTimeHSFM.FileSystem.FileType
accessTimeHiResHSFM.FileSystem.FileType
\ No newline at end of file diff --git a/doc-index-All.html b/doc-index-All.html index 512e311..4409968 100644 --- a/doc-index-All.html +++ b/doc-index-All.html @@ -1,4 +1,4 @@ hsfm-gtk (Index)

hsfm-gtk

Index

accessTimeHSFM.FileSystem.FileType
accessTimeHiResHSFM.FileSystem.FileType
addHistoryHSFM.GUI.Gtk.Utils
BlockDevHSFM.FileSystem.FileType
BrokenSymlinkHSFM.FileSystem.FileType
brokenSymlinkHSFM.FileSystem.FileType
CharDevHSFM.FileSystem.FileType
clearStatusBarHSFM.GUI.Gtk.Data
closeTabHSFM.GUI.Gtk.Callbacks
comparingConstrHSFM.FileSystem.FileType
constructViewHSFM.GUI.Gtk.MyView
Copy 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
copyInitHSFM.GUI.Gtk.Callbacks
createIconViewHSFM.GUI.Gtk.MyView
createMyGUIHSFM.GUI.Gtk.MyGUI
createMyViewHSFM.GUI.Gtk.MyView
createTreeViewHSFM.GUI.Gtk.MyView
cwdHSFM.GUI.Gtk.Data
c_strlenHSFM.GUI.Glib.GlibString
delHSFM.GUI.Gtk.Callbacks
destroyViewHSFM.GUI.Gtk.MyView
deviceIDHSFM.FileSystem.FileType
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
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
goHistoryNextHSFM.GUI.Gtk.Callbacks
goHistoryPrevHSFM.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
homeViewBHSFM.GUI.Gtk.Data
iconSizeHSFM.GUI.Gtk.Data
IErrorHSFM.GUI.Gtk.Icons
IFileHSFM.GUI.Gtk.Icons
IFolderHSFM.GUI.Gtk.Icons
inotifyHSFM.GUI.Gtk.Data
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
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
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
MyGUIHSFM.GUI.Gtk.Data
MyViewHSFM.GUI.Gtk.Data
NamedPipeHSFM.FileSystem.FileType
newDirHSFM.GUI.Gtk.Callbacks
newFileHSFM.GUI.Gtk.Callbacks
newTabHSFM.GUI.Gtk.MyView
newTab'HSFM.GUI.Gtk.Callbacks
NoneHSFM.FileSystem.UtilTypes
noNullPtrsHSFM.GUI.Glib.GlibString
notebookHSFM.GUI.Gtk.Data
opeInNewTabHSFM.GUI.Gtk.Callbacks
openHSFM.GUI.Gtk.Callbacks
openTerminalHereHSFM.GUI.Gtk.Callbacks
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
pathHSFM.FileSystem.FileType
popStatusbarHSFM.GUI.Gtk.Utils
pushStatusBarHSFM.GUI.Gtk.Utils
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
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
textInputDialogHSFM.GUI.Gtk.Dialogs
UnknownDialogButtonHSFM.GUI.Gtk.Errors
upDirHSFM.GUI.Gtk.Callbacks
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 +

hsfm-gtk

Index

accessTimeHSFM.FileSystem.FileType
accessTimeHiResHSFM.FileSystem.FileType
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
comparingConstrHSFM.FileSystem.FileType
constructViewHSFM.GUI.Gtk.MyView
Copy 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
copyInitHSFM.GUI.Gtk.Callbacks
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
destroyViewHSFM.GUI.Gtk.MyView
deviceIDHSFM.FileSystem.FileType
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
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
goBackHSFM.History
goDirHSFM.GUI.Gtk.Callbacks.Utils
goForwardHSFM.History
goHistoryBackHSFM.GUI.Gtk.Callbacks
goHistoryForwardHSFM.GUI.Gtk.Callbacks
goHomeHSFM.GUI.Gtk.Callbacks
goNewPathHSFM.History
goUpHSFM.FileSystem.FileType
goUp'HSFM.FileSystem.FileType
GtkExceptionHSFM.GUI.Gtk.Errors
GtkIconHSFM.GUI.Gtk.Icons
historyHSFM.GUI.Gtk.Data
homeViewBHSFM.GUI.Gtk.Data
iconSizeHSFM.GUI.Gtk.Data
IErrorHSFM.GUI.Gtk.Icons
IFileHSFM.GUI.Gtk.Icons
IFolderHSFM.GUI.Gtk.Icons
inotifyHSFM.GUI.Gtk.Data
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
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
MyGUIHSFM.GUI.Gtk.Data
MyViewHSFM.GUI.Gtk.Data
NamedPipeHSFM.FileSystem.FileType
newDirHSFM.GUI.Gtk.Callbacks
newFileHSFM.GUI.Gtk.Callbacks
newTabHSFM.GUI.Gtk.MyView
newTab'HSFM.GUI.Gtk.Callbacks
NoneHSFM.FileSystem.UtilTypes
noNullPtrsHSFM.GUI.Glib.GlibString
notebookHSFM.GUI.Gtk.Data
opeInNewTabHSFM.GUI.Gtk.Callbacks
openHSFM.GUI.Gtk.Callbacks
openTerminalHereHSFM.GUI.Gtk.Callbacks
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
pathHSFM.FileSystem.FileType
popStatusbarHSFM.GUI.Gtk.Utils
pushStatusBarHSFM.GUI.Gtk.Utils
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
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
textInputDialogHSFM.GUI.Gtk.Dialogs
UnknownDialogButtonHSFM.GUI.Gtk.Errors
upDirHSFM.GUI.Gtk.Callbacks
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-B.html b/doc-index-B.html index 410ef5a..eb0e1ed 100644 --- a/doc-index-B.html +++ b/doc-index-B.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - B)

hsfm-gtk

Index - B

BlockDevHSFM.FileSystem.FileType
BrokenSymlinkHSFM.FileSystem.FileType
brokenSymlinkHSFM.FileSystem.FileType
\ No newline at end of file +

hsfm-gtk

Index - B

backwardsHistoryHSFM.History
BlockDevHSFM.FileSystem.FileType
BrokenSymlinkHSFM.FileSystem.FileType
brokenSymlinkHSFM.FileSystem.FileType
BrowsingHistory 
1 (Type/Class)HSFM.History
2 (Data Constructor)HSFM.History
\ No newline at end of file diff --git a/doc-index-C.html b/doc-index-C.html index 4d62096..3c263d0 100644 --- a/doc-index-C.html +++ b/doc-index-C.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - C)

hsfm-gtk

Index - C

CharDevHSFM.FileSystem.FileType
clearStatusBarHSFM.GUI.Gtk.Data
closeTabHSFM.GUI.Gtk.Callbacks
comparingConstrHSFM.FileSystem.FileType
constructViewHSFM.GUI.Gtk.MyView
Copy 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
copyInitHSFM.GUI.Gtk.Callbacks
createIconViewHSFM.GUI.Gtk.MyView
createMyGUIHSFM.GUI.Gtk.MyGUI
createMyViewHSFM.GUI.Gtk.MyView
createTreeViewHSFM.GUI.Gtk.MyView
cwdHSFM.GUI.Gtk.Data
c_strlenHSFM.GUI.Glib.GlibString
\ No newline at end of file +

hsfm-gtk

Index - C

CharDevHSFM.FileSystem.FileType
clearStatusBarHSFM.GUI.Gtk.Data
closeTabHSFM.GUI.Gtk.Callbacks
comparingConstrHSFM.FileSystem.FileType
constructViewHSFM.GUI.Gtk.MyView
Copy 
1 (Type/Class)HSFM.FileSystem.UtilTypes
2 (Data Constructor)HSFM.FileSystem.UtilTypes
copyInitHSFM.GUI.Gtk.Callbacks
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
\ No newline at end of file diff --git a/doc-index-F.html b/doc-index-F.html index 609930e..3a7591a 100644 --- a/doc-index-F.html +++ b/doc-index-F.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - F)

hsfm-gtk

Index - F

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
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
\ No newline at end of file +

hsfm-gtk

Index - F

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
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
\ No newline at end of file diff --git a/doc-index-G.html b/doc-index-G.html index 856f06c..6706a00 100644 --- a/doc-index-G.html +++ b/doc-index-G.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - G)

hsfm-gtk

Index - G

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
goHistoryNextHSFM.GUI.Gtk.Callbacks
goHistoryPrevHSFM.GUI.Gtk.Callbacks
goHomeHSFM.GUI.Gtk.Callbacks
goUpHSFM.FileSystem.FileType
goUp'HSFM.FileSystem.FileType
GtkExceptionHSFM.GUI.Gtk.Errors
GtkIconHSFM.GUI.Gtk.Icons
\ No newline at end of file +

hsfm-gtk

Index - G

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
goBackHSFM.History
goDirHSFM.GUI.Gtk.Callbacks.Utils
goForwardHSFM.History
goHistoryBackHSFM.GUI.Gtk.Callbacks
goHistoryForwardHSFM.GUI.Gtk.Callbacks
goHomeHSFM.GUI.Gtk.Callbacks
goNewPathHSFM.History
goUpHSFM.FileSystem.FileType
goUp'HSFM.FileSystem.FileType
GtkExceptionHSFM.GUI.Gtk.Errors
GtkIconHSFM.GUI.Gtk.Icons
\ No newline at end of file diff --git a/doc-index-M.html b/doc-index-M.html index 425ce5d..ae31ae0 100644 --- a/doc-index-M.html +++ b/doc-index-M.html @@ -1,4 +1,4 @@ hsfm-gtk (Index - M)

hsfm-gtk

Index - M

mainMain
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
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
MyGUIHSFM.GUI.Gtk.Data
MyViewHSFM.GUI.Gtk.Data
\ No newline at end of file +

hsfm-gtk

Index - M

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
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
MyGUIHSFM.GUI.Gtk.Data
MyViewHSFM.GUI.Gtk.Data
\ No newline at end of file diff --git a/hsfm.haddock b/hsfm.haddock index 63b2aac..4891698 100644 Binary files a/hsfm.haddock and b/hsfm.haddock differ diff --git a/index-frames.html b/index-frames.html index e0badda..d687962 100644 --- a/index-frames.html +++ b/index-frames.html @@ -1,4 +1,4 @@ hsfm-gtk

Modules

\ No newline at end of file +

Modules

\ No newline at end of file diff --git a/index.html b/index.html index be35506..359725a 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ hsfm-gtk

hsfm-gtk

hsfm-gtk

FileManager written in haskell

Modules

\ No newline at end of file +

hsfm-gtk

hsfm-gtk

FileManager written in haskell

Modules

\ No newline at end of file diff --git a/mini_HSFM-GUI-Gtk-Callbacks.html b/mini_HSFM-GUI-Gtk-Callbacks.html index 5d74f57..06a2c79 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

setGUICallbacks

setViewCallbacks

openTerminalHere

closeTab

newTab'

opeInNewTab

del

moveInit

copyInit

operationFinal

newFile

newDir

renameF

urlGoTo

goHome

execute

open

upDir

goHistoryPrev

goHistoryNext

\ No newline at end of file +

HSFM.GUI.Gtk.Callbacks

setGUICallbacks

setViewCallbacks

openTerminalHere

closeTab

newTab'

opeInNewTab

del

moveInit

copyInit

operationFinal

newFile

newDir

renameF

urlGoTo

goHome

execute

open

upDir

goHistoryBack

goHistoryForward

\ No newline at end of file diff --git a/mini_HSFM-GUI-Gtk-Utils.html b/mini_HSFM-GUI-Gtk-Utils.html index c2800ea..c03f89e 100644 --- a/mini_HSFM-GUI-Gtk-Utils.html +++ b/mini_HSFM-GUI-Gtk-Utils.html @@ -1,4 +1,4 @@ HSFM.GUI.Gtk.Utils

HSFM.GUI.Gtk.Utils

getSelectedTreePaths

getSelectedItems

withItems

fileListStore

getFirstItem

getCurrentDir

pushStatusBar

popStatusbar

rawPathToIter

rawPathToItem

addHistory

\ No newline at end of file +

HSFM.GUI.Gtk.Utils

getSelectedTreePaths

getSelectedItems

withItems

fileListStore

getFirstItem

getCurrentDir

pushStatusBar

popStatusbar

rawPathToIter

rawPathToItem

\ No newline at end of file diff --git a/mini_HSFM-History.html b/mini_HSFM-History.html new file mode 100644 index 0000000..328f251 --- /dev/null +++ b/mini_HSFM-History.html @@ -0,0 +1,4 @@ +HSFM.History

HSFM.History

data BrowsingHistory

goNewPath

goBack

goForward

\ No newline at end of file diff --git a/src/HSFM-GUI-Gtk-Callbacks-Utils.html b/src/HSFM-GUI-Gtk-Callbacks-Utils.html index c40325d..8b62722 100644 --- a/src/HSFM-GUI-Gtk-Callbacks-Utils.html +++ b/src/HSFM-GUI-Gtk-Callbacks-Utils.html @@ -38,98 +38,105 @@ forM_ , when ) -import Data.Maybe +import Data.Foldable ( - fromJust + for_ ) -import GHC.IO.Exception +import Data.Maybe ( - IOErrorType(..) + fromJust ) -import Graphics.UI.Gtk -import qualified HPath as P -import HPath.IO -import HPath.IO.Errors -import HSFM.FileSystem.FileType -import HSFM.FileSystem.UtilTypes -import HSFM.GUI.Gtk.Data -import HSFM.GUI.Gtk.Dialogs -import HSFM.GUI.Gtk.MyView -import HSFM.GUI.Gtk.Utils -import HSFM.Utils.IO - ( - modifyTVarIO - ) +import GHC.IO.Exception + ( + IOErrorType(..) + ) +import Graphics.UI.Gtk +import qualified HPath as P +import HPath.IO +import HPath.IO.Errors +import HSFM.FileSystem.FileType +import HSFM.FileSystem.UtilTypes +import HSFM.GUI.Gtk.Data +import HSFM.GUI.Gtk.Dialogs +import HSFM.GUI.Gtk.MyView +import HSFM.History import Prelude hiding(readFile) - - - - --- |Carries out a file operation with the appropriate error handling --- allowing the user to react to various exceptions with further input. -doFileOperation :: FileOperation -> IO () -doFileOperation (FCopy (Copy (f':fs') to)) = - _doFileOperation (f':fs') to easyCopyOverwrite easyCopy - $ doFileOperation (FCopy $ Copy fs' to) -doFileOperation (FMove (Move (f':fs') to)) = - _doFileOperation (f':fs') to moveFileOverwrite moveFile - $ doFileOperation (FMove $ Move fs' to) -doFileOperation _ = return () - - -_doFileOperation :: [P.Path b1] - -> P.Path P.Abs - -> (P.Path b1 -> P.Path P.Abs -> IO b) - -> (P.Path b1 -> P.Path P.Abs -> IO a) - -> IO () - -> IO () -_doFileOperation [] _ _ _ _ = return () -_doFileOperation (f:fs) to mcOverwrite mc rest = do - toname <- P.basename f - let topath = to P.</> toname - reactOnError (mc f topath >> rest) - [(AlreadyExists , collisionAction fileCollisionDialog topath)] - [(FileDoesExist{}, collisionAction fileCollisionDialog topath) - ,(DirDoesExist{} , collisionAction fileCollisionDialog topath) - ,(SameFile{} , collisionAction renameDialog topath)] - where - collisionAction diag topath = do - mcm <- diag . P.fromAbs $ topath - forM_ mcm $ \cm -> case cm of - Overwrite -> mcOverwrite f topath >> rest - OverwriteAll -> forM_ (f:fs) $ \x -> do - toname' <- P.basename x - mcOverwrite x (to P.</> toname') - Skip -> rest - Rename newn -> mc f (to P.</> newn) >> rest - _ -> return () - - --- |Helper that is invoked for any directory change operations. -goDir :: Bool -- ^ whether to update the history - -> MyGUI - -> MyView - -> Item - -> IO () -goDir bhis mygui myview item = do - cdir <- getCurrentDir myview - when bhis $ modifyTVarIO (history myview) - (\(p, _) -> (path cdir `addHistory` p, [])) - refreshView mygui myview item - - -- set notebook tab label - page <- notebookGetCurrentPage (notebook mygui) - child <- fromJust <$> notebookGetNthPage (notebook mygui) page - - -- get the label - ebox <- (castToEventBox . fromJust) - <$> notebookGetTabLabel (notebook mygui) child - label <- (castToLabel . head) <$> containerGetChildren ebox - - -- set the label - labelSetText label - (maybe (P.fromAbs $ path item) - P.fromRel $ P.basename . path $ item) - +import Control.Concurrent.MVar + ( + putMVar + , tryTakeMVar + ) + + + + +-- |Carries out a file operation with the appropriate error handling +-- allowing the user to react to various exceptions with further input. +doFileOperation :: FileOperation -> IO () +doFileOperation (FCopy (Copy (f':fs') to)) = + _doFileOperation (f':fs') to easyCopyOverwrite easyCopy + $ doFileOperation (FCopy $ Copy fs' to) +doFileOperation (FMove (Move (f':fs') to)) = + _doFileOperation (f':fs') to moveFileOverwrite moveFile + $ doFileOperation (FMove $ Move fs' to) +doFileOperation _ = return () + + +_doFileOperation :: [P.Path b1] + -> P.Path P.Abs + -> (P.Path b1 -> P.Path P.Abs -> IO b) + -> (P.Path b1 -> P.Path P.Abs -> IO a) + -> IO () + -> IO () +_doFileOperation [] _ _ _ _ = return () +_doFileOperation (f:fs) to mcOverwrite mc rest = do + toname <- P.basename f + let topath = to P.</> toname + reactOnError (mc f topath >> rest) + [(AlreadyExists , collisionAction fileCollisionDialog topath)] + [(FileDoesExist{}, collisionAction fileCollisionDialog topath) + ,(DirDoesExist{} , collisionAction fileCollisionDialog topath) + ,(SameFile{} , collisionAction renameDialog topath)] + where + collisionAction diag topath = do + mcm <- diag . P.fromAbs $ topath + forM_ mcm $ \cm -> case cm of + Overwrite -> mcOverwrite f topath >> rest + OverwriteAll -> forM_ (f:fs) $ \x -> do + toname' <- P.basename x + mcOverwrite x (to P.</> toname') + Skip -> rest + Rename newn -> mc f (to P.</> newn) >> rest + _ -> return () + + +-- |Helper that is invoked for any directory change operations. +goDir :: Bool -- ^ whether to update the history + -> MyGUI + -> MyView + -> Item + -> IO () +goDir bhis mygui myview item = do + when bhis $ do + mhs <- tryTakeMVar (history myview) + for_ mhs $ \hs -> do + let nhs = goNewPath (path item) hs + putMVar (history myview) nhs + refreshView mygui myview item + + -- set notebook tab label + page <- notebookGetCurrentPage (notebook mygui) + child <- fromJust <$> notebookGetNthPage (notebook mygui) page + + -- get the label + ebox <- (castToEventBox . fromJust) + <$> notebookGetTabLabel (notebook mygui) child + label <- (castToLabel . head) <$> containerGetChildren ebox + + -- set the label + labelSetText label + (maybe (P.fromAbs $ path item) + P.fromRel $ P.basename . path $ item) + diff --git a/src/HSFM-GUI-Gtk-Callbacks.html b/src/HSFM-GUI-Gtk-Callbacks.html index 5842784..628fa7d 100644 --- a/src/HSFM-GUI-Gtk-Callbacks.html +++ b/src/HSFM-GUI-Gtk-Callbacks.html @@ -81,494 +81,494 @@ import HSFM.GUI.Gtk.Dialogs import HSFM.GUI.Gtk.MyView import HSFM.GUI.Gtk.Utils -import HSFM.Utils.IO -import Prelude hiding(readFile) -import System.Glib.UTFString - ( - glibToString - ) -import System.Posix.Env.ByteString - ( - getEnv - ) -import qualified System.Posix.Process.ByteString as SPP -import System.Posix.Types - ( - ProcessID - ) - - - - - - ----------------- - --[ Callbacks ]-- - ----------------- +import HSFM.History +import HSFM.Utils.IO +import Prelude hiding(readFile) +import System.Glib.UTFString + ( + glibToString + ) +import System.Posix.Env.ByteString + ( + getEnv + ) +import qualified System.Posix.Process.ByteString as SPP +import System.Posix.Types + ( + ProcessID + ) +import Control.Concurrent.MVar + ( + putMVar + , tryTakeMVar + ) + + - ----- MAIN CALLBACK ENTRYPOINT ---- - + ----------------- + --[ Callbacks ]-- + ----------------- --- |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 - - -- menubar-help - _ <- (menubarHelpAbout . menubar) mygui `on` menuItemActivated $ - liftIO showAboutDialog - return () - - -- key events - _ <- rootWin mygui `on` keyPressEvent $ tryEvent $ do - [Control] <- eventModifier - "q" <- fmap glibToString eventKeyName - liftIO mainQuit + + + +---- MAIN CALLBACK ENTRYPOINT ---- + + +-- |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 + + -- menubar-help + _ <- (menubarHelpAbout . menubar) mygui `on` menuItemActivated $ + liftIO showAboutDialog + return () - 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) - commonGuiEvents fmv - return () - where - commonGuiEvents fmv = do - let view = fmViewToContainer fmv - - -- GUI events - _ <- 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 - [Control] <- eventModifier - "h" <- 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 - [Alt] <- eventModifier - "Up" <- fmap glibToString eventKeyName - liftIO $ upDir mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - [Alt] <- eventModifier - "Left" <- fmap glibToString eventKeyName - liftIO $ goHistoryPrev mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - [Alt] <- eventModifier - "Right" <- fmap glibToString eventKeyName - liftIO $ goHistoryNext mygui myview - _ <- view `on` keyPressEvent $ tryEvent $ do - "Delete" <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview del - _ <- view `on` keyPressEvent $ tryEvent $ do - [] <- eventModifier - "Return" <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview open - _ <- view `on` keyPressEvent $ tryEvent $ do - [Control] <- eventModifier - "c" <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview copyInit - _ <- view `on` keyPressEvent $ tryEvent $ do - [Control] <- eventModifier - "x" <- fmap glibToString eventKeyName - liftIO $ withItems mygui myview moveInit - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - [Control] <- eventModifier - "v" <- fmap glibToString eventKeyName - liftIO $ operationFinal mygui myview Nothing - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - [Control] <- eventModifier - "t" <- fmap glibToString eventKeyName - liftIO $ void $ newTab' mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - [Control] <- eventModifier - "w" <- fmap glibToString eventKeyName - liftIO $ void $ closeTab mygui myview - _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do - "F4" <- 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 $ goHistoryPrev mygui myview - return False - OtherButton 9 -> do - liftIO $ goHistoryNext 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 () - - 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 ---- - + -- key events + _ <- rootWin mygui `on` keyPressEvent $ tryEvent $ do + [Control] <- eventModifier + "q" <- 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) + commonGuiEvents fmv + return () + where + commonGuiEvents fmv = do + let view = fmViewToContainer fmv + + -- GUI events + _ <- 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 + [Control] <- eventModifier + "h" <- 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 + [Alt] <- eventModifier + "Up" <- fmap glibToString eventKeyName + liftIO $ upDir mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + [Alt] <- eventModifier + "Left" <- fmap glibToString eventKeyName + liftIO $ goHistoryBack mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + [Alt] <- eventModifier + "Right" <- fmap glibToString eventKeyName + liftIO $ goHistoryForward mygui myview + _ <- view `on` keyPressEvent $ tryEvent $ do + "Delete" <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview del + _ <- view `on` keyPressEvent $ tryEvent $ do + [] <- eventModifier + "Return" <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview open + _ <- view `on` keyPressEvent $ tryEvent $ do + [Control] <- eventModifier + "c" <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview copyInit + _ <- view `on` keyPressEvent $ tryEvent $ do + [Control] <- eventModifier + "x" <- fmap glibToString eventKeyName + liftIO $ withItems mygui myview moveInit + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + [Control] <- eventModifier + "v" <- fmap glibToString eventKeyName + liftIO $ operationFinal mygui myview Nothing + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + [Control] <- eventModifier + "t" <- fmap glibToString eventKeyName + liftIO $ void $ newTab' mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + [Control] <- eventModifier + "w" <- fmap glibToString eventKeyName + liftIO $ void $ closeTab mygui myview + _ <- viewBox myview `on` keyPressEvent $ tryEvent $ do + "F4" <- 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 $ goHistoryBack mygui myview + return False + OtherButton 9 -> do + liftIO $ 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 () + + 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) -openTerminalHere :: MyView -> IO ProcessID -openTerminalHere myview = do - cwd <- (P.fromAbs . path) <$> getCurrentDir myview - -- TODO: make terminal configurable - SPP.forkProcess $ SPP.executeFile "sakura" True ["-d", cwd] Nothing + + + +---- OTHER ---- + - - - ----- TAB OPERATIONS ---- - +openTerminalHere :: MyView -> IO ProcessID +openTerminalHere myview = do + cwd <- (P.fromAbs . path) <$> getCurrentDir myview + -- TODO: make terminal configurable + SPP.forkProcess $ SPP.executeFile "sakura" True ["-d", cwd] Nothing --- |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 + + + +---- TAB OPERATIONS ---- + - -newTab' :: MyGUI -> MyView -> IO () -newTab' mygui myview = do - cwd <- getCurrentDir myview - void $ withErrorDialog $ newTab mygui createTreeView cwd (-1) +-- |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 -opeInNewTab :: MyGUI -> Item -> IO () -opeInNewTab mygui item@(DirOrSym _) = - void $ withErrorDialog $ newTab mygui createTreeView item (-1) -opeInNewTab _ _ = return () +newTab' :: MyGUI -> MyView -> IO () +newTab' mygui myview = do + cwd <- getCurrentDir myview + void $ withErrorDialog $ newTab mygui createTreeView cwd (-1) - ----- 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!" - - --- |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 (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 (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 ---- - +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!" + + +-- |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 (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 (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" --- |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 - mhomedir <- getEnv "HOME" - forM_ (P.parseAbs =<< mhomedir :: 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) - - --- |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 - - --- |Go "back" in the history. -goHistoryPrev :: MyGUI -> MyView -> IO () -goHistoryPrev mygui myview = do - hs <- readTVarIO (history myview) - case hs of - ([], _) -> return () - (x:xs, _) -> do - cdir <- getCurrentDir myview - nv <- readFile getFileInfo $ x - modifyTVarIO (history myview) - (\(_, n) -> (xs, path cdir `addHistory` n)) - goDir False mygui myview nv - - --- |Go "forth" in the history. -goHistoryNext :: MyGUI -> MyView -> IO () -goHistoryNext mygui myview = do - hs <- readTVarIO (history myview) - case hs of - (_, []) -> return () - (_, x:xs) -> do - cdir <- getCurrentDir myview - nv <- readFile getFileInfo $ x - modifyTVarIO (history myview) - (\(p, _) -> (path cdir `addHistory` p, xs)) - goDir False mygui myview nv + + + +---- 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 + mhomedir <- getEnv "HOME" + forM_ (P.parseAbs =<< mhomedir :: 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) + + +-- |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 + + +-- |Go "back" in the history. +goHistoryBack :: MyGUI -> MyView -> IO () +goHistoryBack mygui myview = do + mhs <- tryTakeMVar (history myview) + for_ mhs $ \hs -> do + let nhs = goBack hs + putMVar (history myview) nhs + nv <- readFile getFileInfo $ currentDir nhs + goDir False mygui myview nv + + +-- |Go "forward" in the history. +goHistoryForward :: MyGUI -> MyView -> IO () +goHistoryForward mygui myview = do + mhs <- tryTakeMVar (history myview) + for_ mhs $ \hs -> do + let nhs = goForward hs + putMVar (history myview) nhs + nv <- readFile getFileInfo $ currentDir nhs + goDir False mygui myview nv diff --git a/src/HSFM-GUI-Gtk-Data.html b/src/HSFM-GUI-Gtk-Data.html index 6e7bc37..de57d41 100644 --- a/src/HSFM-GUI-Gtk-Data.html +++ b/src/HSFM-GUI-Gtk-Data.html @@ -39,125 +39,121 @@ TVar ) import Graphics.UI.Gtk hiding (MenuBar) -import HPath - ( - Abs - , Path - ) -import HSFM.FileSystem.FileType -import HSFM.FileSystem.UtilTypes -import System.INotify - ( - INotify - ) - - +import HSFM.FileSystem.FileType +import HSFM.FileSystem.UtilTypes +import HSFM.History +import System.INotify + ( + INotify + ) + + + + ------------------ + --[ Base Types ]-- + ------------------ - ------------------ - --[ Base Types ]-- - ------------------ - - --- |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. -data MyGUI = MkMyGUI { - -- |main Window - rootWin :: !Window - - -- widgets on the main window - , menubar :: !MenuBar - , statusBar :: !Statusbar - , clearStatusBar :: !Button - , notebook :: !Notebook + +-- |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. +data MyGUI = MkMyGUI { + -- |main Window + rootWin :: !Window + + -- widgets on the main window + , menubar :: !MenuBar + , statusBar :: !Statusbar + , clearStatusBar :: !Button + , notebook :: !Notebook + + -- other + , fprop :: !FilePropertyGrid + , settings :: !(TVar FMSettings) - -- other - , fprop :: !FilePropertyGrid - , settings :: !(TVar FMSettings) + , operationBuffer :: !(TVar FileOperation) +} + - , operationBuffer :: !(TVar FileOperation) -} - - --- |This describes the contents of the current view and is separated from MyGUI, --- because we might want to have multiple views. -data MyView = MkMyView { - view :: !(TVar FMView) - , cwd :: !(MVar Item) - , rawModel :: !(TVar (ListStore Item)) - , sortedModel :: !(TVar (TypedTreeModelSort Item)) - , filteredModel :: !(TVar (TypedTreeModelFilter Item)) - , inotify :: !(MVar INotify) +-- |This describes the contents of the current view and is separated from MyGUI, +-- because we might want to have multiple views. +data MyView = MkMyView { + view :: !(TVar FMView) + , cwd :: !(MVar Item) + , rawModel :: !(TVar (ListStore Item)) + , sortedModel :: !(TVar (TypedTreeModelSort Item)) + , filteredModel :: !(TVar (TypedTreeModelFilter Item)) + , inotify :: !(MVar INotify) + + -- the first part of the tuple represents the "go back" + -- the second part the "go forth" in the history + , history :: !(MVar BrowsingHistory) - -- the first part of the tuple represents the "go back" - -- the second part the "go forth" in the history - , history :: !(TVar ([Path Abs], [Path Abs])) - - -- sub-widgets - , scroll :: !ScrolledWindow - , viewBox :: !Box - , rcmenu :: !RightClickMenu - , upViewB :: !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 -} - - --- |FM-wide settings. -data FMSettings = MkFMSettings { - showHidden :: !Bool - , isLazy :: !Bool - , iconSize :: !Int -} - -data FMView = FMTreeView !TreeView - | FMIconView !IconView + -- sub-widgets + , scroll :: !ScrolledWindow + , viewBox :: !Box + , rcmenu :: !RightClickMenu + , upViewB :: !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 +} + + +-- |FM-wide settings. +data FMSettings = MkFMSettings { + showHidden :: !Bool + , isLazy :: !Bool + , iconSize :: !Int +} + +data FMView = FMTreeView !TreeView + | FMIconView !IconView + +type Item = File FileInfo + + -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 4f48e6f..70968bb 100644 --- a/src/HSFM-GUI-Gtk-MyView.html +++ b/src/HSFM-GUI-Gtk-MyView.html @@ -73,387 +73,395 @@ import HSFM.GUI.Gtk.Data import HSFM.GUI.Gtk.Icons import HSFM.GUI.Gtk.Utils -import HSFM.Utils.IO -import Paths_hsfm - ( - getDataFileName - ) -import Prelude hiding(readFile) -import System.INotify - ( - addWatch - , initINotify - , killINotify - , EventVariety(..) - ) -import System.IO.Error - ( - catchIOError - , ioError - , isUserError - ) -import System.Posix.FilePath - ( - hiddenFile - ) - +import HSFM.History +import HSFM.Utils.IO +import Paths_hsfm + ( + getDataFileName + ) +import Prelude hiding(readFile) +import System.INotify + ( + addWatch + , initINotify + , killINotify + , EventVariety(..) + ) +import System.IO.Error + ( + catchIOError + , ioError + , isUserError + ) +import System.Posix.FilePath + ( + hiddenFile + ) --- |Creates a new tab with its own view and refreshes the view. -newTab :: MyGUI -> IO FMView -> Item -> Int -> IO MyView -newTab mygui iofmv item pos = do - -- create eventbox with label - label <- labelNewWithMnemonic - (maybe (P.fromAbs $ path item) P.fromRel $ P.basename $ path item) - ebox <- eventBoxNew - eventBoxSetVisibleWindow ebox False - containerAdd ebox label - widgetShowAll label - - myview <- createMyView mygui iofmv - _ <- notebookInsertPageMenu (notebook mygui) (viewBox myview) - ebox ebox pos - - notebookSetTabReorderable (notebook mygui) (viewBox myview) True - - catchIOError (refreshView mygui myview item) $ \e -> do - file <- readFile getFileInfo . fromJust . P.parseAbs . fromString - $ "/" - refreshView mygui myview file - labelSetText label (fromString "/" :: String) - unless (isUserError e) (ioError e) - - -- close callback - _ <- ebox `on` buttonPressEvent $ do - eb <- eventButton - case eb of - MiddleButton -> liftIO $ do - n <- notebookGetNPages (notebook mygui) - when (n > 1) $ void $ destroyView mygui myview - return True - _ -> return False - - return myview - - --- |Constructs the initial MyView object with a few dummy models. --- It also initializes the callbacks. -createMyView :: MyGUI - -> IO FMView - -> IO MyView -createMyView mygui iofmv = do - inotify <- newEmptyMVar - history <- newTVarIO ([],[]) - - builder <- builderNew - builderAddFromFile builder =<< getDataFileName "data/Gtk/builder.xml" - - -- create dummy models, so we don't have to use MVar - rawModel <- newTVarIO =<< listStoreNew [] - filteredModel <- newTVarIO =<< (\x -> treeModelFilterNew x []) - =<< readTVarIO rawModel - sortedModel <- newTVarIO =<< treeModelSortNewWithModel - =<< readTVarIO filteredModel - cwd <- newEmptyMVar - view' <- iofmv - view <- newTVarIO view' - - urlBar <- builderGetObject builder castToEntry - "urlBar" - rcMenu <- builderGetObject builder castToMenu - "rcMenu" - rcFileOpen <- builderGetObject builder castToImageMenuItem - "rcFileOpen" - rcFileExecute <- builderGetObject builder castToImageMenuItem - "rcFileExecute" - rcFileNewRegFile <- builderGetObject builder castToImageMenuItem - "rcFileNewRegFile" - rcFileNewDir <- builderGetObject builder castToImageMenuItem - "rcFileNewDir" - rcFileNewTab <- builderGetObject builder castToImageMenuItem - "rcFileNewTab" - rcFileNewTerm <- builderGetObject builder castToImageMenuItem - "rcFileNewTerm" - rcFileCut <- builderGetObject builder castToImageMenuItem - "rcFileCut" - rcFileCopy <- builderGetObject builder castToImageMenuItem - "rcFileCopy" - rcFileRename <- builderGetObject builder castToImageMenuItem - "rcFileRename" - rcFilePaste <- builderGetObject builder castToImageMenuItem - "rcFilePaste" - rcFileDelete <- builderGetObject builder castToImageMenuItem - "rcFileDelete" - rcFileProperty <- builderGetObject builder castToImageMenuItem - "rcFileProperty" - rcFileIconView <- builderGetObject builder castToImageMenuItem - "rcFileIconView" - rcFileTreeView <- builderGetObject builder castToImageMenuItem - "rcFileTreeView" - upViewB <- builderGetObject builder castToButton - "upViewB" - homeViewB <- builderGetObject builder castToButton - "homeViewB" - refreshViewB <- builderGetObject builder castToButton - "refreshViewB" - scroll <- builderGetObject builder castToScrolledWindow - "mainScroll" - viewBox <- builderGetObject builder castToBox - "viewBox" - - let rcmenu = MkRightClickMenu {..} - let myview = MkMyView {..} - - -- set the bindings - setViewCallbacks mygui myview - - -- add the treeview to the scroll container - let oview = fmViewToContainer view' - containerAdd scroll oview - - widgetShowAll viewBox - - return myview + +-- |Creates a new tab with its own view and refreshes the view. +newTab :: MyGUI -> IO FMView -> Item -> Int -> IO MyView +newTab mygui iofmv item pos = do + + + -- create eventbox with label + label <- labelNewWithMnemonic + (maybe (P.fromAbs $ path item) P.fromRel $ P.basename $ path item) + ebox <- eventBoxNew + eventBoxSetVisibleWindow ebox False + containerAdd ebox label + widgetShowAll label + + myview <- createMyView mygui iofmv + _ <- notebookInsertPageMenu (notebook mygui) (viewBox myview) + ebox ebox pos + + -- set initial history + let historySize = 5 + putMVar (history myview) + (BrowsingHistory [] (path item) [] historySize) + + notebookSetTabReorderable (notebook mygui) (viewBox myview) True + + catchIOError (refreshView mygui myview item) $ \e -> do + file <- readFile getFileInfo . fromJust . P.parseAbs . fromString + $ "/" + refreshView mygui myview file + labelSetText label (fromString "/" :: String) + unless (isUserError e) (ioError e) + + -- close callback + _ <- ebox `on` buttonPressEvent $ do + eb <- eventButton + case eb of + MiddleButton -> liftIO $ do + n <- notebookGetNPages (notebook mygui) + when (n > 1) $ void $ destroyView mygui myview + return True + _ -> return False + + return myview + + +-- |Constructs the initial MyView object with a few dummy models. +-- It also initializes the callbacks. +createMyView :: MyGUI + -> IO FMView + -> IO MyView +createMyView mygui iofmv = do + inotify <- newEmptyMVar + history <- newEmptyMVar + + builder <- builderNew + builderAddFromFile builder =<< getDataFileName "data/Gtk/builder.xml" + + -- create dummy models, so we don't have to use MVar + rawModel <- newTVarIO =<< listStoreNew [] + filteredModel <- newTVarIO =<< (\x -> treeModelFilterNew x []) + =<< readTVarIO rawModel + sortedModel <- newTVarIO =<< treeModelSortNewWithModel + =<< readTVarIO filteredModel + cwd <- newEmptyMVar + view' <- iofmv + view <- newTVarIO view' + + urlBar <- builderGetObject builder castToEntry + "urlBar" + rcMenu <- builderGetObject builder castToMenu + "rcMenu" + rcFileOpen <- builderGetObject builder castToImageMenuItem + "rcFileOpen" + rcFileExecute <- builderGetObject builder castToImageMenuItem + "rcFileExecute" + rcFileNewRegFile <- builderGetObject builder castToImageMenuItem + "rcFileNewRegFile" + rcFileNewDir <- builderGetObject builder castToImageMenuItem + "rcFileNewDir" + rcFileNewTab <- builderGetObject builder castToImageMenuItem + "rcFileNewTab" + rcFileNewTerm <- builderGetObject builder castToImageMenuItem + "rcFileNewTerm" + rcFileCut <- builderGetObject builder castToImageMenuItem + "rcFileCut" + rcFileCopy <- builderGetObject builder castToImageMenuItem + "rcFileCopy" + rcFileRename <- builderGetObject builder castToImageMenuItem + "rcFileRename" + rcFilePaste <- builderGetObject builder castToImageMenuItem + "rcFilePaste" + rcFileDelete <- builderGetObject builder castToImageMenuItem + "rcFileDelete" + rcFileProperty <- builderGetObject builder castToImageMenuItem + "rcFileProperty" + rcFileIconView <- builderGetObject builder castToImageMenuItem + "rcFileIconView" + rcFileTreeView <- builderGetObject builder castToImageMenuItem + "rcFileTreeView" + upViewB <- builderGetObject builder castToButton + "upViewB" + homeViewB <- builderGetObject builder castToButton + "homeViewB" + refreshViewB <- builderGetObject builder castToButton + "refreshViewB" + scroll <- builderGetObject builder castToScrolledWindow + "mainScroll" + viewBox <- builderGetObject builder castToBox + "viewBox" + + let rcmenu = MkRightClickMenu {..} + let myview = MkMyView {..} + + -- set the bindings + setViewCallbacks mygui 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 + -- add the treeview to the scroll container + let oview = fmViewToContainer view' + containerAdd scroll oview + + widgetShowAll viewBox + + return 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 +-- |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 - refreshView mygui nview cwd + oldpage <- destroyView mygui myview - --- |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) - - -- destroy old view and tab page - view' <- readTVarIO $ view myview - widgetDestroy (fmViewToContainer view') - notebookRemovePage (notebook mygui) page - - return 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 + + +-- |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) --- |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 - - --- |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 - - --- |Refreshes the View based on the given directory. --- --- 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 - - view' <- readTVarIO $ view myview - - _ <- tryTakeMVar (cwd myview) - putMVar (cwd myview) item - - -- get selected items - tps <- getSelectedTreePaths mygui myview - trs <- catMaybes <$> mapM (treeRowReferenceNew newRawModel) tps - - 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 - - - view' <- readTVarIO $ view myview - - cdir <- getCurrentDir myview - let cdirp = path cdir - - -- update urlBar - entrySetText (urlBar myview) (P.fromAbs cdirp) + -- destroy old view and tab page + view' <- readTVarIO $ view myview + widgetDestroy (fmViewToContainer view') + notebookRemovePage (notebook mygui) 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 ] -} + + 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 + + return $ FMTreeView treeView + + +-- |Refreshes the View based on the given directory. +-- +-- 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 + + view' <- readTVarIO $ view myview + + _ <- tryTakeMVar (cwd myview) + putMVar (cwd myview) item + + -- get selected items + tps <- getSelectedTreePaths mygui myview + trs <- catMaybes <$> mapM (treeRowReferenceNew newRawModel) tps + + 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 + - rawModel' <- readTVarIO $ rawModel myview + view' <- readTVarIO $ view 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 () + cdir <- getCurrentDir myview + let cdirp = path cdir + + -- update urlBar + entrySetText (urlBar myview) (P.fromAbs cdirp) + + 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 () diff --git a/src/HSFM-GUI-Gtk-Utils.html b/src/HSFM-GUI-Gtk-Utils.html index 1da92c3..94135ed 100644 --- a/src/HSFM-GUI-Gtk-Utils.html +++ b/src/HSFM-GUI-Gtk-Utils.html @@ -161,17 +161,5 @@ miter <- rawPathToIter myview tp forM miter $ \iter -> treeModelGetRow rawModel' iter - --- |Makes sure the list is max 5. This is probably not very efficient --- but we don't care, since it's a small list anyway. -addHistory :: Eq a => a -> [a] -> [a] -addHistory i [] = [i] -addHistory i xs@(x:_) - | i == x = xs - | length xs == maxLength = i : take (maxLength - 1) xs - | otherwise = i : xs - where - maxLength = 10 -