summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opie-ftp.control2
-rw-r--r--noncore/net/opieftp/opieftp.cpp71
2 files changed, 32 insertions, 41 deletions
diff --git a/noncore/net/opieftp/opie-ftp.control b/noncore/net/opieftp/opie-ftp.control
index 32cc7a6..82f774f 100644
--- a/noncore/net/opieftp/opie-ftp.control
+++ b/noncore/net/opieftp/opie-ftp.control
@@ -4,7 +4,7 @@ Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: L.J. Potter <ljp@llornkcor.com> 5Maintainer: L.J. Potter <ljp@llornkcor.com>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal, ftplib 7Depends: task-opie-minimal, ftplib, libopiecore2
8Replaces: opieftp 8Replaces: opieftp
9Description: Opie-Ftp 9Description: Opie-Ftp
10 The ftp client for the Opie environment. 10 The ftp client for the Opie environment.
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 4f0ca29..14fd859 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -23,24 +23,27 @@ extern "C" {
23//#include <opie2/odebug.h> 23//#include <opie2/odebug.h>
24//using namespace Opie::Core; 24//using namespace Opie::Core;
25 25
26#include <qpe/qpeapplication.h> 26#include <opie2/oresource.h>
27#include <qpe/resource.h> 27
28#include <qpe/applnk.h>
28#include <qpe/config.h> 29#include <qpe/config.h>
29#include <qpe/mimetype.h> 30#include <qpe/mimetype.h>
31#include <qpe/qpeapplication.h>
32#include <qpe/qpemenubar.h>
30 33
31#include <qtextstream.h> 34#include <qbitmap.h>
32#include <qpushbutton.h>
33#include <qtoolbutton.h>
34#include <qcombobox.h> 35#include <qcombobox.h>
35#include <qlistview.h>
36#include <qlabel.h> 36#include <qlabel.h>
37#include <qlayout.h>
38#include <qlistview.h>
39#include <qmenubar.h>
40#include <qmessagebox.h>
37#include <qprogressbar.h> 41#include <qprogressbar.h>
42#include <qpushbutton.h>
38#include <qspinbox.h> 43#include <qspinbox.h>
39#include <qtabwidget.h> 44#include <qtabwidget.h>
40#include <qlayout.h> 45#include <qtextstream.h>
41#include <qmessagebox.h> 46#include <qtoolbutton.h>
42#include <qmenubar.h>
43#include <qpe/qpemenubar.h>
44 47
45#include <qlineedit.h> 48#include <qlineedit.h>
46#include <qlistbox.h> 49#include <qlistbox.h>
@@ -90,10 +93,7 @@ void OpieFtp::initializeGui() {
90// QPEToolBar *menuBar = new QPEToolBar(this); 93// QPEToolBar *menuBar = new QPEToolBar(this);
91// menuBar->setHorizontalStretchable( TRUE ); 94// menuBar->setHorizontalStretchable( TRUE );
92 95
93 QWMatrix matrix; 96 unknownXpm = Opie::Core::OResource::loadPixmap( "UnknownDocument", Opie::Core::OResource::SmallIcon );
94 QPixmap pix(Resource::loadPixmap( "UnknownDocument" ));
95 matrix.scale( .4, .4);
96 unknownXpm = pix.xForm(matrix);
97 97
98 connectionMenu = new QPopupMenu( this ); 98 connectionMenu = new QPopupMenu( this );
99 localMenu = new QPopupMenu( this ); 99 localMenu = new QPopupMenu( this );
@@ -133,27 +133,21 @@ void OpieFtp::initializeGui() {
133 tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 133 tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
134 tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); 134 tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
135 tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); 135 tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() ));
136 tabMenu->insertSeparator();
137// tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
138 tabMenu->setCheckable(TRUE); 136 tabMenu->setCheckable(TRUE);
139 137
140 138 bool useBigPix = qApp->desktop()->size().width() > 330;
141 cdUpButton = new QToolButton( view,"cdUpButton"); 139 cdUpButton = new QToolButton( view,"cdUpButton");
142 cdUpButton->setPixmap(Resource::loadPixmap("up")); 140 cdUpButton->setUsesBigPixmap( useBigPix );
143 cdUpButton ->setFixedSize( QSize( 20, 20 ) ); 141 cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) );
142 cdUpButton->setFixedSize( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
144 connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); 143 connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) );
145 layout->addMultiCellWidget( cdUpButton, 0, 0, 4, 4 ); 144 layout->addMultiCellWidget( cdUpButton, 0, 0, 4, 4 );
146 cdUpButton->hide(); 145 cdUpButton->hide();
147 146
148// docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",view,"docsButton");
149// docButton->setFixedSize( QSize( 20, 20 ) );
150// connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
151// docButton->setFlat(TRUE);
152// layout->addMultiCellWidget( docButton, 0, 0, 6, 6 );
153
154 homeButton = new QToolButton( view,"homeButton"); 147 homeButton = new QToolButton( view,"homeButton");
155 homeButton->setPixmap( Resource::loadPixmap("home")); 148 homeButton->setUsesBigPixmap( useBigPix );
156 homeButton->setFixedSize( QSize( 20, 20 ) ); 149 homeButton->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) );
150 homeButton->setFixedSize( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
157 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 151 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
158 layout->addMultiCellWidget( homeButton, 0, 0, 3, 3); 152 layout->addMultiCellWidget( homeButton, 0, 0, 3, 3);
159 homeButton->hide(); 153 homeButton->hide();
@@ -161,8 +155,6 @@ void OpieFtp::initializeGui() {
161 TabWidget = new QTabWidget( view, "TabWidget" ); 155 TabWidget = new QTabWidget( view, "TabWidget" );
162 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); 156 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 );
163 157
164// TabWidget->setTabShape(QTabWidget::Triangular);
165
166 tab = new QWidget( TabWidget, "tab" ); 158 tab = new QWidget( TabWidget, "tab" );
167 tabLayout = new QGridLayout( tab ); 159 tabLayout = new QGridLayout( tab );
168 tabLayout->setSpacing( 2); 160 tabLayout->setSpacing( 2);
@@ -341,7 +333,7 @@ void OpieFtp::initializeGui() {
341// ServerComboBox->setCurrentItem(currentServerConfig); 333// ServerComboBox->setCurrentItem(currentServerConfig);
342 334
343 TabWidget->setCurrentPage(2); 335 TabWidget->setCurrentPage(2);
344 qDebug("XXXXXXXXXXXX Constructor done"); 336 // qDebug("XXXXXXXXXXXX Constructor done");
345 337
346} 338}
347 339
@@ -699,13 +691,13 @@ void OpieFtp::populateLocalView()
699 691
700 if(isDir || fileL.find("/",0,TRUE) != -1) { 692 if(isDir || fileL.find("/",0,TRUE) != -1) {
701 if( !QDir( fi->filePath() ).isReadable()) 693 if( !QDir( fi->filePath() ).isReadable())
702 pm = Resource::loadPixmap( "lockedfolder" ); 694 pm = Opie::Core::OResource::loadPixmap( "lockedfolder", Opie::Core::OResource::SmallIcon );
703 else 695 else
704 pm= Resource::loadPixmap( "folder" ); 696 pm = Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon );
705 item->setPixmap( 0,pm ); 697 item->setPixmap( 0,pm );
706 } else { 698 } else {
707 if( !fi->isReadable() ) 699 if( !fi->isReadable() )
708 pm = Resource::loadPixmap( "locked" ); 700 pm = Opie::Core::OResource::loadPixmap( "locked", Opie::Core::OResource::SmallIcon );
709 else { 701 else {
710 MimeType mt(fi->filePath()); 702 MimeType mt(fi->filePath());
711 pm=mt.pixmap(); //sets the correct pixmap for mimetype 703 pm=mt.pixmap(); //sets the correct pixmap for mimetype
@@ -715,13 +707,12 @@ void OpieFtp::populateLocalView()
715 } 707 }
716 if( fileL.find("->",0,TRUE) != -1) { 708 if( fileL.find("->",0,TRUE) != -1) {
717 // overlay link image 709 // overlay link image
718 pm= Resource::loadPixmap( "folder" ); 710 pm = Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon );
719 QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 711 QPixmap lnk = Opie::Core::OResource::loadPixmap( "opie/symlink" );
720 QPainter painter( &pm ); 712 QPainter painter( &pm );
721 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 713 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
722 pm.setMask( pm.createHeuristicMask( FALSE ) );
723 } 714 }
724 item->setPixmap( 0,pm); 715 item->setPixmap( 0,pm);
725 } 716 }
726 isDir=FALSE; 717 isDir=FALSE;
727 ++it; 718 ++it;
@@ -763,13 +754,13 @@ bool OpieFtp::populateRemoteView( )
763 754
764 if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) { 755 if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
765 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d"); 756 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d");
766 item->setPixmap( 0, Resource::loadPixmap( "folder" )); 757 item->setPixmap( 0, Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ));
767// if(itemDir) 758// if(itemDir)
768 item->moveItem(itemDir); 759 item->moveItem(itemDir);
769 itemDir=item; 760 itemDir=item;
770 } else { 761 } else {
771 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f"); 762 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f");
772 item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); 763 item->setPixmap( 0, Opie::Core::OResource::loadPixmap( "fileopen", Opie::Core::OResource::SmallIcon ));
773// if(itemFile) 764// if(itemFile)
774 item->moveItem(itemDir); 765 item->moveItem(itemDir);
775 item->moveItem(itemFile); 766 item->moveItem(itemFile);
@@ -777,7 +768,7 @@ bool OpieFtp::populateRemoteView( )
777 } 768 }
778 } 769 }
779 QListViewItem * item1 = new QListViewItem( Remote_View, "../"); 770 QListViewItem * item1 = new QListViewItem( Remote_View, "../");
780 item1->setPixmap( 0, Resource::loadPixmap( "folder" )); 771 item1->setPixmap( 0, Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ));
781 file.close(); 772 file.close();
782 if( file.exists()) 773 if( file.exists())
783 file. remove(); 774 file. remove();