source: filezilla/trunk/fuentes/src/interface/file_utils.h @ 3185

Last change on this file since 3185 was 3185, checked in by jrpelegrina, 3 years ago

Update new version: 3.15.02

File size: 1.4 KB
Line 
1#ifndef FILEZILLA_FILE_UTILS_HEADER
2#define FILEZILLA_FILE_UTILS_HEADER
3
4#include <libfilezilla/recursive_remove.hpp>
5
6bool UnquoteCommand(wxString& command, wxString& arguments, bool is_dde = false);
7bool ProgramExists(const wxString& editor);
8bool PathExpand(wxString& cmd);
9
10wxString GetSystemOpenCommand(wxString file, bool &program_exists);
11
12// Returns a file:// URL
13wxString GetAsURL(const wxString& dir);
14
15// Opens specified directory in local file manager, e.g. Explorer on Windows
16bool OpenInFileManager(const wxString& dir);
17
18bool RenameFile(wxWindow* pWnd, wxString dir, wxString from, wxString to);
19
20CLocalPath GetDownloadDir();
21
22class gui_recursive_remove : public fz::recursive_remove
23{
24public:
25        gui_recursive_remove(wxWindow* parent)
26                : parent_(parent)
27        {}
28
29#ifdef FZ_WINDOWS
30        virtual void adjust_shfileop(SHFILEOPSTRUCT & op)
31        {
32                op.hwnd = parent_ ? (HWND)parent_->GetHandle() : 0;
33                if (parent_) {
34                        // Move to trash if shift is not pressed, else delete
35                        op.fFlags = wxGetKeyState(WXK_SHIFT) ? 0 : FOF_ALLOWUNDO;
36                }
37                else {
38                        recursive_remove::adjust_shfileop(op);
39                }
40        }
41#endif
42
43        virtual bool confirm() const {
44                if (parent_) {
45                        if (wxMessageBoxEx(_("Really delete all selected files and/or directories from your computer?"), _("Confirmation needed"), wxICON_QUESTION | wxYES_NO, parent_) != wxYES)
46                                return false;
47                }
48                return true;
49        }
50
51private:
52        wxWindow* parent_;
53};
54
55#endif
Note: See TracBrowser for help on using the repository browser.