summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/transferdialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/transferdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp
index d494a6c..75eb443 100644
--- a/noncore/apps/opie-console/transferdialog.cpp
+++ b/noncore/apps/opie-console/transferdialog.cpp
@@ -1,41 +1,42 @@
1#include <qlayout.h> 1#include <qlayout.h>
2#include <qcombobox.h> 2#include <qcombobox.h>
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qpushbutton.h> 5#include <qpushbutton.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qprogressbar.h> 7#include <qprogressbar.h>
8#include <qradiobutton.h> 8#include <qradiobutton.h>
9#include <qbuttongroup.h> 9#include <qbuttongroup.h>
10 10
11#include <opie2/ofiledialog.h> 11#include <opie2/ofiledialog.h>
12 12
13#include "metafactory.h" 13#include "metafactory.h"
14#include "mainwindow.h" 14#include "mainwindow.h"
15 15
16#include "transferdialog.h" 16#include "transferdialog.h"
17 17
18using namespace Opie::Ui;
18TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) 19TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *)
19: QDialog(parent, 0l, false), m_win(mainwindow) 20: QDialog(parent, 0l, false), m_win(mainwindow)
20{ 21{
21 m_lay = 0l; 22 m_lay = 0l;
22 m_recvlay = 0l; 23 m_recvlay = 0l;
23 QVBoxLayout *vbox, *vbox2; 24 QVBoxLayout *vbox, *vbox2;
24 QHBoxLayout *hbox, *hbox2, *hbox3; 25 QHBoxLayout *hbox, *hbox2, *hbox3;
25 QLabel *file, *mode, *progress, *status; 26 QLabel *file, *mode, *progress, *status;
26 QButtonGroup *group; 27 QButtonGroup *group;
27 QRadioButton *mode_send, *mode_receive; 28 QRadioButton *mode_send, *mode_receive;
28 29
29 m_autocleanup = 0; 30 m_autocleanup = 0;
30 m_running = true; 31 m_running = true;
31 32
32 group = new QButtonGroup(QObject::tr("Transfer mode"), this); 33 group = new QButtonGroup(QObject::tr("Transfer mode"), this);
33 mode_send = new QRadioButton(QObject::tr("Send"), group); 34 mode_send = new QRadioButton(QObject::tr("Send"), group);
34 mode_receive = new QRadioButton(QObject::tr("Receive"), group); 35 mode_receive = new QRadioButton(QObject::tr("Receive"), group);
35 group->insert(mode_send, id_send); 36 group->insert(mode_send, id_send);
36 group->insert(mode_receive, id_receive); 37 group->insert(mode_receive, id_receive);
37 vbox2 = new QVBoxLayout(group, 2); 38 vbox2 = new QVBoxLayout(group, 2);
38 vbox2->addSpacing(10); 39 vbox2->addSpacing(10);
39 hbox3 = new QHBoxLayout(vbox2, 2); 40 hbox3 = new QHBoxLayout(vbox2, 2);
40 hbox3->add(mode_send); 41 hbox3->add(mode_send);
41 hbox3->add(mode_receive); 42 hbox3->add(mode_receive);
@@ -77,49 +78,49 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const ch
77 vbox->add(status); 78 vbox->add(status);
78 vbox->add(statusbar); 79 vbox->add(statusbar);
79 vbox->addStretch(1); 80 vbox->addStretch(1);
80 hbox2 = new QHBoxLayout(vbox, 2); 81 hbox2 = new QHBoxLayout(vbox, 2);
81 hbox2->add(ok); 82 hbox2->add(ok);
82 hbox2->add(cancel); 83 hbox2->add(cancel);
83 84
84 setCaption(QObject::tr("File transfer")); 85 setCaption(QObject::tr("File transfer"));
85 show(); 86 show();
86 87
87 connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); 88 connect(selector, SIGNAL(clicked()), SLOT(slotFilename()));
88 connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); 89 connect(ok, SIGNAL(clicked()), SLOT(slotTransfer()));
89 connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); 90 connect(cancel, SIGNAL(clicked()), SLOT(slotCancel()));
90 connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); 91 connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int)));
91} 92}
92 93
93TransferDialog::~TransferDialog() 94TransferDialog::~TransferDialog()
94{ 95{
95} 96}
96 97
97void TransferDialog::slotFilename() 98void TransferDialog::slotFilename()
98{ 99{
99 QString f; 100 QString f;
100 101
101 f = Opie::OFileDialog::getOpenFileName(0); 102 f = OFileDialog::getOpenFileName(0);
102 if(!f.isNull()) filename->setText(f); 103 if(!f.isNull()) filename->setText(f);
103} 104}
104 105
105void TransferDialog::slotTransfer() 106void TransferDialog::slotTransfer()
106{ 107{
107 if((m_transfermode == id_send) && (filename->text().isEmpty())) 108 if((m_transfermode == id_send) && (filename->text().isEmpty()))
108 { 109 {
109 QMessageBox::information(this, 110 QMessageBox::information(this,
110 QObject::tr("Attention"), 111 QObject::tr("Attention"),
111 QObject::tr("No file has been specified.")); 112 QObject::tr("No file has been specified."));
112 return; 113 return;
113 } 114 }
114 115
115 ok->setEnabled(false); 116 ok->setEnabled(false);
116 117
117 cleanup(); 118 cleanup();
118 m_autocleanup = 0; 119 m_autocleanup = 0;
119 120
120 if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); 121 if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending..."));
121 else statusbar->setText(QObject::tr("Receiving...")); 122 else statusbar->setText(QObject::tr("Receiving..."));
122 123
123 if(m_transfermode == id_send) 124 if(m_transfermode == id_send)
124 { 125 {
125 m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); 126 m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer());