-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 18 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.control | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 9ccefa0..5295600 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -1,101 +1,102 @@ #include <assert.h> #include <qaction.h> #include <qmenubar.h> #include <qlabel.h> #include <qpopupmenu.h> #include <qtoolbar.h> #include <qmessagebox.h> #include <qpushbutton.h> +#include <qwhatsthis.h> #include <qpe/resource.h> #include <opie/ofiledialog.h> #include "keytrans.h" #include "profileeditordialog.h" #include "configdialog.h" #include "default.h" #include "metafactory.h" #include "profile.h" #include "profilemanager.h" #include "mainwindow.h" #include "tabwidget.h" #include "transferdialog.h" #include "function_keyboard.h" #include "script.h" static char * menu_xpm[] = { "12 12 5 1", " c None", ". c #000000", "+ c #FFFDAD", "@ c #FFFF00", "# c #E5E100", " ", " ", " ......... ", " .+++++++. ", " .+@@@@#. ", " .+@@@#. ", " .+@@#. ", " .+@#. ", " .+#. ", " .+. ", " .. ", " "}; -MainWindow::MainWindow() { +MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { KeyTrans::loadAll(); for (int i = 0; i < KeyTrans::count(); i++ ) { KeyTrans* s = KeyTrans::find(i ); assert( s ); } m_factory = new MetaFactory(); Default def(m_factory); m_sessions.setAutoDelete( TRUE ); m_curSession = 0; m_manager = new ProfileManager( m_factory ); m_manager->load(); initUI(); populateProfiles(); } void MainWindow::initUI() { setToolBarsMovable( FALSE ); /* tool bar for the menu */ m_tool = new QToolBar( this ); m_tool->setHorizontalStretchable( TRUE ); m_bar = new QMenuBar( m_tool ); m_console = new QPopupMenu( this ); m_scripts = new QPopupMenu( this ); m_sessionsPop= new QPopupMenu( this ); m_settings = new QPopupMenu( this ); /* add a toolbar for icons */ m_icons = new QToolBar(this); /* * new Action for new sessions */ QAction* a = new QAction(tr("New Connection"), Resource::loadPixmap( "new" ), 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 ); @@ -420,79 +421,78 @@ void MainWindow::create( const Profile& prof ) { m_saveScript->setEnabled( true ); m_runScript->setEnabled( true ); m_fullscreen->setEnabled( true ); m_closewindow->setEnabled( true ); } 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 ) { qWarning("changed!"); if ( ses ) { m_curSession = ses; qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); if ( m_curSession->layer()->isConnected() ) { m_connect->setEnabled( false ); m_disconnect->setEnabled( true ); } else { m_connect->setEnabled( true ); m_disconnect->setEnabled( false ); } } } void MainWindow::slotFullscreen() { if ( m_isFullscreen ) { ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false ); ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); setCentralWidget( m_consoleWindow ); ( m_curSession->widgetStack() )->show(); m_fullscreen->setText( tr("Full screen") ); } else { ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); - ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop, - QPoint(0,0), false); + ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop + , QPoint(0,0), false); ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); ( m_curSession->widgetStack() )->setFocus(); ( m_curSession->widgetStack() )->show(); - //QPushButton *cornerButton = new QPushButton( ); - //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); - //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); - // need teh scrollbar - // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); + QPushButton *cornerButton = new QPushButton( m_curSession->widgetStack() ); + cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); + connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); + // would need a scrollview + // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); m_fullscreen->setText( tr("Stop full screen") ); } - m_isFullscreen = !m_isFullscreen; } void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { qWarning("received key event! relay to TE widget"); if ( m_curSession ) { QKeyEvent ke(QEvent::KeyPress, q, u, 0); ke.ignore(); // where should i send this event? doesnt work sending it here QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke); } } diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h index 91ca147..35338b7 100644 --- a/noncore/apps/opie-console/mainwindow.h +++ b/noncore/apps/opie-console/mainwindow.h @@ -1,74 +1,74 @@ #ifndef OPIE_MAIN_WINDOW_H #define OPIE_MAIN_WINDOW_H #include <qmainwindow.h> #include <qlist.h> #include "session.h" /** * this is the MainWindow of the new opie console * it's also the dispatcher between the different * actions supported by the gui */ class QToolBar; class QToolButton; class QMenuBar; class QAction; class MetaFactory; class TabWidget; class ProfileManager; class Profile; class FunctionKeyboard; class MainWindow : public QMainWindow { Q_OBJECT public: - MainWindow(); + MainWindow( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); ~MainWindow(); /** * our factory to generate IOLayer and so on * */ MetaFactory* factory(); /** * A session contains a QWidget*, * an IOLayer* and some infos for us */ Session* currentSession(); /** * the session list */ QList<Session> sessions(); /** * */ ProfileManager* manager(); TabWidget* tabWidget(); private slots: void slotNew(); void slotConnect(); void slotDisconnect(); void slotTerminate(); void slotConfigure(); void slotClose(); void slotProfile(int); void slotTransfer(); void slotOpenKeb(bool); void slotRecordScript(); void slotSaveScript(); void slotRunScript(); void slotFullscreen(); void slotSessionChanged( Session* ); void slotKeyReceived(ushort, ushort, bool, bool, bool); private: void initUI(); void populateProfiles(); void create( const Profile& ); /** * the current session diff --git a/noncore/apps/opie-console/opie-console.control b/noncore/apps/opie-console/opie-console.control index aba2192..e307fef 100644 --- a/noncore/apps/opie-console/opie-console.control +++ b/noncore/apps/opie-console/opie-console.control @@ -1,10 +1,10 @@ Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* Priority: optional Section: opie/applications Maintainer: Opie team <opie@handhelds.org> Architecture: arm Version: 0.6-$SUB_VERSION -Depends: qpe-base ($QPE_VERSION), libopie ($QPE_VERSION) +Depends: qpe-base ($QPE_VERSION), libopie ($QPE_VERSION), opie-console-help-en License: GPL Description: Opie terminal app |