author | mickeyl <mickeyl> | 2003-12-15 14:46:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-15 14:46:55 (UTC) |
commit | a92cea6bfe45dd7a2e55b22281919f5e588b4d15 (patch) (side-by-side diff) | |
tree | e2c6458304d6a2ede4f4feb265a469d9a196bdeb /noncore/net/wellenreiter | |
parent | ab8df0d8a80bc4ea50b72b39eedf896bb9337f69 (diff) | |
download | opie-a92cea6bfe45dd7a2e55b22281919f5e588b4d15.zip opie-a92cea6bfe45dd7a2e55b22281919f5e588b4d15.tar.gz opie-a92cea6bfe45dd7a2e55b22281919f5e588b4d15.tar.bz2 |
*** empty log message ***
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 60 |
1 files changed, 51 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 88a474d..bb46dd7 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp @@ -27,2 +27,5 @@ #include <qfileinfo.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qlineedit.h> #include <qiconset.h> @@ -31,2 +34,3 @@ #include <qpopupmenu.h> +#include <qpushbutton.h> #include <qstatusbar.h> @@ -89,4 +93,4 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n uploadButton->setIconSet( Resource::loadIconSet( "up" ) ); - //uploadButton->setEnabled( false ); - uploadButton->setEnabled( true ); + uploadButton->setEnabled( false ); + //uploadButton->setEnabled( true ); // DEBUGGING connect( uploadButton, SIGNAL( clicked() ), this, SLOT( uploadSession() ) ); @@ -378,2 +382,34 @@ void WellenreiterMainWindow::uploadSession() { + QLineEdit* from; + QLineEdit* location; + QLineEdit* comments; + QPushButton* accept; + QPushButton* reject; + + QDialog* d = new QDialog( 0, "session upload", true ); + d->setCaption( tr( "Upload Session" ) ); + QGridLayout* g = new QGridLayout( d, 4, 2, 3 ); + g->addWidget( new QLabel( tr( "From: " ), d ), 0, 0 ); + g->addWidget( from = new QLineEdit( d ), 0, 1 ); + g->addWidget( new QLabel( tr( "Location: " ), d ), 1, 0 ); + g->addWidget( location = new QLineEdit( d ), 1, 1 ); + g->addWidget( new QLabel( tr( "Comments: " ), d ), 2, 0 ); + g->addWidget( comments = new QLineEdit( d ), 2, 1 ); + g->addWidget( accept = new QPushButton( tr( "&Ok" ), d ), 3, 0 ); + g->addWidget( reject = new QPushButton( tr( "&Cancel" ), d ), 3, 1 ); + accept->setDefault( true ); + accept->setAutoDefault( true ); + from->setText( "WL II User" ); + location->setText( "WL II Location" ); + comments->setText( "No Comments." ); + connect( accept, SIGNAL( clicked() ), d, SLOT( accept() ) ); + connect( reject, SIGNAL( clicked() ), d, SLOT( reject() ) ); + int result = d->exec(); + + if ( !result ) + { + qDebug( "Session upload cancelled :(" ); + return; + } + qDebug( "Starting upload..." ); @@ -390,3 +426,3 @@ void WellenreiterMainWindow::uploadSession() { - qDebug( "no file to upload!" ); + QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Logfile doesn't exist</p>") ); return; @@ -397,3 +433,3 @@ void WellenreiterMainWindow::uploadSession() { - qDebug( "can't open file!" ); + QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Can't open Logfile</p>") ); return; @@ -437,3 +473,3 @@ void WellenreiterMainWindow::uploadSession() "\r\n" - "Anonymous Wellenreiter II User\r\n" + "%1\r\n" "-----------------------------97267758015830030481215568065\r\n" @@ -441,3 +477,3 @@ void WellenreiterMainWindow::uploadSession() "\r\n" - "Anonymous Wellenreiter II Location\r\n" + "%2\r\n" "-----------------------------97267758015830030481215568065\r\n" @@ -445,3 +481,3 @@ void WellenreiterMainWindow::uploadSession() "\r\n" - "Anonymous Wellenreiter II Comments\r\n" + "%3\r\n" "-----------------------------97267758015830030481215568065\r\n" @@ -454,2 +490,6 @@ void WellenreiterMainWindow::uploadSession() + content = content.arg( from->text().isEmpty() ? QString( "Anonymous Wellenreiter II User" ) : from->text() ); + content = content.arg( location->text().isEmpty() ? QString( "Anonymous Wellenreiter II Location" ) : location->text() ); + content = content.arg( comments->text().isEmpty() ? QString( "Anonymous Wellenreiter II Comments" ) : comments->text() ); + header = header.arg( QString::number( content.length() + f.size() + preambel.length() ) ); @@ -491,5 +531,7 @@ void WellenreiterMainWindow::uploadSession() if ( ok ) - QMessageBox::information ( 0, tr( "Success" ), QString ( "<p>%1</p>" ). arg( tr( "Capture Dump was uploaded to %1" )).arg ( CAP_hostname )); + QMessageBox::information( 0, tr( "Success" ), + QString ( "<p>%1</p>" ).arg( tr( "Capture Dump was uploaded to %1" ) ).arg( CAP_hostname ) ); else - QMessageBox::warning ( 0, tr( "Error" ), QString ( "<p>%1</p>" ). arg ( tr( "Connection to %1 failed." )). arg ( CAP_hostname )); + QMessageBox::warning( 0, tr( "Error" ), + QString ( "<p>%1</p>" ).arg ( tr( "Connection to %1 failed" ) ).arg( CAP_hostname ) ); } |