"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/MessageBox.cpp" between
xfe-1.41.tar.gz and xfe-1.42.tar.gz

About: Xfe (X File Explorer) is a file manager and browser (using the FOX toolkit).

MessageBox.cpp  (xfe-1.41):MessageBox.cpp  (xfe-1.42)
skipping to change at line 143 skipping to change at line 143
getApp()->stopModal(this, BOX_CLICKED_YES+(FXSELID(sel)-ID_CLICKED_YES)); getApp()->stopModal(this, BOX_CLICKED_YES+(FXSELID(sel)-ID_CLICKED_YES));
hide(); hide();
// Wait cursor // Wait cursor
getApp()->beginWaitCursor(); getApp()->beginWaitCursor();
// Obtain preferred root mode // Obtain preferred root mode
FXbool use_sudo = getApp()->reg().readUnsignedEntry("OPTIONS", "use_sudo", F ALSE); FXbool use_sudo = getApp()->reg().readUnsignedEntry("OPTIONS", "use_sudo", F ALSE);
// Use sudo or su to launch xfe as root // Use sudo or su to launch xfe as root
FXString title, sucmd; FXString title, sucmd, command;
if (use_sudo) if (use_sudo)
{ {
title = _("Enter the user password:"); title = _("Enter the user password:");
sucmd = SUDOCMD; sucmd = SUDOCMD;
} }
else else
{ {
title = _("Enter the root password:"); title = _("Enter the root password:");
sucmd = SUCMD; sucmd = SUCMD;
} }
// Use appropriate background and foreground colors for Xvt // Get text font
char color[64]; FXString fontspec = getApp()->reg().readStringEntry("SETTINGS", "textfont",
fxnamefromcolor(color, getApp()->getBackColor()); "Courier,100,normal,regular");
FXString bg = " -bg "; if (fontspec.empty())
bg = bg + color; {
fxnamefromcolor(color, getApp()->getForeColor()); command = "st -t " + ::quote(title) + sucmd;
FXString fg = " -fg "; }
fg = fg + color + " "; else
{
// Command string FXchar fontsize[32];
FXString command = "xvt -title " + ::quote(title) + bg + fg + sucmd; FXFont* font = new FXFont(getApp(), fontspec);
font->create();
snprintf(fontsize, sizeof(fontsize), "%d",(int)(font->getSize()/1
0)); // Size is in deci-points, thus divide by 10
command = "st -t " + ::quote(title) + " -f '" + (font->getFamily(
)).text() + ":pixelsize=" + fontsize + "'" + sucmd;
}
// Execute su or sudo command in an internal Xvt terminal // Execute su or sudo command in an internal st terminal
int status = runinxvt(command); int status = runst(command);
// If error // If error
if (status < 0) if (status < 0)
{ {
MessageBox::error(getApp(), BOX_OK, _("Error"), _("An error has occurred !")); MessageBox::error(getApp(), BOX_OK, _("Error"), _("An error has occurred !"));
getApp()->endWaitCursor(); getApp()->endWaitCursor();
return(0); return(0);
} }
// Wait cursor // Wait cursor
 End of changes. 3 change blocks. 
14 lines changed or deleted 20 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS