-rw-r--r-- | noncore/apps/opie-console/btconfigwidget.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/default.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialer.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 64 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/iolayerbase.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/irdaconfigwidget.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/main.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/procctl.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/serialconfigwidget.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 8 |
14 files changed, 57 insertions, 47 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp index 6246f92..64046d8 100644 --- a/noncore/apps/opie-console/btconfigwidget.cpp +++ b/noncore/apps/opie-console/btconfigwidget.cpp @@ -1,30 +1,30 @@ #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qcombobox.h> #include <qhbox.h> #include <qradiobutton.h> #include "iolayerbase.h" #include "btconfigwidget.h" namespace { void setCurrent( const QString& str, QComboBox* bo ) { uint b = bo->count(); - for (uint i = 0; i < bo->count(); i++ ) { + for (int i = 0; i < bo->count(); i++ ) { if ( bo->text(i) == str ) { bo->setCurrentItem( i ); return; } } bo->insertItem( str ); bo->setCurrentItem( b ); } } BTConfigWidget::BTConfigWidget( const QString& name, QWidget* parent, const char* na ) : ProfileDialogConnectionWidget( name, parent, na ) { m_lay = new QVBoxLayout( this ); @@ -103,32 +103,33 @@ void BTConfigWidget::load( const Profile& prof ) { default: m_base->setSpeed(IOLayerBase::Baud_9600 ); break; } if ( prof.readEntry("Device").isEmpty() ) return; setCurrent( prof.readEntry("Device"), m_deviceCmb ); } /* * save speed, * flow, * parity */ void BTConfigWidget::save( Profile& prof ) { int flow, parity, speed; + flow = parity = speed = 0; prof.writeEntry("Device", m_deviceCmb->currentText() ); switch( m_base->flow() ) { case IOLayerBase::None: flow = 0; break; case IOLayerBase::Software: flow = 2; break; case IOLayerBase::Hardware: flow = 1; break; } switch( m_base->parity() ) { @@ -143,32 +144,33 @@ void BTConfigWidget::save( Profile& prof ) { break; } switch( m_base->speed() ) { case IOLayerBase::Baud_115200: speed = 115200; break; case IOLayerBase::Baud_57600: speed = 57600; break; case IOLayerBase::Baud_38400: speed = 38400; break; case IOLayerBase::Baud_19200: speed = 19200; break; + default: case IOLayerBase::Baud_9600: speed = 9600; break; } prof.writeEntry("Flow", flow); prof.writeEntry("Parity", parity); prof.writeEntry("Speed", speed); prof.writeEntry("Mac", m_mac->text() ); } void BTConfigWidget::slotMacRadio( bool on ) { if ( on ) { m_devRadio->setChecked( false ); m_deviceCmb->setEnabled( false ); m_mac->setEnabled( true ); diff --git a/noncore/apps/opie-console/default.cpp b/noncore/apps/opie-console/default.cpp index 0160b56..19640d8 100644 --- a/noncore/apps/opie-console/default.cpp +++ b/noncore/apps/opie-console/default.cpp @@ -54,33 +54,33 @@ extern "C" { return new MyPty( prof ); } // Connection Widgets ProfileDialogWidget* newSerialWidget( const QString& str, QWidget* wid ) { return new SerialConfigWidget( str, wid ); } ProfileDialogWidget* newIrDaWidget( const QString& str, QWidget* wid ) { return new IrdaConfigWidget( str, wid ); } ProfileDialogWidget* newModemWidget( const QString& str, QWidget* wid ) { return new ModemConfigWidget(str, wid ); } ProfileDialogWidget* newBTWidget( const QString& str, QWidget* wid ) { return new BTConfigWidget(str, wid ); } - ProfileDialogWidget* newConsoleWid( const QString& str, QWidget* wid ) { + ProfileDialogWidget* newConsoleWid( const QString& , QWidget* ) { return 0l; } // Terminal Widget(s) ProfileDialogWidget* newTerminalWidget(const QString& na, QWidget* wid) { return new TerminalWidget(na, wid,0 ); } // Function Keyboard Widget ProfileDialogWidget* newKeyboardWidget(const QString& na, QWidget *wid) { return new FunctionKeyboardConfig(na, wid); } /* // VT Emulations EmulationLayer* newVT102( WidgetLayer* wid ) { diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index d37e406..5056040 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp @@ -179,66 +179,66 @@ void Dialer::trydial(const QString& number) //send(QString("ATDT %1").arg(number)); send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); QString response5 = receive(); if(!response5.contains("\n" + m_profile.readEntry("DefaultConnect"))) { if(response5.contains("BUSY")) switchState(state_dialing); else { QMessageBox::warning(this, QObject::tr("Failure"), QObject::tr("Dialing the number failed.")); slotCancel(); } } } - + if(state != state_cancel) { switchState(state_online); } } void Dialer::send(const QString& msg) { QString m = msg; int bytes; QString termination; //qWarning("Sending: '%s'", m.latin1()); termination = "\r"; //termination = m_profile.readEntry("Termination"); if(termination == "\n") m = m + "\n"; else if(termination == "\r") m = m + "\r"; else m = m + "\r\n"; bytes = ::write(m_fd, m.local8Bit(), strlen(m.local8Bit())); if(bytes < 0) { reset(); } } QString Dialer::receive() { QString buf; char buffer[1024]; int ret; - int counter; + int counter = 0; while(1) { ret = ::read(m_fd, buffer, sizeof(buffer)); if(ret > 0) { for(int i = 0; i < ret; i++) buffer[i] = buffer[i] & 0x7F; buffer[ret] = 0; //qWarning("Got: '%s'", buffer); buf.append(QString(buffer)); if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) { //qWarning("Receiving: '%s'", buf.latin1()); cleanshutdown = 1; diff --git a/noncore/apps/opie-console/dialer.h b/noncore/apps/opie-console/dialer.h index 28303f3..88681a3 100644 --- a/noncore/apps/opie-console/dialer.h +++ b/noncore/apps/opie-console/dialer.h @@ -32,23 +32,23 @@ class Dialer : public QDialog enum States { state_cancel, state_preinit, state_init, state_options, state_dialtone, state_dialing, state_online }; QLabel *status; QProgressBar *progress; QPushButton *cancel; int state; int usercancel; + int m_fd; const Profile& m_profile; - int m_fd; int cleanshutdown; }; #endif diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index fd20e99..100fdfc 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp @@ -1,42 +1,42 @@ #include "function_keyboard.h" -#include <qsizepolicy.h> +#include <qsizepolicy.h> #include <qevent.h> #include <qwindowsystem_qws.h> #include <qapplication.h> #include <qlayout.h> -FunctionKeyboard::FunctionKeyboard(QWidget *parent) : - QFrame(parent), numRows(2), numCols(11), +FunctionKeyboard::FunctionKeyboard(QWidget *parent) : + QFrame(parent), numRows(2), numCols(11), pressedRow(0), pressedCol(0) { setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); Config conf("opie-console-keys"); conf.setGroup("keys"); for (uint r = 0; r < numRows; r++) for (uint c = 0; c < numCols; c++) { QString handle = "r" + QString::number(r) + "c" + QString::number(c); QStringList value_list = conf.readListEntry( handle, '|'); if (value_list.isEmpty()) continue; keys.insert( - handle, + handle, FKey (value_list[0], value_list[1].toUShort(), value_list[2].toUShort()) ); } //qWarning("loaded %d keys", keys.count()); if (keys.isEmpty()) loadDefaults(); } FunctionKeyboard::~FunctionKeyboard() { } void FunctionKeyboard::paintEvent(QPaintEvent *e) { @@ -54,53 +54,53 @@ void FunctionKeyboard::paintEvent(QPaintEvent *e) { // sometimes the last line doesnt get drawn p.drawLine(width() -1, 0, width() -1, height()); for (int i = 0; i <= height(); i += keyHeight) { p.drawLine(0, i, width(), i); } for (uint r = 0; r < numRows; r++) { for (uint c = 0; c < numCols; c++) { QString handle = "r" + QString::number(r) + "c" + QString::number(c); if (keys.contains(handle)) { p.drawText( - c * keyWidth + 1, r * keyHeight + 1, - keyWidth, keyHeight, - Qt::AlignHCenter | Qt::AlignVCenter, + c * keyWidth + 1, r * keyHeight + 1, + keyWidth, keyHeight, + Qt::AlignHCenter | Qt::AlignVCenter, keys[handle].getL() ); } } } } void FunctionKeyboard::paintKey(int row, int col) { QPainter p(this); - - p.fillRect(QRect(QPoint(col * keyWidth + 1, row * keyHeight + 1), - QPoint((col + 1) * keyWidth - 1, row * keyHeight + keyHeight- 1)), + + p.fillRect(QRect(QPoint(col * keyWidth + 1, row * keyHeight + 1), + QPoint((col + 1) * keyWidth - 1, row * keyHeight + keyHeight- 1)), (pressedRow != -1 && pressedCol != -1 ) ? QColor(97,119,155) : QColor(255,255,255)); p.drawText( - col * keyWidth + 1, row * keyHeight + 1, - keyWidth, keyHeight, - Qt::AlignHCenter | Qt::AlignVCenter, + col * keyWidth + 1, row * keyHeight + 1, + keyWidth, keyHeight, + Qt::AlignHCenter | Qt::AlignVCenter, keys["r" + QString::number(row) + "c" + QString::number(col)].getL() ); } void FunctionKeyboard::mousePressEvent(QMouseEvent *e) { pressedRow = e->y() / keyHeight; pressedCol = (int) (e->x() / keyWidth); paintKey(pressedRow, pressedCol); // emit that sucker! FKey k = keys["r" + QString::number(pressedRow) + "c" + QString::number(pressedCol)]; emit keyPressed(k.getU(), k.getQ(), 0, 1, 0); @@ -125,58 +125,58 @@ void FunctionKeyboard::resizeEvent(QResizeEvent*) { /* set he default font height/width */ QFontMetrics fm=fontMetrics(); keyHeight = fm.lineSpacing() + 2; keyWidth = (double)width()/numCols; } QSize FunctionKeyboard::sizeHint() const { return QSize(width(), keyHeight * numRows + 1); } void FunctionKeyboard::loadDefaults() { /* what keys should be default? */ - keys.insert( "r0c0", FKey ("F1", 4144, 0)); - keys.insert( "r0c1", FKey ("F2", 4145, 0)); - keys.insert( "r0c2", FKey ("F3", 4145, 0)); - keys.insert( "r0c3", FKey ("F4", 4146, 0)); - keys.insert( "r0c4", FKey ("F5", 4147, 0)); - keys.insert( "r0c5", FKey ("F6", 4148, 0)); - keys.insert( "r0c6", FKey ("F7", 4149, 0)); - keys.insert( "r0c7", FKey ("F8", 4150, 0)); - keys.insert( "r0c8", FKey ("F9", 4151, 0)); - keys.insert( "r0c9", FKey ("F10", 4152, 0)); - keys.insert( "r0c10", FKey ("F11", 4153, 0)); - - keys.insert( "r1c7", FKey ("Ho", 4112, 0)); - keys.insert( "r1c8", FKey ("End", 4113, 0)); - keys.insert( "r1c9", FKey ("PU", 4118, 0)); - keys.insert( "r1c10", FKey ("PD", 4119, 0)); + keys.insert( "r0c0", FKey ("F1", 4144, 0)); + keys.insert( "r0c1", FKey ("F2", 4145, 0)); + keys.insert( "r0c2", FKey ("F3", 4145, 0)); + keys.insert( "r0c3", FKey ("F4", 4146, 0)); + keys.insert( "r0c4", FKey ("F5", 4147, 0)); + keys.insert( "r0c5", FKey ("F6", 4148, 0)); + keys.insert( "r0c6", FKey ("F7", 4149, 0)); + keys.insert( "r0c7", FKey ("F8", 4150, 0)); + keys.insert( "r0c8", FKey ("F9", 4151, 0)); + keys.insert( "r0c9", FKey ("F10", 4152, 0)); + keys.insert( "r0c10", FKey ("F11", 4153, 0)); + + keys.insert( "r1c7", FKey ("Ho", 4112, 0)); + keys.insert( "r1c8", FKey ("End", 4113, 0)); + keys.insert( "r1c9", FKey ("PU", 4118, 0)); + keys.insert( "r1c10", FKey ("PD", 4119, 0)); } -FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent) : +FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent) : ProfileDialogKeyWidget(name, parent) { FunctionKeyboard *kb = new FunctionKeyboard(this); QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimentions"), this); QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit"), this); QVBoxLayout *root = new QVBoxLayout(this, 2); root->addWidget(kb); root->addWidget(dimentions); root->addWidget(editKey); } FunctionKeyboardConfig::~FunctionKeyboardConfig() { } -void FunctionKeyboardConfig::load (const Profile& prof) { +void FunctionKeyboardConfig::load (const Profile& ) { } -void FunctionKeyboardConfig::save (Profile& prof) { +void FunctionKeyboardConfig::save (Profile& ) { } diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index f246d81..d4ea0b2 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -72,18 +72,20 @@ void IOModem::reload( const Profile &config ) { m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); } QString IOModem::identifier() const { return "modem"; } QString IOModem::name() const { return "Modem IO Layer"; } void IOModem::slotExited(OProcess* proc ){ close(); + /* delete it afterwards */ + delete proc; } diff --git a/noncore/apps/opie-console/iolayerbase.cpp b/noncore/apps/opie-console/iolayerbase.cpp index b0df02d..47f9e76 100644 --- a/noncore/apps/opie-console/iolayerbase.cpp +++ b/noncore/apps/opie-console/iolayerbase.cpp @@ -94,46 +94,47 @@ void IOLayerBase::setFlow( Flow flo ) { } void IOLayerBase::setParity( Parity par ) { switch( par ) { case NonePar: m_parityNone->setChecked( true ); break; case Odd: m_parityOdd->setChecked( true ); break; case Even: m_parityEven->setChecked( true ); break; } } void IOLayerBase::setSpeed( Speed sp ) { - int index; + int index = -1; switch( sp ) { case Baud_115200: index = id_baud_115200; break; case Baud_57600: index = id_baud_57600; break; case Baud_38400: index = id_baud_38400; break; case Baud_19200: index = id_baud_19200; break; + default: case Baud_9600: index = id_baud_9600; break; } m_speedBox->setCurrentItem(index ); } IOLayerBase::Flow IOLayerBase::flow()const { if (m_flowHw->isChecked() ) { return Hardware; }else if( m_flowSw->isChecked() ) { return Software; } else { return None; } } IOLayerBase::Parity IOLayerBase::parity()const { @@ -147,21 +148,22 @@ IOLayerBase::Parity IOLayerBase::parity()const { } IOLayerBase::Speed IOLayerBase::speed()const{ switch( m_speedBox->currentItem() ) { case id_baud_115200: return Baud_115200; break; case id_baud_57600: return Baud_57600; break; case id_baud_38400: return Baud_38400; break; case id_baud_19200: return Baud_19200; break; + default: case id_baud_9600: return Baud_9600; break; } } diff --git a/noncore/apps/opie-console/irdaconfigwidget.cpp b/noncore/apps/opie-console/irdaconfigwidget.cpp index 72e99a1..059530d 100644 --- a/noncore/apps/opie-console/irdaconfigwidget.cpp +++ b/noncore/apps/opie-console/irdaconfigwidget.cpp @@ -1,27 +1,27 @@ #include <qlabel.h> #include <qlayout.h> #include <qcombobox.h> #include "iolayerbase.h" #include "irdaconfigwidget.h" namespace { void setCurrent( const QString& str, QComboBox* bo ) { uint b = bo->count(); - for (uint i = 0; i < bo->count(); i++ ) { + for (int i = 0; i < bo->count(); i++ ) { if ( bo->text(i) == str ) { bo->setCurrentItem( i ); return; } } bo->insertItem( str ); bo->setCurrentItem( b ); } } IrdaConfigWidget::IrdaConfigWidget( const QString& name, QWidget* parent, const char* na ) : ProfileDialogConnectionWidget( name, parent, na ) { @@ -82,32 +82,33 @@ void IrdaConfigWidget::load( const Profile& prof ) { default: m_base->setSpeed(IOLayerBase::Baud_9600 ); break; } if ( prof.readEntry("Device").isEmpty() ) return; setCurrent( prof.readEntry("Device"), m_deviceCmb ); } /* * save speed, * flow, * parity */ void IrdaConfigWidget::save( Profile& prof ) { int flow, parity, speed; + flow = parity = speed = 0; prof.writeEntry("Device", m_deviceCmb->currentText() ); switch( m_base->flow() ) { case IOLayerBase::None: flow = 0; break; case IOLayerBase::Software: flow = 2; break; case IOLayerBase::Hardware: flow = 1; break; } switch( m_base->parity() ) { @@ -122,25 +123,26 @@ void IrdaConfigWidget::save( Profile& prof ) { break; } switch( m_base->speed() ) { case IOLayerBase::Baud_115200: speed = 115200; break; case IOLayerBase::Baud_57600: speed = 57600; break; case IOLayerBase::Baud_38400: speed = 38400; break; case IOLayerBase::Baud_19200: speed = 19200; break; + default: case IOLayerBase::Baud_9600: speed = 9600; break; } prof.writeEntry("Flow", flow); prof.writeEntry("Parity", parity); prof.writeEntry("Speed", speed); } diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp index 78a91a2..7f9f038 100644 --- a/noncore/apps/opie-console/main.cpp +++ b/noncore/apps/opie-console/main.cpp @@ -78,32 +78,33 @@ FixIt::~FixIt() { * one is that pppd is listening on our port... * we've to stop it from that and then do kill(SIGHUP,1); */ void FixIt::fixIt() { ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); QFile file( "/etc/inittab" ); if ( file.open(IO_WriteOnly | IO_Raw ) ) { file.writeBlock(m_file,strlen(m_file) ); } file.close(); ::kill( SIGHUP, 1 ); } #endif int main(int argc, char **argv) { + argv[0]="embeddedkonsole"; QPEApplication app( argc, argv ); #ifdef FSCKED_DISTRIBUTION qWarning("fscked"); FixIt it; it.fixIt(); #endif MainWindow mw; mw.setCaption(QObject::tr("Opie console") ); app.showMainWidget( &mw ); int ap = app.exec(); #ifdef FSCKED_DISTRIBUTION /* should add a signal handler too */ diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index d3a23fa..c37fafd 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp @@ -1,31 +1,31 @@ #include <qlabel.h> #include <qlayout.h> #include <qcombobox.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qhbox.h> #include <qregexp.h> #include "modemconfigwidget.h" #include "dialdialog.h" namespace { void setCurrent( const QString& str, QComboBox* bo ) { uint b = bo->count(); - for (uint i = 0; i < bo->count(); i++ ) { + for (int i = 0; i < bo->count(); i++ ) { if ( bo->text(i) == str ) { bo->setCurrentItem( i ); return; } } bo->insertItem( str ); bo->setCurrentItem( b ); } } ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, const char* na ) : ProfileDialogConnectionWidget( name, parent, na ) { m_lay = new QVBoxLayout( this ); m_device = new QLabel(tr( "Modem is attached to:" ), this ); @@ -113,32 +113,33 @@ void ModemConfigWidget::load( const Profile& prof ) { if ( prof.readEntry( "Device" ).isEmpty() ) { return; } setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); atConf->readConfig( prof ); } /* * save speed, * flow, * parity */ void ModemConfigWidget::save( Profile& prof ) { int flow, parity, speed; + flow = parity = speed = 0; prof.writeEntry( "Device", m_deviceCmb->currentText() ); switch( m_base->flow() ) { case IOLayerBase::None: flow = 0; break; case IOLayerBase::Software: flow = 2; break; case IOLayerBase::Hardware: flow = 1; break; } switch( m_base->parity() ) { diff --git a/noncore/apps/opie-console/procctl.cpp b/noncore/apps/opie-console/procctl.cpp index ff6bea8..a44529b 100644 --- a/noncore/apps/opie-console/procctl.cpp +++ b/noncore/apps/opie-console/procctl.cpp @@ -4,32 +4,33 @@ #include <unistd.h> #include "procctl.h" ProcContainer *ProcCtl::m_last = 0; ProcCtl* ProcCtl::m_self = 0; ProcCtl::ProcCtl() { signal( SIGCHLD, signal_handler ); } ProcCtl::~ProcCtl() { } ProcCtl* ProcCtl::self() { if (!m_self ) { m_self = new ProcCtl; } + return m_self; } void ProcCtl::add(pid_t pi, int fd ) { ProcContainer * con = new ProcContainer; //memset(con, 0, sizeof(con) ); con->pid = pi; con->fd = fd; con->status = 0; con->prev = m_last; m_last = con; } void ProcCtl::remove( pid_t pi ) { /* * We first check if the last item * is equal to pi the we diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 413e80b..1765d42 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp @@ -79,33 +79,33 @@ void ProfileEditorDialog::initUI() m_termCmb = new QComboBox( tabprof ); m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); // layouting QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); vbox3->add(name); vbox3->add(m_name); vbox3->add(con ); vbox3->add(m_conCmb ); vbox3->add(term ); vbox3->add(m_termCmb ); vbox3->add(m_autoConnect); vbox3->addStretch(1); m_showconntab = 0; tabWidget->addTab(tabprof, "", QObject::tr("Profile")); - //tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); + tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); tabWidget->setCurrentTab( tabprof ); // fill the comboboxes QStringList list = m_fact->connectionWidgets(); QStringList::Iterator it; for (it =list.begin(); it != list.end(); ++it ) { m_conCmb->insertItem( (*it) ); } list = m_fact->terminalWidgets(); for (it =list.begin(); it != list.end(); ++it ) { m_termCmb->insertItem( (*it) ); } @@ -172,33 +172,32 @@ QCString ProfileEditorDialog::profType()const */ return QCString(); } /* * we need to switch the widget */ void ProfileEditorDialog::slotConActivated( const QString& str ) { delete m_con; m_con = m_fact->newConnectionPlugin( str, m_tabCon ); if ( !m_con ) { m_con = new NoOptions( str, m_tabCon, "name"); } m_con->load( m_prof ); m_layCon->addWidget( m_con ); - tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") ); tabWidget->setCurrentTab( tabprof ); } /* * we need to switch the widget */ void ProfileEditorDialog::slotTermActivated( const QString& str ) { delete m_term; m_term = m_fact->newTerminalPlugin( str, m_tabTerm ); if (m_term) { m_term->load(m_prof ); m_layTerm->addWidget( m_term ); } } diff --git a/noncore/apps/opie-console/serialconfigwidget.cpp b/noncore/apps/opie-console/serialconfigwidget.cpp index bd0312a..5c6d975 100644 --- a/noncore/apps/opie-console/serialconfigwidget.cpp +++ b/noncore/apps/opie-console/serialconfigwidget.cpp @@ -1,27 +1,27 @@ #include <qlabel.h> #include <qlayout.h> #include <qcombobox.h> #include "iolayerbase.h" #include "serialconfigwidget.h" namespace { void setCurrent( const QString& str, QComboBox* bo ) { uint b = bo->count(); - for (uint i = 0; i < bo->count(); i++ ) { + for (int i = 0; i < bo->count(); i++ ) { if ( bo->text(i) == str ) { bo->setCurrentItem( i ); return; } } bo->insertItem( str ); bo->setCurrentItem( b ); } } SerialConfigWidget::SerialConfigWidget( const QString& name, QWidget* parent, const char* na ) : ProfileDialogConnectionWidget( name, parent, na ) { diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index f89723c..75c4c72 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp @@ -4,33 +4,33 @@ #include <qlineedit.h> #include <qpushbutton.h> #include <qmessagebox.h> #include <qprogressbar.h> #include <qradiobutton.h> #include <qbuttongroup.h> #include <opie/ofiledialog.h> #include "file_layer.h" #include "receive_layer.h" #include "metafactory.h" #include "mainwindow.h" #include "transferdialog.h" -TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *name) +TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) : QDialog(parent, 0l, true), m_win(mainwindow) { m_lay = 0l; m_recvlay = 0l; QVBoxLayout *vbox, *vbox2; QHBoxLayout *hbox, *hbox2, *hbox3; QLabel *file, *mode, *progress, *status; QButtonGroup *group; QRadioButton *mode_send, *mode_receive; m_autocleanup = 0; group = new QButtonGroup(QObject::tr("Transfer mode"), this); mode_send = new QRadioButton(QObject::tr("Send"), group); mode_receive = new QRadioButton(QObject::tr("Receive"), group); group->insert(mode_send, id_send); @@ -168,38 +168,38 @@ void TransferDialog::slotCancel() { cleanup(); if(m_autocleanup) close(); else { QMessageBox::information(this, QObject::tr("Cancelled"), QObject::tr("The file transfer has been cancelled.")); } } else { close(); } } -void TransferDialog::slotProgress(const QString& file, int progress, int speed, int hours, int minutes, int seconds) +void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) { progressbar->setProgress(progress); } -void TransferDialog::slotError(int error, const QString& message) +void TransferDialog::slotError(int error, const QString& ) { statusbar->setText(QObject::tr("Ready")); switch(error) { case FileTransferLayer::NotSupported: QMessageBox::critical(this, QObject::tr("Error"), QObject::tr("Operation not supported.")); break; case FileTransferLayer::StartError: QMessageBox::critical(this, QObject::tr("Error"), QObject::tr("Transfer could not be started.")); break; case FileTransferLayer::NoError: @@ -225,33 +225,33 @@ void TransferDialog::slotError(int error, const QString& message) break; } m_autocleanup = 1; } void TransferDialog::slotSent() { progressbar->setProgress(100); QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent.")); ok->setEnabled(true); progressbar->setProgress(0); statusbar->setText(QObject::tr("Ready")); m_autocleanup = 1; } -void TransferDialog::slotReceived(const QString& file) +void TransferDialog::slotReceived(const QString& ) { progressbar->setProgress(100); QMessageBox::information(this, QObject::tr("Received"), QObject::tr("File has been received.")); //QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file)); ok->setEnabled(true); progressbar->setProgress(0); statusbar->setText(QObject::tr("Ready")); m_autocleanup = 1; } void TransferDialog::slotMode(int id) { if(id == id_send) { selector->setEnabled(true); filename->setEnabled(true); |