author | mickeyl <mickeyl> | 2005-06-11 12:22:30 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-11 12:22:30 (UTC) |
commit | d13a1a3345270ea71215d421627665a40f16454c (patch) (unidiff) | |
tree | 58aa21f57fd6d08547756a9e68e78282ce554568 | |
parent | 9fe80ebf4fbe9b31d9f91a33e4cfc163b7236a62 (diff) | |
download | opie-d13a1a3345270ea71215d421627665a40f16454c.zip opie-d13a1a3345270ea71215d421627665a40f16454c.tar.gz opie-d13a1a3345270ea71215d421627665a40f16454c.tar.bz2 |
- read default profile fixed font specs from qpe.conf, if profile doesn't exist
- fix initial background color
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 20 |
2 files changed, 18 insertions, 3 deletions
@@ -1,78 +1,79 @@ | |||
1 | 2005-??-??Opie 1.2.1 | 1 | 2005-??-??Opie 1.2.1 |
2 | 2 | ||
3 | 3 | ||
4 | New Features | 4 | New Features |
5 | ------------ | 5 | ------------ |
6 | * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) | 6 | * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) |
7 | * Opie-Reader: Support for document formats ArriereGo and Reb, add flite output (tim,pohly) | 7 | * Opie-Reader: Support for document formats ArriereGo and Reb, add flite output (tim,pohly) |
8 | * Opie-Networksettings: Add support for wlan-ng devices and improve WEP handling (Dirk Opfer) | 8 | * Opie-Networksettings: Add support for wlan-ng devices and improve WEP handling (Dirk Opfer) |
9 | * Wellenreiter: Remove Joining networks - use OpieStumbler for that (mickeyl) | 9 | * Wellenreiter: Remove Joining networks - use OpieStumbler for that (mickeyl) |
10 | * Opie-Mobilemsg has gone unsupported - it never really worked and there will be a replacement (mickeyl) | 10 | * Opie-Mobilemsg has gone unsupported - it never really worked and there will be a replacement (mickeyl) |
11 | * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl) | 11 | * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl) |
12 | * Checkbook - added configuration option to use smaller font for checkbook transaction tab (hrw) | 12 | * Checkbook - added configuration option to use smaller font for checkbook transaction tab (hrw) |
13 | * ZSafe - make UI conform to Opie standards (drw) | 13 | * ZSafe - make UI conform to Opie standards (drw) |
14 | * Today Addressbook plugin - fix configuration to show/not show birthdays, use checkboxes for selection (hrw) | 14 | * Today Addressbook plugin - fix configuration to show/not show birthdays, use checkboxes for selection (hrw) |
15 | * Opie-Console: read initial fixed font configuration from qpe.conf (mickeyl) | ||
15 | 16 | ||
16 | Fixed Bugs | 17 | Fixed Bugs |
17 | ---------- | 18 | ---------- |
18 | * #1476 - Wrong order of application entries in the O-menu (skyhusker) | 19 | * #1476 - Wrong order of application entries in the O-menu (skyhusker) |
19 | * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller) | 20 | * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller) |
20 | * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) | 21 | * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) |
21 | * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) | 22 | * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) |
22 | * #1665 - Opie-IRC diplays the host prepended to the message when peer is using and ipv6 address (skyhusker) | 23 | * #1665 - Opie-IRC diplays the host prepended to the message when peer is using and ipv6 address (skyhusker) |
23 | * #1666 - Opie-IRC does not allow to add !channels in config asautojoin ones (skyhusker) | 24 | * #1666 - Opie-IRC does not allow to add !channels in config asautojoin ones (skyhusker) |
24 | * #1667 - Opie-IRC does not show messages from !channel (skyhusker) | 25 | * #1667 - Opie-IRC does not show messages from !channel (skyhusker) |
25 | * n.a.- always show volume and wireless applet popups inside visible screen (deller) | 26 | * n.a.- always show volume and wireless applet popups inside visible screen (deller) |
26 | * n.a. - scale O-Menu-Applets appropriately (mickeyl) | 27 | * n.a. - scale O-Menu-Applets appropriately (mickeyl) |
27 | * n.a.- libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) | 28 | * n.a.- libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) |
28 | * n.a.- Wellenreiter: relax WE version matching test a bit (mickeyl) | 29 | * n.a.- Wellenreiter: relax WE version matching test a bit (mickeyl) |
29 | * n.a.- scale BluezApplet appropriately and use larger icons (mickeyl) | 30 | * n.a.- scale BluezApplet appropriately and use larger icons (mickeyl) |
30 | * n.a.- memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) | 31 | * n.a.- memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) |
31 | * n.a. - networksettings: ignore hostap control interfaces wifi* (mickeyl) | 32 | * n.a. - networksettings: ignore hostap control interfaces wifi* (mickeyl) |
32 | * n.a. - Today Addressbook plugin fix configuration to show/not show birthdays, use checkboxes for selection (hrw) | 33 | * n.a. - Today Addressbook plugin fix configuration to show/not show birthdays, use checkboxes for selection (hrw) |
33 | 34 | ||
34 | Internal | 35 | Internal |
35 | -------- | 36 | -------- |
36 | * Make BluezApplet use OTaskbarApplet (mickeyl) | 37 | * Make BluezApplet use OTaskbarApplet (mickeyl) |
37 | * libopiecore: rewrite OFileNotification to use the Linux 2.6 inotify interface (mickeyl) | 38 | * libopiecore: rewrite OFileNotification to use the Linux 2.6 inotify interface (mickeyl) |
38 | * libopiecore: add ODirNotification - recursive directory notifications (mickeyl) | 39 | * libopiecore: add ODirNotification - recursive directory notifications (mickeyl) |
39 | * libopienet: Skip hostap control interfaces 'wifi' and improve robustness in ONetworkInterface (mickeyl) | 40 | * libopienet: Skip hostap control interfaces 'wifi' and improve robustness in ONetworkInterface (mickeyl) |
40 | * libopieui: Remove OVersatileView and OVersatileViewItem (mickeyl) | 41 | * libopieui: Remove OVersatileView and OVersatileViewItem (mickeyl) |
41 | * libopienet: Miscellaneous API cleanups (mickeyl) | 42 | * libopienet: Miscellaneous API cleanups (mickeyl) |
42 | * libopiecore: Add linux pcmcia system abstraction classes (mickeyl) | 43 | * libopiecore: Add linux pcmcia system abstraction classes (mickeyl) |
43 | 44 | ||
44 | 2005-03-25Opie 1.2.0 | 45 | 2005-03-25Opie 1.2.0 |
45 | 46 | ||
46 | Fixed Bugs | 47 | Fixed Bugs |
47 | ---------- | 48 | ---------- |
48 | * #1613 - AdvancedFM - scale toolbar icons appropriately (drw) | 49 | * #1613 - AdvancedFM - scale toolbar icons appropriately (drw) |
49 | * #1620 - OFileSelector - show the button on press and not on press on hold (alwin) | 50 | * #1620 - OFileSelector - show the button on press and not on press on hold (alwin) |
50 | * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke) | 51 | * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke) |
51 | * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw) | 52 | * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw) |
52 | * n.a.- make qpeglobal.h include qglobal.h (zecke) | 53 | * n.a.- make qpeglobal.h include qglobal.h (zecke) |
53 | 54 | ||
54 | 2005-03-20Opie 1.2.0-rc1 | 55 | 2005-03-20Opie 1.2.0-rc1 |
55 | 56 | ||
56 | 57 | ||
57 | New Features | 58 | New Features |
58 | ------------ | 59 | ------------ |
59 | * Launcher: Support a static background pixmap (mickeyl) | 60 | * Launcher: Support a static background pixmap (mickeyl) |
60 | * LauncherSettings: Choose whether to have a static background pixmap (mickeyl) | 61 | * LauncherSettings: Choose whether to have a static background pixmap (mickeyl) |
61 | * PackageManager supports the 'lists_dir' ipkg configuration option (drw) | 62 | * PackageManager supports the 'lists_dir' ipkg configuration option (drw) |
62 | * Added hi-res inline images for large resolution devices (drw) | 63 | * Added hi-res inline images for large resolution devices (drw) |
63 | * Improved launcher icons for consistency (ar) | 64 | * Improved launcher icons for consistency (ar) |
64 | * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin) | 65 | * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin) |
65 | 66 | ||
66 | Fixed Bugs | 67 | Fixed Bugs |
67 | ---------- | 68 | ---------- |
68 | * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers) | 69 | * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers) |
69 | * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw) | 70 | * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw) |
70 | * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp) | 71 | * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp) |
71 | * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke) | 72 | * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke) |
72 | * #1482 - Fix double '/' in paths (zecke) | 73 | * #1482 - Fix double '/' in paths (zecke) |
73 | * #1536 - Autosave of custom locations in opie backup (ar) | 74 | * #1536 - Autosave of custom locations in opie backup (ar) |
74 | * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke) | 75 | * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke) |
75 | * #1540 - Implemented deletion of DocLnks in opie-eye (zecke) | 76 | * #1540 - Implemented deletion of DocLnks in opie-eye (zecke) |
76 | * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw) | 77 | * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw) |
77 | * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke) | 78 | * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke) |
78 | * #1554 - Fixed Opie-Console name in .desktop file (mickeyl) | 79 | * #1554 - Fixed Opie-Console name in .desktop file (mickeyl) |
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 986ae8d..2087f57 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp | |||
@@ -1,116 +1,130 @@ | |||
1 | #include "TEmuVt102.h" | 1 | #include "TEmuVt102.h" |
2 | #include "profile.h" | 2 | #include "profile.h" |
3 | #include "emulation_handler.h" | 3 | #include "emulation_handler.h" |
4 | #include "script.h" | 4 | #include "script.h" |
5 | #include "logger.h" | 5 | #include "logger.h" |
6 | 6 | ||
7 | /* OPIE */ | ||
8 | #include <qpe/config.h> | ||
9 | |||
10 | /* QT */ | ||
7 | #include <qfile.h> | 11 | #include <qfile.h> |
8 | #include <qtextstream.h> | 12 | #include <qtextstream.h> |
9 | 13 | ||
10 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) | 14 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) |
11 | : QObject(0, name ) | 15 | : QObject(0, name ) |
12 | { | 16 | { |
13 | m_teWid = new TEWidget( parent, "TerminalMain"); | 17 | m_teWid = new TEWidget( parent, "TerminalMain"); |
14 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) | 18 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) |
15 | // use setWrapAt(80) for normal console with scrollbar | 19 | // use setWrapAt(80) for normal console with scrollbar |
16 | setWrap(prof.readNumEntry("Wrap", 80) ? 0 : 80); | 20 | setWrap(prof.readNumEntry("Wrap", 80) ? 0 : 80); |
17 | m_teWid->setMinimumSize(150, 70 ); | 21 | m_teWid->setMinimumSize(150, 70 ); |
18 | m_script = 0; | 22 | m_script = 0; |
19 | m_log = 0; | 23 | m_log = 0; |
20 | parent->resize( m_teWid->calcSize(80, 24 ) ); | 24 | parent->resize( m_teWid->calcSize(80, 24 ) ); |
21 | m_teEmu = new TEmuVt102(m_teWid ); | 25 | m_teEmu = new TEmuVt102(m_teWid ); |
22 | 26 | ||
23 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), | 27 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), |
24 | this, SIGNAL(changeSize(int,int) ) ); | 28 | this, SIGNAL(changeSize(int,int) ) ); |
25 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), | 29 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), |
26 | this, SLOT(recvEmulation(const char*,int) ) ); | 30 | this, SLOT(recvEmulation(const char*,int) ) ); |
27 | m_teEmu->setConnect( true ); | 31 | m_teEmu->setConnect( true ); |
28 | m_teEmu->setHistory( TRUE ); | 32 | m_teEmu->setHistory( TRUE ); |
29 | load( prof ); | 33 | load( prof ); |
30 | 34 | ||
31 | 35 | ||
32 | 36 | ||
33 | } | 37 | } |
34 | TEmulation* EmulationHandler::emulation() { | 38 | TEmulation* EmulationHandler::emulation() { |
35 | return m_teEmu; | 39 | return m_teEmu; |
36 | } | 40 | } |
37 | EmulationHandler::~EmulationHandler() { | 41 | EmulationHandler::~EmulationHandler() { |
38 | if (isRecording()) | 42 | if (isRecording()) |
39 | clearScript(); | 43 | clearScript(); |
40 | delete m_teEmu; | 44 | delete m_teEmu; |
41 | delete m_teWid; | 45 | delete m_teWid; |
42 | delete m_log; | 46 | delete m_log; |
43 | } | 47 | } |
44 | 48 | ||
45 | void EmulationHandler::load( const Profile& prof) { | 49 | void EmulationHandler::load( const Profile& prof) { |
46 | 50 | ||
47 | // m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); | 51 | // try to read the fontconfig from the profile |
48 | QFont font( prof.readEntry("Font"), prof.readNumEntry( "FontSize" ), QFont::Normal ); | 52 | QString aFont = prof.readEntry( "Font" ); |
53 | int aFontSize = prof.readNumEntry( "FontSize" ); | ||
54 | // use defaults from qpe.conf if no profile yet | ||
55 | if ( ( aFontSize == -1 ) || ( aFont == QString::null ) ) | ||
56 | { | ||
57 | Config c( "qpe" ); | ||
58 | c.setGroup( "Appearance" ); | ||
59 | aFont = c.readEntry( "FixedFontFamily", "Fixed" ); | ||
60 | aFontSize = c.readNumEntry( "FixedFontSize", 7 ); | ||
61 | } | ||
62 | QFont font( aFont, aFontSize ); | ||
49 | font.setFixedPitch( TRUE ); | 63 | font.setFixedPitch( TRUE ); |
50 | m_teWid->setVTFont( font ); | 64 | m_teWid->setVTFont( font ); |
51 | 65 | ||
52 | int num = prof.readNumEntry("Color"); | 66 | int num = prof.readNumEntry("Color", 0); |
53 | setColor( foreColor(num), backColor(num) ); | 67 | setColor( foreColor(num), backColor(num) ); |
54 | m_teWid->setBackgroundColor(backColor(num) ); | 68 | m_teWid->setBackgroundColor(backColor(num) ); |
55 | 69 | ||
56 | int term = prof.readNumEntry("Terminal", 0) ; | 70 | int term = prof.readNumEntry("Terminal", 0) ; |
57 | switch(term) { | 71 | switch(term) { |
58 | default: | 72 | default: |
59 | case Profile::VT102: | 73 | case Profile::VT102: |
60 | case Profile::VT100: | 74 | case Profile::VT100: |
61 | m_teEmu->setKeytrans("vt100.keytab"); | 75 | m_teEmu->setKeytrans("vt100.keytab"); |
62 | break; | 76 | break; |
63 | case Profile::Linux: | 77 | case Profile::Linux: |
64 | m_teEmu->setKeytrans("linux.keytab"); | 78 | m_teEmu->setKeytrans("linux.keytab"); |
65 | break; | 79 | break; |
66 | case Profile::XTerm: | 80 | case Profile::XTerm: |
67 | m_teEmu->setKeytrans("default.Keytab"); | 81 | m_teEmu->setKeytrans("default.Keytab"); |
68 | break; | 82 | break; |
69 | } | 83 | } |
70 | } | 84 | } |
71 | void EmulationHandler::recv( const QByteArray& ar) { | 85 | void EmulationHandler::recv( const QByteArray& ar) { |
72 | m_teEmu->onRcvBlock(ar.data(), ar.count() ); | 86 | m_teEmu->onRcvBlock(ar.data(), ar.count() ); |
73 | if ( isLogging() ) { | 87 | if ( isLogging() ) { |
74 | m_log->append( ar ); | 88 | m_log->append( ar ); |
75 | } | 89 | } |
76 | } | 90 | } |
77 | 91 | ||
78 | void EmulationHandler::recvEmulation(const char* src, int len ) { | 92 | void EmulationHandler::recvEmulation(const char* src, int len ) { |
79 | QByteArray ar(len); | 93 | QByteArray ar(len); |
80 | 94 | ||
81 | memcpy(ar.data(), src, sizeof(char) * len ); | 95 | memcpy(ar.data(), src, sizeof(char) * len ); |
82 | if (isRecording()) | 96 | if (isRecording()) |
83 | m_script->append(ar); | 97 | m_script->append(ar); |
84 | emit send(ar); | 98 | emit send(ar); |
85 | } | 99 | } |
86 | 100 | ||
87 | 101 | ||
88 | QWidget* EmulationHandler::widget() { | 102 | QWidget* EmulationHandler::widget() { |
89 | return m_teWid; | 103 | return m_teWid; |
90 | } | 104 | } |
91 | /* | 105 | /* |
92 | * allocate a new table of colors | 106 | * allocate a new table of colors |
93 | */ | 107 | */ |
94 | void EmulationHandler::setColor( const QColor& fore, const QColor& back ) { | 108 | void EmulationHandler::setColor( const QColor& fore, const QColor& back ) { |
95 | ColorEntry table[TABLE_COLORS]; | 109 | ColorEntry table[TABLE_COLORS]; |
96 | const ColorEntry *defaultCt = m_teWid->getdefaultColorTable(); | 110 | const ColorEntry *defaultCt = m_teWid->getdefaultColorTable(); |
97 | 111 | ||
98 | for (int i = 0; i < TABLE_COLORS; i++ ) { | 112 | for (int i = 0; i < TABLE_COLORS; i++ ) { |
99 | if ( i == 0 || i == 10 ) { | 113 | if ( i == 0 || i == 10 ) { |
100 | table[i].color = fore; | 114 | table[i].color = fore; |
101 | }else if ( i == 1 || i == 11 ) { | 115 | }else if ( i == 1 || i == 11 ) { |
102 | table[i].color = back; | 116 | table[i].color = back; |
103 | table[i].transparent = 0; | 117 | table[i].transparent = 0; |
104 | }else { | 118 | }else { |
105 | table[i].color = defaultCt[i].color; | 119 | table[i].color = defaultCt[i].color; |
106 | } | 120 | } |
107 | } | 121 | } |
108 | m_teWid->setColorTable(table ); | 122 | m_teWid->setColorTable(table ); |
109 | m_teWid->update(); | 123 | m_teWid->update(); |
110 | } | 124 | } |
111 | QFont EmulationHandler::font( int id ) { | 125 | QFont EmulationHandler::font( int id ) { |
112 | QString name; | 126 | QString name; |
113 | int size = 0; | 127 | int size = 0; |
114 | switch(id ) { | 128 | switch(id ) { |
115 | default: // fall through | 129 | default: // fall through |
116 | case 0: | 130 | case 0: |