summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-19 23:54:20 (UTC)
committer llornkcor <llornkcor>2002-04-19 23:54:20 (UTC)
commitd2c2dd7d80cfd5359db07952385bca575f1eeeae (patch) (unidiff)
tree280bb492460de8af699caccea5a5183fd8d1bda0
parent609a534bc1f5efda3242be2d1dc5dbc4a13715cb (diff)
downloadopie-d2c2dd7d80cfd5359db07952385bca575f1eeeae.zip
opie-d2c2dd7d80cfd5359db07952385bca575f1eeeae.tar.gz
opie-d2c2dd7d80cfd5359db07952385bca575f1eeeae.tar.bz2
switched date and size columns, added about, and fixed a bug with move
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/Makefile214
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp41
-rw-r--r--noncore/apps/advancedfm/advancedfm.h1
-rw-r--r--noncore/apps/advancedfm/output.cpp148
-rw-r--r--noncore/apps/advancedfm/output.h2
5 files changed, 338 insertions, 68 deletions
diff --git a/noncore/apps/advancedfm/Makefile b/noncore/apps/advancedfm/Makefile
index 4622c6e..8799b03 100644
--- a/noncore/apps/advancedfm/Makefile
+++ b/noncore/apps/advancedfm/Makefile
@@ -1,159 +1,277 @@
1############################################################################# 1#############################################################################
2# Makefile for building $(OPIEDIR)/bin/advancedfm 2# Automatically generated from noncore/advancedfm/Makefile.in
3# Generated by tmake at 18:31, 2002/04/15 3# Build options from
4# Project: advancedfm
5# Template: app
6############################################################################# 4#############################################################################
7 5
8####### Compiler, tools and options 6# Compiling
7 INTERFACE_DECL_PATH = .
8 SYSCONF_CXX = g++
9 SYSCONF_CC = gcc
10 DASHCROSS =
11
12# Compiling with support libraries
13 SYSCONF_CXXFLAGS_X11=
14 SYSCONF_CXXFLAGS_QT= -I$(QTDIR)/include
15 SYSCONF_CXXFLAGS_OPENGL= -I/usr/X11R6/include
16
17# Compiling YACC output
18SYSCONF_CXXFLAGS_YACC = -Wno-unused -Wno-parentheses
19
20# Linking with support libraries
21 SYSCONF_RPATH_X11=
22 SYSCONF_RPATH_QT= -Wl,-rpath,$(QTDIR)/lib
23 SYSCONF_RPATH_OPENGL= -Wl,-rpath,/usr/X11R6/lib
24
25# Linking with support libraries
26# X11
27 SYSCONF_LFLAGS_X11=
28 SYSCONF_LIBS_X11=
29# Qt, Qt+OpenGL
30 SYSCONF_LFLAGS_QT= -L$(QTDIR)/lib
31 SYSCONF_LIBS_QT = -lqte$(QT_THREAD_SUFFIX)
32 SYSCONF_LIBS_QT_OPENGL=
33# OpenGL
34 SYSCONF_LFLAGS_OPENGL= -L/usr/X11R6/lib
35 SYSCONF_LIBS_OPENGL=
36# Yacc
37 SYSCONF_LIBS_YACC=
38
39# Linking applications
40 SYSCONF_LINK = gcc
41 SYSCONF_LFLAGS =
42 SYSCONF_LIBS =
43
44# Link flags for shared objects
45 SYSCONF_LFLAGS_SHOBJ= -shared
46
47# Flags for threading
48 SYSCONF_CFLAGS_THREAD= -D_REENTRANT
49 SYSCONF_CXXFLAGS_THREAD= -D_REENTRANT
50 SYSCONF_LFLAGS_THREAD=
51 SYSCONF_LIBS_THREAD= -lpthread
52
53# Meta-object compiler
54 SYSCONF_MOC = $(QTDIR)/bin/moc
55
56# UI compiler
57 SYSCONF_UIC = $(QTDIR)/bin/uic
58
59# Linking shared libraries
60# - Build the $(TARGET) library, eg. lib$(TARGET).so.2.2.2
61# - Place target in $(DESTDIR) - which has a trailing /
62# - Usually needs to incorporate $(VER_MAJ), $(VER_MIN) and $(VER_PATCH)
63#
64 SYSCONF_LINK_SHLIB= gcc
65 SYSCONF_LINK_TARGET_SHARED= lib$(TARGET).so.$(VER_MAJ).$(VER_MIN).$(VER_PATCH)
66 SYSCONF_LINK_LIB_SHARED= $(SYSCONF_LINK_SHLIB) -shared -Wl,-soname,lib$(TARGET).so.$(VER_MAJ) \
67 $(LFLAGS) -o $(SYSCONF_LINK_TARGET_SHARED) \
68 $(OBJECTS) $(OBJMOC) $(LIBS) && \
69 mv $(SYSCONF_LINK_TARGET_SHARED) $(DESTDIR); \
70 cd $(DESTDIR) && \
71 rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN); \
72 ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so; \
73 ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ); \
74 ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN)
75
76# Linking static libraries
77# - Build the $(TARGET) library, eg. lib$(TARGET).a
78# - Place target in $(DESTDIR) - which has a trailing /
79#
80 SYSCONF_AR = ar cqs
81SYSCONF_LINK_TARGET_STATIC = lib$(TARGET).a
82 SYSCONF_LINK_LIB_STATIC= rm -f $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) ; \
83 $(SYSCONF_AR) $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) $(OBJECTS) $(OBJMOC)
84# Compiling application source
85 SYSCONF_CXXFLAGS= -pipe -DQWS -fno-exceptions -fno-rtti -O2 -Wall -W
86 SYSCONF_CFLAGS = -pipe -O2 -Wall -W
87# Default link type (static linking is still be used where required)
88 SYSCONF_LINK_LIB= $(SYSCONF_LINK_LIB_SHARED)
89 SYSCONF_LINK_TARGET= $(SYSCONF_LINK_TARGET_SHARED)
90# Compiling library source
91 SYSCONF_CXXFLAGS_LIB= -fPIC
92 SYSCONF_CFLAGS_LIB= -fPIC
93# Compiling shared-object source
94 SYSCONF_CXXFLAGS_SHOBJ= -fPIC
95 SYSCONF_CFLAGS_SHOBJ= -fPIC
96# Linking Qt
97 SYSCONF_LIBS_QTLIB= $(SYSCONF_LFLAGS_X11) $(QT_LIBS_MT) $(QT_LIBS_OPT)
98# Linking Qt applications
99 SYSCONF_LIBS_QTAPP=
100#############################################################################
9 101
10 CC =gcc 102####### Compiler, tools and options
11 CXX =g++
12 CFLAGS =-pipe -Wall -W -O2 -fno-default-inline -DNO_DEBUG
13 CXXFLAGS=-pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -DNO_DEBUG
14 INCPATH =-I$(OPIEDIR)/include -I$(QTDIR)/include
15 LINK =g++
16 LFLAGS =
17 LIBS =$(SUBLIBS) -L$(QTDIR)/lib -lqpe -lqte
18 MOC =$(QTDIR)/bin/moc
19 UIC =$(QTDIR)/bin/uic
20 103
21 TAR =tar -cf 104 CXX =$(SYSCONF_CXX) $(QT_CXX_MT)
22 GZIP =gzip -9f 105 CXXFLAGS=$(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS)
106 CC =$(SYSCONF_CC) $(QT_C_MT)
107 CFLAGS =$(SYSCONF_CFLAGS)
108 INCPATH =-I$(OPIEDIR)/include
109 LFLAGS =$(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT)
110 LIBS =$(SUBLIBS) -lqpe $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP)
111 MOC =$(SYSCONF_MOC)
112 UIC =$(SYSCONF_UIC)
113
114####### Target
115
116DESTDIR = $(OPIEDIR)/bin/
117VER_MAJ = 1
118VER_MIN = 0
119VER_PATCH = 0
120 TARGET= advancedfm
121TARGET1 = lib$(TARGET).so.$(VER_MAJ)
23 122
24####### Files 123####### Files
25 124
26 HEADERS =advancedfm.h \ 125 HEADERS =advancedfm.h \
27 inputDialog.h \ 126 inputDialog.h \
28 filePermissions.h \ 127 filePermissions.h \
29 output.h 128 output.h
30 SOURCES =advancedfm.cpp \ 129 SOURCES =advancedfm.cpp \
31 inputDialog.cpp \ 130 inputDialog.cpp \
32 filePermissions.cpp \ 131 filePermissions.cpp \
33 output.cpp \ 132 output.cpp \
34 main.cpp 133 main.cpp
35 OBJECTS =advancedfm.o \ 134 OBJECTS =advancedfm.o \
36 inputDialog.o \ 135 inputDialog.o \
37 filePermissions.o \ 136 filePermissions.o \
38 output.o \ 137 output.o \
39 main.o 138 main.o
40 INTERFACES = 139INTERFACES =
41 UICDECLS = 140UICDECLS =
42 UICIMPLS = 141UICIMPLS =
43 SRCMOC =moc_advancedfm.cpp \ 142 SRCMOC =moc_advancedfm.cpp \
44 moc_inputDialog.cpp \ 143 moc_inputDialog.cpp \
45 moc_filePermissions.cpp \ 144 moc_filePermissions.cpp \
46 moc_output.cpp 145 moc_output.cpp
47 OBJMOC =moc_advancedfm.o \ 146 OBJMOC =moc_advancedfm.o \
48 moc_inputDialog.o \ 147 moc_inputDialog.o \
49 moc_filePermissions.o \ 148 moc_filePermissions.o \
50 moc_output.o 149 moc_output.o
51 DIST = 150
52 TARGET =$(OPIEDIR)/bin/advancedfm
53INTERFACE_DECL_PATH = .
54 151
55####### Implicit rules 152####### Implicit rules
56 153
57.SUFFIXES: .cpp .cxx .cc .C .c 154.SUFFIXES: .cpp .cxx .cc .C .c
58 155
59.cpp.o: 156.cpp.o:
60 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 157 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
61 158
62.cxx.o: 159.cxx.o:
63 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 160 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
64 161
65.cc.o: 162.cc.o:
66 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 163 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
67 164
68.C.o: 165.C.o:
69 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 166 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
70 167
71.c.o: 168.c.o:
72 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< 169 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
73 170
74####### Build rules 171####### Build rules
75 172
76 173
77all: $(TARGET) 174all: $(DESTDIR)$(TARGET)
78 175
79$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) 176$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS)
80 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) 177 $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
81 178
82moc: $(SRCMOC) 179moc: $(SRCMOC)
83 180
84tmake: Makefile 181tmake:
85 182 tmake advancedfm.pro
86Makefile: advancedfm.pro
87 tmake advancedfm.pro -o Makefile
88
89dist:
90 $(TAR) advancedfm.tar advancedfm.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST)
91 $(GZIP) advancedfm.tar
92 183
93clean: 184clean:
94 -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) 185 -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
95 -rm -f *~ core 186 -rm -f *~ core
187 -rm -f allmoc.cpp
188
189####### Extension Modules
190
191listpromodules:
192 @echo
193
194listallmodules:
195 @echo
196
197listaddonpromodules:
198 @echo
199
200listaddonentmodules:
201 @echo
202
203
204REQUIRES=medium-config
96 205
97####### Sub-libraries 206####### Sub-libraries
98 207
99 208
100###### Combined headers 209###### Combined headers
101 210
102 211
212
103####### Compile 213####### Compile
104 214
105advancedfm.o: advancedfm.cpp \ 215advancedfm.o: advancedfm.cpp \
106 advancedfm.h \ 216 advancedfm.h \
107 inputDialog.h \ 217 inputDialog.h \
108 filePermissions.h \ 218 filePermissions.h \
109 output.h \ 219 output.h \
110 /usr/src/oldsrc/Opie/opie/include/qpe/lnkproperties.h \ 220 $(OPIEDIR)/include/qpe/lnkproperties.h \
111 /usr/src/oldsrc/Opie/opie/include/qpe/filemanager.h \ 221 $(OPIEDIR)/include/qpe/filemanager.h \
112 /usr/src/oldsrc/Opie/opie/include/qpe/qcopenvelope_qws.h \ 222 $(OPIEDIR)/include/qpe/qcopenvelope_qws.h \
113 /usr/src/oldsrc/Opie/opie/include/qpe/qpemenubar.h \ 223 $(OPIEDIR)/include/qpe/qpemenubar.h \
114 /usr/src/oldsrc/Opie/opie/include/qpe/qpetoolbar.h \ 224 $(OPIEDIR)/include/qpe/qpetoolbar.h \
115 /usr/src/oldsrc/Opie/opie/include/qpe/qpeapplication.h \ 225 $(OPIEDIR)/include/qpe/qpeapplication.h \
116 /usr/src/oldsrc/Opie/opie/include/qpe/resource.h \ 226 $(OPIEDIR)/include/qpe/resource.h \
117 /usr/src/oldsrc/Opie/opie/include/qpe/config.h \ 227 $(OPIEDIR)/include/qpe/config.h \
118 /usr/src/oldsrc/Opie/opie/include/qpe/mimetype.h \ 228 $(OPIEDIR)/include/qpe/mimetype.h \
119 /usr/src/oldsrc/Opie/opie/include/qpe/applnk.h 229 $(OPIEDIR)/include/qpe/applnk.h
120 230
121inputDialog.o: inputDialog.cpp \ 231inputDialog.o: inputDialog.cpp \
122 inputDialog.h 232 inputDialog.h
123 233
124filePermissions.o: filePermissions.cpp \ 234filePermissions.o: filePermissions.cpp \
125 filePermissions.h 235 filePermissions.h
126 236
127output.o: output.cpp \ 237output.o: output.cpp \
128 output.h 238 output.h
129 239
130main.o: main.cpp \ 240main.o: main.cpp \
131 /usr/src/oldsrc/Opie/opie/include/qpe/qpeapplication.h \ 241 $(OPIEDIR)/include/qpe/qpeapplication.h \
132 /usr/src/oldsrc/Opie/opie/include/qpe/qcopenvelope_qws.h \ 242 $(OPIEDIR)/include/qpe/qcopenvelope_qws.h \
133 /usr/src/oldsrc/Opie/opie/include/qpe/config.h \ 243 $(OPIEDIR)/include/qpe/config.h \
134 advancedfm.h 244 advancedfm.h
135 245
136moc_advancedfm.o: moc_advancedfm.cpp \ 246moc_advancedfm.o: moc_advancedfm.cpp \
137 advancedfm.h 247 advancedfm.h
138 248
139moc_inputDialog.o: moc_inputDialog.cpp \ 249moc_inputDialog.o: moc_inputDialog.cpp \
140 inputDialog.h 250 inputDialog.h
141 251
142moc_filePermissions.o: moc_filePermissions.cpp \ 252moc_filePermissions.o: moc_filePermissions.cpp \
143 filePermissions.h 253 filePermissions.h
144 254
145moc_output.o: moc_output.cpp \ 255moc_output.o: moc_output.cpp \
146 output.h 256 output.h
147 257
148moc_advancedfm.cpp: advancedfm.h 258moc_advancedfm.cpp: advancedfm.h
149 $(MOC) advancedfm.h -o moc_advancedfm.cpp 259 $(MOC) advancedfm.h -o moc_advancedfm.cpp
150 260
151moc_inputDialog.cpp: inputDialog.h 261moc_inputDialog.cpp: inputDialog.h
152 $(MOC) inputDialog.h -o moc_inputDialog.cpp 262 $(MOC) inputDialog.h -o moc_inputDialog.cpp
153 263
154moc_filePermissions.cpp: filePermissions.h 264moc_filePermissions.cpp: filePermissions.h
155 $(MOC) filePermissions.h -o moc_filePermissions.cpp 265 $(MOC) filePermissions.h -o moc_filePermissions.cpp
156 266
157moc_output.cpp: output.h 267moc_output.cpp: output.h
158 $(MOC) output.h -o moc_output.cpp 268 $(MOC) output.h -o moc_output.cpp
159 269
270
271
272lupdate:
273 lupdate advancedfm.pro
274
275lrelease:
276 lrelease advancedfm.pro
277
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index a4ec714..8a1eeec 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -108,89 +108,91 @@ AdvancedFm::AdvancedFm( )
108 docButton->setFlat(TRUE); 108 docButton->setFlat(TRUE);
109 layout->addMultiCellWidget( docButton, 0, 0, 5, 5); 109 layout->addMultiCellWidget( docButton, 0, 0, 5, 5);
110 110
111 homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); 111 homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton");
112 homeButton->setFixedSize( QSize( 20, 20 ) ); 112 homeButton->setFixedSize( QSize( 20, 20 ) );
113 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 113 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
114 homeButton->setFlat(TRUE); 114 homeButton->setFlat(TRUE);
115 layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); 115 layout->addMultiCellWidget( homeButton, 0, 0, 6, 6);
116// fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); 116// fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() ));
117// fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); 117// fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() ));
118// fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); 118// fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() ));
119 119
120 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 120 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
121 fileMenu->insertSeparator(); 121 fileMenu->insertSeparator();
122 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 122 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
123 fileMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); 123 fileMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() ));
124 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); 124 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() ));
125 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); 125 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() ));
126 fileMenu->insertSeparator(); 126 fileMenu->insertSeparator();
127 fileMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 127 fileMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
128 fileMenu->setCheckable(TRUE); 128 fileMenu->setCheckable(TRUE);
129 129
130 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 130 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
131 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); 131 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
132 viewMenu->insertSeparator();
133 viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
132 viewMenu->setCheckable(TRUE); 134 viewMenu->setCheckable(TRUE);
133 135
134 TabWidget = new QTabWidget( this, "TabWidget" ); 136 TabWidget = new QTabWidget( this, "TabWidget" );
135 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); 137 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6);
136 138
137 tab = new QWidget( TabWidget, "tab" ); 139 tab = new QWidget( TabWidget, "tab" );
138 tabLayout = new QGridLayout( tab ); 140 tabLayout = new QGridLayout( tab );
139 tabLayout->setSpacing( 2); 141 tabLayout->setSpacing( 2);
140 tabLayout->setMargin( 2); 142 tabLayout->setMargin( 2);
141 143
142 Local_View = new QListView( tab, "Local_View" ); 144 Local_View = new QListView( tab, "Local_View" );
143// Local_View->setResizePolicy( QListView::AutoOneFit ); 145// Local_View->setResizePolicy( QListView::AutoOneFit );
144 Local_View->addColumn( tr("File"),140); 146 Local_View->addColumn( tr("File"),140);
145 Local_View->addColumn( tr("Size"),-1);
146 Local_View->setColumnAlignment(1,QListView::AlignRight);
147 Local_View->addColumn( tr("Date"),-1); 147 Local_View->addColumn( tr("Date"),-1);
148 Local_View->setColumnAlignment(1,QListView::AlignRight);
149 Local_View->addColumn( tr("Size"),-1);
148 Local_View->setColumnAlignment(2,QListView::AlignRight); 150 Local_View->setColumnAlignment(2,QListView::AlignRight);
149 Local_View->setAllColumnsShowFocus(TRUE); 151 Local_View->setAllColumnsShowFocus(TRUE);
150// Local_View->setMultiSelection( TRUE ); 152// Local_View->setMultiSelection( TRUE );
151// Local_View->setSelectionMode(QListView::Extended); 153// Local_View->setSelectionMode(QListView::Extended);
152 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); 154 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
153 155
154 tabLayout->addWidget( Local_View, 0, 0 ); 156 tabLayout->addWidget( Local_View, 0, 0 );
155 157
156 connect( Local_View, SIGNAL( clicked( QListViewItem*)), 158 connect( Local_View, SIGNAL( clicked( QListViewItem*)),
157 this,SLOT( localListClicked(QListViewItem *)) ); 159 this,SLOT( localListClicked(QListViewItem *)) );
158 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 160 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
159 this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); 161 this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) );
160 162
161 TabWidget->insertTab( tab, tr("1")); 163 TabWidget->insertTab( tab, tr("1"));
162 164
163 tab_2 = new QWidget( TabWidget, "tab_2" ); 165 tab_2 = new QWidget( TabWidget, "tab_2" );
164 tabLayout_2 = new QGridLayout( tab_2 ); 166 tabLayout_2 = new QGridLayout( tab_2 );
165 tabLayout_2->setSpacing( 2); 167 tabLayout_2->setSpacing( 2);
166 tabLayout_2->setMargin( 2); 168 tabLayout_2->setMargin( 2);
167 169
168 Remote_View = new QListView( tab_2, "Remote_View" ); 170 Remote_View = new QListView( tab_2, "Remote_View" );
169 Remote_View->addColumn( tr("File"),140); 171 Remote_View->addColumn( tr("File"),140);
170 Remote_View->addColumn( tr("Size"),-1);
171 Remote_View->setColumnAlignment(1,QListView::AlignRight);
172 Remote_View->addColumn( tr("Date"),-1); 172 Remote_View->addColumn( tr("Date"),-1);
173 Remote_View->setColumnAlignment(1,QListView::AlignRight);
174 Remote_View->addColumn( tr("Size"),-1);
173 Remote_View->setColumnAlignment(2,QListView::AlignRight); 175 Remote_View->setColumnAlignment(2,QListView::AlignRight);
174 Remote_View->setAllColumnsShowFocus(TRUE); 176 Remote_View->setAllColumnsShowFocus(TRUE);
175// Remote_View->setMultiSelection( TRUE ); 177// Remote_View->setMultiSelection( TRUE );
176// Remote_View->setSelectionMode(QListView::Extended); 178// Remote_View->setSelectionMode(QListView::Extended);
177 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); 179 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
178 180
179 connect( Remote_View, SIGNAL( clicked( QListViewItem*)), 181 connect( Remote_View, SIGNAL( clicked( QListViewItem*)),
180 this,SLOT( remoteListClicked(QListViewItem *)) ); 182 this,SLOT( remoteListClicked(QListViewItem *)) );
181 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 183 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
182 this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); 184 this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) );
183 185
184 tabLayout_2->addWidget( Remote_View, 0, 0 ); 186 tabLayout_2->addWidget( Remote_View, 0, 0 );
185 187
186 TabWidget->insertTab( tab_2, tr( "2")); 188 TabWidget->insertTab( tab_2, tr( "2"));
187 189
188 connect(TabWidget,SIGNAL(currentChanged(QWidget *)), 190 connect(TabWidget,SIGNAL(currentChanged(QWidget *)),
189 this,SLOT(tabChanged(QWidget*))); 191 this,SLOT(tabChanged(QWidget*)));
190 192
191// tab_3 = new QWidget( TabWidget, "tab_3" ); 193// tab_3 = new QWidget( TabWidget, "tab_3" );
192// tabLayout_3 = new QGridLayout( tab_3 ); 194// tabLayout_3 = new QGridLayout( tab_3 );
193// tabLayout_3->setSpacing( 2); 195// tabLayout_3->setSpacing( 2);
194// tabLayout_3->setMargin( 2); 196// tabLayout_3->setMargin( 2);
195 197
196// OFileSelector *fileSelector; 198// OFileSelector *fileSelector;
@@ -278,49 +280,49 @@ void AdvancedFm::populateLocalView()
278 280
279 bool isDir=FALSE; 281 bool isDir=FALSE;
280 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 282 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
281 QFileInfoListIterator it(*list); 283 QFileInfoListIterator it(*list);
282 QFileInfo *fi; 284 QFileInfo *fi;
283 while ( (fi=it.current()) ) { 285 while ( (fi=it.current()) ) {
284 if (fi->isSymLink() ) { 286 if (fi->isSymLink() ) {
285 QString symLink=fi->readLink(); 287 QString symLink=fi->readLink();
286// qDebug("Symlink detected "+symLink); 288// qDebug("Symlink detected "+symLink);
287 QFileInfo sym( symLink); 289 QFileInfo sym( symLink);
288 fileS.sprintf( "%10li", sym.size() ); 290 fileS.sprintf( "%10li", sym.size() );
289 fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); 291 fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() );
290 fileDate = sym.lastModified().toString(); 292 fileDate = sym.lastModified().toString();
291 } else { 293 } else {
292 fileS.sprintf( "%10li", fi->size() ); 294 fileS.sprintf( "%10li", fi->size() );
293 fileL.sprintf( "%s",fi->fileName().data() ); 295 fileL.sprintf( "%s",fi->fileName().data() );
294 fileDate= fi->lastModified().toString(); 296 fileDate= fi->lastModified().toString();
295 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { 297 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
296 fileL+="/"; 298 fileL+="/";
297 isDir=TRUE; 299 isDir=TRUE;
298// qDebug( fileL); 300// qDebug( fileL);
299 } 301 }
300 } 302 }
301 if(fileL !="./" && fi->exists()) { 303 if(fileL !="./" && fi->exists()) {
302 item= new QListViewItem( Local_View, fileL, fileS , fileDate); 304 item= new QListViewItem( Local_View, fileL , fileDate, fileS);
303 305
304 if(isDir || fileL.find("/",0,TRUE) != -1) { 306 if(isDir || fileL.find("/",0,TRUE) != -1) {
305 if( !QDir( fi->filePath() ).isReadable()) 307 if( !QDir( fi->filePath() ).isReadable())
306 pm = Resource::loadPixmap( "lockedfolder" ); 308 pm = Resource::loadPixmap( "lockedfolder" );
307 else 309 else
308 pm= Resource::loadPixmap( "folder" ); 310 pm= Resource::loadPixmap( "folder" );
309 item->setPixmap( 0,pm ); 311 item->setPixmap( 0,pm );
310 } else { 312 } else {
311 if( !fi->isReadable() ) 313 if( !fi->isReadable() )
312 pm = Resource::loadPixmap( "locked" ); 314 pm = Resource::loadPixmap( "locked" );
313 else { 315 else {
314 MimeType mt(fi->filePath()); 316 MimeType mt(fi->filePath());
315 pm=mt.pixmap(); //sets the correct pixmap for mimetype 317 pm=mt.pixmap(); //sets the correct pixmap for mimetype
316 if(pm.isNull()) 318 if(pm.isNull())
317 pm = Resource::loadPixmap( "UnknownDocument-14" ); 319 pm = Resource::loadPixmap( "UnknownDocument-14" );
318 item->setPixmap( 0,pm); 320 item->setPixmap( 0,pm);
319 } 321 }
320 } 322 }
321 if( fileL.find("->",0,TRUE) != -1) { 323 if( fileL.find("->",0,TRUE) != -1) {
322 // overlay link image 324 // overlay link image
323 pm= Resource::loadPixmap( "folder" ); 325 pm= Resource::loadPixmap( "folder" );
324 QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 326 QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
325 QPainter painter( &pm ); 327 QPainter painter( &pm );
326 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 328 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
@@ -331,49 +333,49 @@ void AdvancedFm::populateLocalView()
331 ++it; 333 ++it;
332 } 334 }
333 335
334 if(currentDir.canonicalPath().find("dev",0,TRUE) != -1) { 336 if(currentDir.canonicalPath().find("dev",0,TRUE) != -1) {
335 struct stat buf; 337 struct stat buf;
336 struct stat st; 338 struct stat st;
337 dev_t devT; 339 dev_t devT;
338 mode_t mode; 340 mode_t mode;
339 DIR *dir; 341 DIR *dir;
340 int fd = 0; 342 int fd = 0;
341 struct dirent *mydirent; 343 struct dirent *mydirent;
342 int i = 1; 344 int i = 1;
343 if((dir = opendir( currentDir.canonicalPath().latin1())) != NULL) 345 if((dir = opendir( currentDir.canonicalPath().latin1())) != NULL)
344 while ((mydirent = readdir(dir)) != NULL) { 346 while ((mydirent = readdir(dir)) != NULL) {
345 lstat( mydirent->d_name, &buf); 347 lstat( mydirent->d_name, &buf);
346 qDebug(mydirent->d_name); 348 qDebug(mydirent->d_name);
347// mode = buf.st_mode; 349// mode = buf.st_mode;
348 fileL.sprintf("%s", mydirent->d_name); 350 fileL.sprintf("%s", mydirent->d_name);
349// fileS.sprintf("%d, %d", ); //this isn't correct 351// fileS.sprintf("%d, %d", ); //this isn't correct
350 devT = buf.st_dev; 352 devT = buf.st_dev;
351 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); 353 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF);
352// fileS.sprintf("%d,%d", devT, devT); 354// fileS.sprintf("%d,%d", devT, devT);
353 fileDate.sprintf("%s", ctime( &buf.st_mtime)); 355 fileDate.sprintf("%s", ctime( &buf.st_mtime));
354 if( fileL.find(".") == -1 ){ 356 if( fileL.find(".") == -1 ){
355 item= new QListViewItem( Local_View, fileL, fileS, fileDate); 357 item= new QListViewItem( Local_View, fileL, fileDate, fileS);
356 pm = Resource::loadPixmap( "UnknownDocument-14" ); 358 pm = Resource::loadPixmap( "UnknownDocument-14" );
357 item->setPixmap( 0,pm); 359 item->setPixmap( 0,pm);
358 } 360 }
359 } 361 }
360 362
361 closedir(dir); 363 closedir(dir);
362 } 364 }
363 365
364 Local_View->setSorting( 3,FALSE); 366 Local_View->setSorting( 3,FALSE);
365 fillCombo( (const QString &) currentDir.canonicalPath()); 367 fillCombo( (const QString &) currentDir.canonicalPath());
366} 368}
367 369
368void AdvancedFm::populateRemoteView() 370void AdvancedFm::populateRemoteView()
369{ 371{
370// QList<QListViewItem> * getSelectedItems( QListView * Local_View ); 372// QList<QListViewItem> * getSelectedItems( QListView * Local_View );
371// QListViewItemIterator it( Remote_View ); 373// QListViewItemIterator it( Remote_View );
372// for ( ; it.current(); ++it ) { 374// for ( ; it.current(); ++it ) {
373// if ( it.current()->isSelected() ) { 375// if ( it.current()->isSelected() ) {
374// QString strItem = it.current()->text(0); 376// QString strItem = it.current()->text(0);
375// QString localFile = currentRemoteDir.canonicalPath()+"/"+strItem; 377// QString localFile = currentRemoteDir.canonicalPath()+"/"+strItem;
376// QFileInfo fi(localFile); 378// QFileInfo fi(localFile);
377// } 379// }
378// } 380// }
379 QPixmap pm; 381 QPixmap pm;
@@ -385,49 +387,49 @@ void AdvancedFm::populateRemoteView()
385 bool isDir=FALSE; 387 bool isDir=FALSE;
386 const QFileInfoList *list = currentRemoteDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 388 const QFileInfoList *list = currentRemoteDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
387 QFileInfoListIterator it(*list); 389 QFileInfoListIterator it(*list);
388 QFileInfo *fi; 390 QFileInfo *fi;
389 while ( (fi=it.current()) ) { 391 while ( (fi=it.current()) ) {
390 if (fi->isSymLink() ){ 392 if (fi->isSymLink() ){
391 QString symLink=fi->readLink(); 393 QString symLink=fi->readLink();
392// qDebug("Symlink detected "+symLink); 394// qDebug("Symlink detected "+symLink);
393 QFileInfo sym( symLink); 395 QFileInfo sym( symLink);
394 fileS.sprintf( "%10li", sym.size() ); 396 fileS.sprintf( "%10li", sym.size() );
395 fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); 397 fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() );
396 fileDate = sym.lastModified().toString(); 398 fileDate = sym.lastModified().toString();
397 } else { 399 } else {
398// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); 400// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
399 fileS.sprintf( "%10li", fi->size() ); 401 fileS.sprintf( "%10li", fi->size() );
400 fileL.sprintf( "%s",fi->fileName().data() ); 402 fileL.sprintf( "%s",fi->fileName().data() );
401 fileDate= fi->lastModified().toString(); 403 fileDate= fi->lastModified().toString();
402 if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) { 404 if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) {
403 fileL+="/"; 405 fileL+="/";
404 isDir=TRUE; 406 isDir=TRUE;
405// qDebug( fileL); 407// qDebug( fileL);
406 } 408 }
407 } 409 }
408 if(fileL !="./" && fi->exists()) { 410 if(fileL !="./" && fi->exists()) {
409 item= new QListViewItem( Remote_View,fileL,fileS , fileDate); 411 item= new QListViewItem( Remote_View, fileL, fileDate, fileS);
410 QPixmap pm; 412 QPixmap pm;
411 413
412 if(isDir || fileL.find("/",0,TRUE) != -1) { 414 if(isDir || fileL.find("/",0,TRUE) != -1) {
413 if( !QDir( fi->filePath() ).isReadable()) 415 if( !QDir( fi->filePath() ).isReadable())
414 pm = Resource::loadPixmap( "lockedfolder" ); 416 pm = Resource::loadPixmap( "lockedfolder" );
415 else 417 else
416 pm= Resource::loadPixmap( "folder" ); 418 pm= Resource::loadPixmap( "folder" );
417 item->setPixmap( 0,pm ); 419 item->setPixmap( 0,pm );
418 } else { 420 } else {
419 if( !fi->isReadable() ) 421 if( !fi->isReadable() )
420 pm = Resource::loadPixmap( "locked" ); 422 pm = Resource::loadPixmap( "locked" );
421 else { 423 else {
422 MimeType mt(fi->filePath()); 424 MimeType mt(fi->filePath());
423 pm=mt.pixmap(); //sets the correct pixmap for mimetype 425 pm=mt.pixmap(); //sets the correct pixmap for mimetype
424 if(pm.isNull()) 426 if(pm.isNull())
425 pm = Resource::loadPixmap( "UnknownDocument-14" ); 427 pm = Resource::loadPixmap( "UnknownDocument-14" );
426 item->setPixmap( 0,pm); 428 item->setPixmap( 0,pm);
427 } 429 }
428 } 430 }
429 if( fileL.find("->",0,TRUE) != -1) { 431 if( fileL.find("->",0,TRUE) != -1) {
430 // overlay link image 432 // overlay link image
431 pm= Resource::loadPixmap( "folder" ); 433 pm= Resource::loadPixmap( "folder" );
432 QPixmap lnk = Resource::loadPixmap( "symlink" ); 434 QPixmap lnk = Resource::loadPixmap( "symlink" );
433 QPainter painter( &pm ); 435 QPainter painter( &pm );
@@ -436,49 +438,49 @@ void AdvancedFm::populateRemoteView()
436 item->setPixmap( 0, pm); 438 item->setPixmap( 0, pm);
437 } 439 }
438 } isDir=FALSE; 440 } isDir=FALSE;
439 ++it; 441 ++it;
440 } 442 }
441 443
442 if(currentRemoteDir.canonicalPath().find("dev",0,TRUE) != -1) { 444 if(currentRemoteDir.canonicalPath().find("dev",0,TRUE) != -1) {
443 struct stat buf; 445 struct stat buf;
444 struct stat st; 446 struct stat st;
445 mode_t mode; 447 mode_t mode;
446 DIR *dir; 448 DIR *dir;
447 int fd = 0; 449 int fd = 0;
448 struct dirent *mydirent; 450 struct dirent *mydirent;
449 int i = 1; 451 int i = 1;
450 if((dir = opendir( currentRemoteDir.canonicalPath().latin1())) != NULL) 452 if((dir = opendir( currentRemoteDir.canonicalPath().latin1())) != NULL)
451 while ((mydirent = readdir(dir)) != NULL) { 453 while ((mydirent = readdir(dir)) != NULL) {
452 lstat( mydirent->d_name, &buf); 454 lstat( mydirent->d_name, &buf);
453 qDebug(mydirent->d_name); 455 qDebug(mydirent->d_name);
454// mode = buf.st_mode; 456// mode = buf.st_mode;
455 fileL.sprintf("%s", mydirent->d_name); 457 fileL.sprintf("%s", mydirent->d_name);
456// fileS.sprintf("%d, %d", ); //this isn't correct 458// fileS.sprintf("%d, %d", ); //this isn't correct
457 fileS.sprintf("%d,%d", (int) (buf.st_dev>>8)&0xFF, (int) buf.st_dev &0xFF); 459 fileS.sprintf("%d,%d", (int) (buf.st_dev>>8)&0xFF, (int) buf.st_dev &0xFF);
458 fileDate.sprintf("%s", ctime( &buf.st_mtime)); 460 fileDate.sprintf("%s", ctime( &buf.st_mtime));
459 if( fileL.find(".") == -1 ){ 461 if( fileL.find(".") == -1 ){
460 item= new QListViewItem( Remote_View, fileL, fileS, fileDate); 462 item= new QListViewItem( Remote_View, fileL, fileDate, fileS);
461 pm = Resource::loadPixmap( "UnknownDocument-14" ); 463 pm = Resource::loadPixmap( "UnknownDocument-14" );
462 item->setPixmap( 0,pm); 464 item->setPixmap( 0,pm);
463 } 465 }
464 } 466 }
465 467
466 closedir(dir); 468 closedir(dir);
467 } 469 }
468 470
469 Remote_View->setSorting( 3,FALSE); 471 Remote_View->setSorting( 3,FALSE);
470 fillCombo( (const QString &) currentRemoteDir.canonicalPath() ); 472 fillCombo( (const QString &) currentRemoteDir.canonicalPath() );
471} 473}
472 474
473void AdvancedFm::localListClicked(QListViewItem *selectedItem) 475void AdvancedFm::localListClicked(QListViewItem *selectedItem)
474{ 476{
475 if(selectedItem) { 477 if(selectedItem) {
476 QString strItem=selectedItem->text(0); 478 QString strItem=selectedItem->text(0);
477 QString strSize=selectedItem->text(1); 479 QString strSize=selectedItem->text(1);
478 strSize=strSize.stripWhiteSpace(); 480 strSize=strSize.stripWhiteSpace();
479 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink 481 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
480 // is symlink 482 // is symlink
481 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 483 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
482 if(QDir(strItem2).exists() ) { 484 if(QDir(strItem2).exists() ) {
483 currentDir.cd(strItem2, TRUE); 485 currentDir.cd(strItem2, TRUE);
484 populateLocalView(); 486 populateLocalView();
@@ -1076,63 +1078,63 @@ void AdvancedFm::copyAs()
1076 InputDialog *fileDlg; 1078 InputDialog *fileDlg;
1077 fileDlg = new InputDialog(this,tr("Copy As"),TRUE, 0); 1079 fileDlg = new InputDialog(this,tr("Copy As"),TRUE, 0);
1078 fileDlg->setInputText((const QString &) destFile); 1080 fileDlg->setInputText((const QString &) destFile);
1079 fileDlg->exec(); 1081 fileDlg->exec();
1080 if( fileDlg->result() == 1 ) { 1082 if( fileDlg->result() == 1 ) {
1081 QString filename = fileDlg->LineEdit1->text(); 1083 QString filename = fileDlg->LineEdit1->text();
1082 destFile = currentDir.canonicalPath()+"/"+destFile; 1084 destFile = currentDir.canonicalPath()+"/"+destFile;
1083 1085
1084 QFile f(destFile); 1086 QFile f(destFile);
1085 if( f.exists()) 1087 if( f.exists())
1086 f.remove(); 1088 f.remove();
1087 if(!copyFile(destFile, curFile) ) 1089 if(!copyFile(destFile, curFile) )
1088 qWarning("nothin doing"); 1090 qWarning("nothin doing");
1089 } 1091 }
1090 populateLocalView(); 1092 populateLocalView();
1091 TabWidget->setCurrentPage(0); 1093 TabWidget->setCurrentPage(0);
1092 } 1094 }
1093} 1095}
1094 1096
1095void AdvancedFm::move() { 1097void AdvancedFm::move() {
1096 QString curFile = getPath(); 1098 QString curFile = getPath();
1097// qDebug(curFile); 1099// qDebug(curFile);
1098 QString destFile; 1100 QString destFile;
1099 if (TabWidget->currentPageIndex() == 0) { 1101 if (TabWidget->currentPageIndex() == 0) {
1100 QString destFile = currentRemoteDir.canonicalPath()+Local_View->currentItem()->text(0); 1102 QString destFile = currentRemoteDir.canonicalPath() + "/" + Local_View->currentItem()->text(0);
1101// qDebug(destFile); 1103 qDebug("Destination file is "+destFile);
1102 1104
1103 QFile f(destFile); 1105 QFile f(destFile);
1104 if( f.exists()) 1106 if( f.exists())
1105 f.remove(); 1107 f.remove();
1106 if(!copyFile( destFile, curFile) ) { 1108 if(!copyFile( destFile, curFile) ) {
1107 QMessageBox::message(tr("Note"),tr("Could not move\n"+curFile)); 1109 QMessageBox::message(tr("Note"),tr("Could not move\n"+curFile));
1108 return; 1110 return;
1109 } 1111 }
1110 QFile::remove(curFile); 1112 QFile::remove(curFile);
1111 TabWidget->setCurrentPage(1); 1113 TabWidget->setCurrentPage(1);
1112 } else { 1114 } else {
1113 QString destFile = currentDir.canonicalPath()+destFile + Remote_View->currentItem()->text(0); 1115 QString destFile = currentDir.canonicalPath() + "/" + Remote_View->currentItem()->text(0);
1114// qDebug(destFile); 1116 qDebug("Destination file is "+destFile);
1115 1117
1116 QFile f(destFile); 1118 QFile f(destFile);
1117 if( f.exists()) 1119 if( f.exists())
1118 f.remove(); 1120 f.remove();
1119 if(!copyFile(destFile, curFile) ) { 1121 if(!copyFile(destFile, curFile) ) {
1120 QMessageBox::message(tr("Note"),tr("Could not move\n"+curFile)); 1122 QMessageBox::message(tr("Note"),tr("Could not move\n"+curFile));
1121 return; 1123 return;
1122 } 1124 }
1123 QFile::remove(curFile); 1125 QFile::remove(curFile);
1124 TabWidget->setCurrentPage(0); 1126 TabWidget->setCurrentPage(0);
1125 } 1127 }
1126 populateRemoteView(); 1128 populateRemoteView();
1127 populateLocalView(); 1129 populateLocalView();
1128} 1130}
1129 1131
1130bool AdvancedFm::copyFile( const QString & dest, const QString & src ) 1132bool AdvancedFm::copyFile( const QString & dest, const QString & src )
1131{ 1133{
1132 char bf[ 50000 ]; 1134 char bf[ 50000 ];
1133 int bytesRead; 1135 int bytesRead;
1134 bool success = TRUE; 1136 bool success = TRUE;
1135 struct stat status; 1137 struct stat status;
1136 1138
1137 QFile s( src ); 1139 QFile s( src );
1138 QFile d( dest ); 1140 QFile d( dest );
@@ -1175,57 +1177,55 @@ void AdvancedFm::runCommand() {
1175 fileDlg->exec(); 1177 fileDlg->exec();
1176 QString command; 1178 QString command;
1177 if( fileDlg->result() == 1 ) { 1179 if( fileDlg->result() == 1 ) {
1178 command = fileDlg->LineEdit1->text(); 1180 command = fileDlg->LineEdit1->text();
1179 1181
1180 int err=0; 1182 int err=0;
1181 Output *outDlg; 1183 Output *outDlg;
1182 outDlg = new Output(this, tr("Formatter Output"),FALSE); 1184 outDlg = new Output(this, tr("Formatter Output"),FALSE);
1183 outDlg->showMaximized(); 1185 outDlg->showMaximized();
1184 outDlg->show(); 1186 outDlg->show();
1185 qApp->processEvents(); 1187 qApp->processEvents();
1186 FILE *fp; 1188 FILE *fp;
1187 char line[130]; 1189 char line[130];
1188 sleep(1); 1190 sleep(1);
1189// if(command.find("2>",0,TRUE) != -1) 1191// if(command.find("2>",0,TRUE) != -1)
1190 command +=" 2>&1"; 1192 command +=" 2>&1";
1191 fp = popen( (const char *) command, "r"); 1193 fp = popen( (const char *) command, "r");
1192 if ( !fp ) { 1194 if ( !fp ) {
1193 qDebug("Could not execute '" + command + "'! err=%d", fp); 1195 qDebug("Could not execute '" + command + "'! err=%d", fp);
1194 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1196 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1195 pclose(fp); 1197 pclose(fp);
1196 return; 1198 return;
1197 } else { 1199 } else {
1198 while ( fgets( line, sizeof line, fp)) { 1200 while ( fgets( line, sizeof line, fp)) {
1199 outDlg->OutputEdit->append(line); 1201 QString lineStr = line;
1202 lineStr=lineStr.left(lineStr.length()-1);
1203 outDlg->OutputEdit->append(lineStr);
1200 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 1204 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
1201
1202 } 1205 }
1203
1204 } 1206 }
1205
1206 } 1207 }
1207
1208} 1208}
1209 1209
1210void AdvancedFm::runCommandStd() { 1210void AdvancedFm::runCommandStd() {
1211 QString curFile; 1211 QString curFile;
1212 if (TabWidget->currentPageIndex() == 0) { 1212 if (TabWidget->currentPageIndex() == 0) {
1213 if( Local_View->currentItem()) 1213 if( Local_View->currentItem())
1214 curFile = currentDir.canonicalPath() + Local_View->currentItem()->text(0); 1214 curFile = currentDir.canonicalPath() + Local_View->currentItem()->text(0);
1215 } else { 1215 } else {
1216 if(Remote_View->currentItem()) 1216 if(Remote_View->currentItem())
1217 curFile = currentRemoteDir.canonicalPath() + Remote_View->currentItem()->text(0); 1217 curFile = currentRemoteDir.canonicalPath() + Remote_View->currentItem()->text(0);
1218 } 1218 }
1219 1219
1220 InputDialog *fileDlg; 1220 InputDialog *fileDlg;
1221 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 1221 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
1222 fileDlg->setInputText(curFile); 1222 fileDlg->setInputText(curFile);
1223 fileDlg->exec(); 1223 fileDlg->exec();
1224 QString command; 1224 QString command;
1225 if( fileDlg->result() == 1 ) { 1225 if( fileDlg->result() == 1 ) {
1226 qApp->processEvents(); 1226 qApp->processEvents();
1227 command = fileDlg->LineEdit1->text() + " &"; 1227 command = fileDlg->LineEdit1->text() + " &";
1228 system(command.latin1()); 1228 system(command.latin1());
1229 } 1229 }
1230} 1230}
1231 1231
@@ -1240,24 +1240,31 @@ void AdvancedFm::fileStatus() {
1240 int err=0; 1240 int err=0;
1241 Output *outDlg; 1241 Output *outDlg;
1242 outDlg = new Output(this, tr("Formatter Output"),FALSE); 1242 outDlg = new Output(this, tr("Formatter Output"),FALSE);
1243 outDlg->showMaximized(); 1243 outDlg->showMaximized();
1244 outDlg->show(); 1244 outDlg->show();
1245 qApp->processEvents(); 1245 qApp->processEvents();
1246 FILE *fp; 1246 FILE *fp;
1247 char line[130]; 1247 char line[130];
1248 sleep(1); 1248 sleep(1);
1249 fp = popen( (const char *) command, "r"); 1249 fp = popen( (const char *) command, "r");
1250 if ( !fp ) { 1250 if ( !fp ) {
1251 qDebug("Could not execute '" + command + "'! err=%d", fp); 1251 qDebug("Could not execute '" + command + "'! err=%d", fp);
1252 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1252 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1253 pclose(fp); 1253 pclose(fp);
1254 return; 1254 return;
1255 } else { 1255 } else {
1256 while ( fgets( line, sizeof line, fp)) { 1256 while ( fgets( line, sizeof line, fp)) {
1257 outDlg->OutputEdit->append(line); 1257 outDlg->OutputEdit->append(line);
1258 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 1258 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
1259 1259
1260 } 1260 }
1261 1261
1262 } 1262 }
1263} 1263}
1264
1265void AdvancedFm::doAbout() {
1266 QMessageBox::message("AdvancedFm","Advanced FileManager\n"
1267 "is copyright 2002 by\n"
1268 "L.J.Potter<llornkcor@handhelds.org>\n"
1269 "and is licensed by the GPL");
1270}
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 2ca45b1..30ff28c 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -92,27 +92,28 @@ protected slots:
92 void runCommand(); 92 void runCommand();
93 void runCommandStd(); 93 void runCommandStd();
94 QString getPath(); 94 QString getPath();
95 void switchToLocalTab(); 95 void switchToLocalTab();
96 void switchToRemoteTab(); 96 void switchToRemoteTab();
97 97
98protected: 98protected:
99 QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; 99 QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3;
100 QStringList remoteDirPathStringList, localDirPathStringList; 100 QStringList remoteDirPathStringList, localDirPathStringList;
101 101
102protected slots: 102protected slots:
103 void homeButtonPushed(); 103 void homeButtonPushed();
104 void docButtonPushed(); 104 void docButtonPushed();
105 void SDButtonPushed(); 105 void SDButtonPushed();
106 void CFButtonPushed(); 106 void CFButtonPushed();
107 void upDir(); 107 void upDir();
108 void currentPathComboChanged(); 108 void currentPathComboChanged();
109 void copy(); 109 void copy();
110 void copyAs(); 110 void copyAs();
111 void currentPathComboActivated(const QString &); 111 void currentPathComboActivated(const QString &);
112 void fillCombo(const QString &); 112 void fillCombo(const QString &);
113 bool copyFile( const QString & , const QString & ); 113 bool copyFile( const QString & , const QString & );
114 void move(); 114 void move();
115 void fileStatus(); 115 void fileStatus();
116 void doAbout();
116}; 117};
117 118
118#endif // ADVANCEDFM_H 119#endif // ADVANCEDFM_H
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp
index 6970f58..82e78a7 100644
--- a/noncore/apps/advancedfm/output.cpp
+++ b/noncore/apps/advancedfm/output.cpp
@@ -1,38 +1,180 @@
1/**************************************************************************** 1/****************************************************************************
2** outputEdit.cpp 2** outputEdit.cpp
3** 3**
4** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> 4** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com>
5****************************************************************************/ 5****************************************************************************/
6#include "output.h" 6#include "output.h"
7#include "inputDialog.h"
7 8
9#include <qpe/filemanager.h>
10#include <qpe/qpeapplication.h>
11#include <qpe/applnk.h>
12
13#include <qfile.h>
14
15#include <qlineedit.h>
8#include <qmultilineedit.h> 16#include <qmultilineedit.h>
9#include <qpushbutton.h> 17#include <qpushbutton.h>
10#include <qlayout.h> 18#include <qlayout.h>
11#include <qvariant.h> 19#include <qvariant.h>
12#include <qtooltip.h> 20
13#include <qwhatsthis.h> 21/* XPM */
22static char * filesave_xpm[] = {
23"16 16 78 1",
24" c None",
25". c #343434",
26"+ c #A0A0A0",
27"@ c #565656",
28"# c #9E9E9E",
29"$ c #525252",
30"% c #929292",
31"& c #676767",
32"* c #848484",
33"= c #666666",
34"- c #D8D8D8",
35"; c #FFFFFF",
36"> c #DBDBDB",
37", c #636363",
38"' c #989898",
39") c #2D2D2D",
40"! c #909090",
41"~ c #AEAEAE",
42"{ c #EAEAEA",
43"] c #575757",
44"^ c #585858",
45"/ c #8A8A8A",
46"( c #828282",
47"_ c #6F6F6F",
48": c #C9C9C9",
49"< c #050505",
50"[ c #292929",
51"} c #777777",
52"| c #616161",
53"1 c #3A3A3A",
54"2 c #BEBEBE",
55"3 c #2C2C2C",
56"4 c #7C7C7C",
57"5 c #F6F6F6",
58"6 c #FCFCFC",
59"7 c #6B6B6B",
60"8 c #959595",
61"9 c #4F4F4F",
62"0 c #808080",
63"a c #767676",
64"b c #818181",
65"c c #B8B8B8",
66"d c #FBFBFB",
67"e c #F9F9F9",
68"f c #CCCCCC",
69"g c #030303",
70"h c #737373",
71"i c #7A7A7A",
72"j c #7E7E7E",
73"k c #6A6A6A",
74"l c #FAFAFA",
75"m c #505050",
76"n c #9D9D9D",
77"o c #333333",
78"p c #7B7B7B",
79"q c #787878",
80"r c #696969",
81"s c #494949",
82"t c #555555",
83"u c #949494",
84"v c #E6E6E6",
85"w c #424242",
86"x c #515151",
87"y c #535353",
88"z c #3E3E3E",
89"A c #D4D4D4",
90"B c #0C0C0C",
91"C c #353535",
92"D c #474747",
93"E c #ECECEC",
94"F c #919191",
95"G c #7D7D7D",
96"H c #000000",
97"I c #404040",
98"J c #858585",
99"K c #323232",
100"L c #D0D0D0",
101"M c #1C1C1C",
102" ...+ ",
103" @#$%&..+ ",
104" .*=-;;>,..+ ",
105" ')!~;;;;;;{]..",
106" ^/(-;;;;;;;_:<",
107" [}|;;;;;;;{12$",
108" #34-55;;;;678$+",
109" 90ab=c;dd;e1fg ",
110" [ahij((kbl0mn$ ",
111" op^q^^7r&]s/$+ ",
112"@btu;vbwxy]zAB ",
113"CzDEvEv;;DssF$ ",
114"G.H{E{E{IxsJ$+ ",
115" +...vEKxzLM ",
116" +...z]n$ ",
117" +... "};
14 118
15Output::Output( QWidget* parent, const char* name, bool modal, WFlags fl ) 119Output::Output( QWidget* parent, const char* name, bool modal, WFlags fl )
16 : QDialog( parent, name, modal, fl ) 120 : QDialog( parent, name, modal, fl )
17{ 121{
18 if ( !name ) 122 if ( !name )
19 setName( "Output" ); 123 setName( "Output" );
20 resize( 196, 269 ); 124 resize( 196, 269 );
21 setCaption( name ); 125 setCaption( name );
22 OutputLayout = new QGridLayout( this ); 126 OutputLayout = new QGridLayout( this );
23 OutputLayout->setSpacing( 6 ); 127 OutputLayout->setSpacing( 6 );
24 OutputLayout->setMargin( 11 ); 128 OutputLayout->setMargin( 11 );
25 129
130 QPushButton *docButton;
131 docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton");
132 docButton->setFixedSize( QSize( 20, 20 ) );
133 connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() ));
134// docButton->setFlat(TRUE);
135 OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 );
136
137
26 OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); 138 OutputEdit = new QMultiLineEdit( this, "OutputEdit" );
139 OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 );
140
27 141
28 OutputLayout->addWidget( OutputEdit, 0, 0 );
29} 142}
30 143
31/* 144/*
32 * Destroys the object and frees any allocated resources 145 * Destroys the object and frees any allocated resources
33 */ 146 */
34Output::~Output() 147Output::~Output()
35{ 148{
36 // no need to delete child widgets, Qt does it all for us 149 // no need to delete child widgets, Qt does it all for us
37} 150}
38 151
152void Output::saveOutput() {
153
154 InputDialog *fileDlg;
155 fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0);
156 fileDlg->exec();
157 if( fileDlg->result() == 1 ) {
158 QString filename = QPEApplication::documentDir();
159 if(filename.right(1).find('/') == -1)
160 filename+="/";
161 QString name = fileDlg->LineEdit1->text();
162 filename+="text/plain/"+name;
163 qDebug(filename);
164
165 QFile f(filename);
166 f.open( IO_WriteOnly);
167 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
168 DocLnk lnk;
169 lnk.setName(name); //sets file name
170 lnk.setFile(filename); //sets File property
171 lnk.setType("text/plain");
172 if(!lnk.writeLink()) {
173 qDebug("Writing doclink did not work");
174 }
175 } else
176 qWarning("Could not write file");
177 f.close();
178
179 }
180}
diff --git a/noncore/apps/advancedfm/output.h b/noncore/apps/advancedfm/output.h
index 84adccd..c1e48da 100644
--- a/noncore/apps/advancedfm/output.h
+++ b/noncore/apps/advancedfm/output.h
@@ -7,27 +7,29 @@
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#ifndef OUTPUT_H 9#ifndef OUTPUT_H
10#define OUTPUT_H 10#define OUTPUT_H
11 11
12#include <qvariant.h> 12#include <qvariant.h>
13#include <qdialog.h> 13#include <qdialog.h>
14class QVBoxLayout; 14class QVBoxLayout;
15class QHBoxLayout; 15class QHBoxLayout;
16class QGridLayout; 16class QGridLayout;
17class QMultiLineEdit; 17class QMultiLineEdit;
18 18
19class Output : public QDialog 19class Output : public QDialog
20{ 20{
21 Q_OBJECT 21 Q_OBJECT
22 22
23public: 23public:
24 Output( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 24 Output( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
25 ~Output(); 25 ~Output();
26 26
27 QMultiLineEdit* OutputEdit; 27 QMultiLineEdit* OutputEdit;
28 28
29protected: 29protected:
30 QGridLayout* OutputLayout; 30 QGridLayout* OutputLayout;
31protected slots:
32 void saveOutput();
31}; 33};
32 34
33#endif // OUTPUT_H 35#endif // OUTPUT_H