-rw-r--r-- | noncore/apps/advancedfm/Makefile | 214 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 41 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 1 | ||||
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 148 | ||||
-rw-r--r-- | noncore/apps/advancedfm/output.h | 2 |
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,23 +1,122 @@ ############################################################################# -# Makefile for building $(OPIEDIR)/bin/advancedfm -# Generated by tmake at 18:31, 2002/04/15 -# Project: advancedfm -# Template: app +# Automatically generated from noncore/advancedfm/Makefile.in +# Build options from ############################################################################# -####### Compiler, tools and options +# Compiling +INTERFACE_DECL_PATH = . +SYSCONF_CXX = g++ +SYSCONF_CC = gcc +DASHCROSS = + +# Compiling with support libraries +SYSCONF_CXXFLAGS_X11 = +SYSCONF_CXXFLAGS_QT = -I$(QTDIR)/include +SYSCONF_CXXFLAGS_OPENGL = -I/usr/X11R6/include + +# Compiling YACC output +SYSCONF_CXXFLAGS_YACC = -Wno-unused -Wno-parentheses + +# Linking with support libraries +SYSCONF_RPATH_X11 = +SYSCONF_RPATH_QT = -Wl,-rpath,$(QTDIR)/lib +SYSCONF_RPATH_OPENGL = -Wl,-rpath,/usr/X11R6/lib + +# Linking with support libraries +# X11 +SYSCONF_LFLAGS_X11 = +SYSCONF_LIBS_X11 = +# Qt, Qt+OpenGL +SYSCONF_LFLAGS_QT = -L$(QTDIR)/lib +SYSCONF_LIBS_QT = -lqte$(QT_THREAD_SUFFIX) +SYSCONF_LIBS_QT_OPENGL = +# OpenGL +SYSCONF_LFLAGS_OPENGL = -L/usr/X11R6/lib +SYSCONF_LIBS_OPENGL = +# Yacc +SYSCONF_LIBS_YACC = + +# Linking applications +SYSCONF_LINK = gcc +SYSCONF_LFLAGS = +SYSCONF_LIBS = + +# Link flags for shared objects +SYSCONF_LFLAGS_SHOBJ = -shared + +# Flags for threading +SYSCONF_CFLAGS_THREAD = -D_REENTRANT +SYSCONF_CXXFLAGS_THREAD = -D_REENTRANT +SYSCONF_LFLAGS_THREAD = +SYSCONF_LIBS_THREAD = -lpthread + +# Meta-object compiler +SYSCONF_MOC = $(QTDIR)/bin/moc + +# UI compiler +SYSCONF_UIC = $(QTDIR)/bin/uic + +# Linking shared libraries +# - Build the $(TARGET) library, eg. lib$(TARGET).so.2.2.2 +# - Place target in $(DESTDIR) - which has a trailing / +# - Usually needs to incorporate $(VER_MAJ), $(VER_MIN) and $(VER_PATCH) +# +SYSCONF_LINK_SHLIB = gcc +SYSCONF_LINK_TARGET_SHARED = lib$(TARGET).so.$(VER_MAJ).$(VER_MIN).$(VER_PATCH) +SYSCONF_LINK_LIB_SHARED = $(SYSCONF_LINK_SHLIB) -shared -Wl,-soname,lib$(TARGET).so.$(VER_MAJ) \ + $(LFLAGS) -o $(SYSCONF_LINK_TARGET_SHARED) \ + $(OBJECTS) $(OBJMOC) $(LIBS) && \ + mv $(SYSCONF_LINK_TARGET_SHARED) $(DESTDIR); \ + cd $(DESTDIR) && \ + rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN); \ + ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so; \ + ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ); \ + ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN) + +# Linking static libraries +# - Build the $(TARGET) library, eg. lib$(TARGET).a +# - Place target in $(DESTDIR) - which has a trailing / +# +SYSCONF_AR = ar cqs +SYSCONF_LINK_TARGET_STATIC = lib$(TARGET).a +SYSCONF_LINK_LIB_STATIC = rm -f $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) ; \ + $(SYSCONF_AR) $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) $(OBJECTS) $(OBJMOC) +# Compiling application source +SYSCONF_CXXFLAGS = -pipe -DQWS -fno-exceptions -fno-rtti -O2 -Wall -W +SYSCONF_CFLAGS = -pipe -O2 -Wall -W +# Default link type (static linking is still be used where required) +SYSCONF_LINK_LIB = $(SYSCONF_LINK_LIB_SHARED) +SYSCONF_LINK_TARGET = $(SYSCONF_LINK_TARGET_SHARED) +# Compiling library source +SYSCONF_CXXFLAGS_LIB = -fPIC +SYSCONF_CFLAGS_LIB = -fPIC +# Compiling shared-object source +SYSCONF_CXXFLAGS_SHOBJ = -fPIC +SYSCONF_CFLAGS_SHOBJ = -fPIC +# Linking Qt +SYSCONF_LIBS_QTLIB = $(SYSCONF_LFLAGS_X11) $(QT_LIBS_MT) $(QT_LIBS_OPT) +# Linking Qt applications +SYSCONF_LIBS_QTAPP = +############################################################################# -CC = gcc -CXX = g++ -CFLAGS = -pipe -Wall -W -O2 -fno-default-inline -DNO_DEBUG -CXXFLAGS= -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -DNO_DEBUG -INCPATH = -I$(OPIEDIR)/include -I$(QTDIR)/include -LINK = g++ -LFLAGS = -LIBS = $(SUBLIBS) -L$(QTDIR)/lib -lqpe -lqte -MOC = $(QTDIR)/bin/moc -UIC = $(QTDIR)/bin/uic +####### Compiler, tools and options -TAR = tar -cf -GZIP = gzip -9f +CXX = $(SYSCONF_CXX) $(QT_CXX_MT) +CXXFLAGS= $(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS) +CC = $(SYSCONF_CC) $(QT_C_MT) +CFLAGS = $(SYSCONF_CFLAGS) +INCPATH = -I$(OPIEDIR)/include +LFLAGS = $(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT) +LIBS = $(SUBLIBS) -lqpe $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP) +MOC = $(SYSCONF_MOC) +UIC = $(SYSCONF_UIC) + +####### Target + +DESTDIR = $(OPIEDIR)/bin/ +VER_MAJ = 1 +VER_MIN = 0 +VER_PATCH = 0 +TARGET = advancedfm +TARGET1 = lib$(TARGET).so.$(VER_MAJ) @@ -39,5 +138,5 @@ OBJECTS = advancedfm.o \ main.o -INTERFACES = -UICDECLS = -UICIMPLS = +INTERFACES = +UICDECLS = +UICIMPLS = SRCMOC = moc_advancedfm.cpp \ @@ -50,5 +149,3 @@ OBJMOC = moc_advancedfm.o \ moc_output.o -DIST = -TARGET = $(OPIEDIR)/bin/advancedfm -INTERFACE_DECL_PATH = . + @@ -76,6 +173,6 @@ INTERFACE_DECL_PATH = . -all: $(TARGET) +all: $(DESTDIR)$(TARGET) -$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) +$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) + $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) @@ -83,14 +180,26 @@ moc: $(SRCMOC) -tmake: Makefile - -Makefile: advancedfm.pro - tmake advancedfm.pro -o Makefile - -dist: - $(TAR) advancedfm.tar advancedfm.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) - $(GZIP) advancedfm.tar +tmake: + tmake advancedfm.pro clean: - -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) -rm -f *~ core + -rm -f allmoc.cpp + +####### Extension Modules + +listpromodules: + @echo + +listallmodules: + @echo + +listaddonpromodules: + @echo + +listaddonentmodules: + @echo + + +REQUIRES=medium-config @@ -102,2 +211,3 @@ clean: + ####### Compile @@ -109,12 +219,12 @@ advancedfm.o: advancedfm.cpp \ output.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/lnkproperties.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/filemanager.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/qcopenvelope_qws.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/qpemenubar.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/qpetoolbar.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/qpeapplication.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/resource.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/config.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/mimetype.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/applnk.h + $(OPIEDIR)/include/qpe/lnkproperties.h \ + $(OPIEDIR)/include/qpe/filemanager.h \ + $(OPIEDIR)/include/qpe/qcopenvelope_qws.h \ + $(OPIEDIR)/include/qpe/qpemenubar.h \ + $(OPIEDIR)/include/qpe/qpetoolbar.h \ + $(OPIEDIR)/include/qpe/qpeapplication.h \ + $(OPIEDIR)/include/qpe/resource.h \ + $(OPIEDIR)/include/qpe/config.h \ + $(OPIEDIR)/include/qpe/mimetype.h \ + $(OPIEDIR)/include/qpe/applnk.h @@ -130,5 +240,5 @@ output.o: output.cpp \ main.o: main.cpp \ - /usr/src/oldsrc/Opie/opie/include/qpe/qpeapplication.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/qcopenvelope_qws.h \ - /usr/src/oldsrc/Opie/opie/include/qpe/config.h \ + $(OPIEDIR)/include/qpe/qpeapplication.h \ + $(OPIEDIR)/include/qpe/qcopenvelope_qws.h \ + $(OPIEDIR)/include/qpe/config.h \ advancedfm.h @@ -159 +269,9 @@ moc_output.cpp: output.h + + +lupdate: + lupdate advancedfm.pro + +lrelease: + lrelease advancedfm.pro + 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( ) viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); + viewMenu->insertSeparator(); + viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); viewMenu->setCheckable(TRUE); @@ -144,5 +146,5 @@ AdvancedFm::AdvancedFm( ) Local_View->addColumn( tr("File"),140); - Local_View->addColumn( tr("Size"),-1); - Local_View->setColumnAlignment(1,QListView::AlignRight); Local_View->addColumn( tr("Date"),-1); + Local_View->setColumnAlignment(1,QListView::AlignRight); + Local_View->addColumn( tr("Size"),-1); Local_View->setColumnAlignment(2,QListView::AlignRight); @@ -169,5 +171,5 @@ AdvancedFm::AdvancedFm( ) Remote_View->addColumn( tr("File"),140); - Remote_View->addColumn( tr("Size"),-1); - Remote_View->setColumnAlignment(1,QListView::AlignRight); Remote_View->addColumn( tr("Date"),-1); + Remote_View->setColumnAlignment(1,QListView::AlignRight); + Remote_View->addColumn( tr("Size"),-1); Remote_View->setColumnAlignment(2,QListView::AlignRight); @@ -301,3 +303,3 @@ void AdvancedFm::populateLocalView() if(fileL !="./" && fi->exists()) { - item= new QListViewItem( Local_View, fileL, fileS , fileDate); + item= new QListViewItem( Local_View, fileL , fileDate, fileS); @@ -354,3 +356,3 @@ void AdvancedFm::populateLocalView() if( fileL.find(".") == -1 ){ - item= new QListViewItem( Local_View, fileL, fileS, fileDate); + item= new QListViewItem( Local_View, fileL, fileDate, fileS); pm = Resource::loadPixmap( "UnknownDocument-14" ); @@ -408,3 +410,3 @@ void AdvancedFm::populateRemoteView() if(fileL !="./" && fi->exists()) { - item= new QListViewItem( Remote_View,fileL,fileS , fileDate); + item= new QListViewItem( Remote_View, fileL, fileDate, fileS); QPixmap pm; @@ -459,3 +461,3 @@ void AdvancedFm::populateRemoteView() if( fileL.find(".") == -1 ){ - item= new QListViewItem( Remote_View, fileL, fileS, fileDate); + item= new QListViewItem( Remote_View, fileL, fileDate, fileS); pm = Resource::loadPixmap( "UnknownDocument-14" ); @@ -1099,4 +1101,4 @@ void AdvancedFm::move() { if (TabWidget->currentPageIndex() == 0) { - QString destFile = currentRemoteDir.canonicalPath()+Local_View->currentItem()->text(0); -// qDebug(destFile); + QString destFile = currentRemoteDir.canonicalPath() + "/" + Local_View->currentItem()->text(0); + qDebug("Destination file is "+destFile); @@ -1112,4 +1114,4 @@ void AdvancedFm::move() { } else { - QString destFile = currentDir.canonicalPath()+destFile + Remote_View->currentItem()->text(0); -// qDebug(destFile); + QString destFile = currentDir.canonicalPath() + "/" + Remote_View->currentItem()->text(0); + qDebug("Destination file is "+destFile); @@ -1198,11 +1200,9 @@ void AdvancedFm::runCommand() { while ( fgets( line, sizeof line, fp)) { - outDlg->OutputEdit->append(line); + QString lineStr = line; + lineStr=lineStr.left(lineStr.length()-1); + outDlg->OutputEdit->append(lineStr); outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); - } - } - } - } @@ -1263 +1263,8 @@ void AdvancedFm::fileStatus() { } + +void AdvancedFm::doAbout() { + QMessageBox::message("AdvancedFm","Advanced FileManager\n" + "is copyright 2002 by\n" + "L.J.Potter<llornkcor@handhelds.org>\n" + "and is licensed by the GPL"); +} 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: void fileStatus(); + void doAbout(); }; 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 @@ #include "output.h" +#include "inputDialog.h" +#include <qpe/filemanager.h> +#include <qpe/qpeapplication.h> +#include <qpe/applnk.h> + +#include <qfile.h> + +#include <qlineedit.h> #include <qmultilineedit.h> @@ -11,4 +19,100 @@ #include <qvariant.h> -#include <qtooltip.h> -#include <qwhatsthis.h> + +/* XPM */ +static char * filesave_xpm[] = { +"16 16 78 1", +" c None", +". c #343434", +"+ c #A0A0A0", +"@ c #565656", +"# c #9E9E9E", +"$ c #525252", +"% c #929292", +"& c #676767", +"* c #848484", +"= c #666666", +"- c #D8D8D8", +"; c #FFFFFF", +"> c #DBDBDB", +", c #636363", +"' c #989898", +") c #2D2D2D", +"! c #909090", +"~ c #AEAEAE", +"{ c #EAEAEA", +"] c #575757", +"^ c #585858", +"/ c #8A8A8A", +"( c #828282", +"_ c #6F6F6F", +": c #C9C9C9", +"< c #050505", +"[ c #292929", +"} c #777777", +"| c #616161", +"1 c #3A3A3A", +"2 c #BEBEBE", +"3 c #2C2C2C", +"4 c #7C7C7C", +"5 c #F6F6F6", +"6 c #FCFCFC", +"7 c #6B6B6B", +"8 c #959595", +"9 c #4F4F4F", +"0 c #808080", +"a c #767676", +"b c #818181", +"c c #B8B8B8", +"d c #FBFBFB", +"e c #F9F9F9", +"f c #CCCCCC", +"g c #030303", +"h c #737373", +"i c #7A7A7A", +"j c #7E7E7E", +"k c #6A6A6A", +"l c #FAFAFA", +"m c #505050", +"n c #9D9D9D", +"o c #333333", +"p c #7B7B7B", +"q c #787878", +"r c #696969", +"s c #494949", +"t c #555555", +"u c #949494", +"v c #E6E6E6", +"w c #424242", +"x c #515151", +"y c #535353", +"z c #3E3E3E", +"A c #D4D4D4", +"B c #0C0C0C", +"C c #353535", +"D c #474747", +"E c #ECECEC", +"F c #919191", +"G c #7D7D7D", +"H c #000000", +"I c #404040", +"J c #858585", +"K c #323232", +"L c #D0D0D0", +"M c #1C1C1C", +" ...+ ", +" @#$%&..+ ", +" .*=-;;>,..+ ", +" ')!~;;;;;;{]..", +" ^/(-;;;;;;;_:<", +" [}|;;;;;;;{12$", +" #34-55;;;;678$+", +" 90ab=c;dd;e1fg ", +" [ahij((kbl0mn$ ", +" op^q^^7r&]s/$+ ", +"@btu;vbwxy]zAB ", +"CzDEvEv;;DssF$ ", +"G.H{E{E{IxsJ$+ ", +" +...vEKxzLM ", +" +...z]n$ ", +" +... "}; @@ -25,5 +129,14 @@ Output::Output( QWidget* parent, const char* name, bool modal, WFlags fl ) + QPushButton *docButton; + docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton"); + docButton->setFixedSize( QSize( 20, 20 ) ); + connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() )); +// docButton->setFlat(TRUE); + OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 ); + + OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); + OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 ); + - OutputLayout->addWidget( OutputEdit, 0, 0 ); } @@ -38 +151,30 @@ Output::~Output() +void Output::saveOutput() { + + InputDialog *fileDlg; + fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); + fileDlg->exec(); + if( fileDlg->result() == 1 ) { + QString filename = QPEApplication::documentDir(); + if(filename.right(1).find('/') == -1) + filename+="/"; + QString name = fileDlg->LineEdit1->text(); + filename+="text/plain/"+name; + qDebug(filename); + + QFile f(filename); + f.open( IO_WriteOnly); + if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { + DocLnk lnk; + lnk.setName(name); //sets file name + lnk.setFile(filename); //sets File property + lnk.setType("text/plain"); + if(!lnk.writeLink()) { + qDebug("Writing doclink did not work"); + } + } else + qWarning("Could not write file"); + f.close(); + + } +} 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: QGridLayout* OutputLayout; +protected slots: + void saveOutput(); }; |