summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-13 16:26:06 (UTC)
committer harlekin <harlekin>2002-10-13 16:26:06 (UTC)
commit40e7d87b58e6146944da4613c04bfafc90dbb379 (patch) (side-by-side diff)
treeaafd035889122c111218fd510821d8dd47d5983c
parent93133ba6cc82398012c8f7206a7e9a270a04edc6 (diff)
downloadopie-40e7d87b58e6146944da4613c04bfafc90dbb379.zip
opie-40e7d87b58e6146944da4613c04bfafc90dbb379.tar.gz
opie-40e7d87b58e6146944da4613c04bfafc90dbb379.tar.bz2
fullscreen for new connection
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp1
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp0
2 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 46c5bed..0a58b6c 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -109,192 +109,193 @@ void MainWindow::initUI() {
/*
* script actions
*/
m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0);
m_recordScript->addTo(m_scripts);
connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript()));
m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
m_saveScript->addTo(m_scripts);
connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0);
m_runScript->addTo(m_scripts);
connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript()));
/*
* action that open/closes the keyboard
*/
m_openKeys = new QAction (tr("Open Keyboard..."),
Resource::loadPixmap( "down" ),
QString::null, 0, this, 0);
m_openKeys->setToggleAction(true);
connect (m_openKeys, SIGNAL(toggled(bool)),
this, SLOT(slotOpenKeb(bool)));
m_openKeys->addTo(m_icons);
/* insert the submenu */
m_console->insertItem(tr("New from Profile"), m_sessionsPop,
-1, 0);
/* 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");
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() {
return m_factory;
}
Session* MainWindow::currentSession() {
return m_curSession;
}
QList<Session> MainWindow::sessions() {
return m_sessions;
}
void MainWindow::slotNew() {
qWarning("New Connection");
ProfileEditorDialog dlg(factory() );
+ dlg.showMaximized();
int ret = dlg.exec();
if ( ret == QDialog::Accepted ) {
create( dlg.profile() );
}
}
void MainWindow::slotRecordScript() {
if (currentSession()) {
currentSession()->emulationLayer()->startRecording();
}
}
void MainWindow::slotSaveScript() {
if (currentSession() && currentSession()->emulationLayer()->isRecording()) {
MimeTypes types;
QStringList script;
script << "text/plain";
types.insert("Script", script);
QString filename = OFileDialog::getSaveFileName(2, "/", QString::null, types);
if (!filename.isEmpty()) {
currentSession()->emulationLayer()->script()->saveTo(filename);
currentSession()->emulationLayer()->clearScript();
}
}
}
void MainWindow::slotRunScript() {
if (currentSession()) {
MimeTypes types;
QStringList script;
script << "text/plain";
types.insert("Script", script);
QString filename = OFileDialog::getOpenFileName(2, "/", QString::null, types);
if (!filename.isEmpty()) {
Script script(DocLnk(filename).file());
currentSession()->emulationLayer()->runScript(&script);
}
}
}
void MainWindow::slotConnect() {
if ( currentSession() )
currentSession()->layer()->open();
}
void MainWindow::slotDisconnect() {
if ( currentSession() )
currentSession()->layer()->close();
}
void MainWindow::slotTerminate() {
if ( currentSession() )
currentSession()->layer()->close();
slotClose();
/* FIXME move to the next session */
}
void MainWindow::slotConfigure() {
qWarning("configure");
ConfigDialog conf( manager()->all(), factory() );
conf.showMaximized();
int ret = conf.exec();
if ( QDialog::Accepted == ret ) {
qWarning("conf %d", conf.list().count() );
manager()->setProfiles( conf.list() );
populateProfiles();
}
}
/*
* we will remove
* this window from the tabwidget
* remove it from the list
* delete it
* and set the currentSession()
*/
void MainWindow::slotClose() {
qWarning("close");
if (!currentSession() )
return;
tabWidget()->remove( currentSession() );
/*it's autodelete */
m_sessions.remove( m_curSession );
m_curSession = m_sessions.first();
tabWidget()->setCurrent( m_curSession );
}
/*
* We will get the name
* Then the profile
* and then we will make a profile
*/
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index 78751e7..c965700 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp