1 /***************************************************************************
3 openurl.library - universal URL display and browser launcher library
4 Copyright (C) 1998-2005 by Troels Walsted Hansen, et al.
5 Copyright (C) 2005-2013 by openurl.library Open Source Team
7 This library is free software; it has been placed in the public domain
8 and you can freely redistribute it and/or modify it. Please note, however,
9 that some components may be under the LGPL or GPL license.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 openurl.library project: http://sourceforge.net/projects/openurllib/
19 ***************************************************************************/
21 #include <exec/exec.h>
22 #include <intuition/intuition.h>
23 #include <intuition/icclass.h>
25 #include <libraries/gadtools.h>
26 #include <images/label.h>
27 #include <images/glyph.h>
29 #include <classes/window.h>
31 #include <gadgets/layout.h>
32 #include <gadgets/space.h>
33 #include <gadgets/button.h>
34 #include <gadgets/clicktab.h>
35 #include <gadgets/texteditor.h>
36 #include <gadgets/scroller.h>
37 #include <gadgets/checkbox.h>
38 #include <gadgets/listbrowser.h>
39 #include <gadgets/string.h>
40 #include <gadgets/getfile.h>
41 #include <gadgets/chooser.h>
43 #include <proto/exec.h>
44 #include <proto/intuition.h>
45 #include <proto/utility.h>
46 #include <proto/icon.h>
48 #include <proto/window.h>
49 #include <proto/layout.h>
50 #include <proto/space.h>
51 #include <proto/button.h>
52 #include <proto/clicktab.h>
53 #include <proto/texteditor.h>
54 #include <proto/scroller.h>
55 #include <proto/checkbox.h>
56 #include <proto/listbrowser.h>
57 #include <proto/string.h>
58 #include <proto/getfile.h>
59 #include <proto/chooser.h>
60 #include <proto/label.h>
62 #include <reaction/reaction_macros.h>
64 #include <libraries/openurl.h>
65 #include <proto/openurl.h>
67 #include "gui_global.h"
77 static const char USED_VAR version
[] = "$VER: OpenURL-Prefs " LIB_REV_STRING
" [" SYSTEMSHORT
"/" CPU
"] (" LIB_DATE
") " LIB_COPYRIGHT
;
80 struct MsgPort
*AppPort
;
81 struct Hook idcmphook
;
83 struct Window
*window
;
85 struct List list_Brow
;
86 struct List list_Mail
;
87 struct List list_FTPs
;
89 struct Library
* OpenURLBase
= NULL
;
90 struct OpenURLIFace
*IOpenURL
= NULL
;
92 Object
*Objects
[OBJ_NUM
];
94 static STRPTR PageLabels
[] =
96 (STRPTR
)MSG_Win_Labels_Browsers
,
97 (STRPTR
)MSG_Win_Labels_Mailers
,
98 (STRPTR
)MSG_Win_Labels_FTPs
,
99 (STRPTR
)MSG_Win_Labels_Misc
,
103 struct ColumnInfo BrowsColInfo
[] =
105 { 20, (STRPTR
)"Use", CIF_WEIGHTED
},
106 { 20, (STRPTR
)" Name", CIF_WEIGHTED
},
107 { 20, (STRPTR
)" Path", CIF_WEIGHTED
},
111 struct ColumnInfo MailColInfo
[] =
113 { 20, (STRPTR
)"Use", CIF_WEIGHTED
},
114 { 20, (STRPTR
)" Name", CIF_WEIGHTED
},
115 { 20, (STRPTR
)" Path", CIF_WEIGHTED
},
119 struct ColumnInfo FTPsColInfo
[] =
121 { 20, (STRPTR
)"Use", CIF_WEIGHTED
},
122 { 20, (STRPTR
)" Name", CIF_WEIGHTED
},
123 { 20, (STRPTR
)" Path", CIF_WEIGHTED
},
127 #define SPACE LAYOUT_AddChild, SpaceObject, End
129 uint16 pageData
[13] =
132 0x3FF8,0x2008,0x2008,0x3FF8,0x2008,0x2008,0x2008,0x2008,
133 0x2008,0x2008,0x2008,0x2008,0x3FF8
136 struct Image chooser_image
=
138 0, 0, // LeftEdge, TopEdge
139 16, 13, 8, // Width, Height, Depth
140 pageData
, // ImageData
141 0x0001, 0x0000, // PlanePick, PlaneOnOff
145 #define MyItem(i) Item((STRPTR)i,0,i)
149 struct TagItem lst2btn
[] = {
150 {LISTBROWSER_SelectedNode
, GA_ReadOnly
},
154 static struct NewMenu menu
[] =
156 Title((STRPTR
)MSG_Menu_Project
),
157 MyItem(MSG_Menu_About
),
159 MyItem(MSG_Menu_Hide
),
161 MyItem(MSG_Menu_Quit
),
162 Title((STRPTR
)MSG_Menu_Prefs
),
163 MyItem(MSG_Menu_Save
),
164 MyItem(MSG_Menu_Use
),
166 MyItem(MSG_Menu_LastSaved
),
167 MyItem(MSG_Menu_Restore
),
168 MyItem(MSG_Menu_Defaults
),
172 void IDCMPFunc(struct Hook
*hook
,Object
*wobj
,struct IntuiMessage
*Msg
);
173 ULONG
loadPrefs(ULONG mode
);
174 ULONG
storePrefs(BOOL bStorePrefs
);
175 void updateFTPWindow(struct URL_FTPNode
* pFTP
);
177 Object
*make_window(void)
185 OBJ(OBJ_HIDDEN_CHOOSER
) = ChooserObject
,
186 GA_ID
, OBJ_HIDDEN_CHOOSER
,
188 // CHOOSER_Labels, &chooserlist,
189 CHOOSER_DropDown
, TRUE
,
190 CHOOSER_AutoFit
, TRUE
,
191 CHOOSER_Hidden
, TRUE
,
192 ICA_TARGET
, ICTARGET_IDCMP
,
195 page1
= VLayoutObject
,
196 LAYOUT_AddChild
, HLayoutObject
,
198 LAYOUT_AddChild
, VLayoutObject
,
199 LAYOUT_SpaceOuter
, TRUE
,
200 LAYOUT_AddChild
, OBJ(OBJ_LBROWSER_BROW
) = ListBrowserObject
,
201 GA_ID
, OBJ_LBROWSER_BROW
,
202 // GA_Immediate, TRUE,
204 LISTBROWSER_AutoFit
, TRUE
,
205 LISTBROWSER_HorizontalProp
, TRUE
,
206 LISTBROWSER_ShowSelected
, TRUE
,
207 LISTBROWSER_Labels
, &list_Brow
,
208 LISTBROWSER_ColumnInfo
, &BrowsColInfo
,
209 LISTBROWSER_ColumnTitles
, TRUE
,
213 LAYOUT_AddChild
, VLayoutObject
,
214 LAYOUT_SpaceOuter
, TRUE
,
216 LAYOUT_AddChild
, Button(getString(MSG_AppList_Add
),OBJ_ADD_BROW
),
217 CHILD_WeightedHeight
, 0,
218 LAYOUT_AddChild
, Button(getString(MSG_AppList_Edit
),OBJ_EDIT_BROW
),
219 CHILD_WeightedHeight
, 0,
220 LAYOUT_AddChild
, Button(getString(MSG_AppList_Clone
),OBJ_CLONE_BROW
),
221 CHILD_WeightedHeight
, 0,
223 LAYOUT_AddChild
, HLayoutObject
,
224 LAYOUT_AddChild
, OBJ(OBJ_UP_BROW
) = ButtonObject
,
226 BUTTON_AutoButton
, BAG_UPARROW
,
228 CHILD_WeightedWidth
, 0,
230 LAYOUT_AddChild
, OBJ(OBJ_DOWN_BROW
) = ButtonObject
,
231 GA_ID
, OBJ_DOWN_BROW
,
232 BUTTON_AutoButton
, BAG_DNARROW
,
234 CHILD_WeightedWidth
, 0,
236 CHILD_WeightedHeight
, 0,
239 LAYOUT_AddChild
, Button(getString(MSG_AppList_Delete
),OBJ_DELETE_BROW
),
240 CHILD_WeightedHeight
, 0,
243 CHILD_WeightedWidth
, 0,
246 End
; // VLayout // *** end of page 1 ***
249 page2
= VLayoutObject
,
250 LAYOUT_AddChild
, HLayoutObject
,
252 LAYOUT_AddChild
, VLayoutObject
,
253 LAYOUT_SpaceOuter
, TRUE
,
254 LAYOUT_AddChild
, OBJ(OBJ_LBROWSER_MAIL
) = ListBrowserObject
,
255 GA_ID
, OBJ_LBROWSER_MAIL
,
256 // GA_Immediate, TRUE,
258 LISTBROWSER_AutoFit
, TRUE
,
259 LISTBROWSER_HorizontalProp
, TRUE
,
260 LISTBROWSER_ShowSelected
, TRUE
,
261 LISTBROWSER_Labels
, &list_Mail
,
262 LISTBROWSER_ColumnInfo
, &MailColInfo
,
263 LISTBROWSER_ColumnTitles
, TRUE
,
267 LAYOUT_AddChild
, VLayoutObject
,
268 LAYOUT_SpaceOuter
, TRUE
,
270 LAYOUT_AddChild
, Button(getString(MSG_AppList_Add
),OBJ_ADD_MAIL
),
271 CHILD_WeightedHeight
, 0,
272 LAYOUT_AddChild
, Button(getString(MSG_AppList_Edit
),OBJ_EDIT_MAIL
),
273 CHILD_WeightedHeight
, 0,
274 LAYOUT_AddChild
, Button(getString(MSG_AppList_Clone
),OBJ_CLONE_MAIL
),
275 CHILD_WeightedHeight
, 0,
277 LAYOUT_AddChild
, HLayoutObject
,
278 LAYOUT_AddChild
, OBJ(OBJ_UP_MAIL
) = ButtonObject
,
280 BUTTON_AutoButton
, BAG_UPARROW
,
282 CHILD_WeightedWidth
, 0,
284 LAYOUT_AddChild
, OBJ(OBJ_DOWN_MAIL
) = ButtonObject
,
285 GA_ID
, OBJ_DOWN_MAIL
,
286 BUTTON_AutoButton
, BAG_DNARROW
,
288 CHILD_WeightedWidth
, 0,
290 CHILD_WeightedHeight
, 0,
293 LAYOUT_AddChild
, Button(getString(MSG_AppList_Delete
),OBJ_DELETE_MAIL
),
294 CHILD_WeightedHeight
, 0,
297 CHILD_WeightedWidth
, 0,
300 End
; // VLayout // *** end of page 2 ***
302 page3
= VLayoutObject
,
303 LAYOUT_AddChild
, HLayoutObject
,
305 LAYOUT_AddChild
, VLayoutObject
,
306 LAYOUT_SpaceOuter
, TRUE
,
307 LAYOUT_AddChild
, OBJ(OBJ_LBROWSER_FTP
) = ListBrowserObject
,
308 GA_ID
, OBJ_LBROWSER_FTP
,
310 LISTBROWSER_AutoFit
, TRUE
,
311 LISTBROWSER_ShowSelected
, TRUE
,
312 LISTBROWSER_Labels
, &list_FTPs
,
313 LISTBROWSER_ColumnInfo
, &FTPsColInfo
,
314 LISTBROWSER_ColumnTitles
, TRUE
,
318 LAYOUT_AddChild
, VLayoutObject
,
319 LAYOUT_SpaceOuter
, TRUE
,
321 LAYOUT_AddChild
, Button(getString(MSG_AppList_Add
),OBJ_ADD_FTP
),
322 CHILD_WeightedHeight
, 0,
323 LAYOUT_AddChild
, Button(getString(MSG_AppList_Edit
),OBJ_EDIT_FTP
),
324 CHILD_WeightedHeight
, 0,
325 LAYOUT_AddChild
, Button(getString(MSG_AppList_Clone
),OBJ_CLONE_FTP
),
326 CHILD_WeightedHeight
, 0,
328 LAYOUT_AddChild
, HLayoutObject
,
329 LAYOUT_AddChild
, OBJ(OBJ_UP_FTP
) = ButtonObject
,
331 BUTTON_AutoButton
, BAG_UPARROW
,
333 CHILD_WeightedWidth
, 0,
335 LAYOUT_AddChild
, OBJ(OBJ_DOWN_FTP
) = ButtonObject
,
337 BUTTON_AutoButton
, BAG_DNARROW
,
339 CHILD_WeightedWidth
, 0,
341 CHILD_WeightedHeight
, 0,
344 LAYOUT_AddChild
, Button(getString(MSG_AppList_Delete
),OBJ_DELETE_FTP
),
345 CHILD_WeightedHeight
, 0,
348 CHILD_WeightedWidth
, 0,
351 End
; // VLayout // *** end of page 3 ***
354 page4
= VLayoutObject
,
356 LAYOUT_AddChild
, VLayoutObject
,
357 LAYOUT_BevelStyle
, BVS_GROUP
,
358 LAYOUT_Label
, getString(MSG_Misc_Defaults
),
360 LAYOUT_AddChild
, OBJ(OBJ_UNICONIFY
) = CheckBoxObject
,
361 GA_ID
, OBJ_UNICONIFY
,
364 GA_Text
, getString(MSG_Misc_Show
),
367 LAYOUT_AddChild
, OBJ(OBJ_BRING
) = CheckBoxObject
,
371 GA_Text
, getString(MSG_Misc_Bring
),
374 LAYOUT_AddChild
, OBJ(OBJ_OPEN
) = CheckBoxObject
,
378 GA_Text
, getString(MSG_Misc_Open
),
381 LAYOUT_AddChild
, OBJ(OBJ_LAUNCH
) = CheckBoxObject
,
385 GA_Text
, getString(MSG_Misc_Launch
),
389 LAYOUT_AddChild
, VLayoutObject
,
390 LAYOUT_BevelStyle
, BVS_GROUP
,
391 LAYOUT_Label
, getString(MSG_Misc_Options
),
393 LAYOUT_AddChild
, OBJ(OBJ_PREPEND
) = CheckBoxObject
,
397 GA_Text
, getString(MSG_Misc_Prepend
),
400 LAYOUT_AddChild
, OBJ(OBJ_SEND_MAILTO
) = CheckBoxObject
,
401 GA_ID
, OBJ_SEND_MAILTO
,
404 GA_Text
, getString(MSG_Misc_UseMailer
),
407 LAYOUT_AddChild
, OBJ(OBJ_SEND_FTP
) = CheckBoxObject
,
411 GA_Text
, getString(MSG_Misc_UseFTP
),
415 End
; // VLayout // *** end of page 4 ***
418 OBJ(OBJ_CLICKTAB
) = ClickTabObject
,
420 CLICKTAB_Current
, 0, // page to open with
421 CLICKTAB_PageGroup
, PageObject
,
431 WA_ScreenTitle
, getString(MSG_App_ScreenTitle
),
432 WA_Title
, getString(MSG_Win_WinTitle
),
434 WA_CloseGadget
, TRUE
,
436 WA_DepthGadget
, TRUE
,
438 WINDOW_IconifyGadget
, TRUE
,
439 WINDOW_Icon
, IIcon
->GetDiskObject("PROGDIR:OpenURL"),
440 WINDOW_IconTitle
, getString(MSG_Win_WinTitle
),
441 WINDOW_AppPort
, AppPort
,
442 WINDOW_SharedPort
, AppPort
,
443 WINDOW_Position
, WPOS_CENTERSCREEN
,
444 WINDOW_NewMenu
, menu
,
445 WINDOW_Layout
, VLayoutObject
,
447 LAYOUT_AddChild
, OBJ(OBJ_CLICKTAB
),
449 LAYOUT_AddChild
, HLayoutObject
,
450 LAYOUT_BevelStyle
, BVS_SBAR_VERT
,
452 CHILD_WeightedHeight
, 0,
454 LAYOUT_AddChild
, HLayoutObject
,
455 LAYOUT_AddChild
, SpaceObject
,
458 CHILD_WeightedWidth
, 0,
460 LAYOUT_AddChild
, HLayoutObject
,
461 LAYOUT_EvenSize
, TRUE
,
462 LAYOUT_AddChild
, Button(getString(MSG_Win_Save
),OBJ_SAVE
),
463 CHILD_WeightedWidth
, 0,
465 LAYOUT_AddChild
, Button(getString(MSG_Win_Use
),OBJ_USE
),
466 CHILD_WeightedWidth
, 0,
468 LAYOUT_AddChild
, Button(getString(MSG_Win_Apply
),OBJ_APPLY
),
469 CHILD_WeightedWidth
, 0,
471 LAYOUT_AddChild
, Button(getString(MSG_Win_Cancel
),OBJ_CANCEL
),
472 CHILD_WeightedWidth
, 0,
474 CHILD_WeightedHeight
, 0,
476 LAYOUT_AddChild
, SpaceObject
,
479 CHILD_WeightedWidth
, 0,
482 CHILD_MinWidth
, 350, // sets a more attractive size for the whole Layout
483 CHILD_WeightedHeight
, 0,
494 localizeStrings(PageLabels
);
496 localizeNewMenu(menu
);
498 if(!(OpenURLBase
= IExec
->OpenLibrary(OPENURLNAME
, OPENURLVER
)))
500 if(!(IOpenURL
= (struct OpenURLIFace
*)IExec
->GetInterface(OpenURLBase
, "main", 1L, NULL
)))
503 RA_SetUpHook(idcmphook
, IDCMPFunc
, NULL
);
505 if((AppPort
= IExec
->AllocSysObjectTags(ASOT_PORT
, TAG_DONE
)) != NULL
)
507 IExec
->NewList(&list_Brow
);
508 IExec
->NewList(&list_Mail
);
509 IExec
->NewList(&list_FTPs
);
512 edit_brow_win
= make_edit_brow_win();
513 edit_mail_win
= make_edit_mail_win();
514 edit_ftp_win
= make_edit_ftp_win();
516 loadPrefs(URL_GetPrefs_Mode_InUse
);
518 // Set up inter-group label alignment
520 iset(OBJ(OBJ_FTP_ALIGN1
), LAYOUT_AlignLabels
, OBJ(OBJ_FTP_ALIGN2
));
521 iset(OBJ(OBJ_MAIL_ALIGN1
), LAYOUT_AlignLabels
, OBJ(OBJ_MAIL_ALIGN2
));
522 iset(OBJ(OBJ_LBROWSER_BROW
), ICA_TARGET
, OBJ(OBJ_EDIT_BROW
),
525 if((window
= RA_OpenWindow(win
)) != NULL
)
530 sigmask
= iget(win
, WINDOW_SigMask
);
535 siggot
= IExec
->Wait(sigmask
);
536 if (siggot
& sigmask
)
538 done
= HandleInput_Main_Win();
539 HandleInput_Edit_Brow_Win();
540 HandleInput_Edit_Mail_Win();
541 HandleInput_Edit_FTP_Win();
545 IIntuition
->DisposeObject(edit_ftp_win
);
546 IIntuition
->DisposeObject(edit_mail_win
);
547 IIntuition
->DisposeObject(edit_brow_win
);
548 IIntuition
->DisposeObject(win
);
550 // The hidden chooser isn't attached to anything,
551 // so we must dispose of it ourselves...
553 IIntuition
->DisposeObject(OBJ(OBJ_HIDDEN_CHOOSER
));
555 IListBrowser
->FreeListBrowserList(&list_FTPs
);
556 IListBrowser
->FreeListBrowserList(&list_Mail
);
557 IListBrowser
->FreeListBrowserList(&list_Brow
);
558 IExec
->FreeSysObject(ASOT_PORT
, AppPort
);
561 IExec
->DropInterface((struct Interface
*)IOpenURL
);
562 IExec
->CloseLibrary(OpenURLBase
);
569 void IDCMPFunc(UNUSED
struct Hook
*hook
, UNUSED Object
*wobj
, struct IntuiMessage
*Msg
)
571 //struct Window *window = Msg->IDCMPWindow;
574 if (Msg
->Class
== IDCMP_IDCMPUPDATE
)
576 if (IUtility
->GetTagData(GA_ID
, 0, Msg
->IAddress
) == OBJ_HIDDEN_CHOOSER
)
578 active
= IUtility
->GetTagData(CHOOSER_Active
, -1, Msg
->IAddress
);
579 // printf("chooser picked = %d\n",active);
581 // find out which button was clicked, to replace OBJ_STRING with the correct String gad
583 // gadset(GAD(OBJ_STRING), window, NULL,
584 // GA_Text, hidden_strings[active], TAG_END);
589 ULONG
loadPrefs(ULONG mode
)
594 /* get the openurl.library prefs */
597 case MUIV_Win_GetPrefs_InUse: mode = URL_GetPrefs_Mode_InUse; break;
598 case MUIV_Win_GetPrefs_LastSaveds: mode = URL_GetPrefs_Mode_Envarc; break;
599 case MUIV_Win_GetPrefs_Restore: mode = URL_GetPrefs_Mode_Env; break;
600 case MUIV_Win_GetPrefs_Defaults: mode = URL_GetPrefs_Mode_Default; break;
601 default: return FALSE;
604 p
= IOpenURL
->URL_GetPrefs(URL_GetPrefs_Mode
,mode
,TAG_DONE
);
605 if (!p
) error
= MSG_Err_NoPrefs
;
606 else if (p
->up_Version
!=PREFS_VERSION
) error
= MSG_Err_BadPrefs
;
610 RA_Request(NULL
,0,getString(MSG_ErrReqTitle
),
611 getString(MSG_ErrReqGadget
),
613 p
? p
->up_Version
: 0);
615 if (p
) IOpenURL
->URL_FreePrefsA(p
,NULL
);
621 gadset(GAD(OBJ_LBROWSER_BROW
), window
, LISTBROWSER_Labels
, ~0);
622 updateBrowserList(&list_Brow
, p
->up_BrowserList
);
623 gadset(GAD(OBJ_LBROWSER_BROW
), window
, LISTBROWSER_Labels
, &list_Brow
, LISTBROWSER_AutoFit
, TRUE
);
626 gadset(GAD(OBJ_LBROWSER_MAIL
), window
, LISTBROWSER_Labels
, ~0, TAG_DONE
);
627 updateMailerList(&list_Mail
, p
->up_MailerList
);
628 gadset(GAD(OBJ_LBROWSER_MAIL
), window
, LISTBROWSER_Labels
, &list_Mail
, LISTBROWSER_AutoFit
, TRUE
);
631 gadset(GAD(OBJ_LBROWSER_FTP
), window
, LISTBROWSER_Labels
, ~0, TAG_DONE
);
632 updateFTPList(&list_FTPs
, p
->up_FTPList
);
633 gadset(GAD(OBJ_LBROWSER_FTP
), window
, LISTBROWSER_Labels
, &list_FTPs
, LISTBROWSER_AutoFit
, TRUE
);
636 gadset(GAD(OBJ_PREPEND
), window
, GA_Selected
, isFlagSet(p
->up_Flags
, UPF_PREPENDHTTP
));
637 gadset(GAD(OBJ_SEND_MAILTO
), window
, GA_Selected
, isFlagSet(p
->up_Flags
, UPF_DOMAILTO
));
638 gadset(GAD(OBJ_SEND_FTP
), window
, GA_Selected
, isFlagSet(p
->up_Flags
, UPF_DOFTP
));
640 gadset(GAD(OBJ_UNICONIFY
), window
, GA_Selected
, p
->up_DefShow
);
641 gadset(GAD(OBJ_BRING
), window
, GA_Selected
, p
->up_DefBringToFront
);
642 gadset(GAD(OBJ_OPEN
), window
, GA_Selected
, p
->up_DefNewWindow
);
643 gadset(GAD(OBJ_LAUNCH
), window
, GA_Selected
, p
->up_DefLaunch
);
645 /* free the preferences */
646 IOpenURL
->URL_FreePrefsA(p
,NULL
);
651 ULONG
storePrefs(BOOL bStorePrefs
)
655 /* Copy settings from gadgets into structure */
656 up
.up_Version
= PREFS_VERSION
;
659 IExec
->CopyMem(&list_Brow
, &up
.up_BrowserList
, sizeof(struct MinList
));
662 IExec
->CopyMem(&list_Mail
, &up
.up_MailerList
, sizeof(struct MinList
));
665 IExec
->CopyMem(&list_FTPs
, &up
.up_FTPList
, sizeof(struct MinList
));
668 if(iget(OBJ(OBJ_PREPEND
), GA_Selected
))
669 SET_FLAG(up
.up_Flags
, UPF_PREPENDHTTP
);
671 CLEAR_FLAG(up
.up_Flags
, UPF_PREPENDHTTP
);
673 if(iget(OBJ(OBJ_SEND_MAILTO
), GA_Selected
))
674 SET_FLAG(up
.up_Flags
, UPF_DOMAILTO
);
676 CLEAR_FLAG(up
.up_Flags
, UPF_DOMAILTO
);
678 if(iget(OBJ(OBJ_SEND_FTP
), GA_Selected
))
679 SET_FLAG(up
.up_Flags
, UPF_DOFTP
);
681 CLEAR_FLAG(up
.up_Flags
, UPF_DOFTP
);
683 if(iget(OBJ(OBJ_SEND_MAILTO
), GA_Selected
))
684 SET_FLAG(up
.up_Flags
, UPF_DOMAILTO
);
686 CLEAR_FLAG(up
.up_Flags
, UPF_DOMAILTO
);
688 if(iget(OBJ(OBJ_SEND_FTP
), GA_Selected
))
689 SET_FLAG(up
.up_Flags
, UPF_DOFTP
);
691 CLEAR_FLAG(up
.up_Flags
, UPF_DOFTP
);
693 up
.up_DefShow
= iget(OBJ(OBJ_UNICONIFY
), GA_Selected
);
694 up
.up_DefBringToFront
= iget(OBJ(OBJ_BRING
), GA_Selected
);
695 up
.up_DefNewWindow
= iget(OBJ(OBJ_OPEN
), GA_Selected
);
696 up
.up_DefLaunch
= iget(OBJ(OBJ_LAUNCH
), GA_Selected
);
699 if (!IOpenURL
->URL_SetPrefs(&up
,URL_SetPrefs_Save
,bStorePrefs
,TAG_DONE
))
700 RA_Request((Object
*)window
,getString(MSG_ErrReqTitle
),getString(MSG_ErrReqGadget
),getString(MSG_Err_FailedSave
),NULL
);