author | llornkcor <llornkcor> | 2003-04-12 22:54:22 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-04-12 22:54:22 (UTC) |
commit | de26954aa6d25dcd6673dc2b38ed5f5f9f665e53 (patch) (unidiff) | |
tree | f3b2304bc4b13dcb7ed0fe73e6b068103fa3314f | |
parent | 8c18ce3f56a59783f7e37706ccaf133e958baa5e (diff) | |
download | opie-de26954aa6d25dcd6673dc2b38ed5f5f9f665e53.zip opie-de26954aa6d25dcd6673dc2b38ed5f5f9f665e53.tar.gz opie-de26954aa6d25dcd6673dc2b38ed5f5f9f665e53.tar.bz2 |
hide about thingy
-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 db365ca..d3429de 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -1,385 +1,385 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | opieftp.cpp | 2 | opieftp.cpp |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | //#define DEVELOPERS_VERSION | 12 | //#define DEVELOPERS_VERSION |
13 | 13 | ||
14 | #include "opieftp.h" | 14 | #include "opieftp.h" |
15 | 15 | ||
16 | extern "C" { | 16 | extern "C" { |
17 | #include "../ftplib/ftplib.h" | 17 | #include "../ftplib/ftplib.h" |
18 | } | 18 | } |
19 | 19 | ||
20 | #include "inputDialog.h" | 20 | #include "inputDialog.h" |
21 | 21 | ||
22 | #include <qpe/qpemenubar.h> | 22 | #include <qpe/qpemenubar.h> |
23 | #include <qpe/qpetoolbar.h> | 23 | #include <qpe/qpetoolbar.h> |
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/qcopenvelope_qws.h> | 26 | #include <qpe/qcopenvelope_qws.h> |
27 | #include <qpe/config.h> | 27 | #include <qpe/config.h> |
28 | #include <qpe/mimetype.h> | 28 | #include <qpe/mimetype.h> |
29 | #include <qpe/qpemessagebox.h> | 29 | #include <qpe/qpemessagebox.h> |
30 | 30 | ||
31 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qpushbutton.h> | 33 | #include <qpushbutton.h> |
34 | #include <qtoolbutton.h> | 34 | #include <qtoolbutton.h> |
35 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
36 | #include <qdir.h> | 36 | #include <qdir.h> |
37 | #include <qfile.h> | 37 | #include <qfile.h> |
38 | #include <qstring.h> | 38 | #include <qstring.h> |
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qpopupmenu.h> | 40 | #include <qpopupmenu.h> |
41 | #include <qlistview.h> | 41 | #include <qlistview.h> |
42 | #include <qmainwindow.h> | 42 | #include <qmainwindow.h> |
43 | #include <qlabel.h> | 43 | #include <qlabel.h> |
44 | #include <qprogressbar.h> | 44 | #include <qprogressbar.h> |
45 | #include <qspinbox.h> | 45 | #include <qspinbox.h> |
46 | #include <qtabwidget.h> | 46 | #include <qtabwidget.h> |
47 | #include <qwidget.h> | 47 | #include <qwidget.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qimage.h> | 49 | #include <qimage.h> |
50 | #include <qpixmap.h> | 50 | #include <qpixmap.h> |
51 | #include <qmessagebox.h> | 51 | #include <qmessagebox.h> |
52 | #include <qlineedit.h> | 52 | #include <qlineedit.h> |
53 | #include <qregexp.h> | 53 | #include <qregexp.h> |
54 | #include <qlistbox.h> | 54 | #include <qlistbox.h> |
55 | 55 | ||
56 | #include <unistd.h> | 56 | #include <unistd.h> |
57 | #include <stdlib.h> | 57 | #include <stdlib.h> |
58 | 58 | ||
59 | 59 | ||
60 | QProgressBar *ProgressBar; | 60 | QProgressBar *ProgressBar; |
61 | static netbuf *conn=NULL; | 61 | static netbuf *conn=NULL; |
62 | 62 | ||
63 | static int log_progress(netbuf *, int xfered, void *) | 63 | static int log_progress(netbuf *, int xfered, void *) |
64 | { | 64 | { |
65 | // int fsz = *(int *)arg; | 65 | // int fsz = *(int *)arg; |
66 | // int pct = (xfered * 100) / fsz; | 66 | // int pct = (xfered * 100) / fsz; |
67 | // printf("%3d%%\r", pct); | 67 | // printf("%3d%%\r", pct); |
68 | // fflush(stdout); | 68 | // fflush(stdout); |
69 | ProgressBar->setProgress(xfered); | 69 | ProgressBar->setProgress(xfered); |
70 | qApp->processEvents(); | 70 | qApp->processEvents(); |
71 | return 1; | 71 | return 1; |
72 | } | 72 | } |
73 | 73 | ||
74 | OpieFtp::OpieFtp( ) | 74 | OpieFtp::OpieFtp( ) |
75 | : QMainWindow( ) | 75 | : QMainWindow( ) |
76 | { | 76 | { |
77 | setCaption( tr( "OpieFtp" ) ); | 77 | setCaption( tr( "OpieFtp" ) ); |
78 | fuckeduphack=FALSE; | 78 | fuckeduphack=FALSE; |
79 | QGridLayout *layout = new QGridLayout( this ); | 79 | QGridLayout *layout = new QGridLayout( this ); |
80 | layout->setSpacing( 2); | 80 | layout->setSpacing( 2); |
81 | layout->setMargin( 2); | 81 | layout->setMargin( 2); |
82 | 82 | ||
83 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 83 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
84 | 84 | ||
85 | QPEMenuBar *menuBar = new QPEMenuBar(this); | 85 | QPEMenuBar *menuBar = new QPEMenuBar(this); |
86 | // QPEToolBar *menuBar = new QPEToolBar(this); | 86 | // QPEToolBar *menuBar = new QPEToolBar(this); |
87 | // menuBar->setHorizontalStretchable( TRUE ); | 87 | // menuBar->setHorizontalStretchable( TRUE ); |
88 | 88 | ||
89 | QWMatrix matrix; | 89 | QWMatrix matrix; |
90 | QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); | 90 | QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); |
91 | matrix.scale( .4, .4); | 91 | matrix.scale( .4, .4); |
92 | unknownXpm = pix.xForm(matrix); | 92 | unknownXpm = pix.xForm(matrix); |
93 | 93 | ||
94 | connectionMenu = new QPopupMenu( this ); | 94 | connectionMenu = new QPopupMenu( this ); |
95 | localMenu = new QPopupMenu( this ); | 95 | localMenu = new QPopupMenu( this ); |
96 | remoteMenu = new QPopupMenu( this ); | 96 | remoteMenu = new QPopupMenu( this ); |
97 | tabMenu = new QPopupMenu( this ); | 97 | tabMenu = new QPopupMenu( this ); |
98 | 98 | ||
99 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); | 99 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); |
100 | 100 | ||
101 | menuBar->insertItem( tr( "Connection" ), connectionMenu); | 101 | menuBar->insertItem( tr( "Connection" ), connectionMenu); |
102 | menuBar->insertItem( tr( "Local" ), localMenu); | 102 | menuBar->insertItem( tr( "Local" ), localMenu); |
103 | menuBar->insertItem( tr( "Remote" ), remoteMenu); | 103 | menuBar->insertItem( tr( "Remote" ), remoteMenu); |
104 | menuBar->insertItem( tr( "View" ), tabMenu); | 104 | menuBar->insertItem( tr( "View" ), tabMenu); |
105 | 105 | ||
106 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); | 106 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); |
107 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); | 107 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); |
108 | connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); | 108 | connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); |
109 | 109 | ||
110 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 110 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
111 | localMenu->insertSeparator(); | 111 | localMenu->insertSeparator(); |
112 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); | 112 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); |
113 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 113 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
114 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 114 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
115 | localMenu->insertSeparator(); | 115 | localMenu->insertSeparator(); |
116 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 116 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); |
117 | localMenu->setCheckable(TRUE); | 117 | localMenu->setCheckable(TRUE); |
118 | 118 | ||
119 | remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); | 119 | remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); |
120 | remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 120 | remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
121 | remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); | 121 | remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); |
122 | remoteMenu->insertSeparator(); | 122 | remoteMenu->insertSeparator(); |
123 | remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); | 123 | remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); |
124 | 124 | ||
125 | tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 125 | tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); |
126 | tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 126 | tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); |
127 | tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); | 127 | tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); |
128 | tabMenu->insertSeparator(); | 128 | // tabMenu->insertSeparator(); |
129 | tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 129 | // tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
130 | tabMenu->setCheckable(TRUE); | 130 | tabMenu->setCheckable(TRUE); |
131 | 131 | ||
132 | 132 | ||
133 | 133 | ||
134 | cdUpButton = new QToolButton( this,"cdUpButton"); | 134 | cdUpButton = new QToolButton( this,"cdUpButton"); |
135 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | 135 | cdUpButton->setPixmap(Resource::loadPixmap("up")); |
136 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | 136 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); |
137 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | 137 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); |
138 | layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); | 138 | layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); |
139 | cdUpButton->hide(); | 139 | cdUpButton->hide(); |
140 | 140 | ||
141 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); | 141 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); |
142 | // docButton->setFixedSize( QSize( 20, 20 ) ); | 142 | // docButton->setFixedSize( QSize( 20, 20 ) ); |
143 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); | 143 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); |
144 | // docButton->setFlat(TRUE); | 144 | // docButton->setFlat(TRUE); |
145 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); | 145 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); |
146 | 146 | ||
147 | homeButton = new QToolButton(this,"homeButton"); | 147 | homeButton = new QToolButton(this,"homeButton"); |
148 | homeButton->setPixmap( Resource::loadPixmap("home")); | 148 | homeButton->setPixmap( Resource::loadPixmap("home")); |
149 | homeButton->setFixedSize( QSize( 20, 20 ) ); | 149 | homeButton->setFixedSize( QSize( 20, 20 ) ); |
150 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | 150 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); |
151 | layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); | 151 | layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); |
152 | homeButton->hide(); | 152 | homeButton->hide(); |
153 | 153 | ||
154 | TabWidget = new QTabWidget( this, "TabWidget" ); | 154 | TabWidget = new QTabWidget( this, "TabWidget" ); |
155 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); | 155 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); |
156 | 156 | ||
157 | // TabWidget->setTabShape(QTabWidget::Triangular); | 157 | // TabWidget->setTabShape(QTabWidget::Triangular); |
158 | 158 | ||
159 | tab = new QWidget( TabWidget, "tab" ); | 159 | tab = new QWidget( TabWidget, "tab" ); |
160 | tabLayout = new QGridLayout( tab ); | 160 | tabLayout = new QGridLayout( tab ); |
161 | tabLayout->setSpacing( 2); | 161 | tabLayout->setSpacing( 2); |
162 | tabLayout->setMargin( 2); | 162 | tabLayout->setMargin( 2); |
163 | 163 | ||
164 | Local_View = new QListView( tab, "Local_View" ); | 164 | Local_View = new QListView( tab, "Local_View" ); |
165 | // Local_View->setResizePolicy( QListView::AutoOneFit ); | 165 | // Local_View->setResizePolicy( QListView::AutoOneFit ); |
166 | Local_View->addColumn( tr("File"),150); | 166 | Local_View->addColumn( tr("File"),150); |
167 | Local_View->addColumn( tr("Date"),-1); | 167 | Local_View->addColumn( tr("Date"),-1); |
168 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 168 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
169 | Local_View->addColumn( tr("Size"),-1); | 169 | Local_View->addColumn( tr("Size"),-1); |
170 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 170 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
171 | Local_View->setAllColumnsShowFocus(TRUE); | 171 | Local_View->setAllColumnsShowFocus(TRUE); |
172 | 172 | ||
173 | Local_View->setMultiSelection( TRUE); | 173 | Local_View->setMultiSelection( TRUE); |
174 | Local_View->setSelectionMode(QListView::Extended); | 174 | Local_View->setSelectionMode(QListView::Extended); |
175 | Local_View->setFocusPolicy(QWidget::ClickFocus); | 175 | Local_View->setFocusPolicy(QWidget::ClickFocus); |
176 | 176 | ||
177 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 177 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); |
178 | 178 | ||
179 | tabLayout->addWidget( Local_View, 0, 0 ); | 179 | tabLayout->addWidget( Local_View, 0, 0 ); |
180 | 180 | ||
181 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), | 181 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), |
182 | this,SLOT( localListClicked(QListViewItem *)) ); | 182 | this,SLOT( localListClicked(QListViewItem *)) ); |
183 | // connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), | 183 | // connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), |
184 | // this,SLOT( localListClicked(QListViewItem *)) ); | 184 | // this,SLOT( localListClicked(QListViewItem *)) ); |
185 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 185 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
186 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); | 186 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); |
187 | 187 | ||
188 | TabWidget->insertTab( tab, tr( "Local" ) ); | 188 | TabWidget->insertTab( tab, tr( "Local" ) ); |
189 | 189 | ||
190 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 190 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
191 | tabLayout_2 = new QGridLayout( tab_2 ); | 191 | tabLayout_2 = new QGridLayout( tab_2 ); |
192 | tabLayout_2->setSpacing( 2); | 192 | tabLayout_2->setSpacing( 2); |
193 | tabLayout_2->setMargin( 2); | 193 | tabLayout_2->setMargin( 2); |
194 | 194 | ||
195 | Remote_View = new QListView( tab_2, "Remote_View" ); | 195 | Remote_View = new QListView( tab_2, "Remote_View" ); |
196 | Remote_View->addColumn( tr("File"),150); | 196 | Remote_View->addColumn( tr("File"),150); |
197 | Remote_View->addColumn( tr("Date"),-1); | 197 | Remote_View->addColumn( tr("Date"),-1); |
198 | // Remote_View->setColumnAlignment(1,QListView::AlignRight); | 198 | // Remote_View->setColumnAlignment(1,QListView::AlignRight); |
199 | Remote_View->addColumn( tr("Size"),-1); | 199 | Remote_View->addColumn( tr("Size"),-1); |
200 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 200 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
201 | Remote_View->setColumnAlignment(3,QListView::AlignCenter); | 201 | Remote_View->setColumnAlignment(3,QListView::AlignCenter); |
202 | Remote_View->addColumn( tr("Dir"),-1); | 202 | Remote_View->addColumn( tr("Dir"),-1); |
203 | Remote_View->setColumnAlignment(4,QListView::AlignRight); | 203 | Remote_View->setColumnAlignment(4,QListView::AlignRight); |
204 | Remote_View->setAllColumnsShowFocus(TRUE); | 204 | Remote_View->setAllColumnsShowFocus(TRUE); |
205 | 205 | ||
206 | Remote_View->setMultiSelection( FALSE); | 206 | Remote_View->setMultiSelection( FALSE); |
207 | Remote_View->setSelectionMode(QListView::Extended); | 207 | Remote_View->setSelectionMode(QListView::Extended); |
208 | Remote_View->setFocusPolicy(QWidget::ClickFocus); | 208 | Remote_View->setFocusPolicy(QWidget::ClickFocus); |
209 | 209 | ||
210 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | 210 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); |
211 | 211 | ||
212 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), | 212 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), |
213 | this,SLOT( remoteListClicked(QListViewItem *)) ); | 213 | this,SLOT( remoteListClicked(QListViewItem *)) ); |
214 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 214 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
215 | this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); | 215 | this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); |
216 | 216 | ||
217 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 217 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
218 | 218 | ||
219 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); | 219 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); |
220 | 220 | ||
221 | tab_3 = new QWidget( TabWidget, "tab_3" ); | 221 | tab_3 = new QWidget( TabWidget, "tab_3" ); |
222 | tabLayout_3 = new QGridLayout( tab_3 ); | 222 | tabLayout_3 = new QGridLayout( tab_3 ); |
223 | tabLayout_3->setSpacing( 2); | 223 | tabLayout_3->setSpacing( 2); |
224 | tabLayout_3->setMargin( 2); | 224 | tabLayout_3->setMargin( 2); |
225 | 225 | ||
226 | TextLabel1 = new QLabel( tab_3, "TextLabel1" ); | 226 | TextLabel1 = new QLabel( tab_3, "TextLabel1" ); |
227 | TextLabel1->setText( tr( "Username" ) ); | 227 | TextLabel1->setText( tr( "Username" ) ); |
228 | tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); | 228 | tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); |
229 | 229 | ||
230 | UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); | 230 | UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); |
231 | UsernameComboBox->setEditable(TRUE); | 231 | UsernameComboBox->setEditable(TRUE); |
232 | tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); | 232 | tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); |
233 | 233 | ||
234 | connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this, | 234 | connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this, |
235 | SLOT( UsernameComboBoxEdited(const QString & ) )); | 235 | SLOT( UsernameComboBoxEdited(const QString & ) )); |
236 | 236 | ||
237 | TextLabel2 = new QLabel( tab_3, "TextLabel2" ); | 237 | TextLabel2 = new QLabel( tab_3, "TextLabel2" ); |
238 | TextLabel2->setText( tr( "Password" ) ); | 238 | TextLabel2->setText( tr( "Password" ) ); |
239 | tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); | 239 | tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); |
240 | 240 | ||
241 | PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); | 241 | PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); |
242 | PasswordEdit->setEchoMode(QLineEdit::Password); | 242 | PasswordEdit->setEchoMode(QLineEdit::Password); |
243 | tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 ); | 243 | tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 ); |
244 | 244 | ||
245 | connect( PasswordEdit,SIGNAL(textChanged(const QString &)),this, | 245 | connect( PasswordEdit,SIGNAL(textChanged(const QString &)),this, |
246 | SLOT( PasswordEditEdited(const QString & ) )); | 246 | SLOT( PasswordEditEdited(const QString & ) )); |
247 | 247 | ||
248 | //PasswordEdit->setFixedWidth(85); | 248 | //PasswordEdit->setFixedWidth(85); |
249 | TextLabel3 = new QLabel( tab_3, "TextLabel3" ); | 249 | TextLabel3 = new QLabel( tab_3, "TextLabel3" ); |
250 | TextLabel3->setText( tr( "Remote server" ) ); | 250 | TextLabel3->setText( tr( "Remote server" ) ); |
251 | tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 ); | 251 | tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 ); |
252 | 252 | ||
253 | ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); | 253 | ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); |
254 | ServerComboBox->setEditable(TRUE); | 254 | ServerComboBox->setEditable(TRUE); |
255 | tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); | 255 | tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); |
256 | 256 | ||
257 | connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) )); | 257 | connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) )); |
258 | connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this, | 258 | connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this, |
259 | SLOT(serverComboEdited(const QString & ) )); | 259 | SLOT(serverComboEdited(const QString & ) )); |
260 | 260 | ||
261 | QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" ); | 261 | QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" ); |
262 | TextLabel5->setText( tr( "Remote path" ) ); | 262 | TextLabel5->setText( tr( "Remote path" ) ); |
263 | tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); | 263 | tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); |
264 | 264 | ||
265 | 265 | ||
266 | remotePath = new QLineEdit( "/", tab_3, "remotePath" ); | 266 | remotePath = new QLineEdit( "/", tab_3, "remotePath" ); |
267 | tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); | 267 | tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); |
268 | TextLabel4 = new QLabel( tab_3, "TextLabel4" ); | 268 | TextLabel4 = new QLabel( tab_3, "TextLabel4" ); |
269 | TextLabel4->setText( tr( "Port" ) ); | 269 | TextLabel4->setText( tr( "Port" ) ); |
270 | tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); | 270 | tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); |
271 | 271 | ||
272 | PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); | 272 | PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); |
273 | PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); | 273 | PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); |
274 | PortSpinBox->setMaxValue(32786); | 274 | PortSpinBox->setMaxValue(32786); |
275 | tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); | 275 | tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); |
276 | 276 | ||
277 | serverListView = new QListBox( tab_3, "ServerListView" ); | 277 | serverListView = new QListBox( tab_3, "ServerListView" ); |
278 | tabLayout_3->addMultiCellWidget( serverListView , 5, 5, 0, 5); | 278 | tabLayout_3->addMultiCellWidget( serverListView , 5, 5, 0, 5); |
279 | 279 | ||
280 | connect( serverListView, SIGNAL( highlighted( const QString &)), | 280 | connect( serverListView, SIGNAL( highlighted( const QString &)), |
281 | this,SLOT( serverListClicked( const QString &) ) ); | 281 | this,SLOT( serverListClicked( const QString &) ) ); |
282 | 282 | ||
283 | connectServerBtn = new QPushButton( "Connect", tab_3 , "ConnectButton" ); | 283 | connectServerBtn = new QPushButton( "Connect", tab_3 , "ConnectButton" ); |
284 | tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1); | 284 | tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1); |
285 | connectServerBtn->setToggleButton(TRUE); | 285 | connectServerBtn->setToggleButton(TRUE); |
286 | connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); | 286 | connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); |
287 | 287 | ||
288 | newServerButton= new QPushButton( "Add", tab_3 , "NewServerButton" ); | 288 | newServerButton= new QPushButton( "Add", tab_3 , "NewServerButton" ); |
289 | tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2); | 289 | tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2); |
290 | connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() )); | 290 | connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() )); |
291 | 291 | ||
292 | QPushButton *deleteServerBtn; | 292 | QPushButton *deleteServerBtn; |
293 | deleteServerBtn = new QPushButton( "Delete", tab_3 , "OpenButton" ); | 293 | deleteServerBtn = new QPushButton( "Delete", tab_3 , "OpenButton" ); |
294 | tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3); | 294 | tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3); |
295 | 295 | ||
296 | connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); | 296 | connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); |
297 | 297 | ||
298 | 298 | ||
299 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); | 299 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
300 | tabLayout_3->addItem( spacer, 5, 0 ); | 300 | tabLayout_3->addItem( spacer, 5, 0 ); |
301 | 301 | ||
302 | TabWidget->insertTab( tab_3, tr( "Config" ) ); | 302 | TabWidget->insertTab( tab_3, tr( "Config" ) ); |
303 | 303 | ||
304 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), | 304 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), |
305 | this,SLOT(tabChanged(QWidget*))); | 305 | this,SLOT(tabChanged(QWidget*))); |
306 | 306 | ||
307 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 307 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
308 | currentDir.setPath( QDir::currentDirPath()); | 308 | currentDir.setPath( QDir::currentDirPath()); |
309 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 309 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
310 | 310 | ||
311 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 311 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); |
312 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); | 312 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); |
313 | currentPathCombo ->setFixedWidth(220); | 313 | currentPathCombo ->setFixedWidth(220); |
314 | currentPathCombo->setEditable(TRUE); | 314 | currentPathCombo->setEditable(TRUE); |
315 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 315 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
316 | 316 | ||
317 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | 317 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), |
318 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | 318 | this, SLOT( currentPathComboActivated( const QString & ) ) ); |
319 | 319 | ||
320 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 320 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
321 | this,SLOT(currentPathComboChanged())); | 321 | this,SLOT(currentPathComboChanged())); |
322 | 322 | ||
323 | ProgressBar = new QProgressBar( this, "ProgressBar" ); | 323 | ProgressBar = new QProgressBar( this, "ProgressBar" ); |
324 | layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); | 324 | layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); |
325 | ProgressBar->setMaximumHeight(10); | 325 | ProgressBar->setMaximumHeight(10); |
326 | filterStr="*"; | 326 | filterStr="*"; |
327 | b=FALSE; | 327 | b=FALSE; |
328 | populateLocalView(); | 328 | populateLocalView(); |
329 | readConfig(); | 329 | readConfig(); |
330 | 330 | ||
331 | // ServerComboBox->setCurrentItem(currentServerConfig); | 331 | // ServerComboBox->setCurrentItem(currentServerConfig); |
332 | 332 | ||
333 | TabWidget->setCurrentPage(2); | 333 | TabWidget->setCurrentPage(2); |
334 | } | 334 | } |
335 | 335 | ||
336 | OpieFtp::~OpieFtp() | 336 | OpieFtp::~OpieFtp() |
337 | { | 337 | { |
338 | } | 338 | } |
339 | 339 | ||
340 | void OpieFtp::cleanUp() | 340 | void OpieFtp::cleanUp() |
341 | { | 341 | { |
342 | if(conn) | 342 | if(conn) |
343 | FtpQuit(conn); | 343 | FtpQuit(conn); |
344 | QString sfile=QDir::homeDirPath(); | 344 | QString sfile=QDir::homeDirPath(); |
345 | if(sfile.right(1) != "/") | 345 | if(sfile.right(1) != "/") |
346 | sfile+="/._temp"; | 346 | sfile+="/._temp"; |
347 | else | 347 | else |
348 | sfile+="._temp"; | 348 | sfile+="._temp"; |
349 | QFile file( sfile); | 349 | QFile file( sfile); |
350 | if(file.exists()) | 350 | if(file.exists()) |
351 | file.remove(); | 351 | file.remove(); |
352 | Config cfg("opieftp"); | 352 | Config cfg("opieftp"); |
353 | cfg.setGroup("Server"); | 353 | cfg.setGroup("Server"); |
354 | cfg.writeEntry("currentServer", currentServerConfig); | 354 | cfg.writeEntry("currentServer", currentServerConfig); |
355 | 355 | ||
356 | exit(0); | 356 | exit(0); |
357 | } | 357 | } |
358 | 358 | ||
359 | void OpieFtp::tabChanged(QWidget *) | 359 | void OpieFtp::tabChanged(QWidget *) |
360 | { | 360 | { |
361 | if (TabWidget->currentPageIndex() == 0) { | 361 | if (TabWidget->currentPageIndex() == 0) { |
362 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 362 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
363 | tabMenu->setItemChecked(tabMenu->idAt(0),TRUE); | 363 | tabMenu->setItemChecked(tabMenu->idAt(0),TRUE); |
364 | tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); | 364 | tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); |
365 | tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); | 365 | tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); |
366 | if(cdUpButton->isHidden()) | 366 | if(cdUpButton->isHidden()) |
367 | cdUpButton->show(); | 367 | cdUpButton->show(); |
368 | if(homeButton->isHidden()) | 368 | if(homeButton->isHidden()) |
369 | homeButton->show(); | 369 | homeButton->show(); |
370 | 370 | ||
371 | } | 371 | } |
372 | if (TabWidget->currentPageIndex() == 1) { | 372 | if (TabWidget->currentPageIndex() == 1) { |
373 | currentPathCombo->lineEdit()->setText( currentRemoteDir ); | 373 | currentPathCombo->lineEdit()->setText( currentRemoteDir ); |
374 | tabMenu->setItemChecked(tabMenu->idAt(1),TRUE); | 374 | tabMenu->setItemChecked(tabMenu->idAt(1),TRUE); |
375 | tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); | 375 | tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); |
376 | tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); | 376 | tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); |
377 | if(cdUpButton->isHidden()) | 377 | if(cdUpButton->isHidden()) |
378 | cdUpButton->show(); | 378 | cdUpButton->show(); |
379 | homeButton->hide(); | 379 | homeButton->hide(); |
380 | 380 | ||
381 | } | 381 | } |
382 | if (TabWidget->currentPageIndex() == 2) { | 382 | if (TabWidget->currentPageIndex() == 2) { |
383 | tabMenu->setItemChecked(tabMenu->idAt(2),TRUE); | 383 | tabMenu->setItemChecked(tabMenu->idAt(2),TRUE); |
384 | tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); | 384 | tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); |
385 | tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); | 385 | tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); |