author | llornkcor <llornkcor> | 2003-05-26 02:51:00 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-05-26 02:51:00 (UTC) |
commit | eaa924af86511fd43fc9eac5438e73972f82158b (patch) (side-by-side diff) | |
tree | f6a0c07eba3951d50935ab1a7edccc95a1659949 | |
parent | 3fee41c94625fdef794a2eaabfc440cd01a1b11a (diff) | |
download | opie-eaa924af86511fd43fc9eac5438e73972f82158b.zip opie-eaa924af86511fd43fc9eac5438e73972f82158b.tar.gz opie-eaa924af86511fd43fc9eac5438e73972f82158b.tar.bz2 |
remove extra includes
-rw-r--r-- | noncore/net/opieftp/filePermissions.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opieftp/inputDialog.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opieftp/main.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 14 |
4 files changed, 0 insertions, 26 deletions
diff --git a/noncore/net/opieftp/filePermissions.cpp b/noncore/net/opieftp/filePermissions.cpp index ab094db..f545c1f 100644 --- a/noncore/net/opieftp/filePermissions.cpp +++ b/noncore/net/opieftp/filePermissions.cpp @@ -1,216 +1,212 @@ /**************************************************************************** ** copyright 2002 ljp ljp@llornkcor.com ** Created: Sat Feb 23 19:44:40 2002 L.J. Potter ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ****************************************************************************/ #include "filePermissions.h" -#include <qfile.h> #include <qfileinfo.h> #include <qcheckbox.h> #include <qlabel.h> #include <qlineedit.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qtooltip.h> #include <qmessagebox.h> #include <unistd.h> #include <sys/stat.h> #include <stdlib.h> #include <sys/types.h> #include <pwd.h> #include <grp.h> filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName, bool useRemote ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( tr("filePermissions") ); // qDebug("FilePermissions "+fileName); resize( 236, 210 ); isRemote=useRemote; setMaximumSize( QSize( 236, 210 ) ); setCaption( tr( "Set File Permissions" ) ); TextLabel1 = new QLabel( this, "TextLabel1" ); TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); TextLabel1->setText( tr( "Set file permissions for:" ) ); LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setGeometry( QRect( 10, 25, 218, 22 ) ); LineEdit1->setReadOnly(true); TextLabel4 = new QLabel( this, "TextLabel4" ); TextLabel4->setGeometry( QRect( 5, 85, 50, 15 ) ); TextLabel4->setText( tr( "owner" ) ); TextLabel4_2 = new QLabel( this, "TextLabel4_2" ); TextLabel4_2->setGeometry( QRect( 5, 105, 50, 15 ) ); TextLabel4_2->setText( tr( "group" ) ); TextLabel4_3 = new QLabel( this, "TextLabel4_3" ); TextLabel4_3->setGeometry( QRect( 5, 125, 50, 15 ) ); TextLabel4_3->setText( tr( "others" ) ); CheckBox1 = new QCheckBox( this, "CheckBox1" ); CheckBox1->setGeometry( QRect( 75, 85, 20, 16 ) ); connect(CheckBox1, SIGNAL(released()),this,SLOT(ownReadCheck())); CheckBox1_2 = new QCheckBox( this, "CheckBox1_2" ); CheckBox1_2->setGeometry( QRect( 135, 85, 20, 16 ) ); connect(CheckBox1_2, SIGNAL(released()),this,SLOT(ownWriteCheck())); CheckBox1_3 = new QCheckBox( this, "CheckBox1_3" ); CheckBox1_3->setGeometry( QRect( 195, 85, 20, 16 ) ); connect(CheckBox1_3, SIGNAL(released()),this,SLOT(ownExeCheck())); CheckBox1_4 = new QCheckBox( this, "CheckBox1_4" ); CheckBox1_4->setGeometry( QRect( 75, 105, 20, 16 ) ); connect(CheckBox1_4, SIGNAL(released()),this,SLOT(grpReadCheck())); CheckBox1_5 = new QCheckBox( this, "CheckBox1_5" ); CheckBox1_5->setGeometry( QRect( 135, 105, 20, 16 ) ); connect(CheckBox1_5, SIGNAL(released()),this,SLOT(grpWriteCheck())); CheckBox1_6 = new QCheckBox( this, "CheckBox1_6" ); CheckBox1_6->setGeometry( QRect( 195, 105, 20, 16 ) ); connect(CheckBox1_6, SIGNAL(released()),this,SLOT(grpExeCheck())); CheckBox1_7 = new QCheckBox( this, "CheckBox1_7" ); CheckBox1_7->setGeometry( QRect( 75, 125, 16, 16 ) ); connect(CheckBox1_7, SIGNAL(released()),this,SLOT(wrldReadCheck())); CheckBox1_8 = new QCheckBox( this, "CheckBox1_8" ); CheckBox1_8->setGeometry( QRect( 135, 125, 20, 16 ) ); connect(CheckBox1_8, SIGNAL(released()),this,SLOT(wrldWriteCheck())); CheckBox1_8_2 = new QCheckBox( this, "CheckBox1_8_2" ); CheckBox1_8_2->setGeometry( QRect( 195, 125, 20, 16 ) ); connect(CheckBox1_8_2, SIGNAL(released()),this,SLOT(wrldExeCheck())); GroupLineEdit = new QLineEdit( this, "GroupLineEdit" ); GroupLineEdit->setGeometry( QRect( 125, 155, 106, 22 ) ); OwnerLineEdit = new QLineEdit( this, "OwnerLineEdit" ); OwnerLineEdit->setGeometry( QRect( 10, 155, 106, 22 ) ); TextLabel5 = new QLabel( this, "TextLabel5" ); TextLabel5->setGeometry( QRect( 45, 180, 40, 16 ) ); TextLabel5->setText( tr( "Owner" ) ); TextLabel5_2 = new QLabel( this, "TextLabel5_2" ); TextLabel5_2->setGeometry( QRect( 155, 180, 40, 16 ) ); TextLabel5_2->setText( tr( "Group" ) ); ModeLine = new QLineEdit( this, "TextLabelMode" ); ModeLine->setGeometry( QRect( 10, 60, 40, 15 ) ); TextLabel3_2 = new QLabel( this, "TextLabel3_2" ); TextLabel3_2->setGeometry( QRect( 60, 55, 50, 20 ) ); TextLabel3_2->setText( tr( "read" ) ); TextLabel3_2->setAlignment( int( QLabel::AlignBottom | QLabel::AlignHCenter ) ); TextLabel3_2_2 = new QLabel( this, "TextLabel3_2_2" ); TextLabel3_2_2->setGeometry( QRect( 120, 55, 50, 20 ) ); TextLabel3_2_2->setText( tr( "write" ) ); TextLabel3_2_2->setAlignment( int( QLabel::AlignBottom | QLabel::AlignHCenter ) ); TextLabel3 = new QLabel( this, "TextLabel3" ); TextLabel3->setGeometry( QRect( 180, 55, 50, 20 ) ); TextLabel3->setText( tr( "execute" ) ); TextLabel3->setAlignment( int( QLabel::AlignBottom | QLabel::AlignHCenter ) ); struct stat buf; mode_t mode; file = fileName; QFileInfo fi(file); LineEdit1->setText( file); OwnerLineEdit->setText( fi.owner()); GroupLineEdit->setText( fi.group()); if( fi.permission( QFileInfo::ReadUser)) { CheckBox1->setChecked(true); } if( fi.permission( QFileInfo::WriteUser)) { CheckBox1_2->setChecked(true); } if( fi.permission( QFileInfo::ExeUser)) { CheckBox1_3->setChecked(true); } if( fi.permission( QFileInfo::ReadGroup)) { CheckBox1_4->setChecked(true); } if( fi.permission( QFileInfo::WriteGroup)) { CheckBox1_5->setChecked(true); } if( fi.permission( QFileInfo::ExeGroup)) { CheckBox1_6->setChecked(true); } if( fi.permission( QFileInfo::ReadOther)) { CheckBox1_7->setChecked(true); } if( fi.permission( QFileInfo::WriteOther)) { CheckBox1_8->setChecked(true); } if( fi.permission( QFileInfo::ExeOther)) { CheckBox1_8_2->setChecked(true); } stat(file.latin1(), &buf); mode = buf.st_mode; modeStr.sprintf("%#o", buf.st_mode & ~(S_IFMT) ); ModeLine->setText(modeStr); bool ok; i_mode = modeStr.toInt(&ok,10); } /* * Destroys the object and frees any allocated resources */ filePermissions::~filePermissions() { } // might this be better as a callback routine??? void filePermissions::ownReadCheck() { if(CheckBox1->isChecked()) { i_mode +=400; } else i_mode -=400; modeStr.sprintf("0%d",i_mode); ModeLine->setText( modeStr); // 0400 } void filePermissions::ownWriteCheck() { if(CheckBox1_2->isChecked()) { i_mode +=200; } else i_mode -=200; modeStr.sprintf("0%d",i_mode); ModeLine->setText(modeStr); // 0200 } void filePermissions::ownExeCheck() { if(CheckBox1_3->isChecked()) { i_mode +=100; } else i_mode -=100; modeStr.sprintf("0%d",i_mode); ModeLine->setText(modeStr); // 0100 } void filePermissions::grpReadCheck() { if(CheckBox1_4->isChecked()) { i_mode +=40; } else i_mode -=40; modeStr.sprintf("0%d",i_mode); ModeLine->setText(modeStr); // 0040 } void filePermissions::grpWriteCheck() { if(CheckBox1_5->isChecked()) { i_mode +=20; } else i_mode -=20; modeStr.sprintf("0%d",i_mode); ModeLine->setText(modeStr); // 0020 } void filePermissions::grpExeCheck() { if(CheckBox1_6->isChecked()) { i_mode +=10; } else i_mode -=10; modeStr.sprintf("0%d",i_mode); ModeLine->setText(modeStr); diff --git a/noncore/net/opieftp/inputDialog.cpp b/noncore/net/opieftp/inputDialog.cpp index 373db3b..23741c0 100644 --- a/noncore/net/opieftp/inputDialog.cpp +++ b/noncore/net/opieftp/inputDialog.cpp @@ -1,44 +1,40 @@ /**************************************************************************** inputDialog.cpp ------------------- ** Created: Sat Mar 9 23:33:09 2002 copyright : (C) 2002 by ljp email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include "inputDialog.h" #include <qlineedit.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qtooltip.h> -#include <qwhatsthis.h> InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "InputDialog" ); resize( 234, 50 ); setMaximumSize( QSize( 240, 50 ) ); setCaption( tr(name ) ); LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); } InputDialog::~InputDialog() { inputText= LineEdit1->text(); } void InputDialog::setTextEdit(const QString &string) { LineEdit1->setText(string); } diff --git a/noncore/net/opieftp/main.cpp b/noncore/net/opieftp/main.cpp index 28676e1..4f5a7d4 100644 --- a/noncore/net/opieftp/main.cpp +++ b/noncore/net/opieftp/main.cpp @@ -1,31 +1,27 @@ /*************************************************************************** main.cpp - description ------------------- begin : March 10, 2002 copyright : (C) 2002 by llornkcor email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include <qpe/qpeapplication.h> -#include <qpe/qcopenvelope_qws.h> -#include <qpe/config.h> -#include <qstring.h> -#include <qstringlist.h> #include "opieftp.h" int main(int argc, char *argv[]) { QPEApplication a(argc, argv); OpieFtp opieftp; a.showMainWidget( &opieftp); return a.exec(); } diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index e81b7ca..668a03d 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -1,245 +1,231 @@ /*************************************************************************** opieftp.cpp ------------------- ** Created: Sat Mar 9 23:33:09 2002 copyright : (C) 2002 by ljp email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ //#define DEVELOPERS_VERSION #include "opieftp.h" extern "C" { #include "../ftplib/ftplib.h" } #include "inputDialog.h" #include <qpe/qpemenubar.h> -#include <qpe/qpetoolbar.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> -#include <qpe/qcopenvelope_qws.h> #include <qpe/config.h> #include <qpe/mimetype.h> -#include <qpe/qpemessagebox.h> -#include <qstringlist.h> #include <qtextstream.h> #include <qpushbutton.h> #include <qtoolbutton.h> -#include <qdatetime.h> -#include <qdir.h> -#include <qfile.h> -#include <qstring.h> #include <qcombobox.h> -#include <qpopupmenu.h> #include <qlistview.h> -#include <qmainwindow.h> #include <qlabel.h> #include <qprogressbar.h> #include <qspinbox.h> #include <qtabwidget.h> -#include <qwidget.h> #include <qlayout.h> -#include <qimage.h> -#include <qpixmap.h> #include <qmessagebox.h> #include <qlineedit.h> -#include <qregexp.h> #include <qlistbox.h> #include <unistd.h> #include <stdlib.h> QProgressBar *ProgressBar; static netbuf *conn=NULL; static int log_progress(netbuf *, int xfered, void *) { // int fsz = *(int *)arg; // int pct = (xfered * 100) / fsz; // printf("%3d%%\r", pct); // fflush(stdout); ProgressBar->setProgress(xfered); qApp->processEvents(); return 1; } OpieFtp::OpieFtp( ) : QMainWindow( ) { setCaption( tr( "OpieFtp" ) ); fuckeduphack=FALSE; QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 2); layout->setMargin( 2); connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); QPEMenuBar *menuBar = new QPEMenuBar(this); // QPEToolBar *menuBar = new QPEToolBar(this); // menuBar->setHorizontalStretchable( TRUE ); QWMatrix matrix; QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); matrix.scale( .4, .4); unknownXpm = pix.xForm(matrix); connectionMenu = new QPopupMenu( this ); localMenu = new QPopupMenu( this ); remoteMenu = new QPopupMenu( this ); tabMenu = new QPopupMenu( this ); layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); menuBar->insertItem( tr( "Connection" ), connectionMenu); // menuBar->insertItem( tr( "Local" ), localMenu); // menuBar->insertItem( tr( "Remote" ), remoteMenu); menuBar->insertItem( tr( "View" ), tabMenu); tabMenu->insertItem( tr( "Local" ), localMenu); tabMenu->insertItem( tr( "Remote" ), remoteMenu); connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); localMenu->insertSeparator(); localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); localMenu->insertSeparator(); localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); localMenu->setCheckable(TRUE); remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); remoteMenu->insertSeparator(); remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); tabMenu->insertSeparator(); tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); tabMenu->insertSeparator(); // tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); tabMenu->setCheckable(TRUE); cdUpButton = new QToolButton( this,"cdUpButton"); cdUpButton->setPixmap(Resource::loadPixmap("up")); cdUpButton ->setFixedSize( QSize( 20, 20 ) ); connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); cdUpButton->hide(); // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); // docButton->setFixedSize( QSize( 20, 20 ) ); // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); // docButton->setFlat(TRUE); // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); homeButton = new QToolButton(this,"homeButton"); homeButton->setPixmap( Resource::loadPixmap("home")); homeButton->setFixedSize( QSize( 20, 20 ) ); connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); homeButton->hide(); TabWidget = new QTabWidget( this, "TabWidget" ); layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); // TabWidget->setTabShape(QTabWidget::Triangular); tab = new QWidget( TabWidget, "tab" ); tabLayout = new QGridLayout( tab ); tabLayout->setSpacing( 2); tabLayout->setMargin( 2); Local_View = new QListView( tab, "Local_View" ); // Local_View->setResizePolicy( QListView::AutoOneFit ); Local_View->addColumn( tr("File"),150); Local_View->addColumn( tr("Date"),-1); Local_View->setColumnAlignment(1,QListView::AlignRight); Local_View->addColumn( tr("Size"),-1); Local_View->setColumnAlignment(2,QListView::AlignRight); Local_View->setAllColumnsShowFocus(TRUE); Local_View->setMultiSelection( TRUE); Local_View->setSelectionMode(QListView::Extended); Local_View->setFocusPolicy(QWidget::ClickFocus); QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); tabLayout->addWidget( Local_View, 0, 0 ); connect( Local_View, SIGNAL( clicked( QListViewItem*)), this,SLOT( localListClicked(QListViewItem *)) ); // connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), // this,SLOT( localListClicked(QListViewItem *)) ); connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); TabWidget->insertTab( tab, tr( "Local" ) ); tab_2 = new QWidget( TabWidget, "tab_2" ); tabLayout_2 = new QGridLayout( tab_2 ); tabLayout_2->setSpacing( 2); tabLayout_2->setMargin( 2); Remote_View = new QListView( tab_2, "Remote_View" ); Remote_View->addColumn( tr("File"),150); Remote_View->addColumn( tr("Date"),-1); // Remote_View->setColumnAlignment(1,QListView::AlignRight); Remote_View->addColumn( tr("Size"),-1); Remote_View->setColumnAlignment(2,QListView::AlignRight); Remote_View->setColumnAlignment(3,QListView::AlignCenter); Remote_View->addColumn( tr("Dir"),-1); Remote_View->setColumnAlignment(4,QListView::AlignRight); Remote_View->setAllColumnsShowFocus(TRUE); Remote_View->setMultiSelection( FALSE); Remote_View->setSelectionMode(QListView::Extended); Remote_View->setFocusPolicy(QWidget::ClickFocus); QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); connect( Remote_View, SIGNAL( clicked( QListViewItem*)), this,SLOT( remoteListClicked(QListViewItem *)) ); connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); tabLayout_2->addWidget( Remote_View, 0, 0 ); TabWidget->insertTab( tab_2, tr( "Remote" ) ); tab_3 = new QWidget( TabWidget, "tab_3" ); tabLayout_3 = new QGridLayout( tab_3 ); tabLayout_3->setSpacing( 2); tabLayout_3->setMargin( 2); TextLabel1 = new QLabel( tab_3, "TextLabel1" ); TextLabel1->setText( tr( "Username" ) ); tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); UsernameComboBox->setEditable(TRUE); tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this, SLOT( UsernameComboBoxEdited(const QString & ) )); TextLabel2 = new QLabel( tab_3, "TextLabel2" ); TextLabel2->setText( tr( "Password" ) ); tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); |