"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/pathjumpop.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.

pathjumpop.cc  (worker-4.7.0.tar.bz2):pathjumpop.cc  (worker-4.8.0.tar.bz2)
/* pathjumpop.cc /* pathjumpop.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) 2012-2019 Ralf Hoffmann. * Copyright (C) 2012-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 37 skipping to change at line 37
#include "worker_locale.h" #include "worker_locale.h"
#include "fileentry.hh" #include "fileentry.hh"
#include "argclass.hh" #include "argclass.hh"
#include "nwc_path.hh" #include "nwc_path.hh"
#include "virtualdirmode.hh" #include "virtualdirmode.hh"
#include "datei.h" #include "datei.h"
#include "aguix/awindow.h" #include "aguix/awindow.h"
#include "aguix/text.h" #include "aguix/text.h"
#include "aguix/button.h" #include "aguix/button.h"
#include "aguix/cyclebutton.h" #include "aguix/cyclebutton.h"
#include "aguix/choosebutton.h"
const char *PathJumpOp::name = "PathJumpOp"; const char *PathJumpOp::name = "PathJumpOp";
PathJumpOp::PathJumpOp() : FunctionProto() PathJumpOp::PathJumpOp() : FunctionProto()
{ {
m_category = FunctionProto::CAT_CURSOR; m_category = FunctionProto::CAT_CURSOR;
hasConfigure = true; hasConfigure = true;
} }
PathJumpOp::~PathJumpOp() PathJumpOp::~PathJumpOp()
{ {
} }
PathJumpOp *PathJumpOp::duplicate() const PathJumpOp *PathJumpOp::duplicate() const
{ {
PathJumpOp *ta = new PathJumpOp(); PathJumpOp *ta = new PathJumpOp();
ta->m_initial_tab = m_initial_tab; ta->m_initial_tab = m_initial_tab;
ta->m_display_mode = m_display_mode;
ta->m_include_all_data = m_include_all_data;
return ta; return ta;
} }
bool PathJumpOp::isName(const char *str) bool PathJumpOp::isName(const char *str)
{ {
if ( strcmp( str, name ) == 0 ) if ( strcmp( str, name ) == 0 )
return true; return true;
else else
return false; return false;
} }
skipping to change at line 112 skipping to change at line 115
ui.setCurrentBasename( basename ); ui.setCurrentBasename( basename );
} }
PathJumpUI::initial_tab_t show_tab = PathJumpUI::SHOW_BY_TIME; PathJumpUI::initial_tab_t show_tab = PathJumpUI::SHOW_BY_TIME;
if ( m_initial_tab == SHOW_BY_FILTER ) { if ( m_initial_tab == SHOW_BY_FILTER ) {
show_tab = PathJumpUI::SHOW_BY_FILTER; show_tab = PathJumpUI::SHOW_BY_FILTER;
} else if ( m_initial_tab == SHOW_BY_PROGRAM ) { } else if ( m_initial_tab == SHOW_BY_PROGRAM ) {
show_tab = PathJumpUI::SHOW_BY_PROGRAM; show_tab = PathJumpUI::SHOW_BY_PROGRAM;
} }
switch ( m_display_mode ) {
case SHOW_SUBDIRS:
ui.setEntryFilterMode( PathJumpUI::SHOW_ONLY_SUBDIRS );
break;
case SHOW_DIRECT_SUBDIRS:
ui.setEntryFilterMode( PathJumpUI::SHOW_ONLY_DIRECT_SUBDIRS );
break;
default:
ui.setEntryFilterMode( PathJumpUI::SHOW_ALL );
break;
}
ui.setShowAllData( m_include_all_data );
int res = ui.mainLoop( show_tab ); int res = ui.mainLoop( show_tab );
if ( res == 1 ) { if ( res == 1 ) {
bool stored = false; bool stored = false;
std::string sel_path = ui.getSelectedPath( stored ); std::string sel_path = ui.getSelectedPath( stored );
std::list< RefCount< ArgClass > > args; std::list< RefCount< ArgClass > > args;
if ( lm1 ) { if ( lm1 ) {
args.push_back( new StringArg( sel_path ) ); args.push_back( new StringArg( sel_path ) );
skipping to change at line 157 skipping to change at line 173
const char *PathJumpOp::getDescription() const char *PathJumpOp::getDescription()
{ {
return catalog.getLocale( 1301 ); return catalog.getLocale( 1301 );
} }
void PathJumpOp::setInitialTab( initial_tab_t v ) void PathJumpOp::setInitialTab( initial_tab_t v )
{ {
m_initial_tab = v; m_initial_tab = v;
} }
void PathJumpOp::setDisplayMode( display_mode_t v )
{
m_display_mode = v;
}
void PathJumpOp::setIncludeAllData( bool v )
{
m_include_all_data = v;
}
bool bool
PathJumpOp::save( Datei *fh ) PathJumpOp::save( Datei *fh )
{ {
if ( fh == NULL ) return false; if ( fh == NULL ) return false;
switch ( m_initial_tab ) { switch ( m_initial_tab ) {
case SHOW_BY_FILTER: case SHOW_BY_FILTER:
fh->configPutPair( "initialtab", "showbyfilter" ); fh->configPutPair( "initialtab", "showbyfilter" );
break; break;
case SHOW_BY_PROGRAM: case SHOW_BY_PROGRAM:
fh->configPutPair( "initialtab", "showbyprogram" ); fh->configPutPair( "initialtab", "showbyprogram" );
break; break;
default: default:
// don't save default value to be backward compatible // don't save default value to be backward compatible
break; break;
} }
switch ( m_display_mode ) {
case SHOW_SUBDIRS:
fh->configPutPair( "displaymode", "showsubdirs" );
break;
case SHOW_DIRECT_SUBDIRS:
fh->configPutPair( "displaymode", "showdirectsubdirs" );
break;
default:
// don't save default value to be backward compatible
break;
}
if ( m_include_all_data ) {
fh->configPutPairBool( "includeall", m_include_all_data );
}
return true; return true;
} }
int int
PathJumpOp::configure() PathJumpOp::configure()
{ {
AGUIX *aguix = Worker::getAGUIX(); AGUIX *aguix = Worker::getAGUIX();
AWindow *win; AWindow *win;
CycleButton *rcyb; CycleButton *rcyb;
AGMessage *msg; AGMessage *msg;
int endmode = -1; int endmode = -1;
auto title = AGUIXUtils::formatStringToString( catalog.getLocale( 293 ), auto title = AGUIXUtils::formatStringToString( catalog.getLocale( 293 ),
getDescription() ); getDescription() );
win = new AWindow( aguix, 10, 10, 10, 10, title.c_str(), AWindow::AWINDOW_DI ALOG ); win = new AWindow( aguix, 10, 10, 10, 10, title.c_str(), AWindow::AWINDOW_DI ALOG );
win->create(); win->create();
AContainer *ac1 = win->setContainer( new AContainer( win, 1, 2 ), true ); AContainer *ac1 = win->setContainer( new AContainer( win, 1, 4 ), true );
ac1->setMinSpace( 5 ); ac1->setMinSpace( 5 );
ac1->setMaxSpace( 5 ); ac1->setMaxSpace( 5 );
AContainer *ac1_1 = ac1->add( new AContainer( win, 2, 1 ), 0, 0 ); AContainer *ac1_1 = ac1->add( new AContainer( win, 2, 1 ), 0, 0 );
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( 1224 ) ), 0, 0, AConta iner::CO_FIX ); ac1_1->add( new Text( aguix, 0, 0, catalog.getLocale( 1224 ) ), 0, 0, AConta iner::CO_FIX );
rcyb = (CycleButton*)ac1_1->add( new CycleButton( aguix, 0, 0, 100, 0 ), 1, 0, AContainer::CO_INCWNR ); rcyb = (CycleButton*)ac1_1->add( new CycleButton( aguix, 0, 0, 100, 0 ), 1, 0, AContainer::CO_INCWNR );
skipping to change at line 217 skipping to change at line 259
rcyb->setOption( 1 ); rcyb->setOption( 1 );
break; break;
case SHOW_BY_PROGRAM: case SHOW_BY_PROGRAM:
rcyb->setOption( 2 ); rcyb->setOption( 2 );
break; break;
default: default:
rcyb->setOption( 0 ); rcyb->setOption( 0 );
break; break;
} }
AContainer *ac1_2 = ac1->add( new AContainer( win, 2, 1 ), 0, 1 ); AContainer *ac1_3 = ac1->add( new AContainer( win, 2, 1 ), 0, 1 );
ac1_3->setMinSpace( 5 );
ac1_3->setMaxSpace( 5 );
ac1_3->setBorderWidth( 0 );
ac1_3->add( new Text( aguix, 0, 0, catalog.getLocale( 1387 ) ), 0, 0, AConta
iner::CO_FIX );
auto dmcyb = ac1_3->addWidget( new CycleButton( aguix, 0, 0, 100, 0 ), 1, 0,
AContainer::CO_INCWNR );
dmcyb->addOption( catalog.getLocale( 981 ) );
dmcyb->addOption( catalog.getLocale( 982 ) );
dmcyb->addOption( catalog.getLocale( 983 ) );
dmcyb->resize( dmcyb->getMaxSize(), dmcyb->getHeight() );
ac1_3->readLimits();
switch ( m_display_mode ) {
case SHOW_SUBDIRS:
dmcyb->setOption( 1 );
break;
case SHOW_DIRECT_SUBDIRS:
dmcyb->setOption( 2 );
break;
default:
dmcyb->setOption( 0 );
break;
}
auto iacb = ac1->addWidget( new ChooseButton( aguix, 0, 0, m_include_all_dat
a,
catalog.getLocale( 1388 ), LAB
EL_LEFT, 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, AContainer::CO_FIX ); 0 ), 0, 0, AContainer::CO_FIX );
Button *cb = (Button*)ac1_2->add( new Button( aguix, Button *cb = (Button*)ac1_2->add( new Button( aguix,
0, 0,
skipping to change at line 265 skipping to change at line 335
case 1: case 1:
m_initial_tab = SHOW_BY_FILTER; m_initial_tab = SHOW_BY_FILTER;
break; break;
case 2: case 2:
m_initial_tab = SHOW_BY_PROGRAM; m_initial_tab = SHOW_BY_PROGRAM;
break; break;
default: default:
m_initial_tab = SHOW_BY_TIME; m_initial_tab = SHOW_BY_TIME;
break; break;
} }
switch ( dmcyb->getSelectedOption() ) {
case 1:
m_display_mode = SHOW_SUBDIRS;
break;
case 2:
m_display_mode = SHOW_DIRECT_SUBDIRS;
break;
default:
m_display_mode = SHOW_ALL;
break;
}
m_include_all_data = iacb->getState();
} }
delete win; delete win;
return endmode; return endmode;
} }
 End of changes. 9 change blocks. 
3 lines changed or deleted 89 lines changed or added

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