summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
authorllornkcor <llornkcor>2002-04-19 23:54:20 (UTC)
committer llornkcor <llornkcor>2002-04-19 23:54:20 (UTC)
commitd2c2dd7d80cfd5359db07952385bca575f1eeeae (patch) (unidiff)
tree280bb492460de8af699caccea5a5183fd8d1bda0 /noncore/apps/advancedfm
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 (limited to 'noncore/apps/advancedfm') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/Makefile208
-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, 335 insertions, 65 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,23 +1,122 @@
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
@@ -50,5 +149,3 @@ OBJMOC = moc_advancedfm.o \
50 moc_output.o 149 moc_output.o
51 DIST = 150
52 TARGET =$(OPIEDIR)/bin/advancedfm
53INTERFACE_DECL_PATH = .
54 151
@@ -76,6 +173,6 @@ INTERFACE_DECL_PATH = .
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
@@ -83,14 +180,26 @@ moc: $(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
@@ -102,2 +211,3 @@ clean:
102 211
212
103####### Compile 213####### Compile
@@ -109,12 +219,12 @@ advancedfm.o: advancedfm.cpp \
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
@@ -130,5 +240,5 @@ output.o: output.cpp \
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
@@ -159 +269,9 @@ moc_output.cpp: output.h
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
@@ -131,2 +131,4 @@ AdvancedFm::AdvancedFm( )
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);
@@ -144,5 +146,5 @@ AdvancedFm::AdvancedFm( )
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);
@@ -169,5 +171,5 @@ AdvancedFm::AdvancedFm( )
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);
@@ -301,3 +303,3 @@ void AdvancedFm::populateLocalView()
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
@@ -354,3 +356,3 @@ void AdvancedFm::populateLocalView()
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" );
@@ -408,3 +410,3 @@ void AdvancedFm::populateRemoteView()
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;
@@ -459,3 +461,3 @@ void AdvancedFm::populateRemoteView()
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" );
@@ -1099,4 +1101,4 @@ void AdvancedFm::move() {
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
@@ -1112,4 +1114,4 @@ void AdvancedFm::move() {
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
@@ -1198,11 +1200,9 @@ void AdvancedFm::runCommand() {
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}
@@ -1263 +1263,8 @@ void AdvancedFm::fileStatus() {
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
@@ -115,2 +115,3 @@ protected slots:
115 void fileStatus(); 115 void fileStatus();
116 void doAbout();
116}; 117};
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
@@ -6,3 +6,11 @@
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>
@@ -11,4 +19,100 @@
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
@@ -25,5 +129,14 @@ Output::Output( QWidget* parent, const char* name, bool modal, WFlags fl )
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}
@@ -38 +151,30 @@ Output::~Output()
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
@@ -30,2 +30,4 @@ protected:
30 QGridLayout* OutputLayout; 30 QGridLayout* OutputLayout;
31protected slots:
32 void saveOutput();
31}; 33};