1 #ifndef PROPERTIES_H
2 #define PROPERTIES_H
3 
4 #include "TextLabel.h"
5 #include "DialogBox.h"
6 
7 class PropertiesBox;
8 
9 class PermFrame : public FXVerticalFrame
10 {
11     FXDECLARE(PermFrame)
12     friend class PropertiesBox;
13 private:
14     FXCheckButton* ur;
15     FXCheckButton* uw;
16     FXCheckButton* ux;
17     FXCheckButton* gr;
18     FXCheckButton* gw;
19     FXCheckButton* gx;
20     FXCheckButton* or_;
21     FXCheckButton* ow;
22     FXCheckButton* ox;
23     FXCheckButton* suid;
24     FXCheckButton* sgid;
25     FXCheckButton* svtx;
26     FXDataTarget   cmd_radiotarget;
27     FXDataTarget   flt_radiotarget;
28     FXRadioButton* set;
29     FXRadioButton* clear;
30     FXRadioButton* dironly;
31     FXRadioButton* fileonly;
32     FXRadioButton* all;
33     FXRadioButton* add;
34     int            cmd;
35     int            flt;
36     FXCheckButton* rec;
37     FXCheckButton* own;
38     FXComboBox*    user;
39     FXComboBox*    grp;
40 
PermFrame()41     PermFrame() : ur(NULL), uw(NULL), ux(NULL), gr(NULL), gw(NULL), gx(NULL), or_(NULL), ow(NULL), ox(NULL), suid(NULL), sgid(NULL), svtx(NULL),
42                   set(NULL), clear(NULL), dironly(NULL), fileonly(NULL), all(NULL), add(NULL), cmd(0), flt(0), rec(NULL), own(NULL), user(NULL), grp(NULL)
43     {}
44 
45 public:
46     PermFrame(FXComposite* parent, FXObject* target);
47 };
48 
49 class PropertiesBox : public DialogBox
50 {
51     FXDECLARE(PropertiesBox)
52 
53 private:
54     int     pid;                     // Proccess ID of child (valid if busy).
55     int     pipes[2];                // Pipes to communicate with child process.
56 
57 	FXuint 	     totalnbfiles;
58 	FXuint       totalnbsubdirs;
59 	FXulong      totaldirsize;
60 	int          nbseldirs;
61     FXLabel*     fileSize;
62     FXLabel*     fileSizeDetails;
63     TextLabel*   location;
64     FXLabel*     origlocation;
65     FXLabel*     linkto;
66     FXLabel*     deletiondate;
67     FXTextField* ext;
68     FXString*    files;
69     FXString*    paths;
70     FXLabel*     name_encoding;
71     FXString     source;
72     FXString     parentdir;
73     FXString     filename;
74     FXString     oldusr;
75     FXString     oldgrp;
76     FXString     descr_prev;
77     FXString     open_prev;
78     FXString     view_prev;
79     FXString     edit_prev;
80     FXString     bigic_prev;
81     FXString     miniic_prev;
82     int          num;
83     FXString     trashfileslocation;
84     FXString     trashinfolocation;
85     FXbool       executable;
86 #ifdef STARTUP_NOTIFICATION
87     FXCheckButton* snbutton;
88     FXGroupBox*    sngroup;
89     FXbool         sndisable_prev;
90 #endif
91     FXTextField* input;
92     FXTextField* username;
93     FXTextField* grpname;
94     FXTextField* open;
95     FXTextField* view;
96     FXTextField* edit;
97     FXTextField* descr;
98     FXTextField* bigic;
99     FXButton*    bigicbtn;
100     FXTextField* miniic;
101     FXButton*    miniicbtn;
102     FXbool       isDirectory;
103     FXbool       isMountpoint;
104     FXbool       recsize;
105     mode_t       mode;
106     mode_t       orig_mode;
107     PermFrame*   perm;
108 
PropertiesBox()109     PropertiesBox() : totalnbfiles(0), totalnbsubdirs(0), totaldirsize(0), nbseldirs(0), fileSize(NULL), fileSizeDetails(NULL), location(NULL), origlocation(NULL), linkto(NULL),
110                       deletiondate(NULL), ext(NULL), files(NULL), paths(NULL), name_encoding(NULL), num(0), executable(false),
111 #ifdef STARTUP_NOTIFICATION
112                       snbutton(NULL), sngroup(NULL), sndisable_prev(false),
113 #endif
114                       input(NULL), username(NULL), grpname(NULL), open(NULL), view(NULL), edit(NULL), descr(NULL), bigic(NULL), bigicbtn(NULL),
115                       miniic(NULL), miniicbtn(NULL), isDirectory(false), isMountpoint(false), recsize(false), mode(0), orig_mode(0), perm(NULL)
116     {}
117 
118 public:
119     enum
120     {
121         ID_ACCEPT_SINGLE=DialogBox::ID_LAST,
122         ID_ACCEPT_MULT,
123         ID_CANCEL,
124         ID_SET,
125         ID_CLEAR,
126         ID_ADD,
127         ID_DIRONLY,
128         ID_FILEONLY,
129         ID_SNDISABLE,
130         ID_WATCHPROCESS,
131         ID_ALL,
132         ID_BIG_ICON,
133         ID_MINI_ICON,
134         ID_BROWSE_OPEN,
135         ID_BROWSE_VIEW,
136         ID_BROWSE_EDIT,
137         ID_RUSR,
138         ID_WUSR,
139         ID_XUSR,
140         ID_RGRP,
141         ID_WGRP,
142         ID_XGRP,
143         ID_ROTH,
144         ID_WOTH,
145         ID_XOTH,
146         ID_SUID,
147         ID_SGID,
148         ID_SVTX,
149         ID_LAST
150     };
151 
152 public:
153     virtual void create();
154 
155     PropertiesBox(FXWindow* win, FXString file, FXString path);
156     PropertiesBox(FXWindow* win, FXString* file, int num, FXString* path);
157     long onCmdAcceptSingle(FXObject*, FXSelector, void*);
158     long onCmdAcceptMult(FXObject*, FXSelector, void*);
159     long onCmdCancel(FXObject*, FXSelector, void*);
160     long onCmdCheck(FXObject*, FXSelector, void*);
161     long onCmdCommand(FXObject*, FXSelector, void*);
162     long onCmdFilter(FXObject*, FXSelector, void*);
163     long onCmdBrowseIcon(FXObject*, FXSelector, void*);
164     long onCmdBrowse(FXObject*, FXSelector, void*);
165     long onUpdSizeAndPerm(FXObject*, FXSelector, void*);
166     long onCmdKeyPress(FXObject*, FXSelector, void*);
167     long onWatchProcess(FXObject*, FXSelector, void*);
168 #ifdef STARTUP_NOTIFICATION
169     long onUpdSnDisable(FXObject*, FXSelector, void*);
170 #endif
171 };
172 
173 #endif
174