"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/SearchPanel.cpp" between
xfe-1.43.1.tar.gz and xfe-1.43.2.tar.gz

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

SearchPanel.cpp  (xfe-1.43.1):SearchPanel.cpp  (xfe-1.43.2)
skipping to change at line 61 skipping to change at line 61
// Button separator margins and height // Button separator margins and height
#define SEP_SPACE 5 #define SEP_SPACE 5
#define SEP_HEIGHT 20 #define SEP_HEIGHT 20
// Map // Map
FXDEFMAP(SearchPanel) SearchPanelMap[] = FXDEFMAP(SearchPanel) SearchPanelMap[] =
{ {
FXMAPFUNC(SEL_CLIPBOARD_LOST, 0, SearchPanel::onClipboardLost), FXMAPFUNC(SEL_CLIPBOARD_LOST, 0, SearchPanel::onClipboardLost),
FXMAPFUNC(SEL_CLIPBOARD_GAINED, 0, SearchPanel::onClipboardGained), FXMAPFUNC(SEL_CLIPBOARD_GAINED, 0, SearchPanel::onClipboardGained),
FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, SearchPanel::onClipboardRequest), FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, SearchPanel::onClipboardRequest),
FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, SearchPanel::onClipboardRequest),
FXMAPFUNC(SEL_CLICKED, SearchPanel::ID_FILELIST, SearchPanel::onCmdItemClick ed), FXMAPFUNC(SEL_CLICKED, SearchPanel::ID_FILELIST, SearchPanel::onCmdItemClick ed),
FXMAPFUNC(SEL_DOUBLECLICKED, SearchPanel::ID_FILELIST, SearchPanel::onCmdIte mDoubleClicked), FXMAPFUNC(SEL_DOUBLECLICKED, SearchPanel::ID_FILELIST, SearchPanel::onCmdIte mDoubleClicked),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_GOTO_PARENTDIR, SearchPanel::onCmdGot oParentdir), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_GOTO_PARENTDIR, SearchPanel::onCmdGot oParentdir),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_OPEN_WITH, SearchPanel::onCmdOpenWith ), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_OPEN_WITH, SearchPanel::onCmdOpenWith ),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_OPEN, SearchPanel::onCmdOpen), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_OPEN, SearchPanel::onCmdOpen),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_VIEW, SearchPanel::onCmdEdit), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_VIEW, SearchPanel::onCmdEdit),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_EDIT, SearchPanel::onCmdEdit), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_EDIT, SearchPanel::onCmdEdit),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_COMPARE, SearchPanel::onCmdCompare), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_COMPARE, SearchPanel::onCmdCompare),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_REFRESH, SearchPanel::onCmdRefresh), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_REFRESH, SearchPanel::onCmdRefresh),
FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_PROPERTIES, SearchPanel::onCmdPropert ies), FXMAPFUNC(SEL_COMMAND, SearchPanel::ID_PROPERTIES, SearchPanel::onCmdPropert ies),
skipping to change at line 263 skipping to change at line 262
progs["<imgviewer>"] = IMGVIEWER; progs["<imgviewer>"] = IMGVIEWER;
progs["<imgeditor>"] = IMGEDITOR; progs["<imgeditor>"] = IMGEDITOR;
progs["<pdfviewer>"] = PDFVIEWER; progs["<pdfviewer>"] = PDFVIEWER;
progs["<audioplayer>"] = AUDIOPLAYER; progs["<audioplayer>"] = AUDIOPLAYER;
progs["<videoplayer>"] = VIDEOPLAYER; progs["<videoplayer>"] = VIDEOPLAYER;
progs["<archiver>"] = ARCHIVER; progs["<archiver>"] = ARCHIVER;
// Class variable initializations // Class variable initializations
ctrlflag = false; ctrlflag = false;
shiftf10 = false; shiftf10 = false;
urilistType = 0;
xfelistType = 0;
kdelistType = 0;
utf8Type = 0;
} }
// Create window // Create window
void SearchPanel::create() void SearchPanel::create()
{ {
// Register standard uri-list type
urilistType = getApp()->registerDragType("text/uri-list");
// Register special uri-list type used for Gnome, XFCE and Xfe // Register special uri-list type used for Gnome, XFCE and Xfe
xfelistType = getApp()->registerDragType("x-special/gnome-copied-files"); xfelistType = getApp()->registerDragType("x-special/gnome-copied-files");
// Register special uri-list type used for KDE // Register special uri-list type used for KDE
kdelistType = getApp()->registerDragType("application/x-kde-cutselection"); kdelistType = getApp()->registerDragType("application/x-kde-cutselection");
// Register standard UTF-8 text type used for file dialogs
utf8Type = getApp()->registerDragType("UTF8_STRING");
FXVerticalFrame::create(); FXVerticalFrame::create();
// Single click navigation // Single click navigation
if (single_click == SINGLE_CLICK_DIR_FILE) if (single_click == SINGLE_CLICK_DIR_FILE)
{ {
list->setDefaultCursor(getApp()->getDefaultCursor(DEF_HAND_CURSOR)); list->setDefaultCursor(getApp()->getDefaultCursor(DEF_HAND_CURSOR));
} }
else else
{ {
list->setDefaultCursor(getApp()->getDefaultCursor(DEF_ARROW_CURSOR)); list->setDefaultCursor(getApp()->getDefaultCursor(DEF_ARROW_CURSOR));
skipping to change at line 4089 skipping to change at line 4090
// Raise the Xfe window // Raise the Xfe window
((XFileExplorer*)mainWindow)->raise(); ((XFileExplorer*)mainWindow)->raise();
((XFileExplorer*)mainWindow)->setFocus(); ((XFileExplorer*)mainWindow)->setFocus();
return(1); return(1);
} }
// Clear file list and reset panel status // Clear file list and reset panel status
void SearchPanel::clearItems(void) void SearchPanel::clearItems(void)
{ {
status->setText(_("0 items")); status->setText(_("0 item"));
list->clearItems(); list->clearItems();
} }
// Update the status bar // Update the status bar
long SearchPanel::onUpdStatus(FXObject* sender, FXSelector, void*) long SearchPanel::onUpdStatus(FXObject* sender, FXSelector, void*)
{ {
// Update the status bar // Update the status bar
int item = -1; int item = -1;
FXString str, linkto; FXString str, linkto;
char size[64]; char size[64];
FXulong sz = 0; FXulong sz = 0;
FXString hsize = _("0 bytes"); FXString hsize = _("0 bytes");
FXString path = list->getDirectory(); FXString path = list->getDirectory();
int num = list->getNumSelectedItems(); int num = list->getNumSelectedItems();
item = list->getCurrentItem(); item = list->getCurrentItem();
if (num > 1) if (num > 1)
{ {
int nbdirs = 0;
for (int u = 0; u < list->getNumItems(); u++) for (int u = 0; u < list->getNumItems(); u++)
{ {
if (list->isItemSelected(u) && !list->isItemDirectory(u)) if (list->isItemSelected(u) && !list->isItemDirectory(u))
{ {
sz += list->getItemFileSize(u); sz += list->getItemFileSize(u);
#if __WORDSIZE == 64 #if __WORDSIZE == 64
snprintf(size, sizeof(size)-1, "%lu", sz); snprintf(size, sizeof(size)-1, "%lu", sz);
#else #else
snprintf(size, sizeof(size)-1, "%llu", sz); snprintf(size, sizeof(size)-1, "%llu", sz);
#endif #endif
hsize = ::hSize(size); hsize = ::hSize(size);
} }
if (list->isItemDirectory(u))
{
nbdirs++;
}
} }
str.format(_("%s in %s selected items"), hsize.text(), FXStringVal(num).
text()); // Don't count the '..' directory
if (nbdirs >= 1)
{
nbdirs--;
}
int nbfiles = num - nbdirs;
if (nbdirs <= 1 && nbfiles <= 1)
{
str.format(_("%s in %s selected items (%s folder, %s file)"), hsi
ze.text(), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbfi
les).text());
}
else if (nbdirs <=1 && nbfiles > 1)
{
str.format(_("%s in %s selected items (%s folder, %s files)"), hs
ize.text(), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbf
iles).text());
}
else if (nbdirs > 1 && nbfiles <= 1)
{
str.format(_("%s in %s selected items (%s folders, %s file)"), hs
ize.text(), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbf
iles).text());
}
else
{
str.format(_("%s in %s selected items (%s folders, %s files)"), h
size.text(), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nb
files).text());
}
} }
else else
{ {
// Nothing selected
if ((num == 0) || (item < 0)) if ((num == 0) || (item < 0))
{ {
num = list->getNumItems(); num = list->getNumItems();
if (num == 1) if (num == 1)
{ {
str = _("1 item"); str = _("1 item");
} }
else else
{ {
str = FXStringVal(num)+_(" items"); int nbdirs = 0;
for (int u = 0; u < num; u++)
{
if (list->isItemDirectory(u))
{
nbdirs++;
}
}
int nbfiles = num - nbdirs;
str.format(_("%s items (%s folders, %s files)"), FXString
Val(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbfiles).text());
if (nbdirs <= 1 && nbfiles <= 1)
{
str.format(_("%s items (%s folder, %s fil
e)"), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbfiles).
text());
}
else if (nbdirs <=1 && nbfiles > 1)
{
str.format(_("%s items (%s folder, %s fil
es)"), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbfiles)
.text());
}
else if (nbdirs > 1 && nbfiles <= 1)
{
str.format(_("%s items (%s folders, %s fi
le)"), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbfiles)
.text());
}
else
{
str.format(_("%s items (%s folders, %s fi
les)"), FXStringVal(num).text(), FXStringVal(nbdirs).text(), FXStringVal(nbfiles
).text());
}
} }
} }
else // num=1 else // num=1
{ {
FXString string = list->getItemText(item); FXString string = list->getItemText(item);
FXString name = string.section('\t', 0); FXString name = string.section('\t', 0);
FXString type = string.section('\t', 3); FXString type = string.section('\t', 3);
FXString date = string.section('\t', 5); FXString date = string.section('\t', 5);
FXString usr = string.section('\t', 6); FXString usr = string.section('\t', 6);
 End of changes. 10 change blocks. 
9 lines changed or deleted 82 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)