9030945b94
travis build: 20
commit: 89b231a2c9
auto-pushed to gh-pages
80 lines
8.7 KiB
HTML
80 lines
8.7 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<head>
|
|
<!-- Generated by HsColour, http://code.haskell.org/~malcolm/hscolour/ -->
|
|
<title>src/HSFM/GUI/Gtk.hs</title>
|
|
<link type='text/css' rel='stylesheet' href='hscolour.css' />
|
|
</head>
|
|
<body>
|
|
<pre><a name="line-1"></a><span class='hs-comment'>{--
|
|
<a name="line-2"></a>HSFM, a filemanager written in Haskell.
|
|
<a name="line-3"></a>Copyright (C) 2015 Julian Ospald
|
|
<a name="line-4"></a>
|
|
<a name="line-5"></a>This program is free software; you can redistribute it and/or
|
|
<a name="line-6"></a>modify it under the terms of the GNU General Public License
|
|
<a name="line-7"></a>version 2 as published by the Free Software Foundation.
|
|
<a name="line-8"></a>
|
|
<a name="line-9"></a>This program is distributed in the hope that it will be useful,
|
|
<a name="line-10"></a>but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
<a name="line-11"></a>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
<a name="line-12"></a>GNU General Public License for more details.
|
|
<a name="line-13"></a>
|
|
<a name="line-14"></a>You should have received a copy of the GNU General Public License
|
|
<a name="line-15"></a>along with this program; if not, write to the Free Software
|
|
<a name="line-16"></a>Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
<a name="line-17"></a>--}</span>
|
|
<a name="line-18"></a>
|
|
<a name="line-19"></a><span class='hs-comment'>{-# LANGUAGE OverloadedStrings #-}</span>
|
|
<a name="line-20"></a><span class='hs-comment'>{-# OPTIONS_HADDOCK ignore-exports #-}</span>
|
|
<a name="line-21"></a>
|
|
<a name="line-22"></a><span class='hs-keyword'>module</span> <span class='hs-conid'>Main</span> <span class='hs-keyword'>where</span>
|
|
<a name="line-23"></a>
|
|
<a name="line-24"></a>
|
|
<a name="line-25"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Maybe</span>
|
|
<a name="line-26"></a> <span class='hs-layout'>(</span>
|
|
<a name="line-27"></a> <span class='hs-varid'>fromJust</span>
|
|
<a name="line-28"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>fromMaybe</span>
|
|
<a name="line-29"></a> <span class='hs-layout'>)</span>
|
|
<a name="line-30"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>UI</span><span class='hs-varop'>.</span><span class='hs-conid'>Gtk</span>
|
|
<a name="line-31"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>HPath</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>P</span>
|
|
<a name="line-32"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>HSFM</span><span class='hs-varop'>.</span><span class='hs-conid'>FileSystem</span><span class='hs-varop'>.</span><span class='hs-conid'>FileType</span>
|
|
<a name="line-33"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>HSFM</span><span class='hs-varop'>.</span><span class='hs-conid'>GUI</span><span class='hs-varop'>.</span><span class='hs-conid'>Gtk</span><span class='hs-varop'>.</span><span class='hs-conid'>Callbacks</span>
|
|
<a name="line-34"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>HSFM</span><span class='hs-varop'>.</span><span class='hs-conid'>GUI</span><span class='hs-varop'>.</span><span class='hs-conid'>Gtk</span><span class='hs-varop'>.</span><span class='hs-conid'>Data</span>
|
|
<a name="line-35"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>HSFM</span><span class='hs-varop'>.</span><span class='hs-conid'>GUI</span><span class='hs-varop'>.</span><span class='hs-conid'>Gtk</span><span class='hs-varop'>.</span><span class='hs-conid'>MyGUI</span>
|
|
<a name="line-36"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>HSFM</span><span class='hs-varop'>.</span><span class='hs-conid'>GUI</span><span class='hs-varop'>.</span><span class='hs-conid'>Gtk</span><span class='hs-varop'>.</span><span class='hs-conid'>MyView</span>
|
|
<a name="line-37"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Prelude</span> <span class='hs-varid'>hiding</span><span class='hs-layout'>(</span><span class='hs-varid'>readFile</span><span class='hs-layout'>)</span>
|
|
<a name="line-38"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Safe</span>
|
|
<a name="line-39"></a> <span class='hs-layout'>(</span>
|
|
<a name="line-40"></a> <span class='hs-varid'>headDef</span>
|
|
<a name="line-41"></a> <span class='hs-layout'>)</span>
|
|
<a name="line-42"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>System</span><span class='hs-varop'>.</span><span class='hs-conid'>IO</span><span class='hs-varop'>.</span><span class='hs-conid'>Error</span>
|
|
<a name="line-43"></a> <span class='hs-layout'>(</span>
|
|
<a name="line-44"></a> <span class='hs-varid'>catchIOError</span>
|
|
<a name="line-45"></a> <span class='hs-layout'>)</span>
|
|
<a name="line-46"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>System</span><span class='hs-varop'>.</span><span class='hs-conid'>Posix</span><span class='hs-varop'>.</span><span class='hs-conid'>Env</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>SPE</span>
|
|
<a name="line-47"></a>
|
|
<a name="line-48"></a>
|
|
<a name="line-49"></a><a name="main"></a><span class='hs-definition'>main</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
|
|
<a name="line-50"></a><span class='hs-definition'>main</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
|
|
<a name="line-51"></a> <span class='hs-varid'>args</span> <span class='hs-keyglyph'><-</span> <span class='hs-conid'>SPE</span><span class='hs-varop'>.</span><span class='hs-varid'>getArgs</span>
|
|
<a name="line-52"></a> <span class='hs-keyword'>let</span> <span class='hs-varid'>mdir</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>fromMaybe</span> <span class='hs-layout'>(</span><span class='hs-varid'>fromJust</span> <span class='hs-varop'>$</span> <span class='hs-conid'>P</span><span class='hs-varop'>.</span><span class='hs-varid'>parseAbs</span> <span class='hs-str'>"/"</span><span class='hs-layout'>)</span>
|
|
<a name="line-53"></a> <span class='hs-layout'>(</span><span class='hs-conid'>P</span><span class='hs-varop'>.</span><span class='hs-varid'>parseAbs</span> <span class='hs-varop'>.</span> <span class='hs-varid'>headDef</span> <span class='hs-str'>"/"</span> <span class='hs-varop'>$</span> <span class='hs-varid'>args</span><span class='hs-layout'>)</span>
|
|
<a name="line-54"></a>
|
|
<a name="line-55"></a> <span class='hs-varid'>file</span> <span class='hs-keyglyph'><-</span> <span class='hs-varid'>catchIOError</span> <span class='hs-layout'>(</span><span class='hs-varid'>rethrowFailed</span> <span class='hs-varop'>$</span> <span class='hs-varid'>readFile</span> <span class='hs-varid'>getFileInfo</span> <span class='hs-varid'>mdir</span><span class='hs-layout'>)</span> <span class='hs-varop'>$</span>
|
|
<a name="line-56"></a> <span class='hs-keyglyph'>\</span><span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>readFile</span> <span class='hs-varid'>getFileInfo</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromJust</span> <span class='hs-varop'>$</span> <span class='hs-conid'>P</span><span class='hs-varop'>.</span><span class='hs-varid'>parseAbs</span> <span class='hs-str'>"/"</span>
|
|
<a name="line-57"></a>
|
|
<a name="line-58"></a> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'><-</span> <span class='hs-varid'>initGUI</span>
|
|
<a name="line-59"></a> <span class='hs-varid'>mygui</span> <span class='hs-keyglyph'><-</span> <span class='hs-varid'>createMyGUI</span>
|
|
<a name="line-60"></a> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'><-</span> <span class='hs-varid'>newTab</span> <span class='hs-varid'>mygui</span> <span class='hs-varid'>createTreeView</span> <span class='hs-varid'>file</span>
|
|
<a name="line-61"></a>
|
|
<a name="line-62"></a> <span class='hs-varid'>setGUICallbacks</span> <span class='hs-varid'>mygui</span>
|
|
<a name="line-63"></a>
|
|
<a name="line-64"></a> <span class='hs-varid'>widgetShowAll</span> <span class='hs-layout'>(</span><span class='hs-varid'>rootWin</span> <span class='hs-varid'>mygui</span><span class='hs-layout'>)</span>
|
|
<a name="line-65"></a>
|
|
<a name="line-66"></a> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'><-</span> <span class='hs-varid'>mainGUI</span>
|
|
<a name="line-67"></a> <span class='hs-varid'>return</span> <span class='hs-conid'>()</span>
|
|
<a name="line-68"></a>
|
|
</pre></body>
|
|
</html>
|