author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/apps/opie-console | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
-rw-r--r-- | noncore/apps/opie-console/btconfigwidget.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialdialog.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_layer.cpp | 24 | ||||
-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/sz_transfer.cpp | 18 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 12 |
13 files changed, 53 insertions, 53 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp index 64046d8..0ac337f 100644 --- a/noncore/apps/opie-console/btconfigwidget.cpp +++ b/noncore/apps/opie-console/btconfigwidget.cpp | |||
@@ -11,57 +11,57 @@ | |||
11 | namespace { | 11 | namespace { |
12 | void setCurrent( const QString& str, QComboBox* bo ) { | 12 | void setCurrent( const QString& str, QComboBox* bo ) { |
13 | uint b = bo->count(); | 13 | uint b = bo->count(); |
14 | for (int i = 0; i < bo->count(); i++ ) { | 14 | for (int i = 0; i < bo->count(); i++ ) { |
15 | if ( bo->text(i) == str ) { | 15 | if ( bo->text(i) == str ) { |
16 | bo->setCurrentItem( i ); | 16 | bo->setCurrentItem( i ); |
17 | return; | 17 | return; |
18 | } | 18 | } |
19 | } | 19 | } |
20 | bo->insertItem( str ); | 20 | bo->insertItem( str ); |
21 | bo->setCurrentItem( b ); | 21 | bo->setCurrentItem( b ); |
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
25 | BTConfigWidget::BTConfigWidget( const QString& name, | 25 | BTConfigWidget::BTConfigWidget( const QString& name, |
26 | QWidget* parent, | 26 | QWidget* parent, |
27 | const char* na ) | 27 | const char* na ) |
28 | : ProfileDialogConnectionWidget( name, parent, na ) { | 28 | : ProfileDialogConnectionWidget( name, parent, na ) { |
29 | 29 | ||
30 | m_lay = new QVBoxLayout( this ); | 30 | m_lay = new QVBoxLayout( this ); |
31 | 31 | ||
32 | m_device = new QLabel( tr( "Device" ), this ); | 32 | m_device = new QLabel( tr( "Device" ), this ); |
33 | QHBox *deviceBox = new QHBox( this ); | 33 | QHBox *deviceBox = new QHBox( this ); |
34 | m_devRadio = new QRadioButton( deviceBox ); | 34 | m_devRadio = new QRadioButton( deviceBox ); |
35 | connect( m_devRadio, SIGNAL( toggled( bool ) ), this, SLOT( slotDevRadio( bool ) ) ); | 35 | connect( m_devRadio, SIGNAL( toggled(bool) ), this, SLOT( slotDevRadio(bool) ) ); |
36 | m_deviceCmb = new QComboBox( deviceBox ); | 36 | m_deviceCmb = new QComboBox( deviceBox ); |
37 | m_deviceCmb->setEditable( TRUE ); | 37 | m_deviceCmb->setEditable( TRUE ); |
38 | 38 | ||
39 | QLabel *macLabel = new QLabel( this ); | 39 | QLabel *macLabel = new QLabel( this ); |
40 | macLabel->setText( tr( "Or peer mac address" ) ); | 40 | macLabel->setText( tr( "Or peer mac address" ) ); |
41 | QHBox *macBox = new QHBox( this ); | 41 | QHBox *macBox = new QHBox( this ); |
42 | m_macRadio = new QRadioButton( macBox ); | 42 | m_macRadio = new QRadioButton( macBox ); |
43 | connect( m_macRadio, SIGNAL( toggled( bool ) ), this, SLOT( slotMacRadio( bool ) ) ); | 43 | connect( m_macRadio, SIGNAL( toggled(bool) ), this, SLOT( slotMacRadio(bool) ) ); |
44 | m_mac = new QLineEdit( macBox ); | 44 | m_mac = new QLineEdit( macBox ); |
45 | 45 | ||
46 | m_base = new IOLayerBase(this, "base"); | 46 | m_base = new IOLayerBase(this, "base"); |
47 | 47 | ||
48 | m_lay->addWidget( m_device ); | 48 | m_lay->addWidget( m_device ); |
49 | m_lay->addWidget( deviceBox ); | 49 | m_lay->addWidget( deviceBox ); |
50 | m_lay->addWidget( macLabel ); | 50 | m_lay->addWidget( macLabel ); |
51 | m_lay->addWidget( macBox ); | 51 | m_lay->addWidget( macBox ); |
52 | m_lay->addWidget( m_base ); | 52 | m_lay->addWidget( m_base ); |
53 | 53 | ||
54 | m_deviceCmb->insertItem( "/dev/ttyU0" ); | 54 | m_deviceCmb->insertItem( "/dev/ttyU0" ); |
55 | m_deviceCmb->insertItem( "/dev/ttyU1" ); | 55 | m_deviceCmb->insertItem( "/dev/ttyU1" ); |
56 | } | 56 | } |
57 | 57 | ||
58 | BTConfigWidget::~BTConfigWidget() { | 58 | BTConfigWidget::~BTConfigWidget() { |
59 | 59 | ||
60 | } | 60 | } |
61 | void BTConfigWidget::load( const Profile& prof ) { | 61 | void BTConfigWidget::load( const Profile& prof ) { |
62 | int rad_flow = prof.readNumEntry("Flow"); | 62 | int rad_flow = prof.readNumEntry("Flow"); |
63 | int rad_parity = prof.readNumEntry("Parity"); | 63 | int rad_parity = prof.readNumEntry("Parity"); |
64 | int speed = prof.readNumEntry("Speed"); | 64 | int speed = prof.readNumEntry("Speed"); |
65 | QString mac = prof.readEntry("Mac"); | 65 | QString mac = prof.readEntry("Mac"); |
66 | 66 | ||
67 | if (!mac.isEmpty() ) { | 67 | if (!mac.isEmpty() ) { |
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp index 6bc1240..526d55e 100644 --- a/noncore/apps/opie-console/dialdialog.cpp +++ b/noncore/apps/opie-console/dialdialog.cpp | |||
@@ -41,49 +41,49 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f | |||
41 | number0->setFont( number0_font ); | 41 | number0->setFont( number0_font ); |
42 | layout->addWidget( number0, 4, 1 ); | 42 | layout->addWidget( number0, 4, 1 ); |
43 | dialButtons->insert( number0 ); | 43 | dialButtons->insert( number0 ); |
44 | 44 | ||
45 | int x = 0, y = 0; | 45 | int x = 0, y = 0; |
46 | for ( int i = 0 ; i < 9; i++ ) { | 46 | for ( int i = 0 ; i < 9; i++ ) { |
47 | QPushButton *number = new QPushButton( dialWidget ); | 47 | QPushButton *number = new QPushButton( dialWidget ); |
48 | number->setText( QString( "%1" ).arg( i + 1 ) ); | 48 | number->setText( QString( "%1" ).arg( i + 1 ) ); |
49 | QFont number_font( number->font() ); | 49 | QFont number_font( number->font() ); |
50 | number_font.setBold( TRUE ); | 50 | number_font.setBold( TRUE ); |
51 | number->setFont( number_font ); | 51 | number->setFont( number_font ); |
52 | 52 | ||
53 | dialButtons->insert( number ); | 53 | dialButtons->insert( number ); |
54 | 54 | ||
55 | layout->addWidget( number, x, y ); | 55 | layout->addWidget( number, x, y ); |
56 | 56 | ||
57 | if ( y < 2 ) { | 57 | if ( y < 2 ) { |
58 | y++; | 58 | y++; |
59 | } else { | 59 | } else { |
60 | x++; | 60 | x++; |
61 | y = 0; | 61 | y = 0; |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); | 65 | connect( dialButtons, SIGNAL( clicked(int) ), this, SLOT( slotEnterNumber(int) ) ); |
66 | 66 | ||
67 | mainLayout->addStretch( 2 ); | 67 | mainLayout->addStretch( 2 ); |
68 | mainLayout->addWidget( textLabel ); | 68 | mainLayout->addWidget( textLabel ); |
69 | mainLayout->addStretch( 1 ); | 69 | mainLayout->addStretch( 1 ); |
70 | mainLayout->addWidget( m_dialLine ); | 70 | mainLayout->addWidget( m_dialLine ); |
71 | mainLayout->addStretch( 2 ); | 71 | mainLayout->addStretch( 2 ); |
72 | mainLayout->addWidget( dialWidget ); | 72 | mainLayout->addWidget( dialWidget ); |
73 | mainLayout->addStretch( 4 ); | 73 | mainLayout->addStretch( 4 ); |
74 | } | 74 | } |
75 | 75 | ||
76 | 76 | ||
77 | void DialDialog::slotEnterNumber( int number ) { | 77 | void DialDialog::slotEnterNumber( int number ) { |
78 | 78 | ||
79 | // pretty stupid, just for testing .-) | 79 | // pretty stupid, just for testing .-) |
80 | 80 | ||
81 | m_number.append(QString("%1").arg(number)); | 81 | m_number.append(QString("%1").arg(number)); |
82 | 82 | ||
83 | setNumber(m_number); | 83 | setNumber(m_number); |
84 | } | 84 | } |
85 | 85 | ||
86 | DialDialog::~DialDialog() { | 86 | DialDialog::~DialDialog() { |
87 | } | 87 | } |
88 | 88 | ||
89 | QString DialDialog::number() { | 89 | QString DialDialog::number() { |
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 2c1d888..99d069f 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp | |||
@@ -1,47 +1,47 @@ | |||
1 | 1 | ||
2 | #include "TEmuVt102.h" | 2 | #include "TEmuVt102.h" |
3 | 3 | ||
4 | #include "profile.h" | 4 | #include "profile.h" |
5 | #include "emulation_handler.h" | 5 | #include "emulation_handler.h" |
6 | #include "script.h" | 6 | #include "script.h" |
7 | 7 | ||
8 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) | 8 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) |
9 | : QObject(0, name ) | 9 | : QObject(0, name ) |
10 | { | 10 | { |
11 | m_teWid = new TEWidget( parent, "TerminalMain"); | 11 | m_teWid = new TEWidget( parent, "TerminalMain"); |
12 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) | 12 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) |
13 | // use setWrapAt(80) for normal console with scrollbar | 13 | // use setWrapAt(80) for normal console with scrollbar |
14 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); | 14 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); |
15 | m_teWid->setMinimumSize(150, 70 ); | 15 | m_teWid->setMinimumSize(150, 70 ); |
16 | m_script = 0; | 16 | m_script = 0; |
17 | parent->resize( m_teWid->calcSize(80, 24 ) ); | 17 | parent->resize( m_teWid->calcSize(80, 24 ) ); |
18 | m_teEmu = new TEmuVt102(m_teWid ); | 18 | m_teEmu = new TEmuVt102(m_teWid ); |
19 | 19 | ||
20 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int, int) ), | 20 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), |
21 | this, SIGNAL(changeSize(int, int) ) ); | 21 | this, SIGNAL(changeSize(int,int) ) ); |
22 | connect(m_teEmu, SIGNAL(sndBlock(const char*, int) ), | 22 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), |
23 | this, SLOT(recvEmulation(const char*, int) ) ); | 23 | this, SLOT(recvEmulation(const char*,int) ) ); |
24 | m_teEmu->setConnect( true ); | 24 | m_teEmu->setConnect( true ); |
25 | m_teEmu->setHistory( TRUE ); | 25 | m_teEmu->setHistory( TRUE ); |
26 | load( prof ); | 26 | load( prof ); |
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | } | 30 | } |
31 | TEmulation* EmulationHandler::emulation() { | 31 | TEmulation* EmulationHandler::emulation() { |
32 | return m_teEmu; | 32 | return m_teEmu; |
33 | } | 33 | } |
34 | EmulationHandler::~EmulationHandler() { | 34 | EmulationHandler::~EmulationHandler() { |
35 | if (isRecording()) | 35 | if (isRecording()) |
36 | clearScript(); | 36 | clearScript(); |
37 | delete m_teEmu; | 37 | delete m_teEmu; |
38 | delete m_teWid; | 38 | delete m_teWid; |
39 | } | 39 | } |
40 | 40 | ||
41 | void EmulationHandler::load( const Profile& prof) { | 41 | void EmulationHandler::load( const Profile& prof) { |
42 | m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); | 42 | m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); |
43 | int num = prof.readNumEntry("Color"); | 43 | int num = prof.readNumEntry("Color"); |
44 | setColor( foreColor(num), backColor(num) ); | 44 | setColor( foreColor(num), backColor(num) ); |
45 | m_teWid->setBackgroundColor(backColor(num) ); | 45 | m_teWid->setBackgroundColor(backColor(num) ); |
46 | 46 | ||
47 | int term = prof.readNumEntry("Terminal", 0) ; | 47 | int term = prof.readNumEntry("Terminal", 0) ; |
diff --git a/noncore/apps/opie-console/emulation_layer.cpp b/noncore/apps/opie-console/emulation_layer.cpp index 2bef801..fd30ad7 100644 --- a/noncore/apps/opie-console/emulation_layer.cpp +++ b/noncore/apps/opie-console/emulation_layer.cpp | |||
@@ -85,60 +85,60 @@ | |||
85 | /* */ | 85 | /* */ |
86 | /* EmulationLayer */ | 86 | /* EmulationLayer */ |
87 | /* */ | 87 | /* */ |
88 | /* ------------------------------------------------------------------------- */ | 88 | /* ------------------------------------------------------------------------- */ |
89 | 89 | ||
90 | #define CNTL(c) ((c)-'@') | 90 | #define CNTL(c) ((c)-'@') |
91 | 91 | ||
92 | /*! | 92 | /*! |
93 | */ | 93 | */ |
94 | 94 | ||
95 | EmulationLayer::EmulationLayer( WidgetLayer* gui ) | 95 | EmulationLayer::EmulationLayer( WidgetLayer* gui ) |
96 | : decoder((QTextDecoder*)NULL) | 96 | : decoder((QTextDecoder*)NULL) |
97 | { | 97 | { |
98 | this->gui = gui; | 98 | this->gui = gui; |
99 | 99 | ||
100 | screen[0] = new Screen(gui->lines(),gui->columns()); | 100 | screen[0] = new Screen(gui->lines(),gui->columns()); |
101 | screen[1] = new Screen(gui->lines(),gui->columns()); | 101 | screen[1] = new Screen(gui->lines(),gui->columns()); |
102 | scr = screen[0]; | 102 | scr = screen[0]; |
103 | 103 | ||
104 | bulk_nlcnt = 0; // reset bulk newline counter | 104 | bulk_nlcnt = 0; // reset bulk newline counter |
105 | bulk_incnt = 0; // reset bulk counter | 105 | bulk_incnt = 0; // reset bulk counter |
106 | connected = FALSE; | 106 | connected = FALSE; |
107 | 107 | ||
108 | QObject::connect(&bulk_timer, SIGNAL( timeout() ), this, SLOT( showBulk() ) ); | 108 | QObject::connect(&bulk_timer, SIGNAL( timeout() ), this, SLOT( showBulk() ) ); |
109 | QObject::connect(gui,SIGNAL( imageSizeChanged( int, int ) ), | 109 | QObject::connect(gui,SIGNAL( imageSizeChanged(int,int) ), |
110 | this,SLOT( onImageSizeChange( int, int ) ) ); | 110 | this,SLOT( onImageSizeChange(int,int) ) ); |
111 | QObject::connect(gui,SIGNAL( changedHistoryCursor( int ) ), | 111 | QObject::connect(gui,SIGNAL( changedHistoryCursor(int) ), |
112 | this,SLOT( historyCursorChange( int ) ) ); | 112 | this,SLOT( historyCursorChange(int) ) ); |
113 | QObject::connect(gui,SIGNAL( keyPressed( QKeyEvent* ) ), | 113 | QObject::connect(gui,SIGNAL( keyPressed(QKeyEvent*) ), |
114 | this,SLOT( onKeyPress( QKeyEvent* ) ) ); | 114 | this,SLOT( onKeyPress(QKeyEvent*) ) ); |
115 | QObject::connect(gui,SIGNAL( selectionBegin( const int, const int) ), | 115 | QObject::connect(gui,SIGNAL( selectionBegin(const int,const int) ), |
116 | this,SLOT( onSelectionBegin( const int, const int ) ) ); | 116 | this,SLOT( onSelectionBegin(const int,const int) ) ); |
117 | QObject::connect(gui,SIGNAL( selectionExtended( const int, const int ) ), | 117 | QObject::connect(gui,SIGNAL( selectionExtended(const int,const int) ), |
118 | this,SLOT( onSelectionExtend( const int,const int ) ) ); | 118 | this,SLOT( onSelectionExtend(const int,const int) ) ); |
119 | QObject::connect(gui,SIGNAL( selectionEnd( const bool ) ), | 119 | QObject::connect(gui,SIGNAL( selectionEnd(const bool) ), |
120 | this,SLOT( setSelection( const bool ) ) ); | 120 | this,SLOT( setSelection(const bool) ) ); |
121 | QObject::connect(gui,SIGNAL( selectionCleared() ), | 121 | QObject::connect(gui,SIGNAL( selectionCleared() ), |
122 | this,SLOT( clearSelection() ) ); | 122 | this,SLOT( clearSelection() ) ); |
123 | } | 123 | } |
124 | 124 | ||
125 | /*! | 125 | /*! |
126 | */ | 126 | */ |
127 | 127 | ||
128 | EmulationLayer::~EmulationLayer() | 128 | EmulationLayer::~EmulationLayer() |
129 | { | 129 | { |
130 | delete screen[0]; | 130 | delete screen[0]; |
131 | delete screen[1]; | 131 | delete screen[1]; |
132 | bulk_timer.stop(); | 132 | bulk_timer.stop(); |
133 | } | 133 | } |
134 | 134 | ||
135 | /*! change between primary and alternate screen | 135 | /*! change between primary and alternate screen |
136 | */ | 136 | */ |
137 | 137 | ||
138 | void EmulationLayer::setScreen(int n) | 138 | void EmulationLayer::setScreen(int n) |
139 | { | 139 | { |
140 | scr = screen[n&1]; | 140 | scr = screen[n&1]; |
141 | } | 141 | } |
142 | 142 | ||
143 | void EmulationLayer::setHistory(bool on) | 143 | void EmulationLayer::setHistory(bool on) |
144 | { | 144 | { |
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index c232d89..eb32551 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -239,87 +239,87 @@ void FunctionKeyboard::loadDefaults() { | |||
239 | keys.insert( "r1c2", FKey ("F3", 0, 4146, 0)); | 239 | keys.insert( "r1c2", FKey ("F3", 0, 4146, 0)); |
240 | keys.insert( "r1c3", FKey ("F4", 0, 4147, 0)); | 240 | keys.insert( "r1c3", FKey ("F4", 0, 4147, 0)); |
241 | keys.insert( "r1c4", FKey ("F5", 0, 4148, 0)); | 241 | keys.insert( "r1c4", FKey ("F5", 0, 4148, 0)); |
242 | keys.insert( "r1c5", FKey ("F6", 0, 4149, 0)); | 242 | keys.insert( "r1c5", FKey ("F6", 0, 4149, 0)); |
243 | keys.insert( "r1c6", FKey ("F7", 0, 4150, 0)); | 243 | keys.insert( "r1c6", FKey ("F7", 0, 4150, 0)); |
244 | keys.insert( "r1c7", FKey ("F8", 0, 4151, 0)); | 244 | keys.insert( "r1c7", FKey ("F8", 0, 4151, 0)); |
245 | keys.insert( "r1c8", FKey ("F9", 0, 4152, 0)); | 245 | keys.insert( "r1c8", FKey ("F9", 0, 4152, 0)); |
246 | keys.insert( "r1c9", FKey ("F10", 0, 4153, 0)); | 246 | keys.insert( "r1c9", FKey ("F10", 0, 4153, 0)); |
247 | keys.insert( "r1c10", FKey ("F11", 0, 4154, 0)); | 247 | keys.insert( "r1c10", FKey ("F11", 0, 4154, 0)); |
248 | keys.insert( "r1c11", FKey ("F12", 0, 4155, 0)); | 248 | keys.insert( "r1c11", FKey ("F12", 0, 4155, 0)); |
249 | 249 | ||
250 | 250 | ||
251 | } | 251 | } |
252 | 252 | ||
253 | /* FunctionKeyboardConfig {{{1 */ | 253 | /* FunctionKeyboardConfig {{{1 */ |
254 | 254 | ||
255 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) | 255 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) |
256 | : ProfileDialogKeyWidget(name, parent, na), | 256 | : ProfileDialogKeyWidget(name, parent, na), |
257 | selectedRow(0), selectedCol(0) | 257 | selectedRow(0), selectedCol(0) |
258 | { | 258 | { |
259 | qWarning("FunctionKeyboardConfig"); | 259 | qWarning("FunctionKeyboardConfig"); |
260 | 260 | ||
261 | 261 | ||
262 | kb = new FunctionKeyboard(this); | 262 | kb = new FunctionKeyboard(this); |
263 | connect (kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), | 263 | connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), |
264 | this, SLOT(slotKeyPressed(FKey, ushort, ushort, bool))); | 264 | this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); |
265 | 265 | ||
266 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); | 266 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); |
267 | QLabel *l = new QLabel("Rows", dimentions); | 267 | QLabel *l = new QLabel("Rows", dimentions); |
268 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); | 268 | m_rowBox = new QSpinBox(1, 15, 1, dimentions); |
269 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); | 269 | connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); |
270 | l = new QLabel("Columns", dimentions); | 270 | l = new QLabel("Columns", dimentions); |
271 | m_colBox = new QSpinBox(1, 15, 1, dimentions); | 271 | m_colBox = new QSpinBox(1, 15, 1, dimentions); |
272 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); | 272 | connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); |
273 | 273 | ||
274 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); | 274 | QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); |
275 | l = new QLabel("Label", editKey); | 275 | l = new QLabel("Label", editKey); |
276 | m_labels = new QComboBox(true, editKey); | 276 | m_labels = new QComboBox(true, editKey); |
277 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); | 277 | m_labels->setInsertionPolicy(QComboBox::AtCurrent); |
278 | m_labels->insertItem(""); | 278 | m_labels->insertItem(""); |
279 | 279 | ||
280 | QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); | 280 | QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); |
281 | 281 | ||
282 | for (uint i = 0; i < files.count(); i++) { | 282 | for (uint i = 0; i < files.count(); i++) { |
283 | 283 | ||
284 | m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]); | 284 | m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]); |
285 | } | 285 | } |
286 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); | 286 | connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); |
287 | connect (m_labels, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeLabelText(const QString&))); | 287 | connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&))); |
288 | 288 | ||
289 | l = new QLabel("Q Keycode", editKey); | 289 | l = new QLabel("Q Keycode", editKey); |
290 | m_qvalues = new QComboBox(true, editKey); | 290 | m_qvalues = new QComboBox(true, editKey); |
291 | m_qvalues->setInsertionPolicy(QComboBox::AtTop); | 291 | m_qvalues->setInsertionPolicy(QComboBox::AtTop); |
292 | m_qvalues->setDuplicatesEnabled(false); | 292 | m_qvalues->setDuplicatesEnabled(false); |
293 | m_qvalues->insertItem(""); | 293 | m_qvalues->insertItem(""); |
294 | connect (m_qvalues, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeQCode(const QString&))); | 294 | connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&))); |
295 | 295 | ||
296 | l = new QLabel("Unicode Value", editKey); | 296 | l = new QLabel("Unicode Value", editKey); |
297 | m_uniValues = new QComboBox(true, editKey); | 297 | m_uniValues = new QComboBox(true, editKey); |
298 | m_uniValues->setInsertionPolicy(QComboBox::AtTop); | 298 | m_uniValues->setInsertionPolicy(QComboBox::AtTop); |
299 | m_uniValues->setDuplicatesEnabled(false); | 299 | m_uniValues->setDuplicatesEnabled(false); |
300 | m_uniValues->insertItem(""); | 300 | m_uniValues->insertItem(""); |
301 | connect (m_uniValues, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeUnicode(const QString&))); | 301 | connect (m_uniValues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeUnicode(const QString&))); |
302 | 302 | ||
303 | QVBoxLayout *root = new QVBoxLayout(this, 2); | 303 | QVBoxLayout *root = new QVBoxLayout(this, 2); |
304 | root->addWidget(kb); | 304 | root->addWidget(kb); |
305 | root->addWidget(dimentions); | 305 | root->addWidget(dimentions); |
306 | root->addWidget(editKey); | 306 | root->addWidget(editKey); |
307 | } | 307 | } |
308 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { | 308 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { |
309 | 309 | ||
310 | } | 310 | } |
311 | void FunctionKeyboardConfig::load (const Profile& prof) { | 311 | void FunctionKeyboardConfig::load (const Profile& prof) { |
312 | 312 | ||
313 | kb->keys.clear(); | 313 | kb->keys.clear(); |
314 | kb->loadDefaults(); | 314 | kb->loadDefaults(); |
315 | 315 | ||
316 | m_rowBox->setValue(prof.readNumEntry("keb_rows", 2)); | 316 | m_rowBox->setValue(prof.readNumEntry("keb_rows", 2)); |
317 | m_colBox->setValue(prof.readNumEntry("keb_cols", 10)); | 317 | m_colBox->setValue(prof.readNumEntry("keb_cols", 10)); |
318 | 318 | ||
319 | /* load all the keys to the keyboard */ | 319 | /* load all the keys to the keyboard */ |
320 | for (int i = 0; i <= m_rowBox->value() -1; i++) | 320 | for (int i = 0; i <= m_rowBox->value() -1; i++) |
321 | for (int j = 0; j <= m_colBox->value() -1; j++) { | 321 | for (int j = 0; j <= m_colBox->value() -1; j++) { |
322 | 322 | ||
323 | QString h = "r" + QString::number(i) + "c" + QString::number(j); | 323 | QString h = "r" + QString::number(i) + "c" + QString::number(j); |
324 | QString values = prof.readEntry("keb_" + h); | 324 | QString values = prof.readEntry("keb_" + h); |
325 | 325 | ||
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index 37bf797..1a8c979 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp | |||
@@ -15,50 +15,50 @@ IOBt::~IOBt() { | |||
15 | 15 | ||
16 | void IOBt::close() { | 16 | void IOBt::close() { |
17 | 17 | ||
18 | IOSerial::close(); | 18 | IOSerial::close(); |
19 | // still need error handling | 19 | // still need error handling |
20 | if ( m_attach ) { | 20 | if ( m_attach ) { |
21 | delete m_attach; | 21 | delete m_attach; |
22 | m_attach = 0; | 22 | m_attach = 0; |
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||
26 | bool IOBt::open() { | 26 | bool IOBt::open() { |
27 | bool ret = false; | 27 | bool ret = false; |
28 | 28 | ||
29 | // only set up bt stuff if mac address was set, otherwise use the device set | 29 | // only set up bt stuff if mac address was set, otherwise use the device set |
30 | if ( !m_mac.isEmpty() ) { | 30 | if ( !m_mac.isEmpty() ) { |
31 | 31 | ||
32 | // now it should also be checked, if there is a connection to the device with that mac allready | 32 | // now it should also be checked, if there is a connection to the device with that mac allready |
33 | // hciattach here | 33 | // hciattach here |
34 | m_attach = new OProcess(); | 34 | m_attach = new OProcess(); |
35 | *m_attach << "hciattach /dev/ttyS2 any 57600"; | 35 | *m_attach << "hciattach /dev/ttyS2 any 57600"; |
36 | 36 | ||
37 | // then start hcid, then rcfomm handling (m_mac) | 37 | // then start hcid, then rcfomm handling (m_mac) |
38 | 38 | ||
39 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | 39 | connect( m_attach, SIGNAL( processExited(OProcess*) ), |
40 | this, SLOT( slotExited( OProcess* ) ) ); | 40 | this, SLOT( slotExited(OProcess*) ) ); |
41 | 41 | ||
42 | if ( m_attach->start() ) { | 42 | if ( m_attach->start() ) { |
43 | ret = IOSerial::open(); | 43 | ret = IOSerial::open(); |
44 | } else { | 44 | } else { |
45 | qWarning("could not attach to device"); | 45 | qWarning("could not attach to device"); |
46 | delete m_attach; | 46 | delete m_attach; |
47 | m_attach = 0; | 47 | m_attach = 0; |
48 | } | 48 | } |
49 | } else { | 49 | } else { |
50 | // directly to the normal serial | 50 | // directly to the normal serial |
51 | // TODO: look first if the connection really exists. ( is set up ) | 51 | // TODO: look first if the connection really exists. ( is set up ) |
52 | 52 | ||
53 | ret =IOSerial::open(); | 53 | ret =IOSerial::open(); |
54 | } | 54 | } |
55 | return ret; | 55 | return ret; |
56 | } | 56 | } |
57 | 57 | ||
58 | void IOBt::reload( const Profile &config ) { | 58 | void IOBt::reload( const Profile &config ) { |
59 | m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); | 59 | m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); |
60 | m_mac = config.readEntry("Mac", BT_DEFAULT_MAC); | 60 | m_mac = config.readEntry("Mac", BT_DEFAULT_MAC); |
61 | m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD); | 61 | m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD); |
62 | m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY); | 62 | m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY); |
63 | m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS); | 63 | m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS); |
64 | m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS); | 64 | m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS); |
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index e360fb4..b281b7d 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp | |||
@@ -6,50 +6,50 @@ IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { | |||
6 | } | 6 | } |
7 | 7 | ||
8 | 8 | ||
9 | IOIrda::~IOIrda() { | 9 | IOIrda::~IOIrda() { |
10 | if ( m_attach ) { | 10 | if ( m_attach ) { |
11 | delete m_attach; | 11 | delete m_attach; |
12 | } | 12 | } |
13 | } | 13 | } |
14 | 14 | ||
15 | 15 | ||
16 | void IOIrda::close() { | 16 | void IOIrda::close() { |
17 | 17 | ||
18 | IOSerial::close(); | 18 | IOSerial::close(); |
19 | // still need error handling | 19 | // still need error handling |
20 | delete m_attach; | 20 | delete m_attach; |
21 | } | 21 | } |
22 | 22 | ||
23 | bool IOIrda::open() { | 23 | bool IOIrda::open() { |
24 | bool ret; | 24 | bool ret; |
25 | 25 | ||
26 | // irdaattach here | 26 | // irdaattach here |
27 | m_attach = new OProcess(); | 27 | m_attach = new OProcess(); |
28 | *m_attach << "irattach /dev/ttyS2 -s"; | 28 | *m_attach << "irattach /dev/ttyS2 -s"; |
29 | 29 | ||
30 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | 30 | connect( m_attach, SIGNAL( processExited(OProcess*) ), |
31 | this, SLOT( slotExited( OProcess* ) ) ); | 31 | this, SLOT( slotExited(OProcess*) ) ); |
32 | 32 | ||
33 | if ( m_attach->start() ) { | 33 | if ( m_attach->start() ) { |
34 | ret= IOSerial::open(); | 34 | ret= IOSerial::open(); |
35 | } else { | 35 | } else { |
36 | // emit error!!! | 36 | // emit error!!! |
37 | qWarning("could not attach to device"); | 37 | qWarning("could not attach to device"); |
38 | delete m_attach; | 38 | delete m_attach; |
39 | m_attach = 0l; | 39 | m_attach = 0l; |
40 | } | 40 | } |
41 | return ret; | 41 | return ret; |
42 | } | 42 | } |
43 | 43 | ||
44 | void IOIrda::reload( const Profile &config ) { | 44 | void IOIrda::reload( const Profile &config ) { |
45 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | 45 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); |
46 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); | 46 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); |
47 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); | 47 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); |
48 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); | 48 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); |
49 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); | 49 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); |
50 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); | 50 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); |
51 | } | 51 | } |
52 | 52 | ||
53 | 53 | ||
54 | QString IOIrda::identifier() const { | 54 | QString IOIrda::identifier() const { |
55 | return "irda"; | 55 | return "irda"; |
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 1d2385f..197f799 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -189,88 +189,88 @@ void MainWindow::initUI() { | |||
189 | */ | 189 | */ |
190 | m_openKeys = new QAction (tr("Open Keyboard..."), | 190 | m_openKeys = new QAction (tr("Open Keyboard..."), |
191 | Resource::loadPixmap( "console/keys/keyboard_icon" ), | 191 | Resource::loadPixmap( "console/keys/keyboard_icon" ), |
192 | QString::null, 0, this, 0); | 192 | QString::null, 0, this, 0); |
193 | m_openKeys->setToggleAction(true); | 193 | m_openKeys->setToggleAction(true); |
194 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); | 194 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); |
195 | 195 | ||
196 | /* insert the submenu */ | 196 | /* insert the submenu */ |
197 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, | 197 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, |
198 | -1, 0); | 198 | -1, 0); |
199 | 199 | ||
200 | /* insert the connection menu */ | 200 | /* insert the connection menu */ |
201 | m_bar->insertItem( tr("Connection"), m_console ); | 201 | m_bar->insertItem( tr("Connection"), m_console ); |
202 | 202 | ||
203 | /* the scripts menu */ | 203 | /* the scripts menu */ |
204 | m_bar->insertItem( tr("Scripts"), m_scripts ); | 204 | m_bar->insertItem( tr("Scripts"), m_scripts ); |
205 | 205 | ||
206 | /* and the keyboard */ | 206 | /* and the keyboard */ |
207 | m_keyBar = new QToolBar(this); | 207 | m_keyBar = new QToolBar(this); |
208 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); | 208 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); |
209 | m_keyBar->setHorizontalStretchable( TRUE ); | 209 | m_keyBar->setHorizontalStretchable( TRUE ); |
210 | m_keyBar->hide(); | 210 | m_keyBar->hide(); |
211 | 211 | ||
212 | m_kb = new FunctionKeyboard(m_keyBar); | 212 | m_kb = new FunctionKeyboard(m_keyBar); |
213 | connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), | 213 | connect(m_kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), |
214 | this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); | 214 | this, SLOT(slotKeyReceived(FKey,ushort,ushort,bool))); |
215 | 215 | ||
216 | 216 | ||
217 | a = new QAction(tr("Copy"), | 217 | a = new QAction(tr("Copy"), |
218 | Resource::loadPixmap("copy"), QString::null, | 218 | Resource::loadPixmap("copy"), QString::null, |
219 | 0, this, 0 ); | 219 | 0, this, 0 ); |
220 | //a->addTo( m_icons ); | 220 | //a->addTo( m_icons ); |
221 | connect( a, SIGNAL(activated() ), | 221 | connect( a, SIGNAL(activated() ), |
222 | this, SLOT(slotCopy() ) ); | 222 | this, SLOT(slotCopy() ) ); |
223 | 223 | ||
224 | QAction *paste = new QAction(tr("Paste"), | 224 | QAction *paste = new QAction(tr("Paste"), |
225 | Resource::loadPixmap("paste"), QString::null, | 225 | Resource::loadPixmap("paste"), QString::null, |
226 | 0, this, 0 ); | 226 | 0, this, 0 ); |
227 | connect( paste, SIGNAL(activated() ), | 227 | connect( paste, SIGNAL(activated() ), |
228 | this, SLOT(slotPaste() ) ); | 228 | this, SLOT(slotPaste() ) ); |
229 | 229 | ||
230 | 230 | ||
231 | newCon->addTo( m_icons ); | 231 | newCon->addTo( m_icons ); |
232 | //m_setProfiles->addTo( m_icons ); | 232 | //m_setProfiles->addTo( m_icons ); |
233 | paste->addTo( m_icons ); | 233 | paste->addTo( m_icons ); |
234 | m_openKeys->addTo(m_icons); | 234 | m_openKeys->addTo(m_icons); |
235 | m_fullscreen->addTo( m_icons ); | 235 | m_fullscreen->addTo( m_icons ); |
236 | 236 | ||
237 | m_connect->setEnabled( false ); | 237 | m_connect->setEnabled( false ); |
238 | m_disconnect->setEnabled( false ); | 238 | m_disconnect->setEnabled( false ); |
239 | m_terminate->setEnabled( false ); | 239 | m_terminate->setEnabled( false ); |
240 | m_transfer->setEnabled( false ); | 240 | m_transfer->setEnabled( false ); |
241 | m_scripts->setItemEnabled(m_runScript_id, false); | 241 | m_scripts->setItemEnabled(m_runScript_id, false); |
242 | m_recordScript->setEnabled( false ); | 242 | m_recordScript->setEnabled( false ); |
243 | m_saveScript->setEnabled( false ); | 243 | m_saveScript->setEnabled( false ); |
244 | m_fullscreen->setEnabled( false ); | 244 | m_fullscreen->setEnabled( false ); |
245 | m_closewindow->setEnabled( false ); | 245 | m_closewindow->setEnabled( false ); |
246 | m_wrap->setEnabled( false ); | 246 | m_wrap->setEnabled( false ); |
247 | 247 | ||
248 | /* | 248 | /* |
249 | * connect to the menu activation | 249 | * connect to the menu activation |
250 | */ | 250 | */ |
251 | connect( m_sessionsPop, SIGNAL(activated( int ) ), | 251 | connect( m_sessionsPop, SIGNAL(activated(int) ), |
252 | this, SLOT(slotProfile( int ) ) ); | 252 | this, SLOT(slotProfile(int) ) ); |
253 | 253 | ||
254 | m_consoleWindow = new TabWidget( this, "blah"); | 254 | m_consoleWindow = new TabWidget( this, "blah"); |
255 | connect(m_consoleWindow, SIGNAL(activated(Session*) ), | 255 | connect(m_consoleWindow, SIGNAL(activated(Session*) ), |
256 | this, SLOT(slotSessionChanged(Session*) ) ); | 256 | this, SLOT(slotSessionChanged(Session*) ) ); |
257 | setCentralWidget( m_consoleWindow ); | 257 | setCentralWidget( m_consoleWindow ); |
258 | 258 | ||
259 | slotQuickLaunch(); | 259 | slotQuickLaunch(); |
260 | } | 260 | } |
261 | 261 | ||
262 | ProfileManager* MainWindow::manager() { | 262 | ProfileManager* MainWindow::manager() { |
263 | return m_manager; | 263 | return m_manager; |
264 | } | 264 | } |
265 | TabWidget* MainWindow::tabWidget() { | 265 | TabWidget* MainWindow::tabWidget() { |
266 | return m_consoleWindow; | 266 | return m_consoleWindow; |
267 | } | 267 | } |
268 | void MainWindow::populateProfiles() { | 268 | void MainWindow::populateProfiles() { |
269 | m_sessionsPop->clear(); | 269 | m_sessionsPop->clear(); |
270 | Profile::ValueList list = manager()->all(); | 270 | Profile::ValueList list = manager()->all(); |
271 | for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) { | 271 | for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) { |
272 | m_sessionsPop->insertItem( (*it).name() ); | 272 | m_sessionsPop->insertItem( (*it).name() ); |
273 | } | 273 | } |
274 | 274 | ||
275 | } | 275 | } |
276 | 276 | ||
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 979e89d..6e1e23e 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -110,52 +110,52 @@ void ProfileEditorDialog::initUI() | |||
110 | 110 | ||
111 | 111 | ||
112 | // fill the comboboxes | 112 | // fill the comboboxes |
113 | QStringList list = m_fact->connectionWidgets(); | 113 | QStringList list = m_fact->connectionWidgets(); |
114 | QStringList::Iterator it; | 114 | QStringList::Iterator it; |
115 | for (it =list.begin(); it != list.end(); ++it ) { | 115 | for (it =list.begin(); it != list.end(); ++it ) { |
116 | m_conCmb->insertItem( (*it) ); | 116 | m_conCmb->insertItem( (*it) ); |
117 | } | 117 | } |
118 | list = m_fact->terminalWidgets(); | 118 | list = m_fact->terminalWidgets(); |
119 | for (it =list.begin(); it != list.end(); ++it ) { | 119 | for (it =list.begin(); it != list.end(); ++it ) { |
120 | m_termCmb->insertItem( (*it) ); | 120 | m_termCmb->insertItem( (*it) ); |
121 | } | 121 | } |
122 | 122 | ||
123 | // load profile values | 123 | // load profile values |
124 | m_name->setText(m_prof.name()); | 124 | m_name->setText(m_prof.name()); |
125 | slotKeyActivated( "Default Keyboard" ); | 125 | slotKeyActivated( "Default Keyboard" ); |
126 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); | 126 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); |
127 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); | 127 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); |
128 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); | 128 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); |
129 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); | 129 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); |
130 | m_autoConnect->setChecked(m_prof.autoConnect()); | 130 | m_autoConnect->setChecked(m_prof.autoConnect()); |
131 | 131 | ||
132 | 132 | ||
133 | // signal and slots | 133 | // signal and slots |
134 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), | 134 | connect(m_conCmb, SIGNAL(activated(const QString&) ), |
135 | this, SLOT(slotConActivated(const QString&) ) ); | 135 | this, SLOT(slotConActivated(const QString&) ) ); |
136 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), | 136 | connect(m_termCmb, SIGNAL(activated(const QString&) ), |
137 | this, SLOT(slotTermActivated(const QString& ) ) ); | 137 | this, SLOT(slotTermActivated(const QString&) ) ); |
138 | 138 | ||
139 | } | 139 | } |
140 | 140 | ||
141 | ProfileEditorDialog::~ProfileEditorDialog() { | 141 | ProfileEditorDialog::~ProfileEditorDialog() { |
142 | 142 | ||
143 | } | 143 | } |
144 | void ProfileEditorDialog::accept() | 144 | void ProfileEditorDialog::accept() |
145 | { | 145 | { |
146 | if(profName().isEmpty()) | 146 | if(profName().isEmpty()) |
147 | { | 147 | { |
148 | QMessageBox::information(this, | 148 | QMessageBox::information(this, |
149 | QObject::tr("Invalid profile"), | 149 | QObject::tr("Invalid profile"), |
150 | QObject::tr("Please enter a profile name.")); | 150 | QObject::tr("Please enter a profile name.")); |
151 | return; | 151 | return; |
152 | } | 152 | } |
153 | // Save profile and plugin profile | 153 | // Save profile and plugin profile |
154 | //if(plugin_plugin) plugin_plugin->save(); | 154 | //if(plugin_plugin) plugin_plugin->save(); |
155 | 155 | ||
156 | // Save general values | 156 | // Save general values |
157 | m_prof.setName( profName() ); | 157 | m_prof.setName( profName() ); |
158 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); | 158 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); |
159 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); | 159 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); |
160 | m_prof.setAutoConnect( m_autoConnect->isChecked() ); | 160 | m_prof.setAutoConnect( m_autoConnect->isChecked() ); |
161 | 161 | ||
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp index 1034ede..b7f14c5 100644 --- a/noncore/apps/opie-console/session.cpp +++ b/noncore/apps/opie-console/session.cpp | |||
@@ -37,50 +37,50 @@ EmulationHandler* Session::emulationHandler() { | |||
37 | return m_emu; | 37 | return m_emu; |
38 | } | 38 | } |
39 | QWidget* Session::widget() { | 39 | QWidget* Session::widget() { |
40 | if (!m_emu ) | 40 | if (!m_emu ) |
41 | return 0l; | 41 | return 0l; |
42 | 42 | ||
43 | return m_emu->widget(); | 43 | return m_emu->widget(); |
44 | } | 44 | } |
45 | Profile Session::profile()const { | 45 | Profile Session::profile()const { |
46 | return m_prof; | 46 | return m_prof; |
47 | } | 47 | } |
48 | /* | 48 | /* |
49 | WidgetLayer* Session::emulationWidget() { | 49 | WidgetLayer* Session::emulationWidget() { |
50 | return m_widLay; | 50 | return m_widLay; |
51 | } | 51 | } |
52 | */ | 52 | */ |
53 | void Session::connect() { | 53 | void Session::connect() { |
54 | if ( !m_layer || !m_emu ) | 54 | if ( !m_layer || !m_emu ) |
55 | return; | 55 | return; |
56 | 56 | ||
57 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), | 57 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), |
58 | m_emu, SLOT(recv(const QByteArray&) ) ); | 58 | m_emu, SLOT(recv(const QByteArray&) ) ); |
59 | QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), | 59 | QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), |
60 | m_layer, SLOT(send(const QByteArray&) ) ); | 60 | m_layer, SLOT(send(const QByteArray&) ) ); |
61 | QObject::connect(m_emu, SIGNAL(changeSize(int, int) ), | 61 | QObject::connect(m_emu, SIGNAL(changeSize(int,int) ), |
62 | m_layer, SLOT(setSize(int, int) ) ); | 62 | m_layer, SLOT(setSize(int,int) ) ); |
63 | } | 63 | } |
64 | 64 | ||
65 | void Session::disconnect() { | 65 | void Session::disconnect() { |
66 | 66 | ||
67 | if ( !m_layer || !m_emu ) | 67 | if ( !m_layer || !m_emu ) |
68 | return; | 68 | return; |
69 | 69 | ||
70 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), | 70 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), |
71 | m_emu, SLOT(recv(const QByteArray&) ) ); | 71 | m_emu, SLOT(recv(const QByteArray&) ) ); |
72 | QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), | 72 | QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), |
73 | m_layer, SLOT(send(const QByteArray&) ) ); | 73 | m_layer, SLOT(send(const QByteArray&) ) ); |
74 | } | 74 | } |
75 | 75 | ||
76 | void Session::setName( const QString& na){ | 76 | void Session::setName( const QString& na){ |
77 | m_name = na; | 77 | m_name = na; |
78 | } | 78 | } |
79 | 79 | ||
80 | void Session::setWidgetStack( QWidgetStack* wid ) { | 80 | void Session::setWidgetStack( QWidgetStack* wid ) { |
81 | delete m_emu; | 81 | delete m_emu; |
82 | m_emu = 0l; | 82 | m_emu = 0l; |
83 | delete m_widget; | 83 | delete m_widget; |
84 | /* the EmulationLayer was destroyed... */ | 84 | /* the EmulationLayer was destroyed... */ |
85 | 85 | ||
86 | m_widget = wid; | 86 | m_widget = wid; |
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index c47e73e..2f82417 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp | |||
@@ -4,81 +4,81 @@ | |||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <sys/termios.h> | 5 | #include <sys/termios.h> |
6 | 6 | ||
7 | 7 | ||
8 | 8 | ||
9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) | 9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) |
10 | { | 10 | { |
11 | } | 11 | } |
12 | 12 | ||
13 | SzTransfer::~SzTransfer() { | 13 | SzTransfer::~SzTransfer() { |
14 | } | 14 | } |
15 | 15 | ||
16 | void SzTransfer::sendFile(const QFile& file) { | 16 | void SzTransfer::sendFile(const QFile& file) { |
17 | 17 | ||
18 | sendFile(file.name()); | 18 | sendFile(file.name()); |
19 | } | 19 | } |
20 | 20 | ||
21 | void SzTransfer::sendFile(const QString& file) { | 21 | void SzTransfer::sendFile(const QString& file) { |
22 | 22 | ||
23 | //setcbreak(2); /* raw no echo */ | 23 | //setcbreak(2); /* raw no echo */ |
24 | 24 | ||
25 | proc = new OProcess; | 25 | proc = new OProcess; |
26 | *proc << "sz"; | 26 | *proc << "sz"; |
27 | *proc << "-v" << "-v" << "-b" << file; | 27 | *proc << "-v" << "-v" << "-b" << file; |
28 | connect(proc, SIGNAL(processExited(OProcess *)), | 28 | connect(proc, SIGNAL(processExited(OProcess*)), |
29 | this, SLOT(sent())); | 29 | this, SLOT(sent())); |
30 | connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), | 30 | connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)), |
31 | this, SLOT(SzReceivedStdout(OProcess *, char *, int))); | 31 | this, SLOT(SzReceivedStdout(OProcess*,char*,int))); |
32 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), | 32 | connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)), |
33 | this, SLOT(SzReceivedStderr(OProcess *, char *, int))); | 33 | this, SLOT(SzReceivedStderr(OProcess*,char*,int))); |
34 | connect(layer(), SIGNAL(received(const QByteArray &)), | 34 | connect(layer(), SIGNAL(received(const QByteArray&)), |
35 | this, SLOT(receivedStdin(const QByteArray &))); | 35 | this, SLOT(receivedStdin(const QByteArray&))); |
36 | proc->start(OProcess::NotifyOnExit, OProcess::All); | 36 | proc->start(OProcess::NotifyOnExit, OProcess::All); |
37 | 37 | ||
38 | } | 38 | } |
39 | 39 | ||
40 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { | 40 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { |
41 | 41 | ||
42 | qWarning("recieved from sz on stdout %d bytes", buflen); | 42 | qWarning("recieved from sz on stdout %d bytes", buflen); |
43 | 43 | ||
44 | QByteArray data(buflen); | 44 | QByteArray data(buflen); |
45 | data.fill(*buffer, buflen); | 45 | data.fill(*buffer, buflen); |
46 | for (uint i = 0; i < data.count(); i++ ) { | 46 | for (uint i = 0; i < data.count(); i++ ) { |
47 | printf("%c", buffer[i] ); | 47 | printf("%c", buffer[i] ); |
48 | } | 48 | } |
49 | printf("\n"); | 49 | printf("\n"); |
50 | 50 | ||
51 | // send out through the io layer | 51 | // send out through the io layer |
52 | layer()->send(data); | 52 | layer()->send(data); |
53 | } | 53 | } |
54 | 54 | ||
55 | void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { | 55 | void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { |
56 | 56 | ||
57 | // parse and show data in a progress dialog/widget | 57 | // parse and show data in a progress dialog/widget |
58 | printf("stderr:\n"); | 58 | printf("stderr:\n"); |
59 | //for (int i = 0; i < length; i++) | 59 | //for (int i = 0; i < length; i++) |
60 | // printf("%c", buffer[i]); | 60 | // printf("%c", buffer[i]); |
61 | //printf("\n"); | 61 | //printf("\n"); |
62 | } | 62 | } |
63 | 63 | ||
64 | void SzTransfer::receivedStdin(const QByteArray &data) { | 64 | void SzTransfer::receivedStdin(const QByteArray &data) { |
65 | 65 | ||
66 | qWarning("recieved from io_serial %d bytes", data.size()); | 66 | qWarning("recieved from io_serial %d bytes", data.size()); |
67 | 67 | ||
68 | // recieved data from the io layer goes to sz | 68 | // recieved data from the io layer goes to sz |
69 | proc->writeStdin(data.data(), data.size()); | 69 | proc->writeStdin(data.data(), data.size()); |
70 | 70 | ||
71 | } | 71 | } |
72 | 72 | ||
73 | void SzTransfer::sent() { | 73 | void SzTransfer::sent() { |
74 | 74 | ||
75 | qWarning("sent file"); | 75 | qWarning("sent file"); |
76 | 76 | ||
77 | //setcbreak(0); /* default */ | 77 | //setcbreak(0); /* default */ |
78 | 78 | ||
79 | 79 | ||
80 | delete proc; | 80 | delete proc; |
81 | disconnect(layer(), SIGNAL(received(const QByteArray &)), | 81 | disconnect(layer(), SIGNAL(received(const QByteArray&)), |
82 | this, SLOT(receivedStdin(const QByteArray &))); | 82 | this, SLOT(receivedStdin(const QByteArray&))); |
83 | 83 | ||
84 | } | 84 | } |
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index 4a7202d..b1725db 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp | |||
@@ -5,49 +5,49 @@ | |||
5 | 5 | ||
6 | #include <qmultilineedit.h> | 6 | #include <qmultilineedit.h> |
7 | #include <qsocketnotifier.h> | 7 | #include <qsocketnotifier.h> |
8 | 8 | ||
9 | #include "../profile.h" | 9 | #include "../profile.h" |
10 | #include "../io_serial.h" | 10 | #include "../io_serial.h" |
11 | #include "../filetransfer.h" | 11 | #include "../filetransfer.h" |
12 | #include "../filereceive.h" | 12 | #include "../filereceive.h" |
13 | 13 | ||
14 | #include <opie2/oprocess.h> | 14 | #include <opie2/oprocess.h> |
15 | 15 | ||
16 | #include "senderui.h" | 16 | #include "senderui.h" |
17 | 17 | ||
18 | SenderUI::SenderUI() | 18 | SenderUI::SenderUI() |
19 | : Sender() { | 19 | : Sender() { |
20 | 20 | ||
21 | /* we do that manually */ | 21 | /* we do that manually */ |
22 | Profile prof; | 22 | Profile prof; |
23 | QString str = "/dev/bty0"; | 23 | QString str = "/dev/bty0"; |
24 | prof.writeEntry("Device",str ); | 24 | prof.writeEntry("Device",str ); |
25 | prof.writeEntry("Baud", 19200 ); | 25 | prof.writeEntry("Baud", 19200 ); |
26 | 26 | ||
27 | qWarning("prof " + prof.readEntry("Device") + " " + str); | 27 | qWarning("prof " + prof.readEntry("Device") + " " + str); |
28 | ser = new IOSerial(prof); | 28 | ser = new IOSerial(prof); |
29 | connect(ser, SIGNAL(received(const QByteArray& ) ), | 29 | connect(ser, SIGNAL(received(const QByteArray&) ), |
30 | this, SLOT(got(const QByteArray&) ) ); | 30 | this, SLOT(got(const QByteArray&) ) ); |
31 | 31 | ||
32 | if ( ser->open() ) | 32 | if ( ser->open() ) |
33 | qWarning("opened!!!"); | 33 | qWarning("opened!!!"); |
34 | else | 34 | else |
35 | qWarning("could not open"); | 35 | qWarning("could not open"); |
36 | 36 | ||
37 | 37 | ||
38 | } | 38 | } |
39 | SenderUI::~SenderUI() { | 39 | SenderUI::~SenderUI() { |
40 | 40 | ||
41 | } | 41 | } |
42 | void SenderUI::slotSendFile() { | 42 | void SenderUI::slotSendFile() { |
43 | 43 | ||
44 | sz = new FileTransfer(FileTransfer::SY, ser); | 44 | sz = new FileTransfer(FileTransfer::SY, ser); |
45 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); | 45 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); |
46 | 46 | ||
47 | connect (sz, SIGNAL(sent()), | 47 | connect (sz, SIGNAL(sent()), |
48 | this, SLOT(fileTransComplete())); | 48 | this, SLOT(fileTransComplete())); |
49 | } | 49 | } |
50 | 50 | ||
51 | void SenderUI::slotSend() { | 51 | void SenderUI::slotSend() { |
52 | QCString str = MultiLineEdit1->text().utf8(); | 52 | QCString str = MultiLineEdit1->text().utf8(); |
53 | qWarning("sending: %s", str.data() ); | 53 | qWarning("sending: %s", str.data() ); |
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index 30e7caf..d494a6c 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp | |||
@@ -104,61 +104,61 @@ void TransferDialog::slotFilename() | |||
104 | 104 | ||
105 | void TransferDialog::slotTransfer() | 105 | void TransferDialog::slotTransfer() |
106 | { | 106 | { |
107 | if((m_transfermode == id_send) && (filename->text().isEmpty())) | 107 | if((m_transfermode == id_send) && (filename->text().isEmpty())) |
108 | { | 108 | { |
109 | QMessageBox::information(this, | 109 | QMessageBox::information(this, |
110 | QObject::tr("Attention"), | 110 | QObject::tr("Attention"), |
111 | QObject::tr("No file has been specified.")); | 111 | QObject::tr("No file has been specified.")); |
112 | return; | 112 | return; |
113 | } | 113 | } |
114 | 114 | ||
115 | ok->setEnabled(false); | 115 | ok->setEnabled(false); |
116 | 116 | ||
117 | cleanup(); | 117 | cleanup(); |
118 | m_autocleanup = 0; | 118 | m_autocleanup = 0; |
119 | 119 | ||
120 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); | 120 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); |
121 | else statusbar->setText(QObject::tr("Receiving...")); | 121 | else statusbar->setText(QObject::tr("Receiving...")); |
122 | 122 | ||
123 | if(m_transfermode == id_send) | 123 | if(m_transfermode == id_send) |
124 | { | 124 | { |
125 | m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); | 125 | m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); |
126 | m_lay->sendFile(filename->text()); | 126 | m_lay->sendFile(filename->text()); |
127 | 127 | ||
128 | connect(m_lay, SIGNAL(progress(const QString&, int, int, int, int, int)), | 128 | connect(m_lay, SIGNAL(progress(const QString&,int,int,int,int,int)), |
129 | SLOT(slotProgress(const QString&, int, int, int, int, int))); | 129 | SLOT(slotProgress(const QString&,int,int,int,int,int))); |
130 | connect(m_lay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); | 130 | connect(m_lay, SIGNAL(error(int,const QString&)), SLOT(slotError(int,const QString&))); |
131 | connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); | 131 | connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer()); | 135 | m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer()); |
136 | m_recvlay->receive(); | 136 | m_recvlay->receive(); |
137 | 137 | ||
138 | connect(m_recvlay, SIGNAL(progress(const QString&, int, int, int, int, int)), | 138 | connect(m_recvlay, SIGNAL(progress(const QString&,int,int,int,int,int)), |
139 | SLOT(slotProgress(const QString&, int, int, int, int, int))); | 139 | SLOT(slotProgress(const QString&,int,int,int,int,int))); |
140 | connect(m_recvlay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); | 140 | connect(m_recvlay, SIGNAL(error(int,const QString&)), SLOT(slotError(int,const QString&))); |
141 | connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&))); | 141 | connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&))); |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | void TransferDialog::cleanup() | 145 | void TransferDialog::cleanup() |
146 | { | 146 | { |
147 | if(m_lay) | 147 | if(m_lay) |
148 | { | 148 | { |
149 | m_lay->cancel(); | 149 | m_lay->cancel(); |
150 | delete m_lay; | 150 | delete m_lay; |
151 | m_lay = 0l; | 151 | m_lay = 0l; |
152 | } | 152 | } |
153 | if(m_recvlay) | 153 | if(m_recvlay) |
154 | { | 154 | { |
155 | m_recvlay->cancel(); | 155 | m_recvlay->cancel(); |
156 | delete m_recvlay; | 156 | delete m_recvlay; |
157 | m_recvlay = 0l; | 157 | m_recvlay = 0l; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | void TransferDialog::slotCancel() | 161 | void TransferDialog::slotCancel() |
162 | { | 162 | { |
163 | ok->setEnabled(true); | 163 | ok->setEnabled(true); |
164 | statusbar->setText(QObject::tr("Ready")); | 164 | statusbar->setText(QObject::tr("Ready")); |