summaryrefslogtreecommitdiff
Unidiff
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,25 +1,124 @@
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
@@ -37,9 +136,9 @@ OBJECTS = advancedfm.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 \
@@ -48,9 +147,7 @@ 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
@@ -74,25 +171,37 @@ INTERFACE_DECL_PATH = .
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
@@ -100,6 +209,7 @@ clean:
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 \
@@ -107,16 +217,16 @@ advancedfm.o: advancedfm.cpp \
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
@@ -128,9 +238,9 @@ output.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 \
@@ -157,3 +267,11 @@ moc_filePermissions.cpp: filePermissions.h
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
@@ -129,6 +129,8 @@ AdvancedFm::AdvancedFm( )
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" );
@@ -142,9 +144,9 @@ AdvancedFm::AdvancedFm( )
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 );
@@ -167,9 +169,9 @@ AdvancedFm::AdvancedFm( )
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 );
@@ -299,7 +301,7 @@ void AdvancedFm::populateLocalView()
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())
@@ -352,7 +354,7 @@ void AdvancedFm::populateLocalView()
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 }
@@ -406,7 +408,7 @@ void AdvancedFm::populateRemoteView()
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) {
@@ -457,7 +459,7 @@ void AdvancedFm::populateRemoteView()
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 }
@@ -1097,8 +1099,8 @@ void AdvancedFm::move() {
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())
@@ -1110,8 +1112,8 @@ void AdvancedFm::move() {
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())
@@ -1196,15 +1198,13 @@ void AdvancedFm::runCommand() {
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() {
@@ -1261,3 +1261,10 @@ void AdvancedFm::fileStatus() {
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
@@ -113,6 +113,7 @@ protected slots:
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
@@ -4,13 +4,117 @@
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 )
@@ -23,9 +127,18 @@ Output::Output( QWidget* parent, const char* name, bool modal, WFlags fl )
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/*
@@ -36,3 +149,32 @@ Output::~Output()
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
@@ -28,6 +28,8 @@ public:
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