summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/atconfigdialog.cpp1
-rw-r--r--noncore/apps/opie-console/keytrans.cpp3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp1
3 files changed, 1 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp
index e683ab3..8e91b9e 100644
--- a/noncore/apps/opie-console/atconfigdialog.cpp
+++ b/noncore/apps/opie-console/atconfigdialog.cpp
@@ -1,56 +1,55 @@
1 1
2#include <qlineedit.h> 2#include <qlineedit.h>
3#include <qspinbox.h> 3#include <qspinbox.h>
4#include <qlayout.h> 4#include <qlayout.h>
5#include <qcombobox.h> 5#include <qcombobox.h>
6#include <qtabwidget.h> 6#include <qtabwidget.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qcombobox.h>
9#include <qscrollview.h> 8#include <qscrollview.h>
10 9
11#include "atconfigdialog.h" 10#include "atconfigdialog.h"
12#include "io_modem.h" 11#include "io_modem.h"
13 12
14 13
15ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 14ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
16 : QDialog( parent, name, modal, fl ) { 15 : QDialog( parent, name, modal, fl ) {
17 16
18 17
19 setCaption( tr( "Dialing parameter setup" ) ); 18 setCaption( tr( "Dialing parameter setup" ) );
20 19
21 QVBoxLayout *layout = new QVBoxLayout( this ); 20 QVBoxLayout *layout = new QVBoxLayout( this );
22 QTabWidget *tabWidget = new QTabWidget( this ); 21 QTabWidget *tabWidget = new QTabWidget( this );
23 22
24 tabWidget->addTab( tab0( this ), tr("Settings1") ); 23 tabWidget->addTab( tab0( this ), tr("Settings1") );
25 tabWidget->addTab( tab1( this ), tr("Settings2") ); 24 tabWidget->addTab( tab1( this ), tr("Settings2") );
26 25
27 layout->addWidget( tabWidget ); 26 layout->addWidget( tabWidget );
28 27
29} 28}
30 29
31QWidget* ATConfigDialog::tab0( QWidget* parent) { 30QWidget* ATConfigDialog::tab0( QWidget* parent) {
32 31
33 32
34 QScrollView* sv = new QScrollView( parent ); 33 QScrollView* sv = new QScrollView( parent );
35 34
36 QWidget *returnWidget = new QWidget( sv->viewport() ); 35 QWidget *returnWidget = new QWidget( sv->viewport() );
37 sv->setResizePolicy( QScrollView::AutoOneFit ); 36 sv->setResizePolicy( QScrollView::AutoOneFit );
38// sv->setHScrollBarMode( QScrollView::AlwaysOff ); 37// sv->setHScrollBarMode( QScrollView::AlwaysOff );
39// sv->setFrameShape( QFrame::NoFrame ); 38// sv->setFrameShape( QFrame::NoFrame );
40 39
41 40
42 41
43 42
44 QGridLayout *layout = new QGridLayout( returnWidget, 10, 2 ); 43 QGridLayout *layout = new QGridLayout( returnWidget, 10, 2 );
45 44
46 QLabel *initStringLabel = new QLabel( tr("Init string "), returnWidget ); 45 QLabel *initStringLabel = new QLabel( tr("Init string "), returnWidget );
47 initStringLine = new QLineEdit( returnWidget ); 46 initStringLine = new QLineEdit( returnWidget );
48 layout->addWidget( initStringLabel, 0, 0 ); 47 layout->addWidget( initStringLabel, 0, 0 );
49 layout->addWidget( initStringLine, 0, 1 ); 48 layout->addWidget( initStringLine, 0, 1 );
50 49
51 QLabel *resetStringLabel = new QLabel( tr("Reset string "), returnWidget ); 50 QLabel *resetStringLabel = new QLabel( tr("Reset string "), returnWidget );
52 resetStringLine = new QLineEdit( returnWidget ); 51 resetStringLine = new QLineEdit( returnWidget );
53 layout->addWidget( resetStringLabel, 1, 0 ); 52 layout->addWidget( resetStringLabel, 1, 0 );
54 layout->addWidget( resetStringLine, 1, 1 ); 53 layout->addWidget( resetStringLine, 1, 1 );
55 54
56 QLabel *dialPref1Label = new QLabel( tr("Dialing prefix #1 " ), returnWidget ); 55 QLabel *dialPref1Label = new QLabel( tr("Dialing prefix #1 " ), returnWidget );
diff --git a/noncore/apps/opie-console/keytrans.cpp b/noncore/apps/opie-console/keytrans.cpp
index d569ae0..45a7960 100644
--- a/noncore/apps/opie-console/keytrans.cpp
+++ b/noncore/apps/opie-console/keytrans.cpp
@@ -368,97 +368,97 @@ Loop:
368 assertSyntax(sym == SYMOpr && !strcmp(res.latin1(),":"), "':' expected") 368 assertSyntax(sym == SYMOpr && !strcmp(res.latin1(),":"), "':' expected")
369 getSymbol(); 369 getSymbol();
370 // string or command 370 // string or command
371 assertSyntax(sym == SYMName || sym == SYMString,"Command or string expected") 371 assertSyntax(sym == SYMName || sym == SYMString,"Command or string expected")
372 int cmd = 0; 372 int cmd = 0;
373 if (sym == SYMName) 373 if (sym == SYMName)
374 { 374 {
375 assertSyntax(syms->oprsyms[res], "Unknown operator name") 375 assertSyntax(syms->oprsyms[res], "Unknown operator name")
376 cmd = (int)syms->oprsyms[res]-1; 376 cmd = (int)syms->oprsyms[res]-1;
377//printf(": do %s(%d)",res.latin1(),(int)syms->oprsyms[res]-1); 377//printf(": do %s(%d)",res.latin1(),(int)syms->oprsyms[res]-1);
378 } 378 }
379 if (sym == SYMString) 379 if (sym == SYMString)
380 { 380 {
381 cmd = CMD_send; 381 cmd = CMD_send;
382//printf(": send"); 382//printf(": send");
383//for (unsigned i = 0; i < res.length(); i++) 383//for (unsigned i = 0; i < res.length(); i++)
384//printf(" %02x(%c)",res.latin1()[i],res.latin1()[i]>=' '?res.latin1()[i]:'?'); 384//printf(" %02x(%c)",res.latin1()[i],res.latin1()[i]>=' '?res.latin1()[i]:'?');
385 } 385 }
386//printf(". summary %04x,%02x,%02x,%d\n",key,mode,mask,cmd); 386//printf(". summary %04x,%02x,%02x,%d\n",key,mode,mask,cmd);
387 KeyTrans::KeyEntry* ke = kt->addEntry(slinno,key,mode,mask,cmd,res); 387 KeyTrans::KeyEntry* ke = kt->addEntry(slinno,key,mode,mask,cmd,res);
388 if (ke) 388 if (ke)
389 { 389 {
390 fprintf(stderr,"%s(%d): keystroke already assigned in line %d.\n",path.ascii(),slinno,ke->ref); 390 fprintf(stderr,"%s(%d): keystroke already assigned in line %d.\n",path.ascii(),slinno,ke->ref);
391 } 391 }
392 getSymbol(); 392 getSymbol();
393 assertSyntax(sym == SYMEol, "Unexpected text") 393 assertSyntax(sym == SYMEol, "Unexpected text")
394 goto Loop; 394 goto Loop;
395 } 395 }
396 if (sym == SYMEol) 396 if (sym == SYMEol)
397 { 397 {
398 getSymbol(); 398 getSymbol();
399 goto Loop; 399 goto Loop;
400 } 400 }
401 401
402 assertSyntax(sym == SYMEof, "Undecodable Line") 402 assertSyntax(sym == SYMEof, "Undecodable Line")
403 403
404 buf->close(); 404 buf->close();
405 return; 405 return;
406 406
407ERROR: 407ERROR:
408 while (sym != SYMEol && sym != SYMEof) getSymbol(); // eoln 408 while (sym != SYMEol && sym != SYMEof) getSymbol(); // eoln
409 goto Loop; 409 goto Loop;
410} 410}
411 411
412 412
413KeyTrans* KeyTrans::defaultKeyTrans() 413KeyTrans* KeyTrans::defaultKeyTrans()
414{ 414{
415 QCString txt = 415 QCString txt =
416#include "default.keytab.h" 416 #include "default.keytab.h"
417 ; 417 ;
418 QBuffer buf(txt); 418 QBuffer buf(txt);
419 return fromDevice("[buildin]",buf); 419 return fromDevice("[buildin]",buf);
420} 420}
421 421
422KeyTrans* KeyTrans::fromFile(const char* path) 422KeyTrans* KeyTrans::fromFile(const char* path)
423{ 423{
424 QFile file(path); 424 QFile file(path);
425 return fromDevice(path,file); 425 return fromDevice(path,file);
426} 426}
427 427
428// local symbol tables --------------------------------------------------------------------- 428// local symbol tables ---------------------------------------------------------------------
429// material needed for parsing the config file. 429// material needed for parsing the config file.
430// This is incomplete work. 430// This is incomplete work.
431 431
432void KeyTransSymbols::defKeySym(const char* key, int val) 432void KeyTransSymbols::defKeySym(const char* key, int val)
433{ 433{
434 keysyms.insert(key,(QObject*)(val+1)); 434 keysyms.insert(key,(QObject*)(val+1));
435} 435}
436 436
437void KeyTransSymbols::defOprSym(const char* key, int val) 437void KeyTransSymbols::defOprSym(const char* key, int val)
438{ 438{
439 oprsyms.insert(key,(QObject*)(val+1)); 439 oprsyms.insert(key,(QObject*)(val+1));
440} 440}
441 441
442void KeyTransSymbols::defModSym(const char* key, int val) 442void KeyTransSymbols::defModSym(const char* key, int val)
443{ 443{
444 modsyms.insert(key,(QObject*)(val+1)); 444 modsyms.insert(key,(QObject*)(val+1));
445} 445}
446 446
447void KeyTransSymbols::defOprSyms() 447void KeyTransSymbols::defOprSyms()
448{ 448{
449 // Modifier 449 // Modifier
450 defOprSym("scrollLineUp", CMD_scrollLineUp ); 450 defOprSym("scrollLineUp", CMD_scrollLineUp );
451 defOprSym("scrollLineDown",CMD_scrollLineDown); 451 defOprSym("scrollLineDown",CMD_scrollLineDown);
452 defOprSym("scrollPageUp", CMD_scrollPageUp ); 452 defOprSym("scrollPageUp", CMD_scrollPageUp );
453 defOprSym("scrollPageDown",CMD_scrollPageDown); 453 defOprSym("scrollPageDown",CMD_scrollPageDown);
454 defOprSym("emitSelection", CMD_emitSelection ); 454 defOprSym("emitSelection", CMD_emitSelection );
455 defOprSym("prevSession", CMD_prevSession ); 455 defOprSym("prevSession", CMD_prevSession );
456 defOprSym("nextSession", CMD_nextSession ); 456 defOprSym("nextSession", CMD_nextSession );
457} 457}
458 458
459void KeyTransSymbols::defModSyms() 459void KeyTransSymbols::defModSyms()
460{ 460{
461 // Modifier 461 // Modifier
462 defModSym("Shift", BITS_Shift ); 462 defModSym("Shift", BITS_Shift );
463 defModSym("Control", BITS_Control ); 463 defModSym("Control", BITS_Control );
464 defModSym("Alt", BITS_Alt ); 464 defModSym("Alt", BITS_Alt );
@@ -652,55 +652,54 @@ void KeyTrans::addKeyTrans()
652void KeyTrans::loadAll() 652void KeyTrans::loadAll()
653{ 653{
654 if (!numb2keymap) 654 if (!numb2keymap)
655 numb2keymap = new QIntDict<KeyTrans>; 655 numb2keymap = new QIntDict<KeyTrans>;
656 if (!path2keymap) 656 if (!path2keymap)
657 path2keymap = new QDict<KeyTrans>; 657 path2keymap = new QDict<KeyTrans>;
658 if (!syms) 658 if (!syms)
659 syms = new KeyTransSymbols; 659 syms = new KeyTransSymbols;
660 660
661 defaultKeyTrans()->addKeyTrans(); 661 defaultKeyTrans()->addKeyTrans();
662 662
663 663
664 QString path = QPEApplication::qpeDir() + "etc/keytabs"; 664 QString path = QPEApplication::qpeDir() + "etc/keytabs";
665 QDir dir(path); 665 QDir dir(path);
666 QStringList lst = dir.entryList("*.keytab"); 666 QStringList lst = dir.entryList("*.keytab");
667 667
668 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 668 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
669 QFile file(path + "/" + *it); 669 QFile file(path + "/" + *it);
670 KeyTrans* sc = KeyTrans::fromDevice(*it, file); 670 KeyTrans* sc = KeyTrans::fromDevice(*it, file);
671 if (sc) { 671 if (sc) {
672 sc->addKeyTrans(); 672 sc->addKeyTrans();
673 } 673 }
674 } 674 }
675 675
676} 676}
677 677
678// Debugging material ----------------------------------------------------------- 678// Debugging material -----------------------------------------------------------
679/* 679/*
680void TestTokenizer(QBuffer &buf) 680void TestTokenizer(QBuffer &buf)
681{ 681{
682 // opening sequence 682 // opening sequence
683 683
684 buf.open(IO_ReadOnly); 684 buf.open(IO_ReadOnly);
685 cc = buf.getch(); 685 cc = buf.getch();
686 lineno = 1; 686 lineno = 1;
687 687
688 // Test tokenizer 688 // Test tokenizer
689 689
690 while (getSymbol(buf)) ReportToken(); 690 while (getSymbol(buf)) ReportToken();
691 691
692 buf.close(); 692 buf.close();
693} 693}
694 694
695void test() 695void test()
696{ 696{
697 // Opening sequence 697 // Opening sequence
698 698
699 QCString txt = 699 QCString txt =
700#include "default.keytab.h"
701 ; 700 ;
702 QBuffer buf(txt); 701 QBuffer buf(txt);
703 if (0) TestTokenizer(buf); 702 if (0) TestTokenizer(buf);
704 if (1) { KeyTrans kt; kt.scanTable(buf); } 703 if (1) { KeyTrans kt; kt.scanTable(buf); }
705} 704}
706*/ 705*/
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 0a475d8..1d2385f 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -1,59 +1,58 @@
1#include <assert.h> 1#include <assert.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qmenubar.h> 4#include <qmenubar.h>
5#include <qtoolbar.h> 5#include <qtoolbar.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qwhatsthis.h> 7#include <qwhatsthis.h>
8#include <qfileinfo.h> 8#include <qfileinfo.h>
9 9
10#include <qpe/filemanager.h> 10#include <qpe/filemanager.h>
11#include <qpe/qpeapplication.h>
12 11
13#include <opie2/ofiledialog.h> 12#include <opie2/ofiledialog.h>
14 13
15#include "TEmulation.h" 14#include "TEmulation.h"
16#include "profileeditordialog.h" 15#include "profileeditordialog.h"
17#include "configdialog.h" 16#include "configdialog.h"
18#include "default.h" 17#include "default.h"
19#include "profilemanager.h" 18#include "profilemanager.h"
20#include "mainwindow.h" 19#include "mainwindow.h"
21#include "tabwidget.h" 20#include "tabwidget.h"
22#include "transferdialog.h" 21#include "transferdialog.h"
23#include "function_keyboard.h" 22#include "function_keyboard.h"
24#include "emulation_handler.h" 23#include "emulation_handler.h"
25#include "script.h" 24#include "script.h"
26 25
27 26
28MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 27MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
29 KeyTrans::loadAll(); 28 KeyTrans::loadAll();
30 for (int i = 0; i < KeyTrans::count(); i++ ) { 29 for (int i = 0; i < KeyTrans::count(); i++ ) {
31 KeyTrans* s = KeyTrans::find(i ); 30 KeyTrans* s = KeyTrans::find(i );
32 assert( s ); 31 assert( s );
33 } 32 }
34 m_factory = new MetaFactory(); 33 m_factory = new MetaFactory();
35 Default def(m_factory); 34 Default def(m_factory);
36 m_sessions.setAutoDelete( TRUE ); 35 m_sessions.setAutoDelete( TRUE );
37 m_curSession = 0; 36 m_curSession = 0;
38 m_manager = new ProfileManager( m_factory ); 37 m_manager = new ProfileManager( m_factory );
39 m_manager->load(); 38 m_manager->load();
40 m_scriptsData.setAutoDelete(TRUE); 39 m_scriptsData.setAutoDelete(TRUE);
41 40
42 initUI(); 41 initUI();
43 populateProfiles(); 42 populateProfiles();
44 populateScripts(); 43 populateScripts();
45} 44}
46 45
47void MainWindow::initUI() { 46void MainWindow::initUI() {
48 47
49 setToolBarsMovable( FALSE ); 48 setToolBarsMovable( FALSE );
50 49
51 /* tool bar for the menu */ 50 /* tool bar for the menu */
52 m_tool = new QToolBar( this ); 51 m_tool = new QToolBar( this );
53 m_tool->setHorizontalStretchable( TRUE ); 52 m_tool->setHorizontalStretchable( TRUE );
54 53
55 m_bar = new QMenuBar( m_tool ); 54 m_bar = new QMenuBar( m_tool );
56 m_console = new QPopupMenu( this ); 55 m_console = new QPopupMenu( this );
57 m_scripts = new QPopupMenu( this ); 56 m_scripts = new QPopupMenu( this );
58 m_sessionsPop= new QPopupMenu( this ); 57 m_sessionsPop= new QPopupMenu( this );
59 m_scriptsPop = new QPopupMenu( this ); 58 m_scriptsPop = new QPopupMenu( this );