summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp
authorllornkcor <llornkcor>2002-03-16 20:37:12 (UTC)
committer llornkcor <llornkcor>2002-03-16 20:37:12 (UTC)
commitd7203a29593bd5cd21339c67fa094d67283a8525 (patch) (side-by-side diff)
tree50c2112d7b9127fb0a5754d09a7f089fb3b63522 /noncore/net/opieftp
parent1d20ca78752b9da597950087438daa9ff8cb7951 (diff)
downloadopie-d7203a29593bd5cd21339c67fa094d67283a8525.zip
opie-d7203a29593bd5cd21339c67fa094d67283a8525.tar.gz
opie-d7203a29593bd5cd21339c67fa094d67283a8525.tar.bz2
made opieftp resizable
Diffstat (limited to 'noncore/net/opieftp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp105
-rw-r--r--noncore/net/opieftp/opieftp.h10
2 files changed, 89 insertions, 26 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index ed7f4bb..042ed59 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -64,6 +64,8 @@ OpieFtp::OpieFtp( )
{
- resize( 236, 290 );
- setMaximumSize( QSize( 240, 320 ) );
setCaption( tr( "OpieFtp" ) );
+ QGridLayout *layout = new QGridLayout( this );
+ layout->setSpacing( 2);
+ layout->setMargin( 2);
+
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
@@ -74,2 +76,6 @@ OpieFtp::OpieFtp( )
remoteMenu = new QPopupMenu( this );
+ tabMenu = new QPopupMenu( this );
+
+ layout->addMultiCellWidget( menuBar, 0, 0, 0, 3 );
+
menuBar->insertItem( tr( "Connection" ), connectionMenu);
@@ -77,2 +83,3 @@ OpieFtp::OpieFtp( )
menuBar->insertItem( tr( "Remote" ), remoteMenu);
+ menuBar->insertItem( tr( "View" ), tabMenu);
@@ -83,2 +90,3 @@ OpieFtp::OpieFtp( )
localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
+ localMenu->insertSeparator();
localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() ));
@@ -95,7 +103,9 @@ OpieFtp::OpieFtp( )
- ProgressBar = new QProgressBar( this, "ProgressBar" );
- ProgressBar->setGeometry( QRect( 5, 268, 231, 15 ) );
+ 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() ));
+
+ TabWidget = new QTabWidget( this, "TabWidget" );
+ layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 );
- TabWidget = new QTabWidget( this, "TabWidget2" );
- TabWidget->setGeometry( QRect( 3, 25, 240, 220 ) );
TabWidget->setTabShape(QTabWidget::Triangular);
@@ -103,5 +113,8 @@ OpieFtp::OpieFtp( )
tab = new QWidget( TabWidget, "tab" );
+ tabLayout = new QGridLayout( tab );
+ tabLayout->setSpacing( 2);
+ tabLayout->setMargin( 2);
Local_View = new QListView( tab, "Local_View" );
- Local_View->setGeometry( QRect( 3, 2, 225, 195 ) );
+// Local_View->setResizePolicy( QListView::AutoOneFit );
Local_View->addColumn( "File",120);
@@ -114,2 +127,4 @@ OpieFtp::OpieFtp( )
+ tabLayout->addWidget( Local_View, 0, 0 );
+
connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)),
@@ -122,5 +137,7 @@ OpieFtp::OpieFtp( )
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->setGeometry( QRect( 3, 2, 225, 195 ) );
Remote_View->addColumn( "File",120);
@@ -138,2 +155,4 @@ OpieFtp::OpieFtp( )
+ tabLayout_2->addWidget( Remote_View, 0, 0 );
+
TabWidget->insertTab( tab_2, tr( "Remote" ) );
@@ -141,35 +160,45 @@ OpieFtp::OpieFtp( )
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->setGeometry( QRect( 10, 10, 60, 16 ) );
TextLabel1->setText( tr( "Username" ) );
+ tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 );
+
UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" );
- UsernameComboBox->setGeometry( QRect( 10, 25, 196, 21 ) );
UsernameComboBox->setEditable(TRUE);
- UsernameComboBox->lineEdit()->setText("anonymous");
+// UsernameComboBox->lineEdit()->setText("anonymous");
+ UsernameComboBox->lineEdit()->setText("root");
// UsernameComboBox->lineEdit()->setText("llornkcor");
+ tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 );
TextLabel2 = new QLabel( tab_3, "TextLabel2" );
- TextLabel2->setGeometry( QRect( 10, 50, 65, 16 ) );
TextLabel2->setText( tr( "Password" ) );
+ tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 );
+
PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" );
- PasswordEdit->setGeometry( QRect( 10, 65, 195, 16 ) );
PasswordEdit->setEchoMode(QLineEdit::Password);
- PasswordEdit->setText( tr( "me@opieftp.org" ) );
+// PasswordEdit->setText( tr( "me@opieftp.org" ) );
+// PasswordEdit->setText( tr( "" ) );
+ tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 );
TextLabel3 = new QLabel( tab_3, "TextLabel3" );
- TextLabel3->setGeometry( QRect( 10, 90, 95, 16 ) );
TextLabel3->setText( tr( "Remote server" ) );
+ tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
+
ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" );
- ServerComboBox->setGeometry( QRect( 10, 105, 195, 21 ) );
ServerComboBox->setEditable(TRUE);
ServerComboBox->lineEdit()->setText( tr( "" ) );
+ tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 );
// ServerComboBox->lineEdit()->setText( tr( "llornkcor.com" ) );
+ ServerComboBox->lineEdit()->setText( tr( "192.168.129.201" ) );
QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" );
- TextLabel5->setGeometry( QRect( 10, 130, 95, 16 ) );
TextLabel5->setText( tr( "Remote path" ) );
+ tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 );
+
remotePath = new QLineEdit( "/", tab_3, "remotePath" );
- remotePath->setGeometry( QRect( 10, 145, 195, 16 ) );
remotePath->setText( currentRemoteDir = "/");
+ tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 );
// remotePath->setText( currentRemoteDir = "/home/llornkcor/");
@@ -177,9 +206,14 @@ OpieFtp::OpieFtp( )
TextLabel4 = new QLabel( tab_3, "TextLabel4" );
- TextLabel4->setGeometry( QRect( 10, 170, 30, 21 ) );
TextLabel4->setText( tr( "Port" ) );
+ tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 );
+
PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" );
- PortSpinBox->setGeometry( QRect( 40, 175, 75, 20 ) );
PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows );
PortSpinBox->setMaxValue(32786);
- PortSpinBox->setValue( 21);
+ PortSpinBox->setValue( 4242);
+// PortSpinBox->setValue( 21);
+ tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1);
+
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ tabLayout_3->addItem( spacer, 5, 0 );
@@ -194,3 +228,4 @@ OpieFtp::OpieFtp( )
currentPathEdit = new QLineEdit( "/", this, "currentPathEdit" );
- currentPathEdit->setGeometry( QRect( 5, 248, 220, 18 ) );
+ layout->addMultiCellWidget( currentPathEdit, 3, 3, 0, 3 );
+
currentPathEdit->setText( currentDir.canonicalPath());
@@ -198,2 +233,5 @@ OpieFtp::OpieFtp( )
+ ProgressBar = new QProgressBar( this, "ProgressBar" );
+ layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 3 );
+
filterStr="*";
@@ -219,5 +257,8 @@ void OpieFtp::tabChanged(QWidget *w)
currentPathEdit->setText( currentDir.canonicalPath());
- } else if (TabWidget->currentPageIndex() == 1) {
+ }
+ if (TabWidget->currentPageIndex() == 1) {
currentPathEdit->setText( currentRemoteDir );
}
+ if (TabWidget->currentPageIndex() == 2) {
+ }
}
@@ -260,3 +301,4 @@ void OpieFtp::localUpload()
-void OpieFtp::nullifyCallBack() {
+void OpieFtp::nullifyCallBack()
+{
FtpOptions(FTPLIB_CALLBACK, NULL, conn);
@@ -789 +831,16 @@ void OpieFtp::currentPathEditChanged()
}
+
+void OpieFtp::switchToLocalTab()
+{
+TabWidget->setCurrentPage(0);
+}
+
+void OpieFtp::switchToRemoteTab()
+{
+TabWidget->setCurrentPage(1);
+}
+
+void OpieFtp::switchToConfigTab()
+{
+TabWidget->setCurrentPage(2);
+}
diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h
index 5d1c63d..e3ff334 100644
--- a/noncore/net/opieftp/opieftp.h
+++ b/noncore/net/opieftp/opieftp.h
@@ -48,3 +48,3 @@ public:
QTabWidget *TabWidget;
- QWidget *tab, *tab_2, *tab_3;;
+ QWidget *tab, *tab_2, *tab_3;
QListView *Local_View, *Remote_View;
@@ -55,3 +55,3 @@ public:
QSpinBox* PortSpinBox;
- QPopupMenu *connectionMenu, *localMenu, *remoteMenu;
+ QPopupMenu *connectionMenu, *localMenu, *remoteMenu, *tabMenu;
QDir currentDir;
@@ -91,4 +91,10 @@ protected slots:
void currentPathEditChanged();
+ void switchToLocalTab();
+ void switchToRemoteTab();
+ void switchToConfigTab();
protected:
void nullifyCallBack();
+ QGridLayout* tabLayout;
+ QGridLayout* tabLayout_2;
+ QGridLayout* tabLayout_3;