-rw-r--r-- | noncore/net/opieftp/inputDialog.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opieftp/inputDialog.h | 2 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/noncore/net/opieftp/inputDialog.cpp b/noncore/net/opieftp/inputDialog.cpp index 89b345e..373db3b 100644 --- a/noncore/net/opieftp/inputDialog.cpp +++ b/noncore/net/opieftp/inputDialog.cpp | |||
@@ -29,12 +29,16 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags | |||
29 | setCaption( tr(name ) ); | 29 | setCaption( tr(name ) ); |
30 | 30 | ||
31 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 31 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
32 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); | 32 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); |
33 | } | 33 | } |
34 | 34 | ||
35 | InputDialog::~InputDialog() | 35 | InputDialog::~InputDialog() |
36 | { | 36 | { |
37 | inputText= LineEdit1->text(); | 37 | inputText= LineEdit1->text(); |
38 | 38 | ||
39 | } | 39 | } |
40 | 40 | ||
41 | void InputDialog::setTextEdit(const QString &string) | ||
42 | { | ||
43 | LineEdit1->setText(string); | ||
44 | } | ||
diff --git a/noncore/net/opieftp/inputDialog.h b/noncore/net/opieftp/inputDialog.h index 2cd8285..dfe0e8a 100644 --- a/noncore/net/opieftp/inputDialog.h +++ b/noncore/net/opieftp/inputDialog.h | |||
@@ -19,16 +19,16 @@ class QHBoxLayout; | |||
19 | class QGridLayout; | 19 | class QGridLayout; |
20 | class QLineEdit; | 20 | class QLineEdit; |
21 | 21 | ||
22 | class InputDialog : public QDialog | 22 | class InputDialog : public QDialog |
23 | { | 23 | { |
24 | Q_OBJECT | 24 | Q_OBJECT |
25 | 25 | ||
26 | public: | 26 | public: |
27 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 27 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
28 | ~InputDialog(); | 28 | ~InputDialog(); |
29 | QString inputText; | 29 | QString inputText; |
30 | QLineEdit* LineEdit1; | 30 | QLineEdit* LineEdit1; |
31 | 31 | void setTextEdit(const QString &); | |
32 | }; | 32 | }; |
33 | 33 | ||
34 | #endif // INPUTDIALOG_H | 34 | #endif // INPUTDIALOG_H |
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index e64fd73..b451925 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -934,47 +934,47 @@ void OpieFtp::remoteDelete() | |||
934 | } | 934 | } |
935 | break; | 935 | break; |
936 | }; | 936 | }; |
937 | } | 937 | } |
938 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 938 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
939 | } | 939 | } |
940 | 940 | ||
941 | void OpieFtp::remoteRename() | 941 | void OpieFtp::remoteRename() |
942 | { | 942 | { |
943 | QString curFile = Remote_View->currentItem()->text(0); | 943 | QString curFile = Remote_View->currentItem()->text(0); |
944 | InputDialog *fileDlg; | 944 | InputDialog *fileDlg; |
945 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); | 945 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); |
946 | fileDlg->inputText = curFile; | 946 | fileDlg->setTextEdit((const QString &)curFile); |
947 | fileDlg->exec(); | 947 | fileDlg->exec(); |
948 | if( fileDlg->result() == 1 ) { | 948 | if( fileDlg->result() == 1 ) { |
949 | QString oldName = currentRemoteDir +"/"+ curFile; | 949 | QString oldName = currentRemoteDir +"/"+ curFile; |
950 | QString newName = currentRemoteDir +"/"+ fileDlg->LineEdit1->text();//+".playlist"; | 950 | QString newName = currentRemoteDir +"/"+ fileDlg->LineEdit1->text();//+".playlist"; |
951 | QCopEnvelope ( "QPE/System", "busy()" ); | 951 | QCopEnvelope ( "QPE/System", "busy()" ); |
952 | if(FtpRename( oldName.latin1(), newName.latin1(),conn) == 0) { | 952 | if(FtpRename( oldName.latin1(), newName.latin1(),conn) == 0) { |
953 | QString msg; | 953 | QString msg; |
954 | msg.sprintf(tr("Unable to rename file\n")+"%s",FtpLastResponse(conn)); | 954 | msg.sprintf(tr("Unable to rename file\n")+"%s",FtpLastResponse(conn)); |
955 | msg.replace(QRegExp(":"),"\n"); | 955 | msg.replace(QRegExp(":"),"\n"); |
956 | QMessageBox::message(tr("Note"),msg); | 956 | QMessageBox::message(tr("Note"),msg); |
957 | } | 957 | } |
958 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 958 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
959 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | 959 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate |
960 | } | 960 | } |
961 | } | 961 | } |
962 | 962 | ||
963 | void OpieFtp::localRename() | 963 | void OpieFtp::localRename() |
964 | { | 964 | { |
965 | QString curFile = Local_View->currentItem()->text(0); | 965 | QString curFile = Local_View->currentItem()->text(0); |
966 | InputDialog *fileDlg; | 966 | InputDialog *fileDlg; |
967 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); | 967 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); |
968 | fileDlg->inputText = curFile; | 968 | fileDlg->setTextEdit((const QString &)curFile); |
969 | fileDlg->exec(); | 969 | fileDlg->exec(); |
970 | if( fileDlg->result() == 1 ) { | 970 | if( fileDlg->result() == 1 ) { |
971 | QString oldname = currentDir.canonicalPath() + "/" + curFile; | 971 | QString oldname = currentDir.canonicalPath() + "/" + curFile; |
972 | QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; | 972 | QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; |
973 | if( rename(oldname.latin1(), newName.latin1())== -1) | 973 | if( rename(oldname.latin1(), newName.latin1())== -1) |
974 | QMessageBox::message(tr("Note"),tr("Could not rename")); | 974 | QMessageBox::message(tr("Note"),tr("Could not rename")); |
975 | } | 975 | } |
976 | populateLocalView(); | 976 | populateLocalView(); |
977 | } | 977 | } |
978 | 978 | ||
979 | void OpieFtp::currentPathComboActivated(const QString & currentPath) { | 979 | void OpieFtp::currentPathComboActivated(const QString & currentPath) { |
980 | if (TabWidget->currentPageIndex() == 0) { | 980 | if (TabWidget->currentPageIndex() == 0) { |