-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 24da195..4064549 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -44,99 +44,99 @@ extern "C" { | |||
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | 45 | ||
46 | 46 | ||
47 | QProgressBar *ProgressBar; | 47 | QProgressBar *ProgressBar; |
48 | static netbuf *conn=NULL; | 48 | static netbuf *conn=NULL; |
49 | 49 | ||
50 | static int log_progress(netbuf *, int xfered, void *) | 50 | static int log_progress(netbuf *, int xfered, void *) |
51 | { | 51 | { |
52 | // int fsz = *(int *)arg; | 52 | // int fsz = *(int *)arg; |
53 | // int pct = (xfered * 100) / fsz; | 53 | // int pct = (xfered * 100) / fsz; |
54 | // printf("%3d%%\r", pct); | 54 | // printf("%3d%%\r", pct); |
55 | // fflush(stdout); | 55 | // fflush(stdout); |
56 | ProgressBar->setProgress(xfered); | 56 | ProgressBar->setProgress(xfered); |
57 | qApp->processEvents(); | 57 | qApp->processEvents(); |
58 | return 1; | 58 | return 1; |
59 | } | 59 | } |
60 | 60 | ||
61 | OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) | 61 | OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) |
62 | : QMainWindow( parent, name, fl ) | 62 | : QMainWindow( parent, name, fl ) |
63 | { | 63 | { |
64 | qDebug("OpieFtp constructor"); | 64 | qDebug("OpieFtp constructor"); |
65 | setCaption( tr( "OpieFtp" ) ); | 65 | setCaption( tr( "OpieFtp" ) ); |
66 | fuckeduphack=FALSE; | 66 | fuckeduphack=FALSE; |
67 | 67 | ||
68 | QVBox* wrapperBox = new QVBox( this ); | 68 | QVBox* wrapperBox = new QVBox( this ); |
69 | setCentralWidget( wrapperBox ); | 69 | setCentralWidget( wrapperBox ); |
70 | 70 | ||
71 | QWidget *view = new QWidget( wrapperBox ); | 71 | QWidget *view = new QWidget( wrapperBox ); |
72 | 72 | ||
73 | QGridLayout *layout = new QGridLayout( view ); | 73 | QGridLayout *layout = new QGridLayout( view ); |
74 | layout->setSpacing( 2); | 74 | layout->setSpacing( 2); |
75 | layout->setMargin( 2); | 75 | layout->setMargin( 2); |
76 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 76 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
77 | 77 | ||
78 | QMenuBar *menuBar = new QMenuBar(this); | 78 | QMenuBar *menuBar = new QMenuBar(this); |
79 | // QToolBar *menuBar = new QToolBar(this); | 79 | // QToolBar *menuBar = new QToolBar(this); |
80 | // menuBar->setHorizontalStretchable( TRUE ); | 80 | // menuBar->setHorizontalStretchable( TRUE ); |
81 | 81 | ||
82 | QWMatrix matrix; | 82 | QWMatrix matrix; |
83 | QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); | 83 | QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); |
84 | matrix.scale( .4, .4); | 84 | matrix.scale( .4, .4); |
85 | unknownXpm = pix.xForm(matrix); | 85 | unknownXpm = pix.xForm(matrix); |
86 | 86 | ||
87 | connectionMenu = new QPopupMenu( this ); | 87 | connectionMenu = new QPopupMenu( this ); |
88 | localMenu = new QPopupMenu( this ); | 88 | localMenu = new QPopupMenu( this ); |
89 | remoteMenu = new QPopupMenu( this ); | 89 | remoteMenu = new QPopupMenu( this ); |
90 | tabMenu = new QPopupMenu( this ); | 90 | tabMenu = new QPopupMenu( this ); |
91 | 91 | ||
92 | #if 0 | 92 | //#if 0 |
93 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); | 93 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); |
94 | #endif | 94 | //#endif |
95 | 95 | ||
96 | menuBar->insertItem( tr( "Connection" ), connectionMenu); | 96 | menuBar->insertItem( tr( "Connection" ), connectionMenu); |
97 | // menuBar->insertItem( tr( "Local" ), localMenu); | 97 | // menuBar->insertItem( tr( "Local" ), localMenu); |
98 | // menuBar->insertItem( tr( "Remote" ), remoteMenu); | 98 | // menuBar->insertItem( tr( "Remote" ), remoteMenu); |
99 | menuBar->insertItem( tr( "View" ), tabMenu); | 99 | menuBar->insertItem( tr( "View" ), tabMenu); |
100 | 100 | ||
101 | tabMenu->insertItem( tr( "Local" ), localMenu); | 101 | tabMenu->insertItem( tr( "Local" ), localMenu); |
102 | tabMenu->insertItem( tr( "Remote" ), remoteMenu); | 102 | tabMenu->insertItem( tr( "Remote" ), remoteMenu); |
103 | 103 | ||
104 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); | 104 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); |
105 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); | 105 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); |
106 | connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); | 106 | connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); |
107 | 107 | ||
108 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 108 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
109 | localMenu->insertSeparator(); | 109 | localMenu->insertSeparator(); |
110 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); | 110 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); |
111 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 111 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
112 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 112 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
113 | localMenu->insertSeparator(); | 113 | localMenu->insertSeparator(); |
114 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 114 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); |
115 | localMenu->setCheckable(TRUE); | 115 | localMenu->setCheckable(TRUE); |
116 | 116 | ||
117 | remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); | 117 | remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); |
118 | remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 118 | remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
119 | remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); | 119 | remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); |
120 | remoteMenu->insertSeparator(); | 120 | remoteMenu->insertSeparator(); |
121 | remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); | 121 | remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); |
122 | 122 | ||
123 | tabMenu->insertSeparator(); | 123 | tabMenu->insertSeparator(); |
124 | tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 124 | tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); |
125 | tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 125 | tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); |
126 | tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); | 126 | tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); |
127 | tabMenu->insertSeparator(); | 127 | tabMenu->insertSeparator(); |
128 | // tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 128 | // tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
129 | tabMenu->setCheckable(TRUE); | 129 | tabMenu->setCheckable(TRUE); |
130 | 130 | ||
131 | 131 | ||
132 | cdUpButton = new QToolButton( view,"cdUpButton"); | 132 | cdUpButton = new QToolButton( view,"cdUpButton"); |
133 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | 133 | cdUpButton->setPixmap(Resource::loadPixmap("up")); |
134 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | 134 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); |
135 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | 135 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); |
136 | layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); | 136 | layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); |
137 | cdUpButton->hide(); | 137 | cdUpButton->hide(); |
138 | 138 | ||
139 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",view,"docsButton"); | 139 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",view,"docsButton"); |
140 | // docButton->setFixedSize( QSize( 20, 20 ) ); | 140 | // docButton->setFixedSize( QSize( 20, 20 ) ); |
141 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); | 141 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); |
142 | // docButton->setFlat(TRUE); | 142 | // docButton->setFlat(TRUE); |