summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-24 17:03:37 (UTC)
committer llornkcor <llornkcor>2002-03-24 17:03:37 (UTC)
commit6ce8bbff9eb16e0d731755010bda63e7fb43f70b (patch) (side-by-side diff)
tree0f3cf5476398743f86fa6d884d86751a7251df3e
parent368d5032f4ff4566dea1e99aa2bb782300e0bfd5 (diff)
downloadopie-6ce8bbff9eb16e0d731755010bda63e7fb43f70b.zip
opie-6ce8bbff9eb16e0d731755010bda63e7fb43f70b.tar.gz
opie-6ce8bbff9eb16e0d731755010bda63e7fb43f70b.tar.bz2
config last server on startup
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp46
1 files changed, 17 insertions, 29 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index e2a6cad..e97a9bf 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -152,4 +152,6 @@ OpieFtp::OpieFtp( )
Remote_View->addColumn( tr("Date"),-1);
Remote_View->setColumnAlignment(2,QListView::AlignRight);
+ Remote_View->addColumn( tr("Dir"),-1);
+ Remote_View->setColumnAlignment(4,QListView::AlignRight);
Remote_View->setAllColumnsShowFocus(TRUE);
QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
@@ -244,6 +246,5 @@ OpieFtp::OpieFtp( )
layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 3 );
- serverComboSelected(0);
- fillCombos();
+// fillCombos();
#ifdef DEVELOPERS_VERSION
@@ -261,4 +262,6 @@ OpieFtp::OpieFtp( )
b=FALSE;
populateLocalView();
+ readConfig();
+ ServerComboBox->setCurrentItem(currentServerConfig);
TabWidget->setCurrentPage(2);
}
@@ -582,13 +585,15 @@ bool OpieFtp::populateRemoteView( )
fileDate = fileDate.stripWhiteSpace();
if(fileL.find("total",0,TRUE) == -1) {
- QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate);
if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
+ QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"d");
item->setPixmap( 0, Resource::loadPixmap( "folder" ));
- if(itemDir)
+// if(itemDir)
item->moveItem(itemDir);
itemDir=item;
} else {
+ QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"f");
item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
- if(itemFile)
+// if(itemFile)
+ item->moveItem(itemDir);
item->moveItem(itemFile);
itemFile=item;
@@ -604,5 +609,4 @@ bool OpieFtp::populateRemoteView( )
qDebug("temp file not opened successfullly "+sfile);
Remote_View->setSorting( 4,TRUE);
-
return true;
}
@@ -973,29 +977,9 @@ void OpieFtp::switchToConfigTab()
void OpieFtp::readConfig()
{
-
+ fillCombos();
Config cfg("opieftp");
cfg.setGroup("Server");
- QString username, remoteServer, remotePathStr, password, port, temp;
- int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
- for (int i = 0; i <= numberOfEntries; i++) {
- temp.setNum(i+1);
- cfg.setGroup("Server");
- remoteServer = cfg.readEntry( temp,"");
- ServerComboBox->insertItem( remoteServer );
- cfg.setGroup(temp);
-
- remotePathStr = cfg.readEntry(remoteServer,"");
- int divider = remoteServer.length() - remoteServer.find(":",0,TRUE);
- port = remoteServer.right( divider+1);
- bool ok;
- PortSpinBox->setValue( port.toInt(&ok,10));
-
- remoteServer = remoteServer.left(divider - 1);
- remotePath->setText( remotePathStr);
- username = cfg.readEntry(temp);
- UsernameComboBox->insertItem(username);
- password = cfg.readEntryCrypt(username,"");
- PasswordEdit->setText(password);
- }
+ currentServerConfig = cfg.readNumEntry("currentServer", -1);
+ serverComboSelected( currentServerConfig);
}
@@ -1089,4 +1073,8 @@ void OpieFtp::serverComboSelected(int index)
UsernameComboBox->lineEdit()->setText(username);
PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org"));
+
+ cfg.setGroup("Server");
+ temp.sprintf("%d",currentServerConfig);
+ cfg.writeEntry("currentServer", temp);
update();
}