clonePackageSourceDialog :: Window -> FilePath -> IO (Maybe ClonePackageSourceRepo)
clonePackageSourceDialog parent workspaceDir = do
    packages                   <- getInstalledPackageIds
    dia                        <-   dialogNew
    set dia [ windowTransientFor := parent
            , windowTitle := (__ "Clone Package") ]
#ifdef MIN_VERSION_gtk3
    upper                      <-   dialogGetContentArea dia
#else
    upper                      <-   dialogGetUpper dia
#endif
    lower                      <-   dialogGetActionArea dia
    (widget,inj,ext,_)         <-   buildEditor (cloneFields packages workspaceDir)
                                        (ClonePackageSourceRepo "" workspaceDir)
    okButton <- dialogAddButton dia (__"Clone Package") ResponseOk
    dialogAddButton dia (__"Cancel") ResponseCancel
    boxPackStart (castToBox upper) widget PackGrow 7
    set okButton [widgetCanDefault := True]
    widgetGrabDefault okButton
    widgetShowAll dia
    resp  <- dialogRun dia
    value <- ext (ClonePackageSourceRepo "" workspaceDir)
    widgetDestroy dia
    --find
    case resp of
        ResponseOk    -> return value
        _             -> return Nothing
clonePackageSourceDialog :: Window -> FilePath -> IO (Maybe ClonePackageSourceRepo)
clonePackageSourceDialog parent workspaceDir = do
    packages                   <- getInstalledPackageIds
    dia                        <-   dialogNew
    set dia [ windowTransientFor := parent
            , windowTitle := (__ "Clone Package") ]
#ifdef MIN_VERSION_gtk3
    upper                      <-   dialogGetContentArea dia
#else
    upper                      <-   dialogGetUpper dia
#endif
    lower                      <-   dialogGetActionArea dia
    (widget,inj,ext,_)         <-   buildEditor (cloneFields packages workspaceDir)
                                        (ClonePackageSourceRepo "" workspaceDir)
    okButton <- dialogAddButton dia (__"Clone Package") ResponseOk
    dialogAddButton dia (__"Cancel") ResponseCancel
    boxPackStart (castToBox upper) widget PackGrow 7
    set okButton [widgetCanDefault := True]
    widgetGrabDefault okButton
    widgetShowAll dia
    resp  <- dialogRun dia
    value <- ext (ClonePackageSourceRepo "" workspaceDir)
    widgetDestroy dia
    --find
    case resp of
        ResponseOk    -> return value
        _             -> return Nothing
clonePackageSourceDialog parent workspaceDir = do
    packages                   <- getInstalledPackageIds
    dia                        <-   dialogNew
    set dia [ windowTransientFor := parent
            , windowTitle := (__ "Clone Package") ]
#ifdef MIN_VERSION_gtk3
    upper                      <-   dialogGetContentArea dia
#else
    upper                      <-   dialogGetUpper dia
#endif
    lower                      <-   dialogGetActionArea dia
    (widget,inj,ext,_)         <-   buildEditor (cloneFields packages workspaceDir)
                                        (ClonePackageSourceRepo "" workspaceDir)
    okButton <- dialogAddButton dia (__"Clone Package") ResponseOk
    dialogAddButton dia (__"Cancel") ResponseCancel
    boxPackStart (castToBox upper) widget PackGrow 7
    set okButton [widgetCanDefault := True]
    widgetGrabDefault okButton
    widgetShowAll dia
    resp  <- dialogRun dia
    value <- ext (ClonePackageSourceRepo "" workspaceDir)
    widgetDestroy dia
    --find
    case resp of
        ResponseOk    -> return value
        _             -> return Nothing