-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index a0622d4..291912c 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -8,48 +8,52 @@ | |||
8 | #include "transferdialog.h" | 8 | #include "transferdialog.h" |
9 | #include "function_keyboard.h" | 9 | #include "function_keyboard.h" |
10 | #include "emulation_handler.h" | 10 | #include "emulation_handler.h" |
11 | #include "script.h" | 11 | #include "script.h" |
12 | #include "fixit.h" | 12 | #include "fixit.h" |
13 | 13 | ||
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/ofiledialog.h> | 16 | #include <opie2/ofiledialog.h> |
17 | #include <qpe/filemanager.h> | 17 | #include <qpe/filemanager.h> |
18 | using namespace Opie::Core; | 18 | using namespace Opie::Core; |
19 | using namespace Opie::Ui; | 19 | using namespace Opie::Ui; |
20 | 20 | ||
21 | /* QT */ | 21 | /* QT */ |
22 | #include <qaction.h> | 22 | #include <qaction.h> |
23 | #include <qmenubar.h> | 23 | #include <qmenubar.h> |
24 | #include <qtoolbar.h> | 24 | #include <qtoolbar.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qwhatsthis.h> | 26 | #include <qwhatsthis.h> |
27 | #include <qfileinfo.h> | 27 | #include <qfileinfo.h> |
28 | 28 | ||
29 | /* STD */ | 29 | /* STD */ |
30 | #include <assert.h> | 30 | #include <assert.h> |
31 | 31 | ||
32 | #ifdef EAST | ||
33 | #include <opie2/oconfig.h> | ||
34 | #endif | ||
35 | |||
32 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 36 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
33 | 37 | ||
34 | #ifdef FSCKED_DISTRI | 38 | #ifdef FSCKED_DISTRI |
35 | FixIt fix; | 39 | FixIt fix; |
36 | fix.fixIt(); | 40 | fix.fixIt(); |
37 | #endif | 41 | #endif |
38 | 42 | ||
39 | setCaption(QObject::tr("Opie Console") ); | 43 | setCaption(QObject::tr("Opie Console") ); |
40 | KeyTrans::loadAll(); | 44 | KeyTrans::loadAll(); |
41 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 45 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
42 | KeyTrans* s = KeyTrans::find(i ); | 46 | KeyTrans* s = KeyTrans::find(i ); |
43 | assert( s ); | 47 | assert( s ); |
44 | } | 48 | } |
45 | m_factory = new MetaFactory(); | 49 | m_factory = new MetaFactory(); |
46 | Default def(m_factory); | 50 | Default def(m_factory); |
47 | m_sessions.setAutoDelete( TRUE ); | 51 | m_sessions.setAutoDelete( TRUE ); |
48 | m_curSession = 0; | 52 | m_curSession = 0; |
49 | m_manager = new ProfileManager( m_factory ); | 53 | m_manager = new ProfileManager( m_factory ); |
50 | m_manager->load(); | 54 | m_manager->load(); |
51 | m_scriptsData.setAutoDelete(TRUE); | 55 | m_scriptsData.setAutoDelete(TRUE); |
52 | 56 | ||
53 | initUI(); | 57 | initUI(); |
54 | populateProfiles(); | 58 | populateProfiles(); |
55 | populateScripts(); | 59 | populateScripts(); |
@@ -182,68 +186,76 @@ void MainWindow::initUI() { | |||
182 | m_terminate->addTo( m_console ); | 186 | m_terminate->addTo( m_console ); |
183 | connect(m_terminate, SIGNAL(activated() ), | 187 | connect(m_terminate, SIGNAL(activated() ), |
184 | this, SLOT(slotTerminate() ) ); | 188 | this, SLOT(slotTerminate() ) ); |
185 | 189 | ||
186 | m_closewindow = new QAction(); | 190 | m_closewindow = new QAction(); |
187 | m_closewindow->setText( tr("Close Window") ); | 191 | m_closewindow->setText( tr("Close Window") ); |
188 | m_closewindow->addTo( m_console ); | 192 | m_closewindow->addTo( m_console ); |
189 | connect( m_closewindow, SIGNAL(activated() ), | 193 | connect( m_closewindow, SIGNAL(activated() ), |
190 | this, SLOT(slotClose() ) ); | 194 | this, SLOT(slotClose() ) ); |
191 | 195 | ||
192 | 196 | ||
193 | /* | 197 | /* |
194 | * script actions | 198 | * script actions |
195 | */ | 199 | */ |
196 | m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); | 200 | m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); |
197 | connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); | 201 | connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); |
198 | 202 | ||
199 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); | 203 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); |
200 | m_recordScript->addTo(m_scripts); | 204 | m_recordScript->addTo(m_scripts); |
201 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); | 205 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); |
202 | 206 | ||
203 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); | 207 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); |
204 | m_saveScript->addTo(m_scripts); | 208 | m_saveScript->addTo(m_scripts); |
205 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); | 209 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); |
206 | 210 | ||
207 | 211 | ||
212 | |||
213 | |||
208 | /* | 214 | /* |
209 | * action that open/closes the keyboard | 215 | * action that open/closes the keyboard |
210 | */ | 216 | */ |
211 | m_openKeys = new QAction (tr("Open Keyboard..."), | 217 | m_openKeys = new QAction (tr("Open Keyboard..."), |
212 | Resource::loadPixmap( "console/keys/keyboard_icon" ), | 218 | Resource::loadPixmap( "console/keys/keyboard_icon" ), |
213 | QString::null, 0, this, 0); | 219 | QString::null, 0, this, 0); |
214 | m_openKeys->setToggleAction(true); | 220 | m_openKeys->setToggleAction(true); |
215 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); | 221 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); |
216 | 222 | ||
217 | /* insert the submenu */ | 223 | /* insert the submenu */ |
218 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, | 224 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, |
219 | -1, 0); | 225 | -1, 0); |
220 | 226 | ||
221 | /* insert the connection menu */ | 227 | /* insert the connection menu */ |
222 | m_bar->insertItem( tr("Connection"), m_console ); | 228 | m_bar->insertItem( tr("Connection"), m_console ); |
223 | 229 | ||
224 | /* the scripts menu */ | 230 | /* the scripts menu */ |
225 | m_bar->insertItem( tr("Scripts"), m_scripts ); | 231 | #ifdef EAST |
232 | OConfig cfg("opie-console"); | ||
233 | cfg.setGroup("10east"); | ||
234 | if( !cfg.readEntry("scripthide",0) ) { | ||
235 | m_bar->insertItem( tr("Scripts"), m_scripts ); | ||
236 | } | ||
237 | #endif | ||
226 | 238 | ||
227 | /* and the keyboard */ | 239 | /* and the keyboard */ |
228 | m_keyBar = new QToolBar(this); | 240 | m_keyBar = new QToolBar(this); |
229 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); | 241 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); |
230 | m_keyBar->setHorizontalStretchable( TRUE ); | 242 | m_keyBar->setHorizontalStretchable( TRUE ); |
231 | m_keyBar->hide(); | 243 | m_keyBar->hide(); |
232 | 244 | ||
233 | m_kb = new FunctionKeyboard(m_keyBar); | 245 | m_kb = new FunctionKeyboard(m_keyBar); |
234 | connect(m_kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), | 246 | connect(m_kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), |
235 | this, SLOT(slotKeyReceived(FKey,ushort,ushort,bool))); | 247 | this, SLOT(slotKeyReceived(FKey,ushort,ushort,bool))); |
236 | 248 | ||
237 | 249 | ||
238 | a = new QAction(tr("Copy"), | 250 | a = new QAction(tr("Copy"), |
239 | Resource::loadPixmap("copy"), QString::null, | 251 | Resource::loadPixmap("copy"), QString::null, |
240 | 0, this, 0 ); | 252 | 0, this, 0 ); |
241 | //a->addTo( m_icons ); | 253 | //a->addTo( m_icons ); |
242 | connect( a, SIGNAL(activated() ), | 254 | connect( a, SIGNAL(activated() ), |
243 | this, SLOT(slotCopy() ) ); | 255 | this, SLOT(slotCopy() ) ); |
244 | 256 | ||
245 | QAction *paste = new QAction(tr("Paste"), | 257 | QAction *paste = new QAction(tr("Paste"), |
246 | Resource::loadPixmap("paste"), QString::null, | 258 | Resource::loadPixmap("paste"), QString::null, |
247 | 0, this, 0 ); | 259 | 0, this, 0 ); |
248 | connect( paste, SIGNAL(activated() ), | 260 | connect( paste, SIGNAL(activated() ), |
249 | this, SLOT(slotPaste() ) ); | 261 | this, SLOT(slotPaste() ) ); |