"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/normalops.cc" between
worker-4.7.0.tar.bz2 and worker-4.8.0.tar.bz2

About: Worker is a file manager for the X Window System with the classical two panel interface.

normalops.cc  (worker-4.7.0.tar.bz2):normalops.cc  (worker-4.8.0.tar.bz2)
/* normalops.cc /* normalops.cc
* This file belongs to Worker, a file manager for UN*X/X11. * This file belongs to Worker, a file manager for UN*X/X11.
* Copyright (C) 2001-2020 Ralf Hoffmann. * Copyright (C) 2001-2021 Ralf Hoffmann.
* You can contact me at: ralf@boomerangsworld.de * You can contact me at: ralf@boomerangsworld.de
* or http://www.boomerangsworld.de/worker * or http://www.boomerangsworld.de/worker
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 350 skipping to change at line 350
if ( instance_counter == 0 ) { if ( instance_counter == 0 ) {
closeHistory(); closeHistory();
} }
} }
FilterSelectOp *FilterSelectOp::duplicate() const FilterSelectOp *FilterSelectOp::duplicate() const
{ {
FilterSelectOp *ta=new FilterSelectOp(); FilterSelectOp *ta=new FilterSelectOp();
ta->m_filter = m_filter; ta->m_filter = m_filter;
ta->m_auto_filter = m_auto_filter; ta->m_auto_filter = m_auto_filter;
ta->setImmediateFilterApply( immediateFilterApply() );
return ta; return ta;
} }
int FilterSelectOp::run( WPUContext *wpu, ActionMessage *msg ) int FilterSelectOp::run( WPUContext *wpu, ActionMessage *msg )
{ {
Lister *l1; Lister *l1;
ListerMode *lm1; ListerMode *lm1;
if ( msg->mode == msg->AM_MODE_DNDACTION ) { if ( msg->mode == msg->AM_MODE_DNDACTION ) {
return 0; return 0;
skipping to change at line 383 skipping to change at line 384
std::list< NM_specialsourceExt > extfilelist; std::list< NM_specialsourceExt > extfilelist;
std::string entry_basename; std::string entry_basename;
lm1->getSelFiles( extfilelist, ListerMode::LM_GETFILES_ONLYACTIVE ); lm1->getSelFiles( extfilelist, ListerMode::LM_GETFILES_ONLYACTIVE );
for ( auto &ss1 : extfilelist ) { for ( auto &ss1 : extfilelist ) {
if ( ss1.entry() ) { if ( ss1.entry() ) {
entry_basename = ss1.entry()->name; entry_basename = ss1.entry()->name;
} }
} }
if ( requestfilter( entry_basename ) == true ) { if ( m_immediate_filter_apply ) {
vdm->selectByFilter( m_filter, m_mode == FILTER_SELECT ? true : fals
e );
} else if ( requestfilter( entry_basename ) == true ) {
vdm->selectByFilter( current_filter, m_mode == FILTER_SELECT ? true : false ); vdm->selectByFilter( current_filter, m_mode == FILTER_SELECT ? true : false );
} }
} else { } else {
lm1->not_supported(); lm1->not_supported();
} }
return 0; return 0;
} }
const char *FilterSelectOp::getDescription() const char *FilterSelectOp::getDescription()
skipping to change at line 418 skipping to change at line 421
AContainer::ACONT_MINW + AContainer::ACONT_MINW +
AContainer::ACONT_MAXH + AContainer::ACONT_MAXH +
AContainer::ACONT_MAXW; AContainer::ACONT_MAXW;
tstr=(char*)_allocsafe(strlen(catalog.getLocale(293))+strlen(getDescription()) +1); tstr=(char*)_allocsafe(strlen(catalog.getLocale(293))+strlen(getDescription()) +1);
sprintf(tstr,catalog.getLocale(293),getDescription()); sprintf(tstr,catalog.getLocale(293),getDescription());
win = new AWindow( aguix, 10, 10, 10, 10, tstr, AWindow::AWINDOW_DIALOG ); win = new AWindow( aguix, 10, 10, 10, 10, tstr, AWindow::AWINDOW_DIALOG );
win->create(); win->create();
_freesafe(tstr); _freesafe(tstr);
AContainer *ac1 = win->setContainer( new AContainer( win, 1, 3 ), true ); AContainer *ac1 = win->setContainer( new AContainer( win, 1, 4 ), true );
ac1->setMinSpace( 5 ); ac1->setMinSpace( 5 );
ac1->setMaxSpace( 5 ); ac1->setMaxSpace( 5 );
auto autofilter_cb = ac1->addWidget( new ChooseButton( aguix, 0, 0, m_auto_fil ter, auto autofilter_cb = ac1->addWidget( new ChooseButton( aguix, 0, 0, m_auto_fil ter,
catalog.getLocale( 1370 ), LABEL_RIGHT, 0 ), catalog.getLocale( 1370 ), LABEL_RIGHT, 0 ),
0, 0, AContainer::CO_INCWNR ); 0, 0, AContainer::CO_INCWNR );
AContainer *ac1_1 = ac1->add( new AContainer( win, 2, 1 ), 0, 1 ); AContainer *ac1_1 = ac1->add( new AContainer( win, 2, 1 ), 0, 1 );
ac1_1->setMinSpace( 5 ); ac1_1->setMinSpace( 5 );
ac1_1->setMaxSpace( 5 ); ac1_1->setMaxSpace( 5 );
ac1_1->setBorderWidth( 0 ); ac1_1->setBorderWidth( 0 );
ac1_1->add( new Text( aguix, 0, 0, catalog.getLocale( 349 ) ), 0, 0, cfix ); ac1_1->add( new Text( aguix, 0, 0, catalog.getLocale( 349 ) ), 0, 0, cfix );
sg = (StringGadget*)ac1_1->add( new StringGadget( aguix, 0, 0, 100, sg = (StringGadget*)ac1_1->add( new StringGadget( aguix, 0, 0, 100,
m_filter.c_str(), m_filter.c_str(),
0 ), 1, 0, cincw ); 0 ), 1, 0, cincw );
AContainer *ac1_2 = ac1->add( new AContainer( win, 2, 1 ), 0, 2 ); auto immediate_cb = ac1->addWidget( new ChooseButton( aguix, 0, 0, m_immediate
_filter_apply,
catalog.getLocale( 1384
), LABEL_RIGHT, 0 ),
0, 2, AContainer::CO_INCWNR );
AContainer *ac1_2 = ac1->add( new AContainer( win, 2, 1 ), 0, 3 );
ac1_2->setMinSpace( 5 ); ac1_2->setMinSpace( 5 );
ac1_2->setMaxSpace( -1 ); ac1_2->setMaxSpace( -1 );
ac1_2->setBorderWidth( 0 ); ac1_2->setBorderWidth( 0 );
Button *okb =(Button*)ac1_2->add( new Button( aguix, Button *okb =(Button*)ac1_2->add( new Button( aguix,
0, 0,
0, 0,
catalog.getLocale( 11 ), catalog.getLocale( 11 ),
0 ), 0, 0, cfix ); 0 ), 0, 0, cfix );
Button *cancelb = (Button*)ac1_2->add( new Button( aguix, Button *cancelb = (Button*)ac1_2->add( new Button( aguix,
0, 0,
skipping to change at line 476 skipping to change at line 483
if(msg!=NULL) { if(msg!=NULL) {
if(msg->type==AG_CLOSEWINDOW) { if(msg->type==AG_CLOSEWINDOW) {
if(msg->closewindow.window==win->getWindow()) ende=-1; if(msg->closewindow.window==win->getWindow()) ende=-1;
} else if(msg->type==AG_BUTTONCLICKED) { } else if(msg->type==AG_BUTTONCLICKED) {
if(msg->button.button==okb) ende=1; if(msg->button.button==okb) ende=1;
else if(msg->button.button==cancelb) ende=-1; else if(msg->button.button==cancelb) ende=-1;
} else if ( msg->type == AG_CHOOSECLICKED ) { } else if ( msg->type == AG_CHOOSECLICKED ) {
if ( msg->choose.button == autofilter_cb ) { if ( msg->choose.button == autofilter_cb ) {
if ( autofilter_cb->getState() == true ) { if ( autofilter_cb->getState() == true ) {
ac1_1->hide(); ac1_1->hide();
immediate_cb->setState( false );
} else { } else {
ac1_1->show(); ac1_1->show();
} }
} else if ( msg->choose.button == immediate_cb ) {
if ( immediate_cb->getState() == true ) {
autofilter_cb->setState( false );
ac1_1->show();
}
} }
} }
aguix->ReplyMessage(msg); aguix->ReplyMessage(msg);
} }
} }
if(ende==1) { if(ende==1) {
m_filter = sg->getText(); m_filter = sg->getText();
m_auto_filter = autofilter_cb->getState(); m_auto_filter = autofilter_cb->getState();
m_immediate_filter_apply = immediate_cb->getState();
} }
delete win; delete win;
return (ende==1)?0:1; return (ende==1)?0:1;
} }
bool FilterSelectOp::save(Datei *fh) bool FilterSelectOp::save(Datei *fh)
{ {
if ( fh == NULL ) return false; if ( fh == NULL ) return false;
fh->configPutPairString( "filter", m_filter.c_str() ); fh->configPutPairString( "filter", m_filter.c_str() );
if ( m_auto_filter == false ) { if ( m_auto_filter == false ) {
fh->configPutPairBool( "autofilter", m_auto_filter ); fh->configPutPairBool( "autofilter", m_auto_filter );
} }
if ( immediateFilterApply() == true ) {
fh->configPutPairBool( "immediatefilterapply", immediateFilterApply() );
}
return true; return true;
} }
void FilterSelectOp::setMode( filter_select_mode nm ) void FilterSelectOp::setMode( filter_select_mode nm )
{ {
m_mode = nm; m_mode = nm;
} }
bool FilterSelectOp::requestfilter( const std::string &fullname ) bool FilterSelectOp::requestfilter( const std::string &fullname )
{ {
skipping to change at line 767 skipping to change at line 786
{ {
if ( str == NULL ) return; if ( str == NULL ) return;
m_filter = str; m_filter = str;
} }
void FilterSelectOp::setAutoFilter( const bool nv ) void FilterSelectOp::setAutoFilter( const bool nv )
{ {
m_auto_filter = nv; m_auto_filter = nv;
} }
void FilterSelectOp::setImmediateFilterApply( bool nv )
{
m_immediate_filter_apply = nv;
}
bool FilterSelectOp::immediateFilterApply() const
{
return m_immediate_filter_apply;
}
/************* /*************
Ende FilterSelectOp Ende FilterSelectOp
**************/ **************/
/****** /******
FilterUnSelectOp FilterUnSelectOp
*******/ *******/
const char *FilterUnSelectOp::name="FilterUnSelectOp"; const char *FilterUnSelectOp::name="FilterUnSelectOp";
skipping to change at line 802 skipping to change at line 831
FilterUnSelectOp::~FilterUnSelectOp() FilterUnSelectOp::~FilterUnSelectOp()
{ {
} }
FilterUnSelectOp *FilterUnSelectOp::duplicate() const FilterUnSelectOp *FilterUnSelectOp::duplicate() const
{ {
FilterUnSelectOp *ta=new FilterUnSelectOp(); FilterUnSelectOp *ta=new FilterUnSelectOp();
ta->m_filter = m_filter; ta->m_filter = m_filter;
ta->m_auto_filter = m_auto_filter; ta->m_auto_filter = m_auto_filter;
ta->setImmediateFilterApply( immediateFilterApply() );
return ta; return ta;
} }
const char *FilterUnSelectOp::getDescription() const char *FilterUnSelectOp::getDescription()
{ {
return catalog.getLocale(1263); return catalog.getLocale(1263);
} }
/************* /*************
Ende FilterUnSelectOp Ende FilterUnSelectOp
 End of changes. 11 change blocks. 
4 lines changed or deleted 37 lines changed or added

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