-rw-r--r-- | core/settings/button/buttonsettings.cpp | 8 | ||||
-rw-r--r-- | core/settings/button/buttonsettings.h | 1 | ||||
-rw-r--r-- | core/settings/button/buttonutils.cpp | 22 | ||||
-rw-r--r-- | core/settings/button/remapdlg.cpp | 27 | ||||
-rw-r--r-- | core/settings/button/remapdlg.h | 4 |
5 files changed, 48 insertions, 14 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index c71514c..8b0b0a8 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -61,4 +61,5 @@ ButtonSettings::ButtonSettings ( ) | |||
61 | { | 61 | { |
62 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); | 62 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); |
63 | (void) ButtonUtils::inst ( ); // initialise | ||
63 | 64 | ||
64 | setCaption ( tr( "Button Settings" )); | 65 | setCaption ( tr( "Button Settings" )); |
@@ -134,4 +135,5 @@ ButtonSettings::ButtonSettings ( ) | |||
134 | 135 | ||
135 | m_last_button = 0; | 136 | m_last_button = 0; |
137 | m_lock = false; | ||
136 | 138 | ||
137 | m_timer = new QTimer ( this ); | 139 | m_timer = new QTimer ( this ); |
@@ -209,4 +211,8 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) | |||
209 | qDebug ( "remap %s for %s", hold ? "hold" : "press", bi-> m_button-> userText ( ). latin1 ( )); | 211 | qDebug ( "remap %s for %s", hold ? "hold" : "press", bi-> m_button-> userText ( ). latin1 ( )); |
210 | 212 | ||
213 | if ( m_lock ) | ||
214 | return; | ||
215 | m_lock = true; | ||
216 | |||
211 | RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); | 217 | RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); |
212 | 218 | ||
@@ -228,4 +234,6 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) | |||
228 | 234 | ||
229 | delete d; | 235 | delete d; |
236 | |||
237 | m_lock = false; | ||
230 | } | 238 | } |
231 | 239 | ||
diff --git a/core/settings/button/buttonsettings.h b/core/settings/button/buttonsettings.h index f571825..d41a209 100644 --- a/core/settings/button/buttonsettings.h +++ b/core/settings/button/buttonsettings.h | |||
@@ -68,4 +68,5 @@ private: | |||
68 | 68 | ||
69 | QList <buttoninfo> m_infos; | 69 | QList <buttoninfo> m_infos; |
70 | bool m_lock; | ||
70 | }; | 71 | }; |
71 | 72 | ||
diff --git a/core/settings/button/buttonutils.cpp b/core/settings/button/buttonutils.cpp index bb70047..91d2af3 100644 --- a/core/settings/button/buttonutils.cpp +++ b/core/settings/button/buttonutils.cpp | |||
@@ -102,18 +102,26 @@ void ButtonUtils::insertActions ( QListViewItem *here ) | |||
102 | void ButtonUtils::insertAppLnks ( QListViewItem *here ) | 102 | void ButtonUtils::insertAppLnks ( QListViewItem *here ) |
103 | { | 103 | { |
104 | QStringList types = m_apps-> types ( ); | 104 | QStringList types = m_apps-> types ( ); |
105 | QListViewItem *typeitem [types. count ( )]; | ||
105 | 106 | ||
107 | int i = 0; | ||
106 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 108 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
107 | QListViewItem *item = new QListViewItem ( here, m_apps-> typeName ( *it )); | 109 | QListViewItem *item = new QListViewItem ( here, m_apps-> typeName ( *it )); |
108 | item-> setPixmap ( 0, m_apps-> typePixmap ( *it )); | 110 | item-> setPixmap ( 0, m_apps-> typePixmap ( *it )); |
109 | 111 | ||
110 | for ( QListIterator <AppLnk> appit ( m_apps-> children ( )); *appit; ++appit ) { | 112 | typeitem [i++] = item; |
111 | AppLnk *l = *appit; | 113 | } |
112 | 114 | ||
115 | for ( QListIterator <AppLnk> appit ( m_apps-> children ( )); *appit; ++appit ) { | ||
116 | AppLnk *l = *appit; | ||
117 | |||
118 | int i = 0; | ||
119 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | ||
113 | if ( l-> type ( ) == *it ) { | 120 | if ( l-> type ( ) == *it ) { |
114 | QListViewItem *sub = new QListViewItem ( item, l-> name ( ), QString ( "QPE/Application/" ) + l-> exec ( ), "raise()" ); | 121 | QListViewItem *sub = new QListViewItem ( typeitem [i], l-> name ( ), QString ( "QPE/Application/" ) + l-> exec ( ), "raise()" ); |
115 | sub-> setPixmap ( 0, l-> pixmap ( )); | 122 | sub-> setPixmap ( 0, l-> pixmap ( )); |
116 | } | 123 | } |
117 | } | 124 | i++; |
125 | } | ||
118 | } | 126 | } |
119 | } | 127 | } |
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 | |||
@@ -2,4 +2,5 @@ | |||
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" |
@@ -47,4 +48,9 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c | |||
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 ( ); |
@@ -60,15 +66,10 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c | |||
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 | ||
@@ -77,4 +78,16 @@ RemapDlg::~RemapDlg ( ) | |||
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 | { |
diff --git a/core/settings/button/remapdlg.h b/core/settings/button/remapdlg.h index 8c9cc02..046a22f 100644 --- a/core/settings/button/remapdlg.h +++ b/core/settings/button/remapdlg.h | |||
@@ -21,4 +21,7 @@ public slots: | |||
21 | virtual void itemChanged ( QListViewItem * ); | 21 | virtual void itemChanged ( QListViewItem * ); |
22 | virtual void textChanged ( const QString & ); | 22 | virtual void textChanged ( const QString & ); |
23 | |||
24 | private slots: | ||
25 | void delayedInit ( ); | ||
23 | 26 | ||
24 | private: | 27 | private: |
@@ -31,4 +34,5 @@ private: | |||
31 | QListViewItem *m_map_preset; | 34 | QListViewItem *m_map_preset; |
32 | QListViewItem *m_map_custom; | 35 | QListViewItem *m_map_custom; |
36 | QListViewItem *m_map_show; | ||
33 | }; | 37 | }; |
34 | 38 | ||