author | sandman <sandman> | 2002-12-23 03:24:31 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-23 03:24:31 (UTC) |
commit | e91351d2c22ab041b85f49e243e1f510edf7984e (patch) (unidiff) | |
tree | c068e1a8ad21db9995f2a3c5a2d97bb983fa04a9 /core/settings/button/remapdlg.cpp | |
parent | 8bd190d162b538e4226e830f442450f5a95f4434 (diff) | |
download | opie-e91351d2c22ab041b85f49e243e1f510edf7984e.zip opie-e91351d2c22ab041b85f49e243e1f510edf7984e.tar.gz opie-e91351d2c22ab041b85f49e243e1f510edf7984e.tar.bz2 |
small bugfixes and speedup
Diffstat (limited to 'core/settings/button/remapdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/button/remapdlg.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp index 511d0e7..a251bd4 100644 --- a/core/settings/button/remapdlg.cpp +++ b/core/settings/button/remapdlg.cpp | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <qlistview.h> | 1 | #include <qlistview.h> |
2 | #include <qlabel.h> | 2 | #include <qlabel.h> |
3 | #include <qcombobox.h> | 3 | #include <qcombobox.h> |
4 | #include <qtimer.h> | ||
4 | 5 | ||
5 | #include "remapdlg.h" | 6 | #include "remapdlg.h" |
6 | #include "buttonutils.h" | 7 | #include "buttonutils.h" |
@@ -46,6 +47,11 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c | |||
46 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) | 47 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) |
47 | { | 48 | { |
48 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); | 49 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); |
50 | |||
51 | m_current = 0; | ||
52 | |||
53 | static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 }; | ||
54 | w_channel-> insertStrList ((const char **) def_channels ); | ||
49 | 55 | ||
50 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); | 56 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); |
51 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); | 57 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); |
@@ -59,23 +65,30 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c | |||
59 | ButtonUtils::inst ( )-> insertActions ( it ); | 65 | ButtonUtils::inst ( )-> insertActions ( it ); |
60 | it-> setOpen ( true ); | 66 | it-> setOpen ( true ); |
61 | 67 | ||
62 | it = new NoSortItem ( w_list, 4, tr( "Show" )); | 68 | m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); |
63 | ButtonUtils::inst ( )-> insertAppLnks ( it ); | ||
64 | 69 | ||
65 | m_current = m_map_custom; | 70 | m_current = m_map_custom; |
66 | w_list-> setCurrentItem ( m_current ); | 71 | w_list-> setCurrentItem ( m_current ); |
67 | 72 | ||
68 | static const char * const def_channels [] = { | 73 | QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); |
69 | "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 | ||
70 | }; | ||
71 | |||
72 | w_channel-> insertStrList ((const char **) def_channels ); | ||
73 | } | 74 | } |
74 | 75 | ||
75 | RemapDlg::~RemapDlg ( ) | 76 | RemapDlg::~RemapDlg ( ) |
76 | { | 77 | { |
77 | } | 78 | } |
78 | 79 | ||
80 | void RemapDlg::delayedInit ( ) | ||
81 | { | ||
82 | bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); | ||
83 | w_list-> viewport ( )-> setUpdatesEnabled ( false ); | ||
84 | |||
85 | ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); | ||
86 | |||
87 | w_list-> viewport ( )-> setUpdatesEnabled ( b ); | ||
88 | |||
89 | m_map_show-> repaint ( ); | ||
90 | } | ||
91 | |||
79 | void RemapDlg::itemChanged ( QListViewItem *it ) | 92 | void RemapDlg::itemChanged ( QListViewItem *it ) |
80 | { | 93 | { |
81 | bool enabled = false; | 94 | bool enabled = false; |