summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp/opieftp.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 4064549..4c39569 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -83,333 +83,333 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
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);
143// layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); 143// layout->addMultiCellWidget( docButton, 0, 0, 6, 6 );
144 144
145 homeButton = new QToolButton(view,"homeButton"); 145 homeButton = new QToolButton(view,"homeButton");
146 homeButton->setPixmap( Resource::loadPixmap("home")); 146 homeButton->setPixmap( Resource::loadPixmap("home"));
147 homeButton->setFixedSize( QSize( 20, 20 ) ); 147 homeButton->setFixedSize( QSize( 20, 20 ) );
148 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 148 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
149 layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); 149 layout->addMultiCellWidget( homeButton, 0, 0, 4, 4);
150 homeButton->hide(); 150 homeButton->hide();
151 151
152 TabWidget = new QTabWidget( view, "TabWidget" ); 152 TabWidget = new QTabWidget( view, "TabWidget" );
153 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); 153 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 );
154 154
155// TabWidget->setTabShape(QTabWidget::Triangular); 155// TabWidget->setTabShape(QTabWidget::Triangular);
156 156
157 tab = new QWidget( TabWidget, "tab" ); 157 tab = new QWidget( TabWidget, "tab" );
158 tabLayout = new QGridLayout( tab ); 158 tabLayout = new QGridLayout( tab );
159 tabLayout->setSpacing( 2); 159 tabLayout->setSpacing( 2);
160 tabLayout->setMargin( 2); 160 tabLayout->setMargin( 2);
161 161
162 Local_View = new QListView( tab, "Local_View" ); 162 Local_View = new QListView( tab, "Local_View" );
163// Local_View->setResizePolicy( QListView::AutoOneFit ); 163// Local_View->setResizePolicy( QListView::AutoOneFit );
164 Local_View->addColumn( tr("File"),150); 164 Local_View->addColumn( tr("File"),150);
165 Local_View->addColumn( tr("Date"),-1); 165 Local_View->addColumn( tr("Date"),-1);
166 Local_View->setColumnAlignment(1,QListView::AlignRight); 166 Local_View->setColumnAlignment(1,QListView::AlignRight);
167 Local_View->addColumn( tr("Size"),-1); 167 Local_View->addColumn( tr("Size"),-1);
168 Local_View->setColumnAlignment(2,QListView::AlignRight); 168 Local_View->setColumnAlignment(2,QListView::AlignRight);
169 Local_View->setAllColumnsShowFocus(TRUE); 169 Local_View->setAllColumnsShowFocus(TRUE);
170 170
171 Local_View->setMultiSelection( TRUE); 171 Local_View->setMultiSelection( TRUE);
172 Local_View->setSelectionMode(QListView::Extended); 172 Local_View->setSelectionMode(QListView::Extended);
173 Local_View->setFocusPolicy(QWidget::ClickFocus); 173 Local_View->setFocusPolicy(QWidget::ClickFocus);
174 174
175 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); 175 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
176 176
177 tabLayout->addWidget( Local_View, 0, 0 ); 177 tabLayout->addWidget( Local_View, 0, 0 );
178 178
179 connect( Local_View, SIGNAL( clicked( QListViewItem*)), 179 connect( Local_View, SIGNAL( clicked(QListViewItem*)),
180 this,SLOT( localListClicked(QListViewItem *)) ); 180 this,SLOT( localListClicked(QListViewItem*)) );
181// connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), 181// connect( Local_View, SIGNAL( doubleClicked(QListViewItem*)),
182// this,SLOT( localListClicked(QListViewItem *)) ); 182// this,SLOT( localListClicked(QListViewItem*)) );
183 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 183 connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
184 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); 184 this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) );
185 185
186 TabWidget->insertTab( tab, tr( "Local" ) ); 186 TabWidget->insertTab( tab, tr( "Local" ) );
187 187
188 tab_2 = new QWidget( TabWidget, "tab_2" ); 188 tab_2 = new QWidget( TabWidget, "tab_2" );
189 tabLayout_2 = new QGridLayout( tab_2 ); 189 tabLayout_2 = new QGridLayout( tab_2 );
190 tabLayout_2->setSpacing( 2); 190 tabLayout_2->setSpacing( 2);
191 tabLayout_2->setMargin( 2); 191 tabLayout_2->setMargin( 2);
192 192
193 Remote_View = new QListView( tab_2, "Remote_View" ); 193 Remote_View = new QListView( tab_2, "Remote_View" );
194 Remote_View->addColumn( tr("File"),150); 194 Remote_View->addColumn( tr("File"),150);
195 Remote_View->addColumn( tr("Date"),-1); 195 Remote_View->addColumn( tr("Date"),-1);
196// Remote_View->setColumnAlignment(1,QListView::AlignRight); 196// Remote_View->setColumnAlignment(1,QListView::AlignRight);
197 Remote_View->addColumn( tr("Size"),-1); 197 Remote_View->addColumn( tr("Size"),-1);
198 Remote_View->setColumnAlignment(2,QListView::AlignRight); 198 Remote_View->setColumnAlignment(2,QListView::AlignRight);
199 Remote_View->setColumnAlignment(3,QListView::AlignCenter); 199 Remote_View->setColumnAlignment(3,QListView::AlignCenter);
200 Remote_View->addColumn( tr("Dir"),-1); 200 Remote_View->addColumn( tr("Dir"),-1);
201 Remote_View->setColumnAlignment(4,QListView::AlignRight); 201 Remote_View->setColumnAlignment(4,QListView::AlignRight);
202 Remote_View->setAllColumnsShowFocus(TRUE); 202 Remote_View->setAllColumnsShowFocus(TRUE);
203 203
204 Remote_View->setMultiSelection( FALSE); 204 Remote_View->setMultiSelection( FALSE);
205 Remote_View->setSelectionMode(QListView::Extended); 205 Remote_View->setSelectionMode(QListView::Extended);
206 Remote_View->setFocusPolicy(QWidget::ClickFocus); 206 Remote_View->setFocusPolicy(QWidget::ClickFocus);
207 207
208 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); 208 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
209 209
210 connect( Remote_View, SIGNAL( clicked( QListViewItem*)), 210 connect( Remote_View, SIGNAL( clicked(QListViewItem*)),
211 this,SLOT( remoteListClicked(QListViewItem *)) ); 211 this,SLOT( remoteListClicked(QListViewItem*)) );
212 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 212 connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
213 this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); 213 this,SLOT( RemoteListPressed(int,QListViewItem*,const QPoint&,int)) );
214 214
215 tabLayout_2->addWidget( Remote_View, 0, 0 ); 215 tabLayout_2->addWidget( Remote_View, 0, 0 );
216 216
217 TabWidget->insertTab( tab_2, tr( "Remote" ) ); 217 TabWidget->insertTab( tab_2, tr( "Remote" ) );
218 218
219 tab_3 = new QWidget( TabWidget, "tab_3" ); 219 tab_3 = new QWidget( TabWidget, "tab_3" );
220 tabLayout_3 = new QGridLayout( tab_3 ); 220 tabLayout_3 = new QGridLayout( tab_3 );
221 tabLayout_3->setSpacing( 2); 221 tabLayout_3->setSpacing( 2);
222 tabLayout_3->setMargin( 2); 222 tabLayout_3->setMargin( 2);
223 223
224 TextLabel1 = new QLabel( tab_3, "TextLabel1" ); 224 TextLabel1 = new QLabel( tab_3, "TextLabel1" );
225 TextLabel1->setText( tr( "Username" ) ); 225 TextLabel1->setText( tr( "Username" ) );
226 tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); 226 tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 );
227 227
228 UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); 228 UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" );
229 UsernameComboBox->setEditable(TRUE); 229 UsernameComboBox->setEditable(TRUE);
230 tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); 230 tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 );
231 231
232 connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this, 232 connect( UsernameComboBox,SIGNAL(textChanged(const QString&)),this,
233 SLOT( UsernameComboBoxEdited(const QString & ) )); 233 SLOT( UsernameComboBoxEdited(const QString&) ));
234 234
235 TextLabel2 = new QLabel( tab_3, "TextLabel2" ); 235 TextLabel2 = new QLabel( tab_3, "TextLabel2" );
236 TextLabel2->setText( tr( "Password" ) ); 236 TextLabel2->setText( tr( "Password" ) );
237 tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); 237 tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 );
238 238
239 PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); 239 PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" );
240 PasswordEdit->setEchoMode(QLineEdit::Password); 240 PasswordEdit->setEchoMode(QLineEdit::Password);
241 tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 ); 241 tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 );
242 242
243 connect( PasswordEdit,SIGNAL(textChanged(const QString &)),this, 243 connect( PasswordEdit,SIGNAL(textChanged(const QString&)),this,
244 SLOT( PasswordEditEdited(const QString & ) )); 244 SLOT( PasswordEditEdited(const QString&) ));
245 245
246//PasswordEdit->setFixedWidth(85); 246//PasswordEdit->setFixedWidth(85);
247 TextLabel3 = new QLabel( tab_3, "TextLabel3" ); 247 TextLabel3 = new QLabel( tab_3, "TextLabel3" );
248 TextLabel3->setText( tr( "Remote server" ) ); 248 TextLabel3->setText( tr( "Remote server" ) );
249 tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 ); 249 tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
250 250
251 ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); 251 ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" );
252 ServerComboBox->setEditable(TRUE); 252 ServerComboBox->setEditable(TRUE);
253 tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); 253 tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 );
254 254
255 connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) )); 255 connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int) ));
256 connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this, 256 connect(ServerComboBox,SIGNAL(textChanged(const QString&)),this,
257 SLOT(serverComboEdited(const QString & ) )); 257 SLOT(serverComboEdited(const QString&) ));
258 258
259 QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" ); 259 QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" );
260 TextLabel5->setText( tr( "Remote path" ) ); 260 TextLabel5->setText( tr( "Remote path" ) );
261 tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); 261 tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 );
262 262
263 263
264 remotePath = new QLineEdit( "/", tab_3, "remotePath" ); 264 remotePath = new QLineEdit( "/", tab_3, "remotePath" );
265 tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); 265 tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 );
266 TextLabel4 = new QLabel( tab_3, "TextLabel4" ); 266 TextLabel4 = new QLabel( tab_3, "TextLabel4" );
267 TextLabel4->setText( tr( "Port" ) ); 267 TextLabel4->setText( tr( "Port" ) );
268 tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); 268 tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 );
269 269
270 PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); 270 PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" );
271 PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); 271 PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows );
272 PortSpinBox->setMaxValue(32786); 272 PortSpinBox->setMaxValue(32786);
273 tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); 273 tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1);
274 274
275 serverListView = new QListBox( tab_3, "ServerListView" ); 275 serverListView = new QListBox( tab_3, "ServerListView" );
276 tabLayout_3->addMultiCellWidget( serverListView , 5, 5, 0, 5); 276 tabLayout_3->addMultiCellWidget( serverListView , 5, 5, 0, 5);
277 277
278 connect( serverListView, SIGNAL( highlighted( const QString &)), 278 connect( serverListView, SIGNAL( highlighted(const QString&)),
279 this,SLOT( serverListClicked( const QString &) ) ); 279 this,SLOT( serverListClicked(const QString&) ) );
280 280
281 connectServerBtn = new QPushButton( tr("Connect"), tab_3 , "ConnectButton" ); 281 connectServerBtn = new QPushButton( tr("Connect"), tab_3 , "ConnectButton" );
282 tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1); 282 tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1);
283 connectServerBtn->setToggleButton(TRUE); 283 connectServerBtn->setToggleButton(TRUE);
284 connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); 284 connect(connectServerBtn,SIGNAL( toggled(bool)),SLOT( connectorBtnToggled(bool) ));
285 285
286 newServerButton= new QPushButton( tr("Add"), tab_3 , "NewServerButton" ); 286 newServerButton= new QPushButton( tr("Add"), tab_3 , "NewServerButton" );
287 tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2); 287 tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2);
288 connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() )); 288 connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() ));
289 289
290 QPushButton *deleteServerBtn; 290 QPushButton *deleteServerBtn;
291 deleteServerBtn = new QPushButton( tr("Delete"), tab_3 , "OpenButton" ); 291 deleteServerBtn = new QPushButton( tr("Delete"), tab_3 , "OpenButton" );
292 tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3); 292 tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3);
293 293
294 connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); 294 connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer()));
295 295
296 296
297 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 297 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
298 tabLayout_3->addItem( spacer, 5, 0 ); 298 tabLayout_3->addItem( spacer, 5, 0 );
299 299
300 TabWidget->insertTab( tab_3, tr( "Config" ) ); 300 TabWidget->insertTab( tab_3, tr( "Config" ) );
301 301
302#if 0 302#if 0
303 connect(TabWidget,SIGNAL(currentChanged(QWidget *)), 303 connect(TabWidget,SIGNAL(currentChanged(QWidget*)),
304 this,SLOT(tabChanged(QWidget*))); 304 this,SLOT(tabChanged(QWidget*)));
305#endif 305#endif
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, view, "currentPathCombo" ); 311 currentPathCombo = new QComboBox( FALSE, view, "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#if 0 317#if 0
318 connect( currentPathCombo, SIGNAL( activated( const QString & ) ), 318 connect( currentPathCombo, SIGNAL( activated(const QString&) ),
319 this, SLOT( currentPathComboActivated( const QString & ) ) ); 319 this, SLOT( currentPathComboActivated(const QString&) ) );
320 320
321 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), 321 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
322 this,SLOT(currentPathComboChanged())); 322 this,SLOT(currentPathComboChanged()));
323#endif 323#endif
324 ProgressBar = new QProgressBar( view, "ProgressBar" ); 324 ProgressBar = new QProgressBar( view, "ProgressBar" );
325 layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); 325 layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4);
326 ProgressBar->setMaximumHeight(10); 326 ProgressBar->setMaximumHeight(10);
327 filterStr="*"; 327 filterStr="*";
328 b=FALSE; 328 b=FALSE;
329#if 0 329#if 0
330 populateLocalView(); 330 populateLocalView();
331#endif 331#endif
332 readConfig(); 332 readConfig();
333 333
334// ServerComboBox->setCurrentItem(currentServerConfig); 334// ServerComboBox->setCurrentItem(currentServerConfig);
335 335
336 TabWidget->setCurrentPage(2); 336 TabWidget->setCurrentPage(2);
337 qDebug("Constructor done"); 337 qDebug("Constructor done");
338} 338}
339 339
340OpieFtp::~OpieFtp() 340OpieFtp::~OpieFtp()
341{ 341{
342} 342}
343 343
344void OpieFtp::cleanUp() 344void OpieFtp::cleanUp()
345{ 345{
346 if(conn) 346 if(conn)
347 FtpQuit(conn); 347 FtpQuit(conn);
348 QString sfile=QDir::homeDirPath(); 348 QString sfile=QDir::homeDirPath();
349 if(sfile.right(1) != "/") 349 if(sfile.right(1) != "/")
350 sfile+="/._temp"; 350 sfile+="/._temp";
351 else 351 else
352 sfile+="._temp"; 352 sfile+="._temp";
353 QFile file( sfile); 353 QFile file( sfile);
354 if(file.exists()) 354 if(file.exists())
355 file.remove(); 355 file.remove();
356 Config cfg("opieftp"); 356 Config cfg("opieftp");
357 cfg.setGroup("Server"); 357 cfg.setGroup("Server");
358 cfg.writeEntry("currentServer", currentServerConfig); 358 cfg.writeEntry("currentServer", currentServerConfig);
359 359
360 exit(0); 360 exit(0);
361} 361}
362 362
363void OpieFtp::tabChanged(QWidget *) 363void OpieFtp::tabChanged(QWidget *)
364{ 364{
365 if (TabWidget->currentPageIndex() == 0) { 365 if (TabWidget->currentPageIndex() == 0) {
366 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 366 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
367 tabMenu->setItemChecked(tabMenu->idAt(0),TRUE); 367 tabMenu->setItemChecked(tabMenu->idAt(0),TRUE);
368 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); 368 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE);
369 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); 369 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE);
370 if(cdUpButton->isHidden()) 370 if(cdUpButton->isHidden())
371 cdUpButton->show(); 371 cdUpButton->show();
372 if(homeButton->isHidden()) 372 if(homeButton->isHidden())
373 homeButton->show(); 373 homeButton->show();
374 374
375 } 375 }
376 if (TabWidget->currentPageIndex() == 1) { 376 if (TabWidget->currentPageIndex() == 1) {
377 currentPathCombo->lineEdit()->setText( currentRemoteDir ); 377 currentPathCombo->lineEdit()->setText( currentRemoteDir );
378 tabMenu->setItemChecked(tabMenu->idAt(1),TRUE); 378 tabMenu->setItemChecked(tabMenu->idAt(1),TRUE);
379 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); 379 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE);
380 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); 380 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE);
381 if(cdUpButton->isHidden()) 381 if(cdUpButton->isHidden())
382 cdUpButton->show(); 382 cdUpButton->show();
383 homeButton->hide(); 383 homeButton->hide();
384 384
385 } 385 }
386 if (TabWidget->currentPageIndex() == 2) { 386 if (TabWidget->currentPageIndex() == 2) {
387 tabMenu->setItemChecked(tabMenu->idAt(2),TRUE); 387 tabMenu->setItemChecked(tabMenu->idAt(2),TRUE);
388 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); 388 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE);
389 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); 389 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE);
390 cdUpButton->hide(); 390 cdUpButton->hide();
391 homeButton->hide(); 391 homeButton->hide();
392 } 392 }
393} 393}
394 394
395void OpieFtp::newConnection() 395void OpieFtp::newConnection()
396{ 396{
397 UsernameComboBox->lineEdit()->setText(""); 397 UsernameComboBox->lineEdit()->setText("");
398 PasswordEdit->setText( "" ); 398 PasswordEdit->setText( "" );
399 ServerComboBox->lineEdit()->setText( ""); 399 ServerComboBox->lineEdit()->setText( "");
400 remotePath->setText( currentRemoteDir = "/"); 400 remotePath->setText( currentRemoteDir = "/");
401 PortSpinBox->setValue( 21); 401 PortSpinBox->setValue( 21);
402 TabWidget->setCurrentPage(2); 402 TabWidget->setCurrentPage(2);
403} 403}
404 404
405void OpieFtp::serverComboEdited(const QString & ) 405void OpieFtp::serverComboEdited(const QString & )
406{ 406{
407// if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) { 407// if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) {
408// qDebug("ServerComboEdited"); 408// qDebug("ServerComboEdited");
409// // currentServerConfig = -1; 409// // currentServerConfig = -1;
410// } 410// }
411} 411}
412 412
413void OpieFtp::UsernameComboBoxEdited(const QString &) { 413void OpieFtp::UsernameComboBoxEdited(const QString &) {
414// currentServerConfig = -1; 414// currentServerConfig = -1;
415} 415}