-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.h | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 15 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.h | 2 |
5 files changed, 46 insertions, 10 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index c44b359..5f6dc12 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -535,4 +535,7 @@ void MainWindow::slotProfile( int id) { } void MainWindow::create( const Profile& prof ) { + if(m_curSession) + if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); + Session *ses = manager()->fromProfile( prof, tabWidget() ); @@ -579,8 +582,13 @@ void MainWindow::slotTransfer() { if ( currentSession() ) { - TransferDialog dlg(currentSession()->widgetStack(), this); - dlg.showMaximized(); + Session *mysession = currentSession(); + TransferDialog dlg(mysession->widgetStack(), this); + mysession->setTransferDialog(&dlg); + dlg.show(); + //dlg.showMaximized(); //currentSession()->widgetStack()->add(dlg); - dlg.exec(); + //dlg.exec(); + while(dlg.isRunning()) qApp->processEvents(); + mysession->setTransferDialog(0l); } } @@ -608,4 +616,10 @@ void MainWindow::slotOpenButtons( bool state ) { void MainWindow::slotSessionChanged( Session* ses ) { qWarning("changed!"); + + if(m_curSession) + if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); + if(ses) + if(ses->transferDialog()) ses->transferDialog()->show(); + if ( ses ) { m_curSession = ses; @@ -631,8 +645,4 @@ void MainWindow::slotSessionChanged( Session* ses ) { } - - - - QWidget *w = m_curSession->widget(); if(w) w->setFocus(); diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp index c166d95..4f52584 100644 --- a/noncore/apps/opie-console/session.cpp +++ b/noncore/apps/opie-console/session.cpp @@ -12,4 +12,5 @@ Session::Session() { m_layer = 0l; m_emu = 0l; + m_transfer = 0l; } Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay) @@ -105,3 +106,12 @@ void Session::setEmulationWidget( WidgetLayer* lay ) { } */ +void Session::setTransferDialog(QWidget *d) +{ + m_transfer = d; +} + +QWidget *Session::transferDialog() +{ + return m_transfer; +} diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h index f60a6c0..d69224a 100644 --- a/noncore/apps/opie-console/session.h +++ b/noncore/apps/opie-console/session.h @@ -65,4 +65,7 @@ public: void setProfile( const Profile& ); + void setTransferDialog(QWidget *d); + QWidget *transferDialog(); + private: QString m_name; @@ -72,5 +75,5 @@ private: bool m_connected : 1; Profile m_prof; - + QWidget *m_transfer; }; diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index 75c4c72..0af1911 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp @@ -19,5 +19,5 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) -: QDialog(parent, 0l, true), m_win(mainwindow) +: QDialog(parent, 0l, false), m_win(mainwindow) { m_lay = 0l; @@ -30,4 +30,5 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const ch m_autocleanup = 0; + m_running = true; group = new QButtonGroup(QObject::tr("Transfer mode"), this); @@ -168,5 +169,9 @@ void TransferDialog::slotCancel() { cleanup(); - if(m_autocleanup) close(); + if(m_autocleanup) + { + m_running = false; + close(); + } else { @@ -178,4 +183,5 @@ void TransferDialog::slotCancel() else { + m_running = false; close(); } @@ -265,2 +271,7 @@ void TransferDialog::slotMode(int id) } +bool TransferDialog::isRunning() +{ + return m_running; +} + diff --git a/noncore/apps/opie-console/transferdialog.h b/noncore/apps/opie-console/transferdialog.h index d87be6a..23691e0 100644 --- a/noncore/apps/opie-console/transferdialog.h +++ b/noncore/apps/opie-console/transferdialog.h @@ -19,4 +19,5 @@ class TransferDialog : public QDialog TransferDialog(QWidget *parent = 0l, MainWindow *mainwindow = 0l, const char *name = 0l); ~TransferDialog(); + bool isRunning(); public slots: @@ -49,4 +50,5 @@ class TransferDialog : public QDialog int m_transfermode; int m_autocleanup; + bool m_running; }; |