summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp2
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp5
2 files changed, 7 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index 565d03f..a2373bf 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -287,38 +287,40 @@ void MyPty::send(const QByteArray& ar)
287} 287}
288 288
289/*! indicates that a block of data is received */ 289/*! indicates that a block of data is received */
290void MyPty::readPty() 290void MyPty::readPty()
291{ 291{
292 QByteArray buf(4096); 292 QByteArray buf(4096);
293 293
294 int len = ::read( m_fd, buf.data(), 4096 ); 294 int len = ::read( m_fd, buf.data(), 4096 );
295 295
296 if (len == -1 || len == 0) { 296 if (len == -1 || len == 0) {
297 donePty(); 297 donePty();
298 return; 298 return;
299 } 299 }
300 300
301 if (len < 0) 301 if (len < 0)
302 return; 302 return;
303 303
304 304
305 buf.resize(len); 305 buf.resize(len);
306 emit received(buf); 306 emit received(buf);
307 307
308#ifdef VERBOSE_DEBUG 308#ifdef VERBOSE_DEBUG
309 // verbose debug 309 // verbose debug
310 printf("read bytes:\n"); 310 printf("read bytes:\n");
311 for (uint i = 0; i < buf.count(); i++) 311 for (uint i = 0; i < buf.count(); i++)
312 printf("%c", buf[i]); 312 printf("%c", buf[i]);
313 printf("\n"); 313 printf("\n");
314#endif 314#endif
315 315
316} 316}
317QBitArray MyPty::supports()const { 317QBitArray MyPty::supports()const {
318 QBitArray ar(3); 318 QBitArray ar(3);
319 //autoconnect
319 ar[0] = 1; 320 ar[0] = 1;
321 //
320 ar[1] = 0; 322 ar[1] = 0;
321 ar[2] = 0; 323 ar[2] = 0;
322 324
323 return ar; 325 return ar;
324} 326}
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 3066b35..fdb0452 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -369,64 +369,69 @@ void MainWindow::slotClose() {
369 m_saveScript->setEnabled( false ); 369 m_saveScript->setEnabled( false );
370 m_runScript->setEnabled( false ); 370 m_runScript->setEnabled( false );
371 m_fullscreen->setEnabled( false ); 371 m_fullscreen->setEnabled( false );
372 m_closewindow->setEnabled( false ); 372 m_closewindow->setEnabled( false );
373 } 373 }
374} 374}
375 375
376/* 376/*
377 * We will get the name 377 * We will get the name
378 * Then the profile 378 * Then the profile
379 * and then we will make a profile 379 * and then we will make a profile
380 */ 380 */
381void MainWindow::slotProfile( int id) { 381void MainWindow::slotProfile( int id) {
382 Profile prof = manager()->profile( m_sessionsPop->text( id) ); 382 Profile prof = manager()->profile( m_sessionsPop->text( id) );
383 create( prof ); 383 create( prof );
384} 384}
385void MainWindow::create( const Profile& prof ) { 385void MainWindow::create( const Profile& prof ) {
386 Session *ses = manager()->fromProfile( prof, tabWidget() ); 386 Session *ses = manager()->fromProfile( prof, tabWidget() );
387 387
388 if((!ses) || (!ses->layer()) || (!ses->widgetStack())) 388 if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
389 { 389 {
390 QMessageBox::warning(this, 390 QMessageBox::warning(this,
391 QObject::tr("Session failed"), 391 QObject::tr("Session failed"),
392 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); 392 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
393 //if(ses) delete ses; 393 //if(ses) delete ses;
394 return; 394 return;
395 } 395 }
396 396
397 m_sessions.append( ses ); 397 m_sessions.append( ses );
398 tabWidget()->add( ses ); 398 tabWidget()->add( ses );
399 m_curSession = ses; 399 m_curSession = ses;
400 400
401 // is io_layer wants direct connection, then autoconnect
402 if ( ( m_curSession->layer() )->supports()[0] = 1 ) {
403 slotConnect();
404 }
405
401 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it 406 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
402 m_connect->setEnabled( true ); 407 m_connect->setEnabled( true );
403 m_disconnect->setEnabled( false ); 408 m_disconnect->setEnabled( false );
404 m_terminate->setEnabled( true ); 409 m_terminate->setEnabled( true );
405 m_transfer->setEnabled( true ); 410 m_transfer->setEnabled( true );
406 m_recordScript->setEnabled( true ); 411 m_recordScript->setEnabled( true );
407 m_saveScript->setEnabled( true ); 412 m_saveScript->setEnabled( true );
408 m_runScript->setEnabled( true ); 413 m_runScript->setEnabled( true );
409 m_fullscreen->setEnabled( true ); 414 m_fullscreen->setEnabled( true );
410 m_closewindow->setEnabled( true ); 415 m_closewindow->setEnabled( true );
411} 416}
412 417
413void MainWindow::slotTransfer() 418void MainWindow::slotTransfer()
414{ 419{
415 if ( currentSession() ) { 420 if ( currentSession() ) {
416 TransferDialog dlg(this); 421 TransferDialog dlg(this);
417 dlg.showMaximized(); 422 dlg.showMaximized();
418 dlg.exec(); 423 dlg.exec();
419 } 424 }
420} 425}
421 426
422 427
423void MainWindow::slotOpenKeb(bool state) { 428void MainWindow::slotOpenKeb(bool state) {
424 429
425 if (state) m_keyBar->show(); 430 if (state) m_keyBar->show();
426 else m_keyBar->hide(); 431 else m_keyBar->hide();
427 432
428} 433}
429void MainWindow::slotSessionChanged( Session* ses ) { 434void MainWindow::slotSessionChanged( Session* ses ) {
430 qWarning("changed!"); 435 qWarning("changed!");
431 if ( ses ) { 436 if ( ses ) {
432 m_curSession = ses; 437 m_curSession = ses;