summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 0a58b6c..bfd1c2e 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -54,53 +54,53 @@ void MainWindow::initUI() {
QString::null, 0, this, 0);
a->addTo( m_console );
a->addTo( m_icons );
connect(a, SIGNAL(activated() ),
this, SLOT(slotNew() ) );
/*
* connect action
*/
m_connect = new QAction();
m_connect->setText( tr("Connect") );
m_connect->addTo( m_console );
connect(m_connect, SIGNAL(activated() ),
this, SLOT(slotConnect() ) );
/*
* disconnect action
*/
m_disconnect = new QAction();
m_disconnect->setText( tr("Disconnect") );
m_disconnect->addTo( m_console );
connect(m_disconnect, SIGNAL(activated() ),
this, SLOT(slotDisconnect() ) );
- m_transfer = new QAction();
- m_transfer->setText( tr("Transfer file...") );
- m_transfer->addTo( m_console );
- connect(m_transfer, SIGNAL(activated() ),
- this, SLOT(slotTransfer() ) );
+ m_transfer = new QAction();
+ m_transfer->setText( tr("Transfer file...") );
+ m_transfer->addTo( m_console );
+ connect(m_transfer, SIGNAL(activated() ),
+ this, SLOT(slotTransfer() ) );
/*
* terminate action
*/
m_terminate = new QAction();
m_terminate->setText( tr("Terminate") );
m_terminate->addTo( m_console );
connect(m_terminate, SIGNAL(activated() ),
this, SLOT(slotTerminate() ) );
a = new QAction();
a->setText( tr("Close Window") );
a->addTo( m_console );
connect(a, SIGNAL(activated() ),
this, SLOT(slotClose() ) );
/*
* the settings action
*/
m_setProfiles = new QAction(tr("Configure Profiles"),
Resource::loadPixmap( "SettingsIcon" ),
QString::null, 0, this, 0);
m_setProfiles->addTo( m_settings );
m_setProfiles->addTo( m_icons );
@@ -143,48 +143,50 @@ void MainWindow::initUI() {
/* insert the connection menu */
m_bar->insertItem( tr("Connection"), m_console );
/* the scripts menu */
m_bar->insertItem( tr("Scripts"), m_scripts );
/* the settings menu */
m_bar->insertItem( tr("Settings"), m_settings );
/* and the keyboard */
m_keyBar = new QToolBar(this);
addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
m_keyBar->setHorizontalStretchable( TRUE );
m_keyBar->hide();
m_kb = new FunctionKeyboard(m_keyBar);
/*
* connect to the menu activation
*/
connect( m_sessionsPop, SIGNAL(activated( int ) ),
this, SLOT(slotProfile( int ) ) );
m_consoleWindow = new TabWidget( this, "blah");
+ connect(m_consoleWindow, SIGNAL(activated(Session*) ),
+ this, SLOT(slotSessionChanged(Session*) ) );
setCentralWidget( m_consoleWindow );
}
ProfileManager* MainWindow::manager() {
return m_manager;
}
TabWidget* MainWindow::tabWidget() {
return m_consoleWindow;
}
void MainWindow::populateProfiles() {
m_sessionsPop->clear();
Profile::ValueList list = manager()->all();
for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) {
m_sessionsPop->insertItem( (*it).name() );
}
}
MainWindow::~MainWindow() {
delete m_factory;
manager()->save();
}
MetaFactory* MainWindow::factory() {
@@ -307,24 +309,30 @@ void MainWindow::create( const Profile& prof ) {
Session *ses = manager()->fromProfile( prof, tabWidget() );
m_sessions.append( ses );
tabWidget()->add( ses );
m_curSession = ses;
}
void MainWindow::slotTransfer()
{
if ( currentSession() ) {
TransferDialog dlg(this);
//dlg.showMaximized();
dlg.exec();
}
}
void MainWindow::slotOpenKeb(bool state) {
if (state) m_keyBar->show();
else m_keyBar->hide();
}
+void MainWindow::slotSessionChanged( Session* ses ) {
+ if ( ses ) {
+ qWarning("changing %s", ses->name().latin1() );
+ m_curSession = ses;
+ }
+}