summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-17 01:44:37 (UTC)
committer llornkcor <llornkcor>2002-03-17 01:44:37 (UTC)
commit624a283591094628425c94fedfdd62941ad7c853 (patch) (unidiff)
tree092b96fa04b16eae5e9702a7a83c67e1cb6a7e60
parent2fe80a98551e89b45798369f1bf91f0368382ba6 (diff)
downloadopie-624a283591094628425c94fedfdd62941ad7c853.zip
opie-624a283591094628425c94fedfdd62941ad7c853.tar.gz
opie-624a283591094628425c94fedfdd62941ad7c853.tar.bz2
added checks on the 'View' menu for which tab is current
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 6a3a64d..118275b 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -74,7 +74,7 @@ OpieFtp::OpieFtp( )
74 connectionMenu = new QPopupMenu( this ); 74 connectionMenu = new QPopupMenu( this );
75 localMenu = new QPopupMenu( this ); 75 localMenu = new QPopupMenu( this );
76 remoteMenu = new QPopupMenu( this ); 76 remoteMenu = new QPopupMenu( this );
77 tabMenu = new QPopupMenu( this ); 77 tabMenu = new QPopupMenu( this );
78 78
79 layout->addMultiCellWidget( menuBar, 0, 0, 0, 3 ); 79 layout->addMultiCellWidget( menuBar, 0, 0, 0, 3 );
80 80
@@ -83,7 +83,7 @@ OpieFtp::OpieFtp( )
83 menuBar->insertItem( tr( "Remote" ), remoteMenu); 83 menuBar->insertItem( tr( "Remote" ), remoteMenu);
84 menuBar->insertItem( tr( "View" ), tabMenu); 84 menuBar->insertItem( tr( "View" ), tabMenu);
85 85
86 connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); 86 connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() ));
87 connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); 87 connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() ));
88 connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); 88 connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() ));
89 89
@@ -104,8 +104,9 @@ OpieFtp::OpieFtp( )
104 tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 104 tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
105 tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); 105 tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
106 tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); 106 tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() ));
107 tabMenu->setCheckable(TRUE);
107 108
108 TabWidget = new QTabWidget( this, "TabWidget" ); 109 TabWidget = new QTabWidget( this, "TabWidget" );
109 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 ); 110 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 );
110 111
111 TabWidget->setTabShape(QTabWidget::Triangular); 112 TabWidget->setTabShape(QTabWidget::Triangular);
@@ -148,14 +149,14 @@ OpieFtp::OpieFtp( )
148 Remote_View->setAllColumnsShowFocus(TRUE); 149 Remote_View->setAllColumnsShowFocus(TRUE);
149 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); 150 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
150 151
151 connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)), 152 connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)),
152 this,SLOT( remoteListClicked(QListViewItem *)) ); 153 this,SLOT( remoteListClicked(QListViewItem *)) );
153 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 154 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
154 this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); 155 this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) );
155 156
156 tabLayout_2->addWidget( Remote_View, 0, 0 ); 157 tabLayout_2->addWidget( Remote_View, 0, 0 );
157 158
158 TabWidget->insertTab( tab_2, tr( "Remote" ) ); 159 TabWidget->insertTab( tab_2, tr( "Remote" ) );
159 160
160 tab_3 = new QWidget( TabWidget, "tab_3" ); 161 tab_3 = new QWidget( TabWidget, "tab_3" );
161 tabLayout_3 = new QGridLayout( tab_3 ); 162 tabLayout_3 = new QGridLayout( tab_3 );
@@ -205,19 +206,19 @@ OpieFtp::OpieFtp( )
205 206
206 TextLabel4 = new QLabel( tab_3, "TextLabel4" ); 207 TextLabel4 = new QLabel( tab_3, "TextLabel4" );
207 TextLabel4->setText( tr( "Port" ) ); 208 TextLabel4->setText( tr( "Port" ) );
208 tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); 209 tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 );
209 210
210 PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); 211 PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" );
211 PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); 212 PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows );
212 PortSpinBox->setMaxValue(32786); 213 PortSpinBox->setMaxValue(32786);
213 PortSpinBox->setValue( 4242); 214 PortSpinBox->setValue( 4242);
214// PortSpinBox->setValue( 21); 215// PortSpinBox->setValue( 21);
215 tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); 216 tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1);
216 217
217 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 218 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
218 tabLayout_3->addItem( spacer, 5, 0 ); 219 tabLayout_3->addItem( spacer, 5, 0 );
219 220
220 TabWidget->insertTab( tab_3, tr( "Config" ) ); 221 TabWidget->insertTab( tab_3, tr( "Config" ) );
221 222
222 connect(TabWidget,SIGNAL(currentChanged(QWidget *)), 223 connect(TabWidget,SIGNAL(currentChanged(QWidget *)),
223 this,SLOT(tabChanged(QWidget*))); 224 this,SLOT(tabChanged(QWidget*)));
@@ -228,7 +229,7 @@ OpieFtp::OpieFtp( )
228 currentPathEdit = new QLineEdit( "/", this, "currentPathEdit" ); 229 currentPathEdit = new QLineEdit( "/", this, "currentPathEdit" );
229 layout->addMultiCellWidget( currentPathEdit, 3, 3, 0, 3 ); 230 layout->addMultiCellWidget( currentPathEdit, 3, 3, 0, 3 );
230 231
231 currentPathEdit->setText( currentDir.canonicalPath()); 232 currentPathEdit->setText( currentDir.canonicalPath());
232 connect( currentPathEdit,SIGNAL(returnPressed()),this,SLOT(currentPathEditChanged())); 233 connect( currentPathEdit,SIGNAL(returnPressed()),this,SLOT(currentPathEditChanged()));
233 234
234 ProgressBar = new QProgressBar( this, "ProgressBar" ); 235 ProgressBar = new QProgressBar( this, "ProgressBar" );
@@ -260,11 +261,20 @@ void OpieFtp::tabChanged(QWidget *w)
260{ 261{
261 if (TabWidget->currentPageIndex() == 0) { 262 if (TabWidget->currentPageIndex() == 0) {
262 currentPathEdit->setText( currentDir.canonicalPath()); 263 currentPathEdit->setText( currentDir.canonicalPath());
264 tabMenu->setItemChecked(tabMenu->idAt(0),TRUE);
265 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE);
266 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE);
263 } 267 }
264 if (TabWidget->currentPageIndex() == 1) { 268 if (TabWidget->currentPageIndex() == 1) {
265 currentPathEdit->setText( currentRemoteDir ); 269 currentPathEdit->setText( currentRemoteDir );
270 tabMenu->setItemChecked(tabMenu->idAt(1),TRUE);
271 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE);
272 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE);
266 } 273 }
267 if (TabWidget->currentPageIndex() == 2) { 274 if (TabWidget->currentPageIndex() == 2) {
275 tabMenu->setItemChecked(tabMenu->idAt(2),TRUE);
276 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE);
277 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE);
268 } 278 }
269} 279}
270 280
@@ -853,15 +863,15 @@ void OpieFtp::currentPathEditChanged()
853 863
854void OpieFtp::switchToLocalTab() 864void OpieFtp::switchToLocalTab()
855{ 865{
856TabWidget->setCurrentPage(0); 866 TabWidget->setCurrentPage(0);
857} 867}
858 868
859void OpieFtp::switchToRemoteTab() 869void OpieFtp::switchToRemoteTab()
860{ 870{
861TabWidget->setCurrentPage(1); 871 TabWidget->setCurrentPage(1);
862} 872}
863 873
864void OpieFtp::switchToConfigTab() 874void OpieFtp::switchToConfigTab()
865{ 875{
866TabWidget->setCurrentPage(2); 876 TabWidget->setCurrentPage(2);
867} 877}