"Fossies" - the Fresh Open Source Software Archive

Member "xfe-1.43.2/src/Preferences.cpp" (6 Jun 2019, 93512 Bytes) of package /linux/privat/xfe-1.43.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Preferences.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.43.1_vs_1.43.2.

    1 // Preferences dialog box
    2 
    3 #include "config.h"
    4 #include "i18n.h"
    5 
    6 #include <fx.h>
    7 #include <fxkeys.h>
    8 
    9 #include "icons.h"
   10 #include "xfedefs.h"
   11 #include "xfeutils.h"
   12 #include "FileDialog.h"
   13 #include "FontDialog.h"
   14 #include "XFileExplorer.h"
   15 #include "MessageBox.h"
   16 #include "Keybindings.h"
   17 #include "Preferences.h"
   18 
   19 
   20 FXbool Theme::operator !=(const Theme& t)
   21 {
   22     for (int i = 0; i < NUM_COLORS; i++)
   23     {
   24         if (color[i] != t.color[i])
   25         {
   26             return(true);
   27         }
   28     }
   29     return(false);
   30 }
   31 
   32 
   33 // Main window
   34 extern FXMainWindow* mainWindow;
   35 
   36 // Single click navigation
   37 extern FXbool single_click;
   38 
   39 // File tooltips
   40 extern FXbool file_tooltips;
   41 
   42 // Relative resizing of the panels and columns in detailed mode
   43 extern FXbool relative_resize;
   44 
   45 // Save window position
   46 extern FXbool save_win_pos;
   47 
   48 
   49 // Create hilite color from given color for gradient controls
   50 static FXColor makeHiliteColorGradient(FXColor color)
   51 {
   52     FXuint r, g, b;
   53 
   54     r = FXREDVAL(color);
   55     g = FXGREENVAL(color);
   56     b = FXBLUEVAL(color);
   57 
   58     r = (FXuint)(FXMIN(1.2*r, 255));
   59     g = (FXuint)(FXMIN(1.2*g, 255));
   60     b = (FXuint)(FXMIN(1.2*b, 255));
   61 
   62     return(FXRGB(r, g, b));
   63 }
   64 
   65 
   66 // Create shadow color from given color for gradient controls
   67 static FXColor makeShadowColorGradient(FXColor color)
   68 {
   69     FXuint r, g, b;
   70 
   71     r = FXREDVAL(color);
   72     g = FXGREENVAL(color);
   73     b = FXBLUEVAL(color);
   74 
   75     r = (FXuint)(0.7*r);
   76     g = (FXuint)(0.7*g);
   77     b = (FXuint)(0.7*b);
   78 
   79     return(FXRGB(r, g, b));
   80 }
   81 
   82 
   83 // Map
   84 FXDEFMAP(PreferencesBox) PreferencesMap[] =
   85 {
   86     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_ACCEPT, PreferencesBox::onCmdAccept),
   87     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_CANCEL, PreferencesBox::onCmdCancel),
   88     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_TXTEDIT, PreferencesBox::onCmdBrowse),
   89     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_TXTVIEW, PreferencesBox::onCmdBrowse),
   90     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_IMGVIEW, PreferencesBox::onCmdBrowse),
   91     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_ARCHIVER, PreferencesBox::onCmdBrowse),
   92     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_PDFVIEW, PreferencesBox::onCmdBrowse),
   93     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_VIDEOPLAY, PreferencesBox::onCmdBrowse),
   94     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_AUDIOPLAY, PreferencesBox::onCmdBrowse),
   95     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_XTERM, PreferencesBox::onCmdBrowse),
   96     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_MOUNTCMD, PreferencesBox::onCmdBrowse),
   97     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_UMOUNTCMD, PreferencesBox::onCmdBrowse),
   98     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_COLOR, PreferencesBox::onCmdColor),
   99     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_NORMALFONT, PreferencesBox::onCmdNormalFont),
  100     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_TEXTFONT, PreferencesBox::onCmdTextFont),
  101     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_THEME, PreferencesBox::onCmdTheme),
  102     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_BROWSE_ICON_PATH, PreferencesBox::onCmdBrowsePath),
  103     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_START_HOMEDIR, PreferencesBox::onCmdStartDir),
  104     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_START_CURRENTDIR, PreferencesBox::onCmdStartDir),
  105     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_START_LASTDIR, PreferencesBox::onCmdStartDir),
  106     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_SU_CMD, PreferencesBox::onCmdSuMode),
  107     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_SUDO_CMD, PreferencesBox::onCmdSuMode),
  108     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_STANDARD_CONTROLS, PreferencesBox::onCmdControls),
  109     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_CLEARLOOKS_CONTROLS, PreferencesBox::onCmdControls),
  110     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_WHEELADJUST, PreferencesBox::onCmdWheelAdjust),
  111     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_SCROLLBARSIZE, PreferencesBox::onCmdScrollBarSize),
  112     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_CHANGE_KEYBINDINGS, PreferencesBox::onCmdChangeKeyBindings),
  113     FXMAPFUNC(SEL_COMMAND, PreferencesBox::ID_RESTORE_KEYBINDINGS, PreferencesBox::onCmdRestoreKeyBindings),
  114     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_STANDARD_CONTROLS, PreferencesBox::onUpdControls),
  115     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_CLEARLOOKS_CONTROLS, PreferencesBox::onUpdControls),
  116     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_COLOR, PreferencesBox::onUpdColor),
  117     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_WHEELADJUST, PreferencesBox::onUpdWheelAdjust),
  118     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_SCROLLBARSIZE, PreferencesBox::onUpdScrollBarSize),
  119     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_SINGLE_CLICK_FILEOPEN, PreferencesBox::onUpdSingleClickFileopen),
  120     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_CONFIRM_TRASH, PreferencesBox::onUpdTrash),
  121     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_TRASH_BYPASS, PreferencesBox::onUpdTrash),
  122     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_CONFIRM_DEL_EMPTYDIR, PreferencesBox::onUpdConfirmDelEmptyDir),
  123     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_SU_CMD, PreferencesBox::onUpdSuMode),
  124     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_SUDO_CMD, PreferencesBox::onUpdSuMode),
  125     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_START_HOMEDIR, PreferencesBox::onUpdStartDir),
  126     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_START_CURRENTDIR, PreferencesBox::onUpdStartDir),
  127     FXMAPFUNC(SEL_UPDATE, PreferencesBox::ID_START_LASTDIR, PreferencesBox::onUpdStartDir),
  128 };
  129 
  130 // Object implementation
  131 FXIMPLEMENT(PreferencesBox, DialogBox, PreferencesMap, ARRAYNUMBER(PreferencesMap))
  132 
  133 // Construct window
  134 PreferencesBox::PreferencesBox(FXWindow* win, FXColor listbackcolor, FXColor listforecolor, FXColor highlightcolor, FXColor pbarcolor, FXColor attentioncolor, FXColor scrollbarcolor) : DialogBox(win, _("Preferences"), DECOR_TITLE|DECOR_BORDER|DECOR_MAXIMIZE|DECOR_STRETCHABLE|DECOR_CLOSE)
  135 {
  136     currTheme.name = _("Current Theme");
  137     currTheme.color[0] = getApp()->getBaseColor();
  138     currTheme.color[1] = getApp()->getBorderColor();
  139     currTheme.color[2] = getApp()->getBackColor();
  140     currTheme.color[3] = getApp()->getForeColor();
  141     currTheme.color[4] = getApp()->getSelbackColor();
  142     currTheme.color[5] = getApp()->getSelforeColor();
  143     currTheme.color[6] = listbackcolor;
  144     currTheme.color[7] = listforecolor;
  145     currTheme.color[8] = highlightcolor;
  146     currTheme.color[9] = pbarcolor;
  147     currTheme.color[10] = attentioncolor;
  148     currTheme.color[11] = scrollbarcolor;
  149 
  150     Themes[0] = currTheme;
  151     Themes[1] = Theme("Clearlooks", FXRGB(237, 236, 235), FXRGB(0, 0, 0), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(139, 175, 220), FXRGB(255, 255, 255), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(121, 153, 192), FXRGB(255, 0, 0), FXRGB(149, 178, 215));
  152     Themes[2] = Theme("Human", FXRGB(239, 235, 231), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(0, 0, 0), FXRGB(211, 170, 123), FXRGB(255, 255, 255), FXRGB(238, 238, 238), FXRGB(0, 0, 0), FXRGB(255, 255, 255), FXRGB(195, 158, 114), FXRGB(255, 0, 0), FXRGB(212, 172, 124));
  153     Themes[3] = Theme("Sea Sky", FXRGB(165, 178, 198), FXRGB(0, 0, 0), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(49, 101, 156), FXRGB(255, 255, 255), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(49, 101, 156), FXRGB(255, 0, 0), FXRGB(68, 106, 146));
  154     Themes[4] = Theme("Blue Slate", FXRGB(156, 186, 205), FXRGB(0, 0, 0), FXRGB(197, 194, 197), FXRGB(0, 0, 0), FXRGB(82, 129, 148), FXRGB(255, 255, 255), FXRGB(197, 194, 197), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(82, 129, 148), FXRGB(255, 0, 0), FXRGB(156, 186, 205));
  155     Themes[5] = Theme("FOX", FXRGB(237, 233, 227), FXRGB(0, 0, 0), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(10, 36, 106), FXRGB(255, 255, 255), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(10, 36, 106), FXRGB(255, 0, 0), FXRGB(237, 233, 227));
  156     Themes[6] = Theme("GNOME2", FXRGB(220, 218, 213), FXRGB(0, 0, 0), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(75, 105, 131), FXRGB(255, 255, 255), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(75, 105, 131), FXRGB(255, 0, 0), FXRGB(134, 171, 217));
  157     Themes[7] = Theme("KDE3", FXRGB(238, 238, 230), FXRGB(0, 0, 0), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(255, 222, 118), FXRGB(0, 0, 0), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(255, 222, 118), FXRGB(255, 0, 0), FXRGB(238, 238, 230));
  158     Themes[8] = Theme("XFCE4", FXRGB(238, 238, 238), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(0, 0, 0), FXRGB(99, 119, 146), FXRGB(255, 255, 255), FXRGB(255, 255, 255), FXRGB(0, 0, 0), FXRGB(238, 238, 238), FXRGB(99, 119, 146), FXRGB(255, 0, 0), FXRGB(238, 238, 238));
  159     Themes[9] = Theme("CDE", FXRGB(156, 153, 156), FXRGB(0, 0, 0), FXRGB(131, 129, 131), FXRGB(255, 255, 255), FXRGB(49, 97, 131), FXRGB(255, 255, 255), FXRGB(131, 129, 131), FXRGB(255, 255, 255), FXRGB(165, 162, 165), FXRGB(49, 97, 131), FXRGB(255, 0, 0), FXRGB(156, 153, 156));
  160 
  161     // Buttons
  162     FXHorizontalFrame* buttons = new FXHorizontalFrame(this, LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X, 0, 0, 0, 0, 10, 10, 5, 5);
  163 
  164     // Contents
  165     FXHorizontalFrame* contents = new FXHorizontalFrame(this, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDTH);
  166 
  167     // Accept
  168     FXButton* ok = new FXButton(buttons, _("&Accept"), NULL, this, PreferencesBox::ID_ACCEPT, BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  169     ok->addHotKey(KEY_Return);
  170     ok->setFocus();
  171 
  172     // Cancel
  173     new FXButton(buttons, _("&Cancel"), NULL, this, PreferencesBox::ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  174 
  175     // Switcher
  176     FXTabBook* tabbook = new FXTabBook(contents, NULL, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT);
  177 
  178     // First tab - General options
  179     new FXTabItem(tabbook, _("&General"), NULL);
  180     FXVerticalFrame* options = new FXVerticalFrame(tabbook, FRAME_RAISED);
  181 
  182     FXGroupBox* group = new FXGroupBox(options, _("Options"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  183     trashcan = new FXCheckButton(group, _("Use trash can for file deletion (safe delete)"));
  184     trashbypass = new FXCheckButton(group, _("Include a command to bypass the trash can (permanent delete)"), this, ID_TRASH_BYPASS);
  185     autosave = new FXCheckButton(group, _("Auto save layout"));
  186     savewinpos = new FXCheckButton(group, _("Save window position"));
  187     diropen = new FXCheckButton(group, _("Single click folder open"));
  188     fileopen = new FXCheckButton(group, _("Single click file open"), this, ID_SINGLE_CLICK_FILEOPEN);
  189     filetooltips = new FXCheckButton(group, _("Display tooltips in file and folder lists"), this, ID_FILE_TOOLTIPS);
  190     relativeresize = new FXCheckButton(group, _("Relative resizing of file lists"), this, ID_RELATIVE_RESIZE);
  191     showpathlink = new FXCheckButton(group, _("Display a path linker above file lists"), this, ID_SHOW_PATHLINK);
  192 #ifdef STARTUP_NOTIFICATION
  193     usesn = new FXCheckButton(group, _("Notify when applications start up"));
  194 #endif
  195 
  196     FXMatrix* matrix = new FXMatrix(group, 2, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  197     new FXLabel(matrix, _("Date format used in file and folder lists:\n(Type 'man strftime' in a terminal for help on the format)"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  198     timeformat = new FXTextField(matrix, 15, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  199     oldtimeformat = getApp()->reg().readStringEntry("SETTINGS", "time_format", DEFAULT_TIME_FORMAT);
  200     timeformat->setText(oldtimeformat);
  201 
  202     new FXTabItem(tabbook, _("&Modes"), NULL);
  203     FXVerticalFrame* modes = new FXVerticalFrame(tabbook, FRAME_RAISED);
  204 
  205     startdirmode = getApp()->reg().readUnsignedEntry("OPTIONS", "startdir_mode", START_HOMEDIR) + ID_START_HOMEDIR;
  206     oldstartdirmode = startdirmode;
  207     startdirtarget.connect(startdirmode);
  208 
  209     group = new FXGroupBox(modes, _("Starting mode"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  210     new FXRadioButton(group, _("Start in home folder"), this, PreferencesBox::ID_START_HOMEDIR);
  211     new FXRadioButton(group, _("Start in current folder"), this, PreferencesBox::ID_START_CURRENTDIR);
  212     new FXRadioButton(group, _("Start in last visited folder"), this, PreferencesBox::ID_START_LASTDIR);
  213 
  214     group = new FXGroupBox(modes, _("Scrolling mode"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  215 
  216     matrix = new FXMatrix(group, 2, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP);
  217     scroll = new FXCheckButton(matrix, _("Smooth scrolling in file lists and text windows"));
  218     FXbool smoothscroll = getApp()->reg().readUnsignedEntry("SETTINGS", "smooth_scroll", true);
  219     scroll->setCheck(smoothscroll);
  220     new FXLabel(matrix, "", NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  221     new FXLabel(matrix, _("Mouse scrolling speed:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  222     FXSpinner* spinner = new FXSpinner(matrix, 3, this, PreferencesBox::ID_WHEELADJUST, JUSTIFY_RIGHT|LAYOUT_FILL_X|LAYOUT_FILL_ROW, 0, 0, 0, 0, 2, 2, 1, 1);
  223     spinner->setRange(1, 100);
  224     new FXLabel(matrix, _("Scrollbar width:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  225     spinner = new FXSpinner(matrix, 3, this, PreferencesBox::ID_SCROLLBARSIZE, JUSTIFY_RIGHT|LAYOUT_FILL_X|LAYOUT_FILL_ROW, 0, 0, 0, 0, 2, 2, 1, 1);
  226     spinner->setRange(1, 100);
  227 
  228     group = new FXGroupBox(modes, _("Root mode"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  229     rootmode = new FXCheckButton(group, _("Allow root mode"));
  230     FXRadioButton* subutton = new FXRadioButton(group, _("Authentication using su (uses root password)"), this, ID_SU_CMD);
  231     FXRadioButton* sudobutton = new FXRadioButton(group, _("Authentication using sudo (uses user password)"), this, ID_SUDO_CMD);
  232 
  233     FXbool root_mode = getApp()->reg().readUnsignedEntry("OPTIONS", "root_mode", true);
  234     rootmode->setCheck(root_mode);
  235 
  236     if (getuid() == 0) // Super user
  237     {
  238         rootmode->disable();
  239         subutton->disable();
  240         sudobutton->disable();
  241     }
  242     use_sudo = getApp()->reg().readUnsignedEntry("OPTIONS", "use_sudo", false);
  243 
  244     FXbool use_trash_can = getApp()->reg().readUnsignedEntry("OPTIONS", "use_trash_can", true);
  245     trashcan->setCheck(use_trash_can);
  246 
  247     if (trashcan->getCheck())
  248     {
  249         FXbool use_trash_bypass = getApp()->reg().readUnsignedEntry("OPTIONS", "use_trash_bypass", false);
  250         trashbypass->setCheck(use_trash_bypass);
  251     }
  252     else
  253     {
  254         trashbypass->disable();
  255     }
  256 
  257     FXbool auto_save_layout = getApp()->reg().readUnsignedEntry("OPTIONS", "auto_save_layout", true);
  258     autosave->setCheck(auto_save_layout);
  259 
  260     FXbool save_win_pos = getApp()->reg().readUnsignedEntry("SETTINGS", "save_win_pos", false);
  261     savewinpos->setCheck(save_win_pos);
  262 
  263     // Single click navigation
  264     single_click = getApp()->reg().readUnsignedEntry("SETTINGS", "single_click", SINGLE_CLICK_NONE);
  265     if (single_click == SINGLE_CLICK_DIR)
  266     {
  267         diropen->setCheck(true);
  268         fileopen->setCheck(false);
  269     }
  270     else if (single_click == SINGLE_CLICK_DIR_FILE)
  271     {
  272         diropen->setCheck(true);
  273         fileopen->setCheck(true);
  274     }
  275     else
  276     {
  277         diropen->setCheck(false);
  278         fileopen->setCheck(false);
  279     }
  280 
  281     // File tooltips
  282     if (file_tooltips == false)
  283     {
  284         filetooltips->setCheck(false);
  285     }
  286     else
  287     {
  288         filetooltips->setCheck(true);
  289     }
  290 
  291     // Relative resizing
  292     if (relative_resize == false)
  293     {
  294         relativeresize->setCheck(false);
  295     }
  296     else
  297     {
  298         relativeresize->setCheck(true);
  299     }
  300 
  301     // Display path linker
  302     show_pathlink = getApp()->reg().readUnsignedEntry("SETTINGS", "show_pathlinker", true);
  303     if (show_pathlink == false)
  304     {
  305         showpathlink->setCheck(false);
  306     }
  307     else
  308     {
  309         showpathlink->setCheck(true);
  310     }
  311 
  312 #ifdef STARTUP_NOTIFICATION
  313     FXbool use_sn = getApp()->reg().readUnsignedEntry("OPTIONS", "use_startup_notification", true);
  314     usesn->setCheck(use_sn);
  315 #endif
  316 
  317     // Second tab - Dialogs
  318     new FXTabItem(tabbook, _("&Dialogs"), NULL);
  319     FXVerticalFrame* dialogs = new FXVerticalFrame(tabbook, FRAME_RAISED);
  320     group = new FXGroupBox(dialogs, _("Confirmations"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  321     ask = new FXCheckButton(group, _("Confirm copy/move/rename/symlink"));
  322     dnd = new FXCheckButton(group, _("Confirm drag and drop"));
  323     trashmv = new FXCheckButton(group, _("Confirm move to trash/restore from trash"), this, ID_CONFIRM_TRASH);
  324     del = new FXCheckButton(group, _("Confirm delete"));
  325     del_emptydir = new FXCheckButton(group, _("Confirm delete non empty folders"), this, ID_CONFIRM_DEL_EMPTYDIR);
  326     overwrite = new FXCheckButton(group, _("Confirm overwrite"));
  327     exec = new FXCheckButton(group, _("Confirm execute text files"));
  328     properties = new FXCheckButton(group, _("Confirm change properties"));
  329 
  330     group = new FXGroupBox(dialogs, _("Warnings"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  331     folder_warning = new FXCheckButton(group, _("Warn when setting current folder in search window"));
  332 #if defined(linux)
  333     mount = new FXCheckButton(group, _("Warn when mount points are not responding"));
  334     show_mount = new FXCheckButton(group, _("Display mount / unmount success messages"));
  335 #endif
  336     preserve_date_warning = new FXCheckButton(group, _("Warn when date preservation failed"));
  337     root_warning = new FXCheckButton(group, _("Warn if running as root"));
  338 
  339     FXbool confirm_trash = getApp()->reg().readUnsignedEntry("OPTIONS", "confirm_trash", true);
  340     trashmv->setCheck(confirm_trash);
  341     FXbool confirm_del = getApp()->reg().readUnsignedEntry("OPTIONS", "confirm_delete", true);
  342     del->setCheck(confirm_del);
  343     FXbool confirm_properties = getApp()->reg().readUnsignedEntry("OPTIONS", "confirm_properties", true);
  344     properties->setCheck(confirm_properties);
  345     FXbool confirm_del_emptydir = getApp()->reg().readUnsignedEntry("OPTIONS", "confirm_delete_emptydir", true);
  346     del_emptydir->setCheck(confirm_del_emptydir);
  347     FXbool confirm_overwrite = getApp()->reg().readUnsignedEntry("OPTIONS", "confirm_overwrite", true);
  348     overwrite->setCheck(confirm_overwrite);
  349     FXbool confirm_exec = getApp()->reg().readUnsignedEntry("OPTIONS", "confirm_execute", true);
  350     exec->setCheck(confirm_exec);
  351     FXbool ask_before_copy = getApp()->reg().readUnsignedEntry("OPTIONS", "ask_before_copy", true);
  352     ask->setCheck(ask_before_copy);
  353     FXbool confirm_dnd = getApp()->reg().readUnsignedEntry("OPTIONS", "confirm_drag_and_drop", true);
  354     dnd->setCheck(confirm_dnd);
  355 
  356 #if defined(linux)
  357     FXbool mount_warn = getApp()->reg().readUnsignedEntry("OPTIONS", "mount_warn", true);
  358     FXbool mount_messages = getApp()->reg().readUnsignedEntry("OPTIONS", "mount_messages", true);
  359     mount->setCheck(mount_warn);
  360     show_mount->setCheck(mount_messages);
  361 #endif
  362 
  363     FXbool folder_warn = getApp()->reg().readUnsignedEntry("OPTIONS", "folderwarn", true);
  364     folder_warning->setCheck(folder_warn);
  365 
  366     FXbool preserve_date_warn = getApp()->reg().readUnsignedEntry("OPTIONS", "preserve_date_warn", true);
  367     preserve_date_warning->setCheck(preserve_date_warn);
  368 
  369     FXbool root_warn = getApp()->reg().readUnsignedEntry("OPTIONS", "root_warn", true);
  370     if (getuid()) // Simple user
  371     {
  372         root_warning->disable();
  373     }
  374     else
  375     {
  376         root_warning->setCheck(root_warn);
  377     }
  378 
  379     // Third tab - Programs
  380     new FXTabItem(tabbook, _("&Programs"), NULL);
  381     FXVerticalFrame* programs = new FXVerticalFrame(tabbook, FRAME_RAISED);
  382     group = new FXGroupBox(programs, _("Default programs"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  383     matrix = new FXMatrix(group, 3, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  384 
  385     new FXLabel(matrix, _("Text viewer:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  386     txtviewer = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  387     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_TXTVIEW, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  388     oldtxtviewer = getApp()->reg().readStringEntry("PROGS", "txtviewer", DEFAULT_TXTVIEWER);
  389     txtviewer->setText(oldtxtviewer);
  390 
  391     new FXLabel(matrix, _("Text editor:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  392     txteditor = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  393     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_TXTEDIT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  394     oldtxteditor = getApp()->reg().readStringEntry("PROGS", "txteditor", DEFAULT_TXTEDITOR);
  395     txteditor->setText(oldtxteditor);
  396 
  397     new FXLabel(matrix, _("File comparator:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  398     filecomparator = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  399     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_TXTEDIT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  400     oldfilecomparator = getApp()->reg().readStringEntry("PROGS", "filecomparator", DEFAULT_FILECOMPARATOR);
  401     filecomparator->setText(oldfilecomparator);
  402 
  403     new FXLabel(matrix, _("Image editor:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  404     imgeditor = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  405     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_IMGVIEW, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  406     oldimgeditor = getApp()->reg().readStringEntry("PROGS", "imgeditor", DEFAULT_IMGEDITOR);
  407     imgeditor->setText(oldimgeditor);
  408 
  409     new FXLabel(matrix, _("Image viewer:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  410     imgviewer = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  411     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_IMGVIEW, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  412     oldimgviewer = getApp()->reg().readStringEntry("PROGS", "imgviewer", DEFAULT_IMGVIEWER);
  413     imgviewer->setText(oldimgviewer);
  414 
  415     new FXLabel(matrix, _("Archiver:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  416     archiver = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  417     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_ARCHIVER, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  418     oldarchiver = getApp()->reg().readStringEntry("PROGS", "archiver", DEFAULT_ARCHIVER);
  419     archiver->setText(oldarchiver);
  420 
  421     new FXLabel(matrix, _("Pdf viewer:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  422     pdfviewer = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  423     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_PDFVIEW, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  424     oldpdfviewer = getApp()->reg().readStringEntry("PROGS", "pdfviewer", DEFAULT_PDFVIEWER);
  425     pdfviewer->setText(oldpdfviewer);
  426 
  427     new FXLabel(matrix, _("Audio player:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  428     audioplayer = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  429     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_AUDIOPLAY, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  430     oldaudioplayer = getApp()->reg().readStringEntry("PROGS", "audioplayer", DEFAULT_AUDIOPLAYER);
  431     audioplayer->setText(oldaudioplayer);
  432 
  433     new FXLabel(matrix, _("Video player:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  434     videoplayer = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  435     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_VIDEOPLAY, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  436     oldvideoplayer = getApp()->reg().readStringEntry("PROGS", "videoplayer", DEFAULT_VIDEOPLAYER);
  437     videoplayer->setText(oldvideoplayer);
  438 
  439     new FXLabel(matrix, _("Terminal:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  440     xterm = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  441     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_XTERM, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  442     oldxterm = getApp()->reg().readStringEntry("PROGS", "xterm", DEFAULT_TERMINAL);
  443     xterm->setText(oldxterm);
  444 
  445     group = new FXGroupBox(programs, _("Volume management"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  446     matrix = new FXMatrix(group, 3, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  447 
  448     new FXLabel(matrix, _("Mount:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  449     mountcmd = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  450     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_MOUNTCMD, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  451     oldmountcmd = getApp()->reg().readStringEntry("PROGS", "mount", DEFAULT_MOUNTCMD);
  452     mountcmd->setText(oldmountcmd);
  453 
  454     new FXLabel(matrix, _("Unmount:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  455     umountcmd = new FXTextField(matrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  456     new FXButton(matrix, _("\tSelect file..."), filedialogicon, this, ID_BROWSE_UMOUNTCMD, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  457     oldumountcmd = getApp()->reg().readStringEntry("PROGS", "unmount", DEFAULT_UMOUNTCMD);
  458     umountcmd->setText(oldumountcmd);
  459 
  460 
  461     // Fourth tab - Visual
  462     new FXTabItem(tabbook, _("&Themes"), NULL);
  463     FXVerticalFrame* visual = new FXVerticalFrame(tabbook, FRAME_RAISED);
  464     FXGroupBox*      themes = new FXGroupBox(visual, _("Color theme"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  465     FXPacker*        pack = new FXPacker(themes, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_Y|LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0);
  466     themesList = new FXList(pack, this, ID_THEME, LIST_BROWSESELECT|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  467     themesList->setNumVisible(7);
  468     for (int i = 0; i < NUM_THEMES; i++)
  469     {
  470         themesList->appendItem(Themes[i].name);
  471     }
  472     themesList->setCurrentItem(0);
  473 
  474     FXGroupBox* colors = new FXGroupBox(visual, _("Custom colors"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X);
  475     FXMatrix*   matrix3 = new FXMatrix(colors, 2, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  476     colorsBox = new FXComboBox(matrix3, NUM_COLORS, NULL, 0, COMBOBOX_STATIC|LAYOUT_FILL_X|LAYOUT_SIDE_RIGHT|LAYOUT_CENTER_Y);
  477     colorsBox->setNumVisible(NUM_COLORS);
  478     cwell = new FXColorWell(matrix3, FXRGB(0, 0, 0), this, ID_COLOR, LAYOUT_FILL_X|LAYOUT_FILL_COLUMN|LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 0, 0);
  479     cwell->setTipText(_("Double click to customize the color"));
  480 
  481     colorsBox->appendItem(_("Base color"));
  482     colorsBox->appendItem(_("Border color"));
  483     colorsBox->appendItem(_("Background color"));
  484     colorsBox->appendItem(_("Text color"));
  485     colorsBox->appendItem(_("Selection background color"));
  486     colorsBox->appendItem(_("Selection text color"));
  487     colorsBox->appendItem(_("File list background color"));
  488     colorsBox->appendItem(_("File list text color"));
  489     colorsBox->appendItem(_("File list highlight color"));
  490     colorsBox->appendItem(_("Progress bar color"));
  491     colorsBox->appendItem(_("Attention color"));
  492     colorsBox->appendItem(_("Scrollbar color"));
  493     colorsBox->setCurrentItem(0);
  494 
  495     // Controls theme
  496     FXGroupBox* button = new FXGroupBox(visual, _("Controls"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  497     use_clearlooks = getApp()->reg().readUnsignedEntry("SETTINGS", "use_clearlooks", true);
  498     new FXRadioButton(button, _("Standard (classic controls)"), this, ID_STANDARD_CONTROLS);
  499     new FXRadioButton(button, _("Clearlooks (modern looking controls)"), this, ID_CLEARLOOKS_CONTROLS);
  500 
  501     // Find iconpath from the Xfe registry settings or set it to DEFAULTICONPATH
  502     FXGroupBox* group2 = new FXGroupBox(visual, _("Icon theme path"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X);
  503     FXMatrix*   matrix2 = new FXMatrix(group2, 2, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  504     iconpath = new FXTextField(matrix2, 40, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  505     new FXButton(matrix2, _("\tSelect path..."), filedialogicon, this, ID_BROWSE_ICON_PATH, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y, 0, 0, 0, 0, 20, 20);
  506     oldiconpath = getApp()->reg().readStringEntry("SETTINGS", "iconpath", DEFAULTICONPATH);
  507     iconpath->setText(oldiconpath);
  508 
  509     // Fifth tab - Fonts
  510     new FXTabItem(tabbook, _("&Fonts"), NULL);
  511     FXVerticalFrame* fonts = new FXVerticalFrame(tabbook, FRAME_RAISED);
  512     FXGroupBox*      fgroup = new FXGroupBox(fonts, _("Fonts"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  513 
  514     FXMatrix* fmatrix = new FXMatrix(fgroup, 3, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  515     new FXLabel(fmatrix, _("Normal font:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  516     normalfont = new FXTextField(fmatrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  517     new FXButton(fmatrix, _(" Select..."), NULL, this, ID_NORMALFONT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y); //,0,0,0,0,20,20);
  518     oldnormalfont = getApp()->reg().readStringEntry("SETTINGS", "font", DEFAULT_NORMAL_FONT);
  519     normalfont->setText(oldnormalfont);
  520 
  521     new FXLabel(fmatrix, _("Text font:"), NULL, JUSTIFY_LEFT|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW);
  522     textfont = new FXTextField(fmatrix, 30, NULL, 0, FRAME_THICK|FRAME_SUNKEN|LAYOUT_FILL_COLUMN|LAYOUT_FILL_ROW|LAYOUT_FILL_X);
  523     new FXButton(fmatrix, _(" Select..."), NULL, this, ID_TEXTFONT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y); //0,0,0,0,20,20);
  524     oldtextfont = getApp()->reg().readStringEntry("SETTINGS", "textfont", DEFAULT_TEXT_FONT);
  525     textfont->setText(oldtextfont);
  526 
  527     // Sixth tab - Key bindings
  528     new FXTabItem(tabbook, _("&Key Bindings"), NULL);
  529     FXVerticalFrame* keybindings = new FXVerticalFrame(tabbook, FRAME_RAISED);
  530     FXGroupBox*      kbgroup = new FXGroupBox(keybindings, _("Key Bindings"), GROUPBOX_TITLE_LEFT|FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_FILL_Y);
  531 
  532     FXPacker* kbpack = new FXPacker(kbgroup, LAYOUT_FILL_X);
  533     new FXButton(kbpack, _("Modify key bindings..."), minikeybindingsicon, this, ID_CHANGE_KEYBINDINGS, FRAME_RAISED|FRAME_THICK|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|LAYOUT_FILL_X);  //,0,0,0,0,20,20);
  534     new FXButton(kbpack, _("Restore default key bindings..."), reloadicon, this, ID_RESTORE_KEYBINDINGS, FRAME_RAISED|FRAME_THICK|ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP|LAYOUT_FILL_X); //,0,0,0,0,20,20);
  535 
  536     // Initializations
  537     bindingsbox = NULL;
  538     glbBindingsDict = NULL;
  539     xfeBindingsDict = NULL;
  540     xfiBindingsDict = NULL;
  541     xfwBindingsDict = NULL;
  542 
  543     themesBox = NULL;
  544     bg = NULL;
  545     controls = NULL;
  546 
  547     trashbypass_prev = false;
  548     autosave_prev = false;
  549     savewinpos_prev = false;
  550     diropen_prev = false;
  551     fileopen_prev = false;
  552     filetooltips_prev = false;
  553     relativeresize_prev = false;
  554     show_pathlink_prev = false;
  555     wheellines_prev = 0;
  556     scrollbarsize_prev = 0;
  557     ask_prev = false;
  558     dnd_prev = false;
  559     trashmv_prev = false;
  560     del_prev = false;
  561     properties_prev = false;
  562     del_emptydir_prev = false;
  563     overwrite_prev = false;
  564     exec_prev = false;
  565     use_clearlooks_prev = false;
  566     rootmode_prev = false;
  567 #ifdef STARTUP_NOTIFICATION
  568     usesn_prev = false;
  569 #endif
  570 #if defined(linux)
  571     mount_prev = false;
  572     show_mount_prev = false;
  573 #endif
  574     root_warning_prev = false;
  575     folder_warning_prev = false;
  576     preserve_date_warning_prev = false;
  577     themelist_prev = false;
  578     smoothscroll_prev = false;
  579     use_sudo_prev = false;
  580     trashcan_prev = false;
  581 }
  582 
  583 
  584 long PreferencesBox::onUpdColor(FXObject* o, FXSelector s, void* p)
  585 {
  586     FXColorWell* cwell = (FXColorWell*)o;
  587     int i = colorsBox->getCurrentItem();
  588 
  589     cwell->setRGBA(currTheme.color[i]);
  590 
  591     return(1);
  592 }
  593 
  594 
  595 long PreferencesBox::onCmdColor(FXObject* o, FXSelector s, void* p)
  596 {
  597     FXColorWell* cwell = (FXColorWell*)o;
  598     int i = colorsBox->getCurrentItem();
  599 
  600     currTheme.color[i] = cwell->getRGBA();
  601 
  602     return(1);
  603 }
  604 
  605 
  606 long PreferencesBox::onCmdTheme(FXObject* o, FXSelector s, void* p)
  607 {
  608     currTheme = Themes[themesList->getCurrentItem()];
  609     return(1);
  610 }
  611 
  612 
  613 long PreferencesBox::onCmdBrowsePath(FXObject* o, FXSelector s, void* p)
  614 {
  615     FileDialog browse(this, _("Select an icon theme folder or an icon file"));
  616 
  617     browse.setSelectMode(SELECT_FILE_MIXED);
  618     browse.setDirectory(iconpath->getText());
  619     if (browse.execute())
  620     {
  621         FXString path = browse.getFilename();
  622         if (::isFile(path))
  623         {
  624             iconpath->setText(FXPath::directory(path).text());
  625         }
  626         else
  627         {
  628             iconpath->setText(path);
  629         }
  630     }
  631     return(1);
  632 }
  633 
  634 
  635 long PreferencesBox::onCmdBrowse(FXObject* o, FXSelector s, void* p)
  636 {
  637     FileDialog  browse(this, _("Select an executable file"));
  638     const char* patterns[] =
  639     {
  640         _("All files"), "*", NULL
  641     };
  642 
  643     browse.setFilename(ROOTDIR);
  644     browse.setPatternList(patterns);
  645     browse.setSelectMode(SELECT_FILE_EXISTING);
  646     if (browse.execute())
  647     {
  648         FXString path = browse.getFilename();
  649 
  650         switch (FXSELID(s))
  651         {
  652         case ID_BROWSE_TXTVIEW:
  653             txtviewer->setText(FXPath::name(path));
  654             break;
  655 
  656         case ID_BROWSE_TXTEDIT:
  657             txteditor->setText(FXPath::name(path));
  658             break;
  659 
  660         case ID_BROWSE_FILECOMP:
  661             filecomparator->setText(FXPath::name(path));
  662             break;
  663 
  664         case ID_BROWSE_IMGVIEW:
  665             imgviewer->setText(FXPath::name(path));
  666             break;
  667 
  668         case ID_BROWSE_ARCHIVER:
  669             archiver->setText(FXPath::name(path));
  670             break;
  671 
  672         case ID_BROWSE_PDFVIEW:
  673             pdfviewer->setText(FXPath::name(path));
  674             break;
  675 
  676         case ID_BROWSE_AUDIOPLAY:
  677             audioplayer->setText(FXPath::name(path));
  678             break;
  679 
  680         case ID_BROWSE_VIDEOPLAY:
  681             videoplayer->setText(FXPath::name(path));
  682             break;
  683 
  684         case ID_BROWSE_XTERM:
  685             xterm->setText(FXPath::name(path));
  686             break;
  687 
  688         case ID_BROWSE_MOUNTCMD:
  689             mountcmd->setText(FXPath::name(path));
  690             break;
  691 
  692         case ID_BROWSE_UMOUNTCMD:
  693             umountcmd->setText(FXPath::name(path));
  694             break;
  695         }
  696     }
  697     return(1);
  698 }
  699 
  700 
  701 // Change normal font
  702 long PreferencesBox::onCmdNormalFont(FXObject*, FXSelector, void*)
  703 {
  704     FontDialog fontdlg(this, _("Change Normal Font"), DECOR_BORDER|DECOR_TITLE);
  705     FXFontDesc fontdesc;
  706     FXString   fontspec;
  707 
  708     fontspec = getApp()->reg().readStringEntry("SETTINGS", "font", DEFAULT_NORMAL_FONT);
  709     FXFont* nfont = new FXFont(getApp(), fontspec);
  710     nfont->create();
  711     nfont->getFontDesc(fontdesc);
  712 
  713     fontdlg.setFontSelection(fontdesc);
  714     if (fontdlg.execute())
  715     {
  716         fontdlg.getFontSelection(fontdesc);
  717         nfont->setFontDesc(fontdesc);
  718         fontspec = nfont->getFont();
  719         normalfont->setText(fontspec);
  720     }
  721     return(1);
  722 }
  723 
  724 
  725 // Change text font
  726 long PreferencesBox::onCmdTextFont(FXObject*, FXSelector, void*)
  727 {
  728     FontDialog fontdlg(this, _("Change Text Font"), DECOR_BORDER|DECOR_TITLE);
  729     FXFontDesc fontdesc;
  730     FXString   fontspec;
  731 
  732     fontspec = getApp()->reg().readStringEntry("SETTINGS", "textfont", DEFAULT_TEXT_FONT);
  733     FXFont* tfont = new FXFont(getApp(), fontspec);
  734     tfont->create();
  735     tfont->getFontDesc(fontdesc);
  736     fontdlg.setFontSelection(fontdesc);
  737     if (fontdlg.execute())
  738     {
  739         fontdlg.getFontSelection(fontdesc);
  740         tfont->setFontDesc(fontdesc);
  741         fontspec = tfont->getFont();
  742         textfont->setText(fontspec);
  743     }
  744     return(1);
  745 }
  746 
  747 
  748 // Change key bindings
  749 long PreferencesBox::onCmdChangeKeyBindings(FXObject*, FXSelector, void*)
  750 {
  751     FXString key, str;
  752 
  753     // String dictionary used to store global key bindings
  754     if (glbBindingsDict == NULL)
  755     {
  756         glbBindingsDict = new FXStringDict();
  757     }
  758 
  759     key = getApp()->reg().readStringEntry("KEYBINDINGS", "go_back", "Ctrl-Backspace");
  760     str = _("Go to previous folder")+TAB+key;
  761     glbBindingsDict->insert("go_back", str.text());
  762 
  763     key = getApp()->reg().readStringEntry("KEYBINDINGS", "go_forward", "Shift-Backspace");
  764     str = _("Go to next folder")+TAB+key;
  765     glbBindingsDict->insert("go_forward", str.text());
  766 
  767     key = getApp()->reg().readStringEntry("KEYBINDINGS", "go_up", "Backspace");
  768     str = _("Go to parent folder")+TAB+key;
  769     glbBindingsDict->insert("go_up", str.text());
  770 
  771     key = getApp()->reg().readStringEntry("KEYBINDINGS", "go_home", "Ctrl-H");
  772     str = _("Go to home folder")+TAB+key;
  773     glbBindingsDict->insert("go_home", str.text());
  774 
  775     key = getApp()->reg().readStringEntry("KEYBINDINGS", "new_file", "Ctrl-N");
  776     str = _("Create new file")+TAB+key;
  777     glbBindingsDict->insert("new_file", str.text());
  778 
  779     key = getApp()->reg().readStringEntry("KEYBINDINGS", "new_folder", "F7");
  780     str = _("Create new folder")+TAB+key;
  781     glbBindingsDict->insert("new_folder", str.text());
  782 
  783     key = getApp()->reg().readStringEntry("KEYBINDINGS", "copy", "Ctrl-C");
  784     str = _("Copy to clipboard")+TAB+key;
  785     glbBindingsDict->insert("copy", str.text());
  786 
  787     key = getApp()->reg().readStringEntry("KEYBINDINGS", "cut", "Ctrl-X");
  788     str = _("Cut to clipboard")+TAB+key;
  789     glbBindingsDict->insert("cut", str.text());
  790 
  791     key = getApp()->reg().readStringEntry("KEYBINDINGS", "paste", "Ctrl-V");
  792     str = _("Paste from clipboard")+TAB+key;
  793     glbBindingsDict->insert("paste", str.text());
  794 
  795     key = getApp()->reg().readStringEntry("KEYBINDINGS", "big_icons", "F10");
  796     str = _("Big icon list")+TAB+key;
  797     glbBindingsDict->insert("big_icons", str.text());
  798 
  799     key = getApp()->reg().readStringEntry("KEYBINDINGS", "small_icons", "F11");
  800     str = _("Small icon list")+TAB+key;
  801     glbBindingsDict->insert("small_icons", str.text());
  802 
  803     key = getApp()->reg().readStringEntry("KEYBINDINGS", "detailed_file_list", "F12");
  804     str = _("Detailed file list")+TAB+key;
  805     glbBindingsDict->insert("detailed_file_list", str.text());
  806 
  807     key = getApp()->reg().readStringEntry("KEYBINDINGS", "open", "Ctrl-O");
  808     str = _("Open file")+TAB+key;
  809     glbBindingsDict->insert("open", str.text());
  810 
  811     key = getApp()->reg().readStringEntry("KEYBINDINGS", "quit", "Ctrl-Q");
  812     str = _("Quit application")+TAB+key;
  813     glbBindingsDict->insert("quit", str.text());
  814 
  815     key = getApp()->reg().readStringEntry("KEYBINDINGS", "select_all", "Ctrl-A");
  816     str = _("Select all")+TAB+key;
  817     glbBindingsDict->insert("select_all", str.text());
  818 
  819     key = getApp()->reg().readStringEntry("KEYBINDINGS", "deselect_all", "Ctrl-Z");
  820     str = _("Deselect all")+TAB+key;
  821     glbBindingsDict->insert("deselect_all", str.text());
  822 
  823     key = getApp()->reg().readStringEntry("KEYBINDINGS", "invert_selection", "Ctrl-I");
  824     str = _("Invert selection")+TAB+key;
  825     glbBindingsDict->insert("invert_selection", str.text());
  826 
  827     key = getApp()->reg().readStringEntry("KEYBINDINGS", "help", "F1");
  828     str = _("Display help")+TAB+key;
  829     glbBindingsDict->insert("help", str.text());
  830 
  831     key = getApp()->reg().readStringEntry("KEYBINDINGS", "hidden_files", "Ctrl-F6");
  832     str = _("Toggle display hidden files")+TAB+key;
  833     glbBindingsDict->insert("hidden_files", str.text());
  834 
  835     key = getApp()->reg().readStringEntry("KEYBINDINGS", "thumbnails", "Ctrl-F7");
  836     str = _("Toggle display thumbnails")+TAB+key;
  837     glbBindingsDict->insert("thumbnails", str.text());
  838 
  839     key = getApp()->reg().readStringEntry("KEYBINDINGS", "go_work", "Shift-F2");
  840     str = _("Go to working folder")+TAB+key;
  841     glbBindingsDict->insert("go_work", str.text());
  842 
  843     key = getApp()->reg().readStringEntry("KEYBINDINGS", "close", "Ctrl-W");
  844     str = _("Close window")+TAB+key;
  845     glbBindingsDict->insert("close", str.text());
  846 
  847     key = getApp()->reg().readStringEntry("KEYBINDINGS", "print", "Ctrl-P");
  848     str = _("Print file")+TAB+key;
  849     glbBindingsDict->insert("print", str.text());
  850 
  851     key = getApp()->reg().readStringEntry("KEYBINDINGS", "search", "Ctrl-F");
  852     str = _("Search")+TAB+key;
  853     glbBindingsDict->insert("search", str.text());
  854 
  855     key = getApp()->reg().readStringEntry("KEYBINDINGS", "search_prev", "Ctrl-Shift-G");
  856     str = _("Search previous")+TAB+key;
  857     glbBindingsDict->insert("search_prev", str.text());
  858 
  859     key = getApp()->reg().readStringEntry("KEYBINDINGS", "search_next", "Ctrl-G");
  860     str = _("Search next")+TAB+key;
  861     glbBindingsDict->insert("search_next", str.text());
  862 
  863     key = getApp()->reg().readStringEntry("KEYBINDINGS", "vert_panels", "Ctrl-Shift-F1");
  864     str = _("Vertical panels")+TAB+key;
  865     glbBindingsDict->insert("vert_panels", str.text());
  866 
  867     key = getApp()->reg().readStringEntry("KEYBINDINGS", "horz_panels", "Ctrl-Shift-F2");
  868     str = _("Horizontal panels")+TAB+key;
  869     glbBindingsDict->insert("horz_panels", str.text());
  870 
  871     // Key bindings specific to X File Explorer (Xfe)
  872     if (xfeBindingsDict == NULL)
  873     {
  874         xfeBindingsDict = new FXStringDict();
  875     }
  876 
  877     key = getApp()->reg().readStringEntry("KEYBINDINGS", "refresh", "Ctrl-R");
  878     str = _("Refresh panels")+TAB+key;
  879     xfeBindingsDict->insert("refresh", str.text());
  880 
  881     key = getApp()->reg().readStringEntry("KEYBINDINGS", "new_symlink", "Ctrl-J");
  882     str = _("Create new symbolic link")+TAB+key;
  883     xfeBindingsDict->insert("new_symlink", str.text());
  884 
  885     key = getApp()->reg().readStringEntry("KEYBINDINGS", "properties", "F9");
  886     str = _("File properties")+TAB+key;
  887     xfeBindingsDict->insert("properties", str.text());
  888 
  889     key = getApp()->reg().readStringEntry("KEYBINDINGS", "move_to_trash", "Del");
  890     str = _("Move files to trash")+TAB+key;
  891     xfeBindingsDict->insert("move_to_trash", str.text());
  892 
  893     key = getApp()->reg().readStringEntry("KEYBINDINGS", "restore_from_trash", "Alt-Del");
  894     str = _("Restore files from trash")+TAB+key;
  895     xfeBindingsDict->insert("restore_from_trash", str.text());
  896 
  897     key = getApp()->reg().readStringEntry("KEYBINDINGS", "delete", "Shift-Del");
  898     str = _("Delete files")+TAB+key;
  899     xfeBindingsDict->insert("delete", str.text());
  900 
  901     key = getApp()->reg().readStringEntry("KEYBINDINGS", "new_window", "F3");
  902     str = _("Create new window")+TAB+key;
  903     xfeBindingsDict->insert("new_window", str.text());
  904 
  905     key = getApp()->reg().readStringEntry("KEYBINDINGS", "new_root_window", "Shift-F3");
  906     str = _("Create new root window")+TAB+key;
  907     xfeBindingsDict->insert("new_root_window", str.text());
  908 
  909     key = getApp()->reg().readStringEntry("KEYBINDINGS", "execute_command", "Ctrl-E");
  910     str = _("Execute command")+TAB+key;
  911     xfeBindingsDict->insert("execute_command", str.text());
  912 
  913     key = getApp()->reg().readStringEntry("KEYBINDINGS", "terminal", "Ctrl-T");
  914     str = _("Launch terminal")+TAB+key;
  915     xfeBindingsDict->insert("terminal", str.text());
  916 
  917 #if defined(linux)
  918     key = getApp()->reg().readStringEntry("KEYBINDINGS", "mount", "Ctrl-M");
  919     str = _("Mount file system (Linux only)")+TAB+key;
  920     xfeBindingsDict->insert("mount", str.text());
  921 
  922     key = getApp()->reg().readStringEntry("KEYBINDINGS", "unmount", "Ctrl-U");
  923     str = _("Unmount file system (Linux only)")+TAB+key;
  924     xfeBindingsDict->insert("unmount", str.text());
  925 #endif
  926     key = getApp()->reg().readStringEntry("KEYBINDINGS", "one_panel", "Ctrl-F1");
  927     str = _("One panel mode")+TAB+key;
  928     xfeBindingsDict->insert("one_panel", str.text());
  929 
  930     key = getApp()->reg().readStringEntry("KEYBINDINGS", "tree_panel", "Ctrl-F2");
  931     str = _("Tree and panel mode")+TAB+key;
  932     xfeBindingsDict->insert("tree_panel", str.text());
  933 
  934     key = getApp()->reg().readStringEntry("KEYBINDINGS", "two_panels", "Ctrl-F3");
  935     str = _("Two panels mode")+TAB+key;
  936     xfeBindingsDict->insert("two_panels", str.text());
  937 
  938     key = getApp()->reg().readStringEntry("KEYBINDINGS", "tree_two_panels", "Ctrl-F4");
  939     str = _("Tree and two panels mode")+TAB+key;
  940     xfeBindingsDict->insert("tree_two_panels", str.text());
  941 
  942     key = getApp()->reg().readStringEntry("KEYBINDINGS", "clear_location", "Ctrl-L");
  943     str = _("Clear location bar")+TAB+key;
  944     xfeBindingsDict->insert("clear_location", str.text());
  945 
  946     key = getApp()->reg().readStringEntry("KEYBINDINGS", "rename", "F2");
  947     str = _("Rename file")+TAB+key;
  948     xfeBindingsDict->insert("rename", str.text());
  949 
  950     key = getApp()->reg().readStringEntry("KEYBINDINGS", "copy_to", "F5");
  951     str = _("Copy files to location")+TAB+key;
  952     xfeBindingsDict->insert("copy_to", str.text());
  953 
  954     key = getApp()->reg().readStringEntry("KEYBINDINGS", "move_to", "F6");
  955     str = _("Move files to location")+TAB+key;
  956     xfeBindingsDict->insert("move_to", str.text());
  957 
  958     key = getApp()->reg().readStringEntry("KEYBINDINGS", "symlink_to", "Ctrl-S");
  959     str = _("Symlink files to location")+TAB+key;
  960     xfeBindingsDict->insert("symlink_to", str.text());
  961 
  962     key = getApp()->reg().readStringEntry("KEYBINDINGS", "add_bookmark", "Ctrl-B");
  963     str = _("Add bookmark")+TAB+key;
  964     xfeBindingsDict->insert("add_bookmark", str.text());
  965 
  966     key = getApp()->reg().readStringEntry("KEYBINDINGS", "synchronize_panels", "Ctrl-Y");
  967     str = _("Synchronize panels")+TAB+key;
  968     xfeBindingsDict->insert("synchronize_panels", str.text());
  969 
  970     key = getApp()->reg().readStringEntry("KEYBINDINGS", "switch_panels", "Ctrl-K");
  971     str = _("Switch panels")+TAB+key;
  972     xfeBindingsDict->insert("switch_panels", str.text());
  973 
  974     key = getApp()->reg().readStringEntry("KEYBINDINGS", "go_to_trash", "Ctrl-F8");
  975     str = _("Go to trash can")+TAB+key;
  976     xfeBindingsDict->insert("go_to_trash", str.text());
  977 
  978     key = getApp()->reg().readStringEntry("KEYBINDINGS", "empty_trash_can", "Ctrl-Del");
  979     str = _("Empty trash can")+TAB+key;
  980     xfeBindingsDict->insert("empty_trash_can", str.text());
  981 
  982     key = getApp()->reg().readStringEntry("KEYBINDINGS", "view", "Shift-F4");
  983     str = _("View")+TAB+key;
  984     xfeBindingsDict->insert("view", str.text());
  985 
  986     key = getApp()->reg().readStringEntry("KEYBINDINGS", "edit", "F4");
  987     str = _("Edit")+TAB+key;
  988     xfeBindingsDict->insert("edit", str.text());
  989 
  990     key = getApp()->reg().readStringEntry("KEYBINDINGS", "compare", "F8");
  991     str = _("Compare")+TAB+key;
  992     xfeBindingsDict->insert("compare", str.text());
  993 
  994     key = getApp()->reg().readStringEntry("KEYBINDINGS", "hidden_dirs", "Ctrl-F5");
  995     str = _("Toggle display hidden folders")+TAB+key;
  996     xfeBindingsDict->insert("hidden_dirs", str.text());
  997 
  998     key = getApp()->reg().readStringEntry("KEYBINDINGS", "filter", "Ctrl-D");
  999     str = _("Filter files")+TAB+key;
 1000     xfeBindingsDict->insert("filter", str.text());
 1001 
 1002 
 1003     // Key bindings specific to X File Image (Xfi)
 1004     if (xfiBindingsDict == NULL)
 1005     {
 1006         xfiBindingsDict = new FXStringDict();
 1007     }
 1008 
 1009     key = getApp()->reg().readStringEntry("KEYBINDINGS", "zoom_100", "Ctrl-I");
 1010     str = _("Zoom image to 100%")+TAB+key;
 1011     xfiBindingsDict->insert("zoom_100", str.text());
 1012 
 1013     key = getApp()->reg().readStringEntry("KEYBINDINGS", "zoom_win", "Ctrl-F");
 1014     str = _("Zoom to fit window")+TAB+key;
 1015     xfiBindingsDict->insert("zoom_win", str.text());
 1016 
 1017     key = getApp()->reg().readStringEntry("KEYBINDINGS", "rotate_left", "Ctrl-L");
 1018     str = _("Rotate image to left")+TAB+key;
 1019     xfiBindingsDict->insert("rotate_left", str.text());
 1020 
 1021     key = getApp()->reg().readStringEntry("KEYBINDINGS", "rotate_right", "Ctrl-R");
 1022     str = _("Rotate image to right")+TAB+key;
 1023     xfiBindingsDict->insert("rotate_right", str.text());
 1024 
 1025     key = getApp()->reg().readStringEntry("KEYBINDINGS", "mirror_horizontally", "Ctrl-Shift-H");
 1026     str = _("Mirror image horizontally")+TAB+key;
 1027     xfiBindingsDict->insert("mirror_horizontally", str.text());
 1028 
 1029     key = getApp()->reg().readStringEntry("KEYBINDINGS", "mirror_vertically", "Ctrl-Shift-V");
 1030     str = _("Mirror image vertically")+TAB+key;
 1031     xfiBindingsDict->insert("mirror_vertically", str.text());
 1032 
 1033     // Key bindings specific to X File Write (Xfw)
 1034     if (xfwBindingsDict == NULL)
 1035     {
 1036         xfwBindingsDict = new FXStringDict();
 1037     }
 1038 
 1039     key = getApp()->reg().readStringEntry("KEYBINDINGS", "new", "Ctrl-N");
 1040     str = _("Create new document")+TAB+key;
 1041     xfwBindingsDict->insert("new", str.text());
 1042 
 1043     key = getApp()->reg().readStringEntry("KEYBINDINGS", "save", "Ctrl-S");
 1044     str = _("Save changes to file")+TAB+key;
 1045     xfwBindingsDict->insert("save", str.text());
 1046 
 1047     key = getApp()->reg().readStringEntry("KEYBINDINGS", "goto_line", "Ctrl-L");
 1048     str = _("Goto line")+TAB+key;
 1049     xfwBindingsDict->insert("goto_line", str.text());
 1050 
 1051     key = getApp()->reg().readStringEntry("KEYBINDINGS", "undo", "Ctrl-Z");
 1052     str = _("Undo last change")+TAB+key;
 1053     xfwBindingsDict->insert("undo", str.text());
 1054 
 1055     key = getApp()->reg().readStringEntry("KEYBINDINGS", "redo", "Ctrl-Y");
 1056     str = _("Redo last change")+TAB+key;
 1057     xfwBindingsDict->insert("redo", str.text());
 1058 
 1059     key = getApp()->reg().readStringEntry("KEYBINDINGS", "replace", "Ctrl-R");
 1060     str = _("Replace string")+TAB+key;
 1061     xfwBindingsDict->insert("replace", str.text());
 1062 
 1063     key = getApp()->reg().readStringEntry("KEYBINDINGS", "word_wrap", "Ctrl-K");
 1064     str = _("Toggle word wrap mode")+TAB+key;
 1065     xfwBindingsDict->insert("word_wrap", str.text());
 1066 
 1067     key = getApp()->reg().readStringEntry("KEYBINDINGS", "line_numbers", "Ctrl-T");
 1068     str = _("Toggle line numbers mode")+TAB+key;
 1069     xfwBindingsDict->insert("line_numbers", str.text());
 1070 
 1071     key = getApp()->reg().readStringEntry("KEYBINDINGS", "lower_case", "Ctrl-U");
 1072     str = _("Toggle lower case mode")+TAB+key;
 1073     xfwBindingsDict->insert("lower_case", str.text());
 1074 
 1075     key = getApp()->reg().readStringEntry("KEYBINDINGS", "upper_case", "Ctrl-Shift-U");
 1076     str = _("Toggle upper case mode")+TAB+key;
 1077     xfwBindingsDict->insert("upper_case", str.text());
 1078 
 1079     // Display the key bindings dialog box
 1080     if (bindingsbox == NULL)
 1081     {
 1082         bindingsbox = new KeybindingsBox(this, glbBindingsDict, xfeBindingsDict, xfiBindingsDict, xfwBindingsDict);
 1083     }
 1084 
 1085     bindingsbox->execute(PLACEMENT_OWNER);
 1086 
 1087     return(1);
 1088 }
 1089 
 1090 
 1091 // Restore default key bindings
 1092 long PreferencesBox::onCmdRestoreKeyBindings(FXObject*, FXSelector, void*)
 1093 {
 1094     // Confirmation message
 1095     FXString   message = _("Do you really want to restore the default key bindings?\n\nAll your customizations will be lost!");
 1096     MessageBox box(this, _("Restore default key bindings"), message, keybindingsicon, BOX_OK_CANCEL|DECOR_TITLE|DECOR_BORDER);
 1097 
 1098     if (box.execute(PLACEMENT_CURSOR) != BOX_CLICKED_OK)
 1099     {
 1100         return(0);
 1101     }
 1102 
 1103     // Write default key bindings to the registry
 1104 
 1105     // Global key bindings
 1106     getApp()->reg().writeStringEntry("KEYBINDINGS", "go_back", "Ctrl-Backspace");
 1107     getApp()->reg().writeStringEntry("KEYBINDINGS", "go_forward", "Shift-Backspace");
 1108     getApp()->reg().writeStringEntry("KEYBINDINGS", "go_up", "Backspace");
 1109     getApp()->reg().writeStringEntry("KEYBINDINGS", "go_home", "Ctrl-H");
 1110     getApp()->reg().writeStringEntry("KEYBINDINGS", "new_file", "Ctrl-N");
 1111     getApp()->reg().writeStringEntry("KEYBINDINGS", "new_folder", "F7");
 1112     getApp()->reg().writeStringEntry("KEYBINDINGS", "copy", "Ctrl-C");
 1113     getApp()->reg().writeStringEntry("KEYBINDINGS", "cut", "Ctrl-X");
 1114     getApp()->reg().writeStringEntry("KEYBINDINGS", "paste", "Ctrl-V");
 1115     getApp()->reg().writeStringEntry("KEYBINDINGS", "big_icons", "F10");
 1116     getApp()->reg().writeStringEntry("KEYBINDINGS", "small_icons", "F11");
 1117     getApp()->reg().writeStringEntry("KEYBINDINGS", "detailed_file_list", "F12");
 1118     getApp()->reg().writeStringEntry("KEYBINDINGS", "open", "Ctrl-O");
 1119     getApp()->reg().writeStringEntry("KEYBINDINGS", "quit", "Ctrl-Q");
 1120     getApp()->reg().writeStringEntry("KEYBINDINGS", "select_all", "Ctrl-A");
 1121     getApp()->reg().writeStringEntry("KEYBINDINGS", "deselect_all", "Ctrl-Z");
 1122     getApp()->reg().writeStringEntry("KEYBINDINGS", "invert_selection", "Ctrl-I");
 1123     getApp()->reg().writeStringEntry("KEYBINDINGS", "help", "F1");
 1124     getApp()->reg().writeStringEntry("KEYBINDINGS", "hidden_files", "Ctrl-F6");
 1125     getApp()->reg().writeStringEntry("KEYBINDINGS", "thumbnails", "Ctrl-F7");
 1126     getApp()->reg().writeStringEntry("KEYBINDINGS", "go_work", "Shift-F2");
 1127     getApp()->reg().writeStringEntry("KEYBINDINGS", "close", "Ctrl-W");
 1128     getApp()->reg().writeStringEntry("KEYBINDINGS", "print", "Ctrl-P");
 1129     getApp()->reg().writeStringEntry("KEYBINDINGS", "search", "Ctrl-F");
 1130     getApp()->reg().writeStringEntry("KEYBINDINGS", "search_prev", "Ctrl-Shift-G");
 1131     getApp()->reg().writeStringEntry("KEYBINDINGS", "search_next", "Ctrl-G");
 1132     getApp()->reg().writeStringEntry("KEYBINDINGS", "vert_panels", "Ctrl-Shift-F1");
 1133     getApp()->reg().writeStringEntry("KEYBINDINGS", "horz_panels", "Ctrl-Shift-F2");
 1134 
 1135     // Key bindings specific to X File Explorer (Xfe)
 1136     getApp()->reg().writeStringEntry("KEYBINDINGS", "refresh", "Ctrl-R");
 1137     getApp()->reg().writeStringEntry("KEYBINDINGS", "new_symlink", "Ctrl-J");
 1138     getApp()->reg().writeStringEntry("KEYBINDINGS", "properties", "F9");
 1139     getApp()->reg().writeStringEntry("KEYBINDINGS", "move_to_trash", "Del");
 1140     getApp()->reg().writeStringEntry("KEYBINDINGS", "restore_from_trash", "Alt-Del");
 1141     getApp()->reg().writeStringEntry("KEYBINDINGS", "delete", "Shift-Del");
 1142     getApp()->reg().writeStringEntry("KEYBINDINGS", "new_window", "F3");
 1143     getApp()->reg().writeStringEntry("KEYBINDINGS", "new_root_window", "Shift-F3");
 1144     getApp()->reg().writeStringEntry("KEYBINDINGS", "execute_command", "Ctrl-E");
 1145     getApp()->reg().writeStringEntry("KEYBINDINGS", "terminal", "Ctrl-T");
 1146 #if defined(linux)
 1147     getApp()->reg().writeStringEntry("KEYBINDINGS", "mount", "Ctrl-M");
 1148     getApp()->reg().writeStringEntry("KEYBINDINGS", "unmount", "Ctrl-U");
 1149 #endif
 1150     getApp()->reg().writeStringEntry("KEYBINDINGS", "one_panel", "Ctrl-F1");
 1151     getApp()->reg().writeStringEntry("KEYBINDINGS", "tree_panel", "Ctrl-F2");
 1152     getApp()->reg().writeStringEntry("KEYBINDINGS", "two_panels", "Ctrl-F3");
 1153     getApp()->reg().writeStringEntry("KEYBINDINGS", "tree_two_panels", "Ctrl-F4");
 1154     getApp()->reg().writeStringEntry("KEYBINDINGS", "clear_location", "Ctrl-L");
 1155     getApp()->reg().writeStringEntry("KEYBINDINGS", "rename", "F2");
 1156     getApp()->reg().writeStringEntry("KEYBINDINGS", "copy_to", "F5");
 1157     getApp()->reg().writeStringEntry("KEYBINDINGS", "move_to", "F6");
 1158     getApp()->reg().writeStringEntry("KEYBINDINGS", "symlink_to", "Ctrl-S");
 1159     getApp()->reg().writeStringEntry("KEYBINDINGS", "add_bookmark", "Ctrl-B");
 1160     getApp()->reg().writeStringEntry("KEYBINDINGS", "synchronize_panels", "Ctrl-Y");
 1161     getApp()->reg().writeStringEntry("KEYBINDINGS", "switch_panels", "Ctrl-K");
 1162     getApp()->reg().writeStringEntry("KEYBINDINGS", "go_to_trash", "Ctrl-F8");
 1163     getApp()->reg().writeStringEntry("KEYBINDINGS", "empty_trash_can", "Ctrl-Del");
 1164     getApp()->reg().writeStringEntry("KEYBINDINGS", "view", "Shift-F4");
 1165     getApp()->reg().writeStringEntry("KEYBINDINGS", "edit", "F4");
 1166     getApp()->reg().writeStringEntry("KEYBINDINGS", "compare", "F8");
 1167     getApp()->reg().writeStringEntry("KEYBINDINGS", "hidden_dirs", "Ctrl-F5");
 1168     getApp()->reg().writeStringEntry("KEYBINDINGS", "filter", "Ctrl-D");
 1169 
 1170     // Key bindings specific to X File Image (Xfi)
 1171     getApp()->reg().writeStringEntry("KEYBINDINGS", "zoom_100", "Ctrl-I");
 1172     getApp()->reg().writeStringEntry("KEYBINDINGS", "zoom_win", "Ctrl-F");
 1173     getApp()->reg().writeStringEntry("KEYBINDINGS", "rotate_left", "Ctrl-L");
 1174     getApp()->reg().writeStringEntry("KEYBINDINGS", "rotate_right", "Ctrl-R");
 1175     getApp()->reg().writeStringEntry("KEYBINDINGS", "mirror_horizontally", "Ctrl-Shift-H");
 1176     getApp()->reg().writeStringEntry("KEYBINDINGS", "mirror_vertically", "Ctrl-Shift-V");
 1177 
 1178     // Key bindings specific to X File Write (Xfw)
 1179     getApp()->reg().writeStringEntry("KEYBINDINGS", "new", "Ctrl-N");
 1180     getApp()->reg().writeStringEntry("KEYBINDINGS", "save", "Ctrl-S");
 1181     getApp()->reg().writeStringEntry("KEYBINDINGS", "goto_line", "Ctrl-L");
 1182     getApp()->reg().writeStringEntry("KEYBINDINGS", "undo", "Ctrl-Z");
 1183     getApp()->reg().writeStringEntry("KEYBINDINGS", "redo", "Ctrl-Y");
 1184     getApp()->reg().writeStringEntry("KEYBINDINGS", "replace", "Ctrl-R");
 1185     getApp()->reg().writeStringEntry("KEYBINDINGS", "word_wrap", "Ctrl-K");
 1186     getApp()->reg().writeStringEntry("KEYBINDINGS", "line_numbers", "Ctrl-T");
 1187     getApp()->reg().writeStringEntry("KEYBINDINGS", "lower_case", "Ctrl-U");
 1188     getApp()->reg().writeStringEntry("KEYBINDINGS", "upper_case", "Ctrl-Shift-U");
 1189 
 1190     // Finally, update the registry
 1191     getApp()->reg().write();
 1192 
 1193     // Ask the user if he wants to restart Xfe
 1194     if (BOX_CLICKED_CANCEL != MessageBox::question(this, BOX_OK_CANCEL, _("Restart"), _("Key bindings will be changed after restart.\nRestart X File Explorer now?")))
 1195     {
 1196         mainWindow->handle(this, FXSEL(SEL_COMMAND, XFileExplorer::ID_RESTART), NULL);
 1197     }
 1198 
 1199     return(1);
 1200 }
 1201 
 1202 
 1203 long PreferencesBox::onCmdAccept(FXObject* o, FXSelector s, void* p)
 1204 {
 1205     FXbool restart_theme = false;
 1206     FXbool restart_smoothscroll = false;
 1207     FXbool restart_scrollbarsize = false;
 1208     FXbool restart_pathlink = false;
 1209     FXbool restart_controls = false;
 1210     FXbool restart_normalfont = false;
 1211     FXbool restart_textfont = false;
 1212 
 1213     if (iconpath->getText() == "")
 1214     {
 1215         iconpath->setText(oldiconpath);
 1216     }
 1217 
 1218     // Icon path has changed
 1219     if (oldiconpath != iconpath->getText())
 1220     {
 1221         getApp()->reg().writeStringEntry("SETTINGS", "iconpath", iconpath->getText().text());
 1222         getApp()->reg().write();
 1223         restart_theme = true;
 1224     }
 1225 
 1226     // Normal font has changed
 1227     if (oldnormalfont != normalfont->getText())
 1228     {
 1229         getApp()->reg().writeStringEntry("SETTINGS", "font", normalfont->getText().text());
 1230         getApp()->reg().write();
 1231         restart_normalfont = true;
 1232     }
 1233 
 1234     // Text font has changed
 1235     if (oldtextfont != textfont->getText())
 1236     {
 1237         getApp()->reg().writeStringEntry("SETTINGS", "textfont", textfont->getText().text());
 1238         getApp()->reg().write();
 1239         restart_textfont = true;
 1240     }
 1241 
 1242     // Note: code below is for compatibility with pre 1.40 Xfe versions
 1243     // To be removed in the future!
 1244 
 1245     // Text viewer has changed
 1246     if (oldtxtviewer != txtviewer->getText())
 1247     {
 1248         // Update the txtviewer string
 1249         FXString newtxtviewer = txtviewer->getText().text();
 1250         getApp()->reg().writeStringEntry("PROGS", "txtviewer", newtxtviewer.text());
 1251 
 1252         // Update each filetype where the old txtviewer was used
 1253         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1254         FileDict*     assoc = new FileDict(getApp());
 1255 
 1256         FXString key, value, newvalue;
 1257         FXString strtmp, open, view, edit, command;
 1258         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1259         {
 1260             // Read key and value of each filetype
 1261             key = strdict->key(i);
 1262             value = strdict->data(i);
 1263 
 1264             // Replace the old txtviewer string with the new one
 1265             if (value.contains(oldtxtviewer))
 1266             {
 1267                 // Obtain the open, view, edit and command strings
 1268                 strtmp = value.before(';', 1);
 1269                 command = value.after(';', 1);
 1270                 open = strtmp.section(',', 0);
 1271                 view = strtmp.section(',', 1);
 1272                 edit = strtmp.section(',', 2);
 1273 
 1274                 // Replace only the view string, if needed
 1275                 if (view == oldtxtviewer)
 1276                 {
 1277                     //view=newtxtviewer;
 1278                     view = "<txtviewer>";
 1279                 }
 1280 
 1281                 // Replace with the new value
 1282                 value = open + "," + view + "," + edit + ";" + command;
 1283                 assoc->replace(key.text(), value.text());
 1284             }
 1285         }
 1286     }
 1287 
 1288     // Text editor has changed
 1289     if (oldtxteditor != txteditor->getText())
 1290     {
 1291         // Update the txteditor string
 1292         FXString newtxteditor = txteditor->getText().text();
 1293         getApp()->reg().writeStringEntry("PROGS", "txteditor", newtxteditor.text());
 1294 
 1295         // Note: code below is for compatibility with pre 1.40 Xfe versions
 1296         // To be removed in the future!
 1297 
 1298         // Update each filetype where the old txteditor was used
 1299         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1300         FileDict*     assoc = new FileDict(getApp());
 1301 
 1302         FXString key, value, newvalue;
 1303         FXString strtmp, open, view, edit, command;
 1304         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1305         {
 1306             // Read key and value of each filetype
 1307             key = strdict->key(i);
 1308             value = strdict->data(i);
 1309 
 1310             // Replace the old txteditor string with the new one
 1311             if (value.contains(oldtxteditor))
 1312             {
 1313                 // Obtain the open, view, edit and command strings
 1314                 strtmp = value.before(';', 1);
 1315                 command = value.after(';', 1);
 1316                 open = strtmp.section(',', 0);
 1317                 view = strtmp.section(',', 1);
 1318                 edit = strtmp.section(',', 2);
 1319 
 1320                 // Replace only the open and edit strings, if needed
 1321                 if (open == oldtxteditor)
 1322                 {
 1323                     //open=newtxteditor;
 1324                     open = "<txteditor>";
 1325                 }
 1326                 if (edit == oldtxteditor)
 1327                 {
 1328                     //edit=newtxteditor;
 1329                     edit = "<txteditor>";
 1330                 }
 1331 
 1332                 // Replace with the new value
 1333                 value = open + "," + view + "," + edit + ";" + command;
 1334                 assoc->replace(key.text(), value.text());
 1335             }
 1336         }
 1337     }
 1338 
 1339     // File comparator has changed
 1340     if (oldfilecomparator != filecomparator->getText())
 1341     {
 1342         // Update the filecomparator string
 1343         FXString newfilecomparator = filecomparator->getText().text();
 1344         getApp()->reg().writeStringEntry("PROGS", "filecomparator", newfilecomparator.text());
 1345     }
 1346 
 1347     // Image editor has changed
 1348     if (oldimgeditor != imgeditor->getText())
 1349     {
 1350         // Update the imgeditor string
 1351         FXString newimgeditor = imgeditor->getText().text();
 1352         getApp()->reg().writeStringEntry("PROGS", "imgeditor", newimgeditor.text());
 1353 
 1354         // Note: code below is for compatibility with pre 1.40 Xfe versions
 1355         // To be removed in the future!
 1356 
 1357         // Update each filetype where the old imgeditor was used
 1358         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1359         FileDict*     assoc = new FileDict(getApp());
 1360 
 1361         FXString key, value, newvalue;
 1362         FXString strtmp, open, view, edit, command;
 1363         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1364         {
 1365             // Read key and value of each filetype
 1366             key = strdict->key(i);
 1367             value = strdict->data(i);
 1368 
 1369             // Replace the old imgeditor string with the new one
 1370             if (value.contains(oldimgeditor))
 1371             {
 1372                 // Obtain the open, view, edit and command strings
 1373                 strtmp = value.before(';', 1);
 1374                 command = value.after(';', 1);
 1375                 open = strtmp.section(',', 0);
 1376                 view = strtmp.section(',', 1);
 1377                 edit = strtmp.section(',', 2);
 1378 
 1379                 // Replace only the open and edit strings, if needed
 1380                 if (open == oldimgeditor)
 1381                 {
 1382                     //open=newimgeditor;
 1383                     open = "<imgeditor>";
 1384                 }
 1385                 if (edit == oldimgeditor)
 1386                 {
 1387                     //edit=newimgeditor;
 1388                     edit = "<imgeditor>";
 1389                 }
 1390 
 1391                 // Replace with the new value
 1392                 value = open + "," + view + "," + edit + ";" + command;
 1393                 assoc->replace(key.text(), value.text());
 1394             }
 1395         }
 1396     }
 1397 
 1398     // Image viewer has changed
 1399     if (oldimgviewer != imgviewer->getText())
 1400     {
 1401         // Update the imgviewer string
 1402         FXString newimgviewer = imgviewer->getText().text();
 1403         getApp()->reg().writeStringEntry("PROGS", "imgviewer", newimgviewer.text());
 1404 
 1405         // Note: code below is for compatibility with pre 1.40 Xfe versions
 1406         // To be removed in the future!
 1407 
 1408         // Update each filetype where the old imgviewer was used
 1409         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1410         FileDict*     assoc = new FileDict(getApp());
 1411 
 1412         FXString key, value, newvalue;
 1413         FXString strtmp, open, view, edit, command;
 1414         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1415         {
 1416             // Read key and value of each filetype
 1417             key = strdict->key(i);
 1418             value = strdict->data(i);
 1419 
 1420             // Replace the old imgviewer string with the new one
 1421             if (value.contains(oldimgviewer))
 1422             {
 1423                 // Obtain the open, view, edit and command strings
 1424                 strtmp = value.before(';', 1);
 1425                 command = value.after(';', 1);
 1426                 open = strtmp.section(',', 0);
 1427                 view = strtmp.section(',', 1);
 1428                 edit = strtmp.section(',', 2);
 1429 
 1430                 // Replace the open and view string, if needed
 1431                 if (open == oldimgviewer)
 1432                 {
 1433                     //open=newimgviewer;
 1434                     open = "<imgviewer>";
 1435                 }
 1436                 if (view == oldimgviewer)
 1437                 {
 1438                     //view=newimgviewer;
 1439                     view = "<imgviewer>";
 1440                 }
 1441 
 1442                 // Replace with the new value
 1443                 value = open + "," + view + "," + edit + ";" + command;
 1444                 assoc->replace(key.text(), value.text());
 1445             }
 1446         }
 1447     }
 1448 
 1449     // Archiver has changed
 1450     if (oldarchiver != archiver->getText())
 1451     {
 1452         // Update the archiver string
 1453         FXString newarchiver = archiver->getText().text();
 1454         getApp()->reg().writeStringEntry("PROGS", "archiver", newarchiver.text());
 1455 
 1456         // Note: code below is for compatibility with pre 1.40 Xfe versions
 1457         // To be removed in the future!
 1458 
 1459         // Update each filetype where the old archiver was used
 1460         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1461         FileDict*     assoc = new FileDict(getApp());
 1462 
 1463         FXString key, value, newvalue;
 1464         FXString strtmp, open, view, edit, command;
 1465         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1466         {
 1467             // Read key and value of each filetype
 1468             key = strdict->key(i);
 1469             value = strdict->data(i);
 1470 
 1471             // Replace the old archiver string with the new one
 1472             if (value.contains(oldarchiver))
 1473             {
 1474                 // Obtain the open, view, edit and command strings
 1475                 strtmp = value.before(';', 1);
 1476                 command = value.after(';', 1);
 1477                 open = strtmp.section(',', 0);
 1478                 view = strtmp.section(',', 1);
 1479                 edit = strtmp.section(',', 2);
 1480 
 1481                 // Replace the open, view and edit strings, if needed
 1482                 if (open == oldarchiver)
 1483                 {
 1484                     //open=newarchiver;
 1485                     open = "<archiver>";
 1486                 }
 1487                 if (view == oldarchiver)
 1488                 {
 1489                     //view=newarchiver;
 1490                     view = "<archiver>";
 1491                 }
 1492                 if (edit == oldarchiver)
 1493                 {
 1494                     //edit=newarchiver;
 1495                     edit = "<archiver>";
 1496                 }
 1497 
 1498                 // Replace with the new value
 1499                 value = open + "," + view + "," + edit + ";" + command;
 1500                 assoc->replace(key.text(), value.text());
 1501             }
 1502         }
 1503     }
 1504 
 1505     // PDF viewer has changed
 1506     if (oldpdfviewer != pdfviewer->getText())
 1507     {
 1508         // Update the PDF viewer string
 1509         FXString newpdfviewer = pdfviewer->getText().text();
 1510         getApp()->reg().writeStringEntry("PROGS", "pdfviewer", newpdfviewer.text());
 1511 
 1512         // Note: code below is for compatibility with pre 1.40 Xfe versions
 1513         // To be removed in the future!
 1514 
 1515         // Update each filetype where the old PDF viewer was used
 1516         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1517         FileDict*     assoc = new FileDict(getApp());
 1518 
 1519         FXString key, value, newvalue;
 1520         FXString strtmp, open, view, edit, command;
 1521         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1522         {
 1523             // Read key and value of each filetype
 1524             key = strdict->key(i);
 1525             value = strdict->data(i);
 1526 
 1527             // Replace the old PDF viewer string with the new one
 1528             if (value.contains(oldpdfviewer))
 1529             {
 1530                 // Obtain the open, view, edit and command strings
 1531                 strtmp = value.before(';', 1);
 1532                 command = value.after(';', 1);
 1533                 open = strtmp.section(',', 0);
 1534                 view = strtmp.section(',', 1);
 1535                 edit = strtmp.section(',', 2);
 1536 
 1537                 // Replace the open, view and edit strings, if needed
 1538                 if (open == oldpdfviewer)
 1539                 {
 1540                     //open=newpdfviewer;
 1541                     open = "<pdfviewer>";
 1542                 }
 1543                 if (view == oldpdfviewer)
 1544                 {
 1545                     //view=newpdfviewer;
 1546                     view = "<pdfviewer>";
 1547                 }
 1548 
 1549                 // Replace with the new value
 1550                 value = open + "," + view + "," + edit + ";" + command;
 1551                 assoc->replace(key.text(), value.text());
 1552             }
 1553         }
 1554     }
 1555 
 1556     // Audio player has changed
 1557     if (oldaudioplayer != audioplayer->getText())
 1558     {
 1559         // Update the audio player string
 1560         FXString newaudioplayer = audioplayer->getText().text();
 1561         getApp()->reg().writeStringEntry("PROGS", "audioplayer", newaudioplayer.text());
 1562 
 1563         // Note: code below is for compatibility with pre 1.40 Xfe versions
 1564         // To be removed in the future!
 1565 
 1566         // Update each filetype where the old audio player was used
 1567         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1568         FileDict*     assoc = new FileDict(getApp());
 1569 
 1570         FXString key, value, newvalue;
 1571         FXString strtmp, open, view, edit, command;
 1572         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1573         {
 1574             // Read key and value of each filetype
 1575             key = strdict->key(i);
 1576             value = strdict->data(i);
 1577 
 1578             // Replace the old audio player string with the new one
 1579             if (value.contains(oldaudioplayer))
 1580             {
 1581                 // Obtain the open, view, edit and command strings
 1582                 strtmp = value.before(';', 1);
 1583                 command = value.after(';', 1);
 1584                 open = strtmp.section(',', 0);
 1585                 view = strtmp.section(',', 1);
 1586                 edit = strtmp.section(',', 2);
 1587 
 1588                 // Replace the open, view and edit strings, if needed
 1589                 if (open == oldaudioplayer)
 1590                 {
 1591                     //open=newaudioplayer;
 1592                     open = "<audioplayer>";
 1593                 }
 1594                 if (view == oldaudioplayer)
 1595                 {
 1596                     //view=newaudioplayer;
 1597                     view = "<audioplayer>";
 1598                 }
 1599 
 1600                 // Replace with the new value
 1601                 value = open + "," + view + "," + edit + ";" + command;
 1602                 assoc->replace(key.text(), value.text());
 1603             }
 1604         }
 1605     }
 1606 
 1607     // Video player has changed
 1608     if (oldvideoplayer != videoplayer->getText())
 1609     {
 1610         // Update the video player string
 1611         FXString newvideoplayer = videoplayer->getText().text();
 1612         getApp()->reg().writeStringEntry("PROGS", "videoplayer", newvideoplayer.text());
 1613 
 1614         // Note: code below is for compatibility with pre 1.40 Xfe versions
 1615         // To be removed in the future!
 1616 
 1617         // Update each filetype where the old video player was used
 1618         FXStringDict* strdict = getApp()->reg().find("FILETYPES");
 1619         FileDict*     assoc = new FileDict(getApp());
 1620 
 1621         FXString key, value, newvalue;
 1622         FXString strtmp, open, view, edit, command;
 1623         for (int i = strdict->first(); i < strdict->size(); i = strdict->next(i))
 1624         {
 1625             // Read key and value of each filetype
 1626             key = strdict->key(i);
 1627             value = strdict->data(i);
 1628 
 1629             // Replace the old video player string with the new one
 1630             if (value.contains(oldvideoplayer))
 1631             {
 1632                 // Obtain the open, view, edit and command strings
 1633                 strtmp = value.before(';', 1);
 1634                 command = value.after(';', 1);
 1635                 open = strtmp.section(',', 0);
 1636                 view = strtmp.section(',', 1);
 1637                 edit = strtmp.section(',', 2);
 1638 
 1639                 // Replace the open, view and edit strings, if needed
 1640                 if (open == oldvideoplayer)
 1641                 {
 1642                     //open=newvideoplayer;
 1643                     open = "<videoplayer>";
 1644                 }
 1645                 if (view == oldvideoplayer)
 1646                 {
 1647                     //view=newvideoplayer;
 1648                     view = "<videoplayer>";
 1649                 }
 1650 
 1651                 // Replace with the new value
 1652                 value = open + "," + view + "," + edit + ";" + command;
 1653                 assoc->replace(key.text(), value.text());
 1654             }
 1655         }
 1656     }
 1657 
 1658     // Terminal has changed
 1659     if (oldxterm != xterm->getText())
 1660     {
 1661         getApp()->reg().writeStringEntry("PROGS", "xterm", xterm->getText().text());
 1662     }
 1663 
 1664     // Mount command has changed
 1665     if (oldmountcmd != mountcmd->getText())
 1666     {
 1667         getApp()->reg().writeStringEntry("PROGS", "mount", mountcmd->getText().text());
 1668     }
 1669 
 1670     // Unmount command has changed
 1671     if (oldumountcmd != umountcmd->getText())
 1672     {
 1673         getApp()->reg().writeStringEntry("PROGS", "unmount", umountcmd->getText().text());
 1674     }
 1675 
 1676 
 1677     getApp()->reg().writeUnsignedEntry("OPTIONS", "auto_save_layout", autosave->getCheck());
 1678     getApp()->reg().writeUnsignedEntry("SETTINGS", "save_win_pos", savewinpos->getCheck());
 1679     getApp()->reg().writeUnsignedEntry("OPTIONS", "use_trash_can", trashcan->getCheck());
 1680     getApp()->reg().writeUnsignedEntry("OPTIONS", "use_trash_bypass", trashbypass->getCheck());
 1681     getApp()->reg().writeUnsignedEntry("OPTIONS", "ask_before_copy", ask->getCheck());
 1682     getApp()->reg().writeUnsignedEntry("SETTINGS", "single_click", single_click);
 1683     getApp()->reg().writeStringEntry("SETTINGS", "time_format", timeformat->getText().text());
 1684     getApp()->reg().writeUnsignedEntry("OPTIONS", "confirm_trash", trashmv->getCheck());
 1685     getApp()->reg().writeUnsignedEntry("OPTIONS", "confirm_delete", del->getCheck());
 1686     getApp()->reg().writeUnsignedEntry("OPTIONS", "confirm_properties", properties->getCheck());
 1687     getApp()->reg().writeUnsignedEntry("OPTIONS", "confirm_delete_emptydir", del_emptydir->getCheck());
 1688     getApp()->reg().writeUnsignedEntry("OPTIONS", "confirm_overwrite", overwrite->getCheck());
 1689     getApp()->reg().writeUnsignedEntry("OPTIONS", "confirm_execute", exec->getCheck());
 1690     getApp()->reg().writeUnsignedEntry("OPTIONS", "confirm_drag_and_drop", dnd->getCheck());
 1691     getApp()->reg().writeUnsignedEntry("OPTIONS", "folder_warn", folder_warning->getCheck());
 1692     getApp()->reg().writeUnsignedEntry("OPTIONS", "preserve_date_warn", preserve_date_warning->getCheck());
 1693     getApp()->reg().writeUnsignedEntry("OPTIONS", "startdir_mode", startdirmode-ID_START_HOMEDIR);
 1694     getApp()->reg().writeUnsignedEntry("OPTIONS", "root_warn", root_warning->getCheck());
 1695     getApp()->reg().writeUnsignedEntry("OPTIONS", "root_mode", rootmode->getCheck());
 1696 #ifdef STARTUP_NOTIFICATION
 1697     getApp()->reg().writeUnsignedEntry("OPTIONS", "use_startup_notification", usesn->getCheck());
 1698 #endif
 1699 #if defined(linux)
 1700     getApp()->reg().writeUnsignedEntry("OPTIONS", "mount_warn", mount->getCheck());
 1701     getApp()->reg().writeUnsignedEntry("OPTIONS", "mount_messages", show_mount->getCheck());
 1702 #endif
 1703 
 1704     // Smooth scrolling
 1705     getApp()->reg().writeUnsignedEntry("SETTINGS", "smooth_scroll", scroll->getCheck());
 1706     if (scroll->getCheck() != smoothscroll_prev)
 1707     {
 1708         getApp()->reg().write();
 1709         restart_smoothscroll = true;
 1710     }
 1711 
 1712     // Scrollbar size
 1713     if (getApp()->getScrollBarSize() != scrollbarsize_prev)
 1714     {
 1715         getApp()->reg().write();
 1716         restart_scrollbarsize = true;
 1717     }
 1718 
 1719     // Control themes
 1720     getApp()->reg().writeUnsignedEntry("SETTINGS", "use_clearlooks", use_clearlooks);
 1721 
 1722     if (use_clearlooks != use_clearlooks_prev)
 1723     {
 1724         FXColor hilitecolor, shadowcolor;
 1725 
 1726         // Change control hilite and shadow colors when the control theme has changed
 1727         if (use_clearlooks) // clearlooks
 1728         {
 1729             hilitecolor = makeHiliteColorGradient(currTheme.color[0]);
 1730             shadowcolor = makeShadowColorGradient(currTheme.color[0]);
 1731         }
 1732         else // standard
 1733         {
 1734             hilitecolor = makeHiliteColor(currTheme.color[0]);
 1735             shadowcolor = makeShadowColor(currTheme.color[0]);
 1736         }
 1737         getApp()->reg().writeColorEntry("SETTINGS", "hilitecolor", hilitecolor);
 1738         getApp()->reg().writeColorEntry("SETTINGS", "shadowcolor", shadowcolor);
 1739 
 1740         getApp()->reg().write();
 1741         restart_controls = true;
 1742     }
 1743 
 1744     // Update some global options
 1745     if (diropen->getCheck() && fileopen->getCheck())
 1746     {
 1747         single_click = SINGLE_CLICK_DIR_FILE;
 1748     }
 1749     else if (diropen->getCheck() && !fileopen->getCheck())
 1750     {
 1751         single_click = SINGLE_CLICK_DIR;
 1752     }
 1753     else
 1754     {
 1755         single_click = SINGLE_CLICK_NONE;
 1756     }
 1757 
 1758     if (single_click == SINGLE_CLICK_DIR_FILE)
 1759     {
 1760         ((XFileExplorer*)mainWindow)->setDefaultCursor(getApp()->getDefaultCursor(DEF_HAND_CURSOR));
 1761     }
 1762     else
 1763     {
 1764         ((XFileExplorer*)mainWindow)->setDefaultCursor(getApp()->getDefaultCursor(DEF_ARROW_CURSOR));
 1765     }
 1766 
 1767     // Update the file tooltips flag
 1768     if (filetooltips->getCheck())
 1769     {
 1770         file_tooltips = true;
 1771     }
 1772     else
 1773     {
 1774         file_tooltips = false;
 1775     }
 1776     getApp()->reg().writeUnsignedEntry("SETTINGS", "file_tooltips", (FXuint)file_tooltips);
 1777 
 1778     // Update the relative resize flag
 1779     if (relativeresize->getCheck())
 1780     {
 1781         relative_resize = true;
 1782     }
 1783     else
 1784     {
 1785         relative_resize = false;
 1786     }
 1787     getApp()->reg().writeUnsignedEntry("SETTINGS", "relative_resize", (FXuint)relative_resize);
 1788 
 1789     // Update the display path linker flag
 1790     show_pathlink = showpathlink->getCheck();
 1791     getApp()->reg().writeUnsignedEntry("SETTINGS", "show_pathlinker", show_pathlink);
 1792     if (show_pathlink != show_pathlink_prev)
 1793     {
 1794         getApp()->reg().write();
 1795         restart_pathlink = true;
 1796     }
 1797 
 1798     // Theme has changed
 1799     if (currTheme != Themes[0])
 1800     {
 1801         getApp()->reg().writeColorEntry("SETTINGS", "basecolor", currTheme.color[0]);
 1802         getApp()->reg().writeColorEntry("SETTINGS", "bordercolor", currTheme.color[1]);
 1803         getApp()->reg().writeColorEntry("SETTINGS", "backcolor", currTheme.color[2]);
 1804         getApp()->reg().writeColorEntry("SETTINGS", "forecolor", currTheme.color[3]);
 1805         getApp()->reg().writeColorEntry("SETTINGS", "selbackcolor", currTheme.color[4]);
 1806         getApp()->reg().writeColorEntry("SETTINGS", "selforecolor", currTheme.color[5]);
 1807         getApp()->reg().writeColorEntry("SETTINGS", "listbackcolor", currTheme.color[6]);
 1808         getApp()->reg().writeColorEntry("SETTINGS", "listforecolor", currTheme.color[7]);
 1809         getApp()->reg().writeColorEntry("SETTINGS", "highlightcolor", currTheme.color[8]);
 1810         getApp()->reg().writeColorEntry("SETTINGS", "pbarcolor", currTheme.color[9]);
 1811         getApp()->reg().writeColorEntry("SETTINGS", "attentioncolor", currTheme.color[10]);
 1812         getApp()->reg().writeColorEntry("SETTINGS", "scrollbarcolor", currTheme.color[11]);
 1813 
 1814         // Control themes
 1815         FXColor hilitecolor, shadowcolor;
 1816 
 1817         // Change control hilite and shadow colors when the control theme has changed
 1818         if (use_clearlooks) // clearlooks
 1819         {
 1820             hilitecolor = makeHiliteColorGradient(currTheme.color[0]);
 1821             shadowcolor = makeShadowColorGradient(currTheme.color[0]);
 1822         }
 1823         else // standard
 1824         {
 1825             hilitecolor = makeHiliteColor(currTheme.color[0]);
 1826             shadowcolor = makeShadowColor(currTheme.color[0]);
 1827         }
 1828         getApp()->reg().writeColorEntry("SETTINGS", "hilitecolor", hilitecolor);
 1829         getApp()->reg().writeColorEntry("SETTINGS", "shadowcolor", shadowcolor);
 1830 
 1831         getApp()->reg().write();
 1832         restart_theme = true;
 1833     }
 1834 
 1835     // Restart application if necessary
 1836     if (restart_smoothscroll | restart_scrollbarsize|restart_theme|restart_pathlink|restart_controls|restart_normalfont|restart_textfont)
 1837     {
 1838         if (BOX_CLICKED_CANCEL != MessageBox::question(this, BOX_OK_CANCEL, _("Restart"), _("Preferences will be changed after restart.\nRestart X File Explorer now?")))
 1839         {
 1840             mainWindow->handle(this, FXSEL(SEL_COMMAND, XFileExplorer::ID_RESTART), NULL);
 1841         }
 1842     }
 1843 
 1844     // Finally, update the registry
 1845     getApp()->reg().write();
 1846 
 1847     // Refresh panels
 1848     mainWindow->handle(this, FXSEL(SEL_COMMAND, XFileExplorer::ID_REFRESH), NULL);
 1849 
 1850     DialogBox::onCmdAccept(o, s, p);
 1851     return(1);
 1852 }
 1853 
 1854 
 1855 long PreferencesBox::onCmdCancel(FXObject* o, FXSelector s, void* p)
 1856 {
 1857     // Reset preferences to their previous values
 1858 
 1859     // First tab - Options
 1860     trashcan->setCheck(trashcan_prev);
 1861     trashbypass->setCheck(trashbypass_prev);
 1862     autosave->setCheck(autosave_prev);
 1863     savewinpos->setCheck(savewinpos_prev);
 1864     diropen->setCheck(diropen_prev);
 1865     fileopen->setCheck(fileopen_prev);
 1866     filetooltips->setCheck(filetooltips_prev);
 1867     relativeresize->setCheck(relativeresize_prev);
 1868     showpathlink->setCheck(show_pathlink_prev);
 1869     getApp()->setWheelLines(wheellines_prev);
 1870     getApp()->setScrollBarSize(scrollbarsize_prev);
 1871     use_sudo = use_sudo_prev;
 1872     getApp()->reg().writeUnsignedEntry("OPTIONS", "use_sudo", use_sudo);
 1873     scroll->setCheck(smoothscroll_prev);
 1874     rootmode->setCheck(rootmode_prev);
 1875     timeformat->setText(oldtimeformat);
 1876     startdirmode = oldstartdirmode;
 1877 
 1878 #ifdef STARTUP_NOTIFICATION
 1879     usesn->setCheck(usesn_prev);
 1880 #endif
 1881 
 1882     // Second tab - Dialogs
 1883     ask->setCheck(ask_prev);
 1884     dnd->setCheck(dnd_prev);
 1885     trashmv->setCheck(trashmv_prev);
 1886     del->setCheck(del_prev);
 1887     properties->setCheck(properties_prev);
 1888     del_emptydir->setCheck(del_emptydir_prev);
 1889     overwrite->setCheck(overwrite_prev);
 1890     exec->setCheck(exec_prev);
 1891 #if defined(linux)
 1892     mount->setCheck(mount_prev);
 1893     show_mount->setCheck(show_mount_prev);
 1894 #endif
 1895     folder_warning->setCheck(folder_warning_prev);
 1896     preserve_date_warning->setCheck(preserve_date_warning_prev);
 1897     root_warning->setCheck(root_warning_prev);
 1898 
 1899     // Third tab - Programs
 1900     txtviewer->setText(oldtxtviewer);
 1901     txteditor->setText(oldtxteditor);
 1902     filecomparator->setText(oldfilecomparator);
 1903     imgeditor->setText(oldimgeditor);
 1904     imgviewer->setText(oldimgviewer);
 1905     archiver->setText(oldarchiver);
 1906     pdfviewer->setText(oldpdfviewer);
 1907     audioplayer->setText(oldaudioplayer);
 1908     videoplayer->setText(oldvideoplayer);
 1909     xterm->setText(oldxterm);
 1910     mountcmd->setText(oldmountcmd);
 1911     umountcmd->setText(oldumountcmd);
 1912 
 1913     // Fourth tab - Visual
 1914     themesList->setCurrentItem(themelist_prev);
 1915     currTheme = currTheme_prev;
 1916     iconpath->setText(oldiconpath);
 1917     use_clearlooks = use_clearlooks_prev;
 1918     getApp()->reg().writeUnsignedEntry("SETTINGS", "use_clearlooks", use_clearlooks);
 1919 
 1920     // Fifth tab - Fonts
 1921     normalfont->setText(oldnormalfont);
 1922     textfont->setText(oldtextfont);
 1923 
 1924     // Finally, update the registry (really necessary?)
 1925     getApp()->reg().write();
 1926 
 1927     DialogBox::onCmdCancel(o, s, p);
 1928     return(1);
 1929 }
 1930 
 1931 
 1932 // Execute dialog box modally
 1933 FXuint PreferencesBox::execute(FXuint placement)
 1934 {
 1935     // Save current preferences to restore them if cancel is pressed
 1936 
 1937     // First tab - Options
 1938     trashcan_prev = trashcan->getCheck();
 1939     trashbypass_prev = trashbypass->getCheck();
 1940     autosave_prev = autosave->getCheck();
 1941     savewinpos_prev = savewinpos->getCheck();
 1942     diropen_prev = diropen->getCheck();
 1943     fileopen_prev = fileopen->getCheck();
 1944     filetooltips_prev = filetooltips->getCheck();
 1945     relativeresize_prev = relativeresize->getCheck();
 1946     show_pathlink_prev = showpathlink->getCheck();
 1947     wheellines_prev = getApp()->getWheelLines();
 1948     scrollbarsize_prev = getApp()->getScrollBarSize();
 1949     use_sudo_prev = use_sudo;
 1950     smoothscroll_prev = scroll->getCheck();
 1951     rootmode_prev = rootmode->getCheck();
 1952 #ifdef STARTUP_NOTIFICATION
 1953     usesn_prev = usesn->getCheck();
 1954 #endif
 1955 
 1956     // Second tab - Dialogs
 1957     ask_prev = ask->getCheck();
 1958     dnd_prev = dnd->getCheck();
 1959     trashmv_prev = trashmv->getCheck();
 1960     del_prev = del->getCheck();
 1961     properties_prev = properties->getCheck();
 1962     del_emptydir_prev = del_emptydir->getCheck();
 1963     overwrite_prev = overwrite->getCheck();
 1964     exec_prev = exec->getCheck();
 1965 #if defined(linux)
 1966     mount_prev = mount->getCheck();
 1967     show_mount_prev = show_mount->getCheck();
 1968 #endif
 1969     folder_warning_prev = folder_warning->getCheck();
 1970     preserve_date_warning_prev = preserve_date_warning->getCheck();
 1971     root_warning_prev = root_warning->getCheck();
 1972 
 1973     // Third tab - Programs
 1974     oldtxtviewer = txtviewer->getText();
 1975     oldtxteditor = txteditor->getText();
 1976     oldfilecomparator = filecomparator->getText();
 1977     oldimgeditor = imgeditor->getText();
 1978     oldimgviewer = imgviewer->getText();
 1979     oldarchiver = archiver->getText();
 1980     oldpdfviewer = pdfviewer->getText();
 1981     oldaudioplayer = audioplayer->getText();
 1982     oldvideoplayer = videoplayer->getText();
 1983     oldxterm = xterm->getText();
 1984     oldmountcmd = mountcmd->getText();
 1985     oldumountcmd = umountcmd->getText();
 1986 
 1987     // Fourth tab - Visual
 1988     themelist_prev = themesList->getCurrentItem();
 1989     currTheme_prev = currTheme;
 1990     oldiconpath = iconpath->getText();
 1991     use_clearlooks_prev = use_clearlooks;
 1992 
 1993     // Fifth tab - Fonts
 1994     oldnormalfont = normalfont->getText();
 1995     oldtextfont = textfont->getText();
 1996 
 1997     create();
 1998     show(placement);
 1999     getApp()->refresh();
 2000     return(getApp()->runModalFor(this));
 2001 }
 2002 
 2003 
 2004 // Update buttons related to the trash can option item
 2005 long PreferencesBox::onUpdTrash(FXObject* o, FXSelector, void*)
 2006 {
 2007     if (trashcan->getCheck())
 2008     {
 2009         o->handle(this, FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE), NULL);
 2010     }
 2011     else
 2012     {
 2013         o->handle(this, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), NULL);
 2014     }
 2015     return(1);
 2016 }
 2017 
 2018 
 2019 // Update the confirm delete empty directories option item
 2020 long PreferencesBox::onUpdConfirmDelEmptyDir(FXObject* o, FXSelector, void*)
 2021 {
 2022     if (del->getCheck())
 2023     {
 2024         o->handle(this, FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE), NULL);
 2025     }
 2026     else
 2027     {
 2028         o->handle(this, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), NULL);
 2029     }
 2030     return(1);
 2031 }
 2032 
 2033 
 2034 // Set root mode
 2035 long PreferencesBox::onCmdSuMode(FXObject*, FXSelector sel, void*)
 2036 {
 2037     if (FXSELID(sel) == ID_SU_CMD)
 2038     {
 2039         use_sudo = false;
 2040     }
 2041 
 2042     else if (FXSELID(sel) == ID_SUDO_CMD)
 2043     {
 2044         use_sudo = true;
 2045     }
 2046 
 2047     getApp()->reg().writeUnsignedEntry("OPTIONS", "use_sudo", use_sudo);
 2048     getApp()->reg().write();
 2049 
 2050     return(1);
 2051 }
 2052 
 2053 
 2054 // Update root mode radio button
 2055 long PreferencesBox::onUpdSuMode(FXObject* sender, FXSelector sel, void*)
 2056 {
 2057     if (!rootmode->getCheck())
 2058     {
 2059         sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), NULL);
 2060     }
 2061     else
 2062     {
 2063         if (getuid()) // Simple user
 2064         {
 2065             sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), NULL);
 2066         }
 2067 
 2068         FXSelector updatemessage = FXSEL(SEL_COMMAND, ID_UNCHECK);
 2069 
 2070         if (FXSELID(sel) == ID_SU_CMD)
 2071         {
 2072             if (use_sudo)
 2073             {
 2074                 updatemessage = FXSEL(SEL_COMMAND, ID_UNCHECK);
 2075             }
 2076             else
 2077             {
 2078                 updatemessage = FXSEL(SEL_COMMAND, ID_CHECK);
 2079             }
 2080         }
 2081         else if (FXSELID(sel) == ID_SUDO_CMD)
 2082         {
 2083             if (use_sudo)
 2084             {
 2085                 updatemessage = FXSEL(SEL_COMMAND, ID_CHECK);
 2086             }
 2087             else
 2088             {
 2089                 updatemessage = FXSEL(SEL_COMMAND, ID_UNCHECK);
 2090             }
 2091         }
 2092         sender->handle(this, updatemessage, NULL);
 2093     }
 2094     return(1);
 2095 }
 2096 
 2097 
 2098 // Set root mode
 2099 long PreferencesBox::onCmdControls(FXObject*, FXSelector sel, void*)
 2100 {
 2101     if (FXSELID(sel) == ID_STANDARD_CONTROLS)
 2102     {
 2103         use_clearlooks = false;
 2104     }
 2105 
 2106     else if (FXSELID(sel) == ID_CLEARLOOKS_CONTROLS)
 2107     {
 2108         use_clearlooks = true;
 2109     }
 2110 
 2111     getApp()->reg().writeUnsignedEntry("SETTINGS", "use_clearlooks", use_clearlooks);
 2112     getApp()->reg().write();
 2113 
 2114     return(1);
 2115 }
 2116 
 2117 
 2118 // Update root mode radio button
 2119 long PreferencesBox::onUpdControls(FXObject* sender, FXSelector sel, void*)
 2120 {
 2121     FXSelector updatemessage = FXSEL(SEL_COMMAND, ID_UNCHECK);
 2122 
 2123     if (FXSELID(sel) == ID_STANDARD_CONTROLS)
 2124     {
 2125         if (use_clearlooks)
 2126         {
 2127             updatemessage = FXSEL(SEL_COMMAND, ID_UNCHECK);
 2128         }
 2129         else
 2130         {
 2131             updatemessage = FXSEL(SEL_COMMAND, ID_CHECK);
 2132         }
 2133     }
 2134     else if (FXSELID(sel) == ID_CLEARLOOKS_CONTROLS)
 2135     {
 2136         if (use_clearlooks)
 2137         {
 2138             updatemessage = FXSEL(SEL_COMMAND, ID_CHECK);
 2139         }
 2140         else
 2141         {
 2142             updatemessage = FXSEL(SEL_COMMAND, ID_UNCHECK);
 2143         }
 2144     }
 2145     sender->handle(this, updatemessage, NULL);
 2146     return(1);
 2147 }
 2148 
 2149 
 2150 // Set scroll wheel lines (Mathew Robertson <mathew@optushome.com.au>)
 2151 long PreferencesBox::onCmdWheelAdjust(FXObject* sender, FXSelector, void*)
 2152 {
 2153     FXuint value;
 2154 
 2155     sender->handle(this, FXSEL(SEL_COMMAND, ID_GETINTVALUE), (void*)&value);
 2156     getApp()->setWheelLines(value);
 2157     getApp()->reg().write();
 2158     return(1);
 2159 }
 2160 
 2161 
 2162 // Update the wheel lines button
 2163 long PreferencesBox::onUpdWheelAdjust(FXObject* sender, FXSelector, void*)
 2164 {
 2165     FXuint value = getApp()->getWheelLines();
 2166 
 2167     sender->handle(this, FXSEL(SEL_COMMAND, ID_SETINTVALUE), (void*)&value);
 2168     return(1);
 2169 }
 2170 
 2171 
 2172 // Set scrollbar size
 2173 long PreferencesBox::onCmdScrollBarSize(FXObject* sender, FXSelector, void*)
 2174 {
 2175     FXuint value;
 2176 
 2177     sender->handle(this, FXSEL(SEL_COMMAND, ID_GETINTVALUE), (void*)&value);
 2178     getApp()->setScrollBarSize(value);
 2179     getApp()->reg().write();
 2180     return(1);
 2181 }
 2182 
 2183 
 2184 // Update the scrollbar size button
 2185 long PreferencesBox::onUpdScrollBarSize(FXObject* sender, FXSelector, void*)
 2186 {
 2187     FXuint value = getApp()->getScrollBarSize();
 2188 
 2189     sender->handle(this, FXSEL(SEL_COMMAND, ID_SETINTVALUE), (void*)&value);
 2190     return(1);
 2191 }
 2192 
 2193 
 2194 // Update single click file open button
 2195 long PreferencesBox::onUpdSingleClickFileopen(FXObject* o, FXSelector, void*)
 2196 {
 2197     if (diropen->getCheck())
 2198     {
 2199         o->handle(this, FXSEL(SEL_COMMAND, FXWindow::ID_ENABLE), NULL);
 2200     }
 2201     else
 2202     {
 2203         fileopen->setCheck(false);
 2204         o->handle(this, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), NULL);
 2205     }
 2206     return(1);
 2207 }
 2208 
 2209 
 2210 // Start directory mode
 2211 long PreferencesBox::onCmdStartDir(FXObject*, FXSelector sel, void*)
 2212 {
 2213     startdirmode = FXSELID(sel);
 2214     //~ getApp()->reg().writeUnsignedEntry("OPTIONS","startdir_mode",startdirmode-ID_START_HOMEDIR);
 2215     //~ getApp()->reg().write();
 2216 
 2217     return(1);
 2218 }
 2219 
 2220 
 2221 // Update start directory mode radio buttons
 2222 long PreferencesBox::onUpdStartDir(FXObject* sender, FXSelector sel, void*)
 2223 {
 2224     sender->handle(this, (FXSELID(sel) == startdirmode) ? FXSEL(SEL_COMMAND, ID_CHECK) : FXSEL(SEL_COMMAND, ID_UNCHECK), (void*)&startdirmode);
 2225     return(1);
 2226 }