summaryrefslogtreecommitdiff
Side-by-side diff
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 @@
#include <qlineedit.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qcombobox.h>
#include <qtabwidget.h>
#include <qlabel.h>
-#include <qcombobox.h>
#include <qscrollview.h>
#include "atconfigdialog.h"
#include "io_modem.h"
ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl ) {
setCaption( tr( "Dialing parameter setup" ) );
QVBoxLayout *layout = new QVBoxLayout( this );
QTabWidget *tabWidget = new QTabWidget( this );
tabWidget->addTab( tab0( this ), tr("Settings1") );
tabWidget->addTab( tab1( this ), tr("Settings2") );
layout->addWidget( tabWidget );
}
QWidget* ATConfigDialog::tab0( QWidget* parent) {
QScrollView* sv = new QScrollView( parent );
QWidget *returnWidget = new QWidget( sv->viewport() );
sv->setResizePolicy( QScrollView::AutoOneFit );
// sv->setHScrollBarMode( QScrollView::AlwaysOff );
// sv->setFrameShape( QFrame::NoFrame );
QGridLayout *layout = new QGridLayout( returnWidget, 10, 2 );
QLabel *initStringLabel = new QLabel( tr("Init string "), returnWidget );
initStringLine = new QLineEdit( returnWidget );
layout->addWidget( initStringLabel, 0, 0 );
layout->addWidget( initStringLine, 0, 1 );
QLabel *resetStringLabel = new QLabel( tr("Reset string "), returnWidget );
resetStringLine = new QLineEdit( returnWidget );
layout->addWidget( resetStringLabel, 1, 0 );
layout->addWidget( resetStringLine, 1, 1 );
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:
assertSyntax(sym == SYMOpr && !strcmp(res.latin1(),":"), "':' expected")
getSymbol();
// string or command
assertSyntax(sym == SYMName || sym == SYMString,"Command or string expected")
int cmd = 0;
if (sym == SYMName)
{
assertSyntax(syms->oprsyms[res], "Unknown operator name")
cmd = (int)syms->oprsyms[res]-1;
//printf(": do %s(%d)",res.latin1(),(int)syms->oprsyms[res]-1);
}
if (sym == SYMString)
{
cmd = CMD_send;
//printf(": send");
//for (unsigned i = 0; i < res.length(); i++)
//printf(" %02x(%c)",res.latin1()[i],res.latin1()[i]>=' '?res.latin1()[i]:'?');
}
//printf(". summary %04x,%02x,%02x,%d\n",key,mode,mask,cmd);
KeyTrans::KeyEntry* ke = kt->addEntry(slinno,key,mode,mask,cmd,res);
if (ke)
{
fprintf(stderr,"%s(%d): keystroke already assigned in line %d.\n",path.ascii(),slinno,ke->ref);
}
getSymbol();
assertSyntax(sym == SYMEol, "Unexpected text")
goto Loop;
}
if (sym == SYMEol)
{
getSymbol();
goto Loop;
}
assertSyntax(sym == SYMEof, "Undecodable Line")
buf->close();
return;
ERROR:
while (sym != SYMEol && sym != SYMEof) getSymbol(); // eoln
goto Loop;
}
KeyTrans* KeyTrans::defaultKeyTrans()
{
QCString txt =
-#include "default.keytab.h"
+ #include "default.keytab.h"
;
QBuffer buf(txt);
return fromDevice("[buildin]",buf);
}
KeyTrans* KeyTrans::fromFile(const char* path)
{
QFile file(path);
return fromDevice(path,file);
}
// local symbol tables ---------------------------------------------------------------------
// material needed for parsing the config file.
// This is incomplete work.
void KeyTransSymbols::defKeySym(const char* key, int val)
{
keysyms.insert(key,(QObject*)(val+1));
}
void KeyTransSymbols::defOprSym(const char* key, int val)
{
oprsyms.insert(key,(QObject*)(val+1));
}
void KeyTransSymbols::defModSym(const char* key, int val)
{
modsyms.insert(key,(QObject*)(val+1));
}
void KeyTransSymbols::defOprSyms()
{
// Modifier
defOprSym("scrollLineUp", CMD_scrollLineUp );
defOprSym("scrollLineDown",CMD_scrollLineDown);
defOprSym("scrollPageUp", CMD_scrollPageUp );
defOprSym("scrollPageDown",CMD_scrollPageDown);
defOprSym("emitSelection", CMD_emitSelection );
defOprSym("prevSession", CMD_prevSession );
defOprSym("nextSession", CMD_nextSession );
}
void KeyTransSymbols::defModSyms()
{
// Modifier
defModSym("Shift", BITS_Shift );
defModSym("Control", BITS_Control );
defModSym("Alt", BITS_Alt );
@@ -652,55 +652,54 @@ void KeyTrans::addKeyTrans()
void KeyTrans::loadAll()
{
if (!numb2keymap)
numb2keymap = new QIntDict<KeyTrans>;
if (!path2keymap)
path2keymap = new QDict<KeyTrans>;
if (!syms)
syms = new KeyTransSymbols;
defaultKeyTrans()->addKeyTrans();
QString path = QPEApplication::qpeDir() + "etc/keytabs";
QDir dir(path);
QStringList lst = dir.entryList("*.keytab");
for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
QFile file(path + "/" + *it);
KeyTrans* sc = KeyTrans::fromDevice(*it, file);
if (sc) {
sc->addKeyTrans();
}
}
}
// Debugging material -----------------------------------------------------------
/*
void TestTokenizer(QBuffer &buf)
{
// opening sequence
buf.open(IO_ReadOnly);
cc = buf.getch();
lineno = 1;
// Test tokenizer
while (getSymbol(buf)) ReportToken();
buf.close();
}
void test()
{
// Opening sequence
QCString txt =
-#include "default.keytab.h"
;
QBuffer buf(txt);
if (0) TestTokenizer(buf);
if (1) { KeyTrans kt; kt.scanTable(buf); }
}
*/
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 @@
#include <assert.h>
#include <qaction.h>
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qmessagebox.h>
#include <qwhatsthis.h>
#include <qfileinfo.h>
#include <qpe/filemanager.h>
-#include <qpe/qpeapplication.h>
#include <opie2/ofiledialog.h>
#include "TEmulation.h"
#include "profileeditordialog.h"
#include "configdialog.h"
#include "default.h"
#include "profilemanager.h"
#include "mainwindow.h"
#include "tabwidget.h"
#include "transferdialog.h"
#include "function_keyboard.h"
#include "emulation_handler.h"
#include "script.h"
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();
m_scriptsData.setAutoDelete(TRUE);
initUI();
populateProfiles();
populateScripts();
}
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_scriptsPop = new QPopupMenu( this );