Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 8f2b9c9..9d6356d 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -104,65 +104,65 @@ OpieFtp::OpieFtp( ) | |||
104 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 104 | localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
105 | localMenu->insertSeparator(); | 105 | localMenu->insertSeparator(); |
106 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); | 106 | localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); |
107 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 107 | localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
108 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 108 | localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
109 | localMenu->insertSeparator(); | 109 | localMenu->insertSeparator(); |
110 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 110 | localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); |
111 | localMenu->setCheckable(TRUE); | 111 | localMenu->setCheckable(TRUE); |
112 | 112 | ||
113 | remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); | 113 | remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); |
114 | remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 114 | remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
115 | remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); | 115 | remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); |
116 | remoteMenu->insertSeparator(); | 116 | remoteMenu->insertSeparator(); |
117 | remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); | 117 | remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); |
118 | 118 | ||
119 | tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 119 | tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); |
120 | tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 120 | tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); |
121 | tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); | 121 | tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); |
122 | tabMenu->insertSeparator(); | 122 | tabMenu->insertSeparator(); |
123 | tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 123 | tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
124 | tabMenu->setCheckable(TRUE); | 124 | tabMenu->setCheckable(TRUE); |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); | 128 | cdUpButton = new QToolButton( this,"cdUpButton"); |
129 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | ||
129 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | 130 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); |
130 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | 131 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); |
131 | cdUpButton ->setFlat(TRUE); | ||
132 | layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); | 132 | layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); |
133 | cdUpButton->hide(); | 133 | cdUpButton->hide(); |
134 | 134 | ||
135 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); | 135 | // docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); |
136 | // docButton->setFixedSize( QSize( 20, 20 ) ); | 136 | // docButton->setFixedSize( QSize( 20, 20 ) ); |
137 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); | 137 | // connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); |
138 | // docButton->setFlat(TRUE); | 138 | // docButton->setFlat(TRUE); |
139 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); | 139 | // layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); |
140 | 140 | ||
141 | homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); | 141 | homeButton = new QToolButton(this,"homeButton"); |
142 | homeButton->setPixmap( Resource::loadPixmap("home")); | ||
142 | homeButton->setFixedSize( QSize( 20, 20 ) ); | 143 | homeButton->setFixedSize( QSize( 20, 20 ) ); |
143 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | 144 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); |
144 | homeButton->setFlat(TRUE); | ||
145 | layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); | 145 | layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); |
146 | homeButton->hide(); | 146 | homeButton->hide(); |
147 | 147 | ||
148 | TabWidget = new QTabWidget( this, "TabWidget" ); | 148 | TabWidget = new QTabWidget( this, "TabWidget" ); |
149 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); | 149 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); |
150 | 150 | ||
151 | // TabWidget->setTabShape(QTabWidget::Triangular); | 151 | // TabWidget->setTabShape(QTabWidget::Triangular); |
152 | 152 | ||
153 | tab = new QWidget( TabWidget, "tab" ); | 153 | tab = new QWidget( TabWidget, "tab" ); |
154 | tabLayout = new QGridLayout( tab ); | 154 | tabLayout = new QGridLayout( tab ); |
155 | tabLayout->setSpacing( 2); | 155 | tabLayout->setSpacing( 2); |
156 | tabLayout->setMargin( 2); | 156 | tabLayout->setMargin( 2); |
157 | 157 | ||
158 | Local_View = new QListView( tab, "Local_View" ); | 158 | Local_View = new QListView( tab, "Local_View" ); |
159 | // Local_View->setResizePolicy( QListView::AutoOneFit ); | 159 | // Local_View->setResizePolicy( QListView::AutoOneFit ); |
160 | Local_View->addColumn( tr("File"),150); | 160 | Local_View->addColumn( tr("File"),150); |
161 | Local_View->addColumn( tr("Date"),-1); | 161 | Local_View->addColumn( tr("Date"),-1); |
162 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 162 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
163 | Local_View->addColumn( tr("Size"),-1); | 163 | Local_View->addColumn( tr("Size"),-1); |
164 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 164 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
165 | Local_View->setAllColumnsShowFocus(TRUE); | 165 | Local_View->setAllColumnsShowFocus(TRUE); |
166 | 166 | ||
167 | Local_View->setMultiSelection( TRUE); | 167 | Local_View->setMultiSelection( TRUE); |
168 | Local_View->setSelectionMode(QListView::Extended); | 168 | Local_View->setSelectionMode(QListView::Extended); |
@@ -210,103 +210,102 @@ OpieFtp::OpieFtp( ) | |||
210 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 210 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
211 | 211 | ||
212 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); | 212 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); |
213 | 213 | ||
214 | tab_3 = new QWidget( TabWidget, "tab_3" ); | 214 | tab_3 = new QWidget( TabWidget, "tab_3" ); |
215 | tabLayout_3 = new QGridLayout( tab_3 ); | 215 | tabLayout_3 = new QGridLayout( tab_3 ); |
216 | tabLayout_3->setSpacing( 2); | 216 | tabLayout_3->setSpacing( 2); |
217 | tabLayout_3->setMargin( 2); | 217 | tabLayout_3->setMargin( 2); |
218 | 218 | ||
219 | TextLabel1 = new QLabel( tab_3, "TextLabel1" ); | 219 | TextLabel1 = new QLabel( tab_3, "TextLabel1" ); |
220 | TextLabel1->setText( tr( "Username" ) ); | 220 | TextLabel1->setText( tr( "Username" ) ); |
221 | tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); | 221 | tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); |
222 | 222 | ||
223 | UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); | 223 | UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); |
224 | UsernameComboBox->setEditable(TRUE); | 224 | UsernameComboBox->setEditable(TRUE); |
225 | tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); | 225 | tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); |
226 | 226 | ||
227 | TextLabel2 = new QLabel( tab_3, "TextLabel2" ); | 227 | TextLabel2 = new QLabel( tab_3, "TextLabel2" ); |
228 | TextLabel2->setText( tr( "Password" ) ); | 228 | TextLabel2->setText( tr( "Password" ) ); |
229 | tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); | 229 | tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); |
230 | 230 | ||
231 | PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); | 231 | PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); |
232 | PasswordEdit->setEchoMode(QLineEdit::Password); | 232 | PasswordEdit->setEchoMode(QLineEdit::Password); |
233 | tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 ); | 233 | tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 ); |
234 | 234 | //PasswordEdit->setFixedWidth(85); | |
235 | TextLabel3 = new QLabel( tab_3, "TextLabel3" ); | 235 | TextLabel3 = new QLabel( tab_3, "TextLabel3" ); |
236 | TextLabel3->setText( tr( "Remote server" ) ); | 236 | TextLabel3->setText( tr( "Remote server" ) ); |
237 | tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 ); | 237 | tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 ); |
238 | 238 | ||
239 | ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); | 239 | ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); |
240 | ServerComboBox->setEditable(TRUE); | 240 | ServerComboBox->setEditable(TRUE); |
241 | tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); | 241 | tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); |
242 | 242 | ||
243 | connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) )); | 243 | connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) )); |
244 | connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this,SLOT(serverComboEdited(const QString & ) )); | 244 | connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this,SLOT(serverComboEdited(const QString & ) )); |
245 | 245 | ||
246 | QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" ); | 246 | QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" ); |
247 | TextLabel5->setText( tr( "Remote path" ) ); | 247 | TextLabel5->setText( tr( "Remote path" ) ); |
248 | tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); | 248 | tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); |
249 | 249 | ||
250 | 250 | ||
251 | remotePath = new QLineEdit( "/", tab_3, "remotePath" ); | 251 | remotePath = new QLineEdit( "/", tab_3, "remotePath" ); |
252 | tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); | 252 | tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); |
253 | |||
254 | TextLabel4 = new QLabel( tab_3, "TextLabel4" ); | 253 | TextLabel4 = new QLabel( tab_3, "TextLabel4" ); |
255 | TextLabel4->setText( tr( "Port" ) ); | 254 | TextLabel4->setText( tr( "Port" ) ); |
256 | tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); | 255 | tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); |
257 | 256 | ||
258 | PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); | 257 | PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); |
259 | PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); | 258 | PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); |
260 | PortSpinBox->setMaxValue(32786); | 259 | PortSpinBox->setMaxValue(32786); |
261 | tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); | 260 | tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); |
262 | 261 | ||
263 | QPushButton *deleteServerBtn; | 262 | QPushButton *deleteServerBtn; |
264 | deleteServerBtn = new QPushButton( "Delete Server", tab_3 , "OpenButton" ); | 263 | deleteServerBtn = new QPushButton( "Delete Server", tab_3 , "OpenButton" ); |
265 | tabLayout_3->addMultiCellWidget( deleteServerBtn, 5, 5, 2, 3); | 264 | tabLayout_3->addMultiCellWidget( deleteServerBtn, 5, 5, 2, 3); |
266 | 265 | ||
267 | connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); | 266 | connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); |
268 | 267 | ||
269 | connectServerBtn = new QPushButton( "Connect", tab_3 , "ConnectButton" ); | 268 | connectServerBtn = new QPushButton( "Connect", tab_3 , "ConnectButton" ); |
270 | tabLayout_3->addMultiCellWidget( connectServerBtn, 5, 5, 0, 1); | 269 | tabLayout_3->addMultiCellWidget( connectServerBtn, 5, 5, 0, 1); |
271 | connectServerBtn->setToggleButton(TRUE); | 270 | connectServerBtn->setToggleButton(TRUE); |
272 | connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); | 271 | connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); |
273 | 272 | ||
274 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); | 273 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
275 | tabLayout_3->addItem( spacer, 5, 0 ); | 274 | tabLayout_3->addItem( spacer, 5, 0 ); |
276 | 275 | ||
277 | TabWidget->insertTab( tab_3, tr( "Config" ) ); | 276 | TabWidget->insertTab( tab_3, tr( "Config" ) ); |
278 | 277 | ||
279 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), | 278 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), |
280 | this,SLOT(tabChanged(QWidget*))); | 279 | this,SLOT(tabChanged(QWidget*))); |
281 | 280 | ||
282 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 281 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
283 | currentDir.setPath( QDir::currentDirPath()); | 282 | currentDir.setPath( QDir::currentDirPath()); |
284 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 283 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
285 | 284 | ||
286 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 285 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); |
287 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); | 286 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); |
288 | 287 | currentPathCombo ->setFixedWidth(220); | |
289 | currentPathCombo->setEditable(TRUE); | 288 | currentPathCombo->setEditable(TRUE); |
290 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 289 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
291 | 290 | ||
292 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | 291 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), |
293 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | 292 | this, SLOT( currentPathComboActivated( const QString & ) ) ); |
294 | 293 | ||
295 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 294 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
296 | this,SLOT(currentPathComboChanged())); | 295 | this,SLOT(currentPathComboChanged())); |
297 | 296 | ||
298 | ProgressBar = new QProgressBar( this, "ProgressBar" ); | 297 | ProgressBar = new QProgressBar( this, "ProgressBar" ); |
299 | layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); | 298 | layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); |
300 | 299 | ||
301 | fillCombos(); | 300 | fillCombos(); |
302 | 301 | ||
303 | filterStr="*"; | 302 | filterStr="*"; |
304 | b=FALSE; | 303 | b=FALSE; |
305 | populateLocalView(); | 304 | populateLocalView(); |
306 | qDebug("read COnfig"); | 305 | qDebug("read COnfig"); |
307 | readConfig(); | 306 | readConfig(); |
308 | qDebug("Set current item"); | 307 | qDebug("Set current item"); |
309 | ServerComboBox->setCurrentItem(currentServerConfig); | 308 | ServerComboBox->setCurrentItem(currentServerConfig); |
310 | 309 | ||
311 | TabWidget->setCurrentPage(2); | 310 | TabWidget->setCurrentPage(2); |
312 | } | 311 | } |