author | alwin <alwin> | 2004-03-02 12:14:15 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:14:15 (UTC) |
commit | 0d59c780513da78033f4d9040475dee9db0256d4 (patch) (unidiff) | |
tree | 503d320b4aa3daae9982082e7b34e3e2c48bdfb7 /core/settings | |
parent | a0981652d61776d70f25980f035748b21339e946 (diff) | |
download | opie-0d59c780513da78033f4d9040475dee9db0256d4.zip opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.gz opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.bz2 |
run the optimize_connect script
the whole cvs is tagged with "before_optimize_connect" if there are problems you
can check the diff (but it had compiled and run here)
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 2 | ||||
-rw-r--r-- | core/settings/button/remapdlg.cpp | 2 | ||||
-rw-r--r-- | core/settings/citytime/citytime.cpp | 4 | ||||
-rw-r--r-- | core/settings/citytime/citytimebase.cpp | 2 | ||||
-rw-r--r-- | core/settings/citytime/zonemap.cpp | 16 | ||||
-rw-r--r-- | core/settings/launcher/menusettings.cpp | 4 | ||||
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 18 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 6 | ||||
-rw-r--r-- | core/settings/launcher/taskbarsettings.cpp | 2 | ||||
-rw-r--r-- | core/settings/light-and-power/light.cpp | 14 | ||||
-rw-r--r-- | core/settings/light-and-power/sensor.cpp | 8 |
11 files changed, 39 insertions, 39 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index 141e0f6..d80e496 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -91,97 +91,97 @@ ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal | |||
91 | bi-> m_button = &(*it); | 91 | bi-> m_button = &(*it); |
92 | bi-> m_index = index++; | 92 | bi-> m_index = index++; |
93 | bi-> m_pmsg = (*it). pressedAction ( ); | 93 | bi-> m_pmsg = (*it). pressedAction ( ); |
94 | bi-> m_hmsg = (*it). heldAction ( ); | 94 | bi-> m_hmsg = (*it). heldAction ( ); |
95 | bi-> m_pdirty = false; | 95 | bi-> m_pdirty = false; |
96 | bi-> m_hdirty = false; | 96 | bi-> m_hdirty = false; |
97 | 97 | ||
98 | l = new QLabel ( this ); | 98 | l = new QLabel ( this ); |
99 | l-> setPixmap (( *it ). pixmap ( )); | 99 | l-> setPixmap (( *it ). pixmap ( )); |
100 | 100 | ||
101 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); | 101 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); |
102 | 102 | ||
103 | l = new QLabel ( tr( "Press:" ), this ); | 103 | l = new QLabel ( tr( "Press:" ), this ); |
104 | lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom ); | 104 | lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom ); |
105 | l = new QLabel ( tr( "Hold:" ), this ); | 105 | l = new QLabel ( tr( "Hold:" ), this ); |
106 | lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); | 106 | lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); |
107 | 107 | ||
108 | l = new QLabel ( this ); | 108 | l = new QLabel ( this ); |
109 | l-> setFixedSize ( 16, 16 ); | 109 | l-> setFixedSize ( 16, 16 ); |
110 | lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom ); | 110 | lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom ); |
111 | bi-> m_picon = l; | 111 | bi-> m_picon = l; |
112 | 112 | ||
113 | l = new QLabel ( this ); | 113 | l = new QLabel ( this ); |
114 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); | 114 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); |
115 | lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom ); | 115 | lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom ); |
116 | bi-> m_plabel = l; | 116 | bi-> m_plabel = l; |
117 | 117 | ||
118 | l = new QLabel ( this ); | 118 | l = new QLabel ( this ); |
119 | l-> setFixedSize ( 16, 16 ); | 119 | l-> setFixedSize ( 16, 16 ); |
120 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); | 120 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); |
121 | bi-> m_hicon = l; | 121 | bi-> m_hicon = l; |
122 | 122 | ||
123 | l = new QLabel ( this ); | 123 | l = new QLabel ( this ); |
124 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); | 124 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); |
125 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); | 125 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); |
126 | bi-> m_hlabel = l; | 126 | bi-> m_hlabel = l; |
127 | 127 | ||
128 | i += 2; | 128 | i += 2; |
129 | 129 | ||
130 | m_infos. append ( bi ); | 130 | m_infos. append ( bi ); |
131 | } | 131 | } |
132 | 132 | ||
133 | toplay-> addStretch ( 10 ); | 133 | toplay-> addStretch ( 10 ); |
134 | 134 | ||
135 | m_last_button = 0; | 135 | m_last_button = 0; |
136 | m_lock = false; | 136 | m_lock = false; |
137 | 137 | ||
138 | m_timer = new QTimer ( this ); | 138 | m_timer = new QTimer ( this ); |
139 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( ))); | 139 | connect ( m_timer, SIGNAL( timeout()), this, SLOT( keyTimeout())); |
140 | 140 | ||
141 | updateLabels ( ); | 141 | updateLabels ( ); |
142 | 142 | ||
143 | QPEApplication::grabKeyboard ( ); | 143 | QPEApplication::grabKeyboard ( ); |
144 | } | 144 | } |
145 | 145 | ||
146 | ButtonSettings::~ButtonSettings ( ) | 146 | ButtonSettings::~ButtonSettings ( ) |
147 | { | 147 | { |
148 | QPEApplication::ungrabKeyboard ( ); | 148 | QPEApplication::ungrabKeyboard ( ); |
149 | } | 149 | } |
150 | 150 | ||
151 | void ButtonSettings::updateLabels ( ) | 151 | void ButtonSettings::updateLabels ( ) |
152 | { | 152 | { |
153 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 153 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
154 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); | 154 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); |
155 | 155 | ||
156 | (*it)-> m_picon-> setPixmap ( cip. m_icon ); | 156 | (*it)-> m_picon-> setPixmap ( cip. m_icon ); |
157 | (*it)-> m_plabel-> setText ( cip. m_name ); | 157 | (*it)-> m_plabel-> setText ( cip. m_name ); |
158 | 158 | ||
159 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); | 159 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); |
160 | 160 | ||
161 | (*it)-> m_hicon-> setPixmap ( cih. m_icon ); | 161 | (*it)-> m_hicon-> setPixmap ( cih. m_icon ); |
162 | (*it)-> m_hlabel-> setText ( cih. m_name ); | 162 | (*it)-> m_hlabel-> setText ( cih. m_name ); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | 165 | ||
166 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) | 166 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) |
167 | { | 167 | { |
168 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 168 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
169 | if ((*it)-> m_button-> keycode ( ) == key ) | 169 | if ((*it)-> m_button-> keycode ( ) == key ) |
170 | return *it; | 170 | return *it; |
171 | } | 171 | } |
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | void ButtonSettings::keyPressEvent ( QKeyEvent *e ) | 175 | void ButtonSettings::keyPressEvent ( QKeyEvent *e ) |
176 | { | 176 | { |
177 | buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); | 177 | buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); |
178 | 178 | ||
179 | if ( bi && !e-> isAutoRepeat ( )) { | 179 | if ( bi && !e-> isAutoRepeat ( )) { |
180 | m_timer-> stop ( ); | 180 | m_timer-> stop ( ); |
181 | m_last_button = bi; | 181 | m_last_button = bi; |
182 | m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); | 182 | m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); |
183 | } | 183 | } |
184 | else | 184 | else |
185 | QDialog::keyPressEvent ( e ); | 185 | QDialog::keyPressEvent ( e ); |
186 | } | 186 | } |
187 | 187 | ||
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp index 7dabe68..121173a 100644 --- a/core/settings/button/remapdlg.cpp +++ b/core/settings/button/remapdlg.cpp | |||
@@ -34,97 +34,97 @@ public: | |||
34 | p-> setFont ( f ); | 34 | p-> setFont ( f ); |
35 | } | 35 | } |
36 | QListViewItem::paintCell ( p, cg, column, width, align ); | 36 | QListViewItem::paintCell ( p, cg, column, width, align ); |
37 | } | 37 | } |
38 | 38 | ||
39 | private: | 39 | private: |
40 | QString m_key; | 40 | QString m_key; |
41 | bool m_def; | 41 | bool m_def; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | 44 | ||
45 | RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) | 45 | RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) |
46 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) | 46 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) |
47 | { | 47 | { |
48 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); | 48 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); |
49 | 49 | ||
50 | m_current = 0; | 50 | m_current = 0; |
51 | 51 | ||
52 | static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 }; | 52 | static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 }; |
53 | w_channel-> insertStrList ((const char **) def_channels ); | 53 | w_channel-> insertStrList ((const char **) def_channels ); |
54 | 54 | ||
55 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); | 55 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); |
56 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); | 56 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); |
57 | 57 | ||
58 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); | 58 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); |
59 | m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); | 59 | m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); |
60 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); | 60 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); |
61 | 61 | ||
62 | if (m_msg. channel ( ) == "ignore") | 62 | if (m_msg. channel ( ) == "ignore") |
63 | { | 63 | { |
64 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); | 64 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); |
65 | 65 | ||
66 | m_current = m_map_none; | 66 | m_current = m_map_none; |
67 | } | 67 | } |
68 | else | 68 | else |
69 | { | 69 | { |
70 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); | 70 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); |
71 | m_current = m_map_custom; | 71 | m_current = m_map_custom; |
72 | } | 72 | } |
73 | 73 | ||
74 | QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); | 74 | QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); |
75 | ButtonUtils::inst ( )-> insertActions ( it ); | 75 | ButtonUtils::inst ( )-> insertActions ( it ); |
76 | it-> setOpen ( true ); | 76 | it-> setOpen ( true ); |
77 | 77 | ||
78 | m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); | 78 | m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); |
79 | 79 | ||
80 | w_list-> setCurrentItem ( m_current ); | 80 | w_list-> setCurrentItem ( m_current ); |
81 | 81 | ||
82 | QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); | 82 | QTimer::singleShot ( 0, this, SLOT( delayedInit())); |
83 | } | 83 | } |
84 | 84 | ||
85 | RemapDlg::~RemapDlg ( ) | 85 | RemapDlg::~RemapDlg ( ) |
86 | { | 86 | { |
87 | } | 87 | } |
88 | 88 | ||
89 | void RemapDlg::delayedInit ( ) | 89 | void RemapDlg::delayedInit ( ) |
90 | { | 90 | { |
91 | bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); | 91 | bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); |
92 | w_list-> viewport ( )-> setUpdatesEnabled ( false ); | 92 | w_list-> viewport ( )-> setUpdatesEnabled ( false ); |
93 | 93 | ||
94 | ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); | 94 | ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); |
95 | 95 | ||
96 | w_list-> viewport ( )-> setUpdatesEnabled ( b ); | 96 | w_list-> viewport ( )-> setUpdatesEnabled ( b ); |
97 | 97 | ||
98 | m_map_show-> repaint ( ); | 98 | m_map_show-> repaint ( ); |
99 | } | 99 | } |
100 | 100 | ||
101 | void RemapDlg::itemChanged ( QListViewItem *it ) | 101 | void RemapDlg::itemChanged ( QListViewItem *it ) |
102 | { | 102 | { |
103 | bool enabled = false; | 103 | bool enabled = false; |
104 | OQCopMessage m; | 104 | OQCopMessage m; |
105 | 105 | ||
106 | m_current = it; | 106 | m_current = it; |
107 | 107 | ||
108 | if ( it == m_map_none ) | 108 | if ( it == m_map_none ) |
109 | { | 109 | { |
110 | m_msg = m = OQCopMessage ( "ignore", 0 ); | 110 | m_msg = m = OQCopMessage ( "ignore", 0 ); |
111 | qDebug ("***ignoring"); | 111 | qDebug ("***ignoring"); |
112 | } | 112 | } |
113 | else if ( it == m_map_preset ) | 113 | else if ( it == m_map_preset ) |
114 | { | 114 | { |
115 | m_msg = m = m_msg_preset; | 115 | m_msg = m = m_msg_preset; |
116 | qDebug ("***Preset"); | 116 | qDebug ("***Preset"); |
117 | } | 117 | } |
118 | else if ( it && !it-> childCount ( ) ) | 118 | else if ( it && !it-> childCount ( ) ) |
119 | { | 119 | { |
120 | qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); | 120 | qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); |
121 | enabled = ( it == m_map_custom ); | 121 | enabled = ( it == m_map_custom ); |
122 | m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); | 122 | m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); |
123 | } | 123 | } |
124 | 124 | ||
125 | w_channel-> setEnabled ( enabled ); | 125 | w_channel-> setEnabled ( enabled ); |
126 | w_message-> setEnabled ( enabled ); | 126 | w_message-> setEnabled ( enabled ); |
127 | 127 | ||
128 | w_channel-> setEditText ( m. channel ( )); | 128 | w_channel-> setEditText ( m. channel ( )); |
129 | //hack for if user has typed in a message, such as 'suspend()' | 129 | //hack for if user has typed in a message, such as 'suspend()' |
130 | //so raise() is always present | 130 | //so raise() is always present |
diff --git a/core/settings/citytime/citytime.cpp b/core/settings/citytime/citytime.cpp index e7f0c46..721285d 100644 --- a/core/settings/citytime/citytime.cpp +++ b/core/settings/citytime/citytime.cpp | |||
@@ -64,98 +64,98 @@ CityTime::CityTime( QWidget *parent, const char* name, | |||
64 | 64 | ||
65 | listCities.append( cmdCity1 ); | 65 | listCities.append( cmdCity1 ); |
66 | listCities.append( cmdCity2 ); | 66 | listCities.append( cmdCity2 ); |
67 | listCities.append( cmdCity3 ); | 67 | listCities.append( cmdCity3 ); |
68 | 68 | ||
69 | listTimes.append( lblCTime1 ); | 69 | listTimes.append( lblCTime1 ); |
70 | listTimes.append( lblCTime2 ); | 70 | listTimes.append( lblCTime2 ); |
71 | listTimes.append( lblCTime3 ); | 71 | listTimes.append( lblCTime3 ); |
72 | 72 | ||
73 | 73 | ||
74 | // kludgy way of getting the screen size so we don't have to depend | 74 | // kludgy way of getting the screen size so we don't have to depend |
75 | // on a resize event... | 75 | // on a resize event... |
76 | QWidget *d = QApplication::desktop(); | 76 | QWidget *d = QApplication::desktop(); |
77 | if ( d->width() < d->height() ) { | 77 | if ( d->width() < d->height() ) { |
78 | // append for that 4 down look | 78 | // append for that 4 down look |
79 | listCities.append( cmdCity4 ); | 79 | listCities.append( cmdCity4 ); |
80 | listCities.append( cmdCity5 ); | 80 | listCities.append( cmdCity5 ); |
81 | listCities.append( cmdCity6 ); | 81 | listCities.append( cmdCity6 ); |
82 | listTimes.append( lblCTime4 ); | 82 | listTimes.append( lblCTime4 ); |
83 | listTimes.append( lblCTime5 ); | 83 | listTimes.append( lblCTime5 ); |
84 | listTimes.append( lblCTime6 ); | 84 | listTimes.append( lblCTime6 ); |
85 | lblCTime7->hide(); | 85 | lblCTime7->hide(); |
86 | lblCTime8->hide(); | 86 | lblCTime8->hide(); |
87 | lblCTime9->hide(); | 87 | lblCTime9->hide(); |
88 | cmdCity7->hide(); | 88 | cmdCity7->hide(); |
89 | cmdCity8->hide(); | 89 | cmdCity8->hide(); |
90 | cmdCity9->hide(); | 90 | cmdCity9->hide(); |
91 | } else { | 91 | } else { |
92 | listCities.append( cmdCity7 ); | 92 | listCities.append( cmdCity7 ); |
93 | listCities.append( cmdCity8 ); | 93 | listCities.append( cmdCity8 ); |
94 | listCities.append( cmdCity9 ); | 94 | listCities.append( cmdCity9 ); |
95 | listTimes.append( lblCTime7 ); | 95 | listTimes.append( lblCTime7 ); |
96 | listTimes.append( lblCTime8 ); | 96 | listTimes.append( lblCTime8 ); |
97 | listTimes.append( lblCTime9 ); | 97 | listTimes.append( lblCTime9 ); |
98 | lblCTime4->hide(); | 98 | lblCTime4->hide(); |
99 | lblCTime5->hide(); | 99 | lblCTime5->hide(); |
100 | lblCTime6->hide(); | 100 | lblCTime6->hide(); |
101 | cmdCity4->hide(); | 101 | cmdCity4->hide(); |
102 | cmdCity5->hide(); | 102 | cmdCity5->hide(); |
103 | cmdCity6->hide(); | 103 | cmdCity6->hide(); |
104 | } | 104 | } |
105 | 105 | ||
106 | selWidget = frmMap->selectionWidget( this ); | 106 | selWidget = frmMap->selectionWidget( this ); |
107 | selWidget->hide(); | 107 | selWidget->hide(); |
108 | CityTimeBaseLayout->addWidget( selWidget ); | 108 | CityTimeBaseLayout->addWidget( selWidget ); |
109 | bAdded = true; | 109 | bAdded = true; |
110 | readInTimes(); | 110 | readInTimes(); |
111 | changed = FALSE; | 111 | changed = FALSE; |
112 | QObject::connect( qApp, SIGNAL( clockChanged( bool ) ), | 112 | QObject::connect( qApp, SIGNAL( clockChanged(bool) ), |
113 | this, SLOT( changeClock( bool ) ) ); | 113 | this, SLOT( changeClock(bool) ) ); |
114 | // now start the timer so we can update the time quickly every second | 114 | // now start the timer so we can update the time quickly every second |
115 | timerEvent( 0 ); | 115 | timerEvent( 0 ); |
116 | } | 116 | } |
117 | 117 | ||
118 | CityTime::~CityTime() | 118 | CityTime::~CityTime() |
119 | { | 119 | { |
120 | if ( changed ) { | 120 | if ( changed ) { |
121 | Config cfg("CityTime"); | 121 | Config cfg("CityTime"); |
122 | cfg.setGroup("TimeZones"); | 122 | cfg.setGroup("TimeZones"); |
123 | QListIterator<QToolButton> itCity( listCities ); | 123 | QListIterator<QToolButton> itCity( listCities ); |
124 | int i; | 124 | int i; |
125 | bool realTzWritten = FALSE; | 125 | bool realTzWritten = FALSE; |
126 | for ( i = 0, itCity.toFirst(); i < CITIES; i++, ++itCity ) { | 126 | for ( i = 0, itCity.toFirst(); i < CITIES; i++, ++itCity ) { |
127 | if ( !strCityTz[i].isNull() ) { | 127 | if ( !strCityTz[i].isNull() ) { |
128 | cfg.writeEntry("Zone"+QString::number(i), strCityTz[i]); | 128 | cfg.writeEntry("Zone"+QString::number(i), strCityTz[i]); |
129 | cfg.writeEntry("ZoneName"+QString::number(i), itCity.current()->text()); | 129 | cfg.writeEntry("ZoneName"+QString::number(i), itCity.current()->text()); |
130 | if ( strCityTz[i] == strRealTz ) | 130 | if ( strCityTz[i] == strRealTz ) |
131 | realTzWritten = TRUE; | 131 | realTzWritten = TRUE; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | if ( realTzWritten ) { | 134 | if ( realTzWritten ) { |
135 | cfg.removeEntry("Zone"+QString::number(CITIES)); | 135 | cfg.removeEntry("Zone"+QString::number(CITIES)); |
136 | cfg.removeEntry("ZoneName"+QString::number(CITIES)); | 136 | cfg.removeEntry("ZoneName"+QString::number(CITIES)); |
137 | } else { | 137 | } else { |
138 | cfg.writeEntry("Zone"+QString::number(CITIES), strRealTz); | 138 | cfg.writeEntry("Zone"+QString::number(CITIES), strRealTz); |
139 | if ( nameRealTz.isEmpty() ) { | 139 | if ( nameRealTz.isEmpty() ) { |
140 | int i = strRealTz.find( '/' ); | 140 | int i = strRealTz.find( '/' ); |
141 | nameRealTz = strRealTz.mid( i+1 ); | 141 | nameRealTz = strRealTz.mid( i+1 ); |
142 | } | 142 | } |
143 | cfg.writeEntry("ZoneName"+QString::number(CITIES), nameRealTz); | 143 | cfg.writeEntry("ZoneName"+QString::number(CITIES), nameRealTz); |
144 | } | 144 | } |
145 | QCopEnvelope ( "QPE/System", "timeZoneListChange()" ); | 145 | QCopEnvelope ( "QPE/System", "timeZoneListChange()" ); |
146 | 146 | ||
147 | changed = FALSE; | 147 | changed = FALSE; |
148 | } | 148 | } |
149 | // restore the timezone, just in case we messed with it and | 149 | // restore the timezone, just in case we messed with it and |
150 | // are destroyed at an inoppurtune moment | 150 | // are destroyed at an inoppurtune moment |
151 | if ( !strRealTz.isNull() ) { | 151 | if ( !strRealTz.isNull() ) { |
152 | // this should be checked, but there is not much that can done at this | 152 | // this should be checked, but there is not much that can done at this |
153 | //point if it fails | 153 | //point if it fails |
154 | setenv( "TZ", strRealTz, true ); | 154 | setenv( "TZ", strRealTz, true ); |
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | void CityTime::timerEvent( QTimerEvent *e ) | 158 | void CityTime::timerEvent( QTimerEvent *e ) |
159 | { | 159 | { |
160 | if ( e ) | 160 | if ( e ) |
161 | killTimer( timerId ); | 161 | killTimer( timerId ); |
diff --git a/core/settings/citytime/citytimebase.cpp b/core/settings/citytime/citytimebase.cpp index a3483cc..323929b 100644 --- a/core/settings/citytime/citytimebase.cpp +++ b/core/settings/citytime/citytimebase.cpp | |||
@@ -185,97 +185,97 @@ CityTimeBase::CityTimeBase( QWidget* parent, const char* name, WFlags ) | |||
185 | lblCTime7->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 185 | lblCTime7->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
186 | 186 | ||
187 | Layout2->addWidget( lblCTime7, 0, 3 ); | 187 | Layout2->addWidget( lblCTime7, 0, 3 ); |
188 | 188 | ||
189 | lblCTime4 = new QLabel( buttonWidget, "lblCTime4" ); | 189 | lblCTime4 = new QLabel( buttonWidget, "lblCTime4" ); |
190 | QFont lblCTime4_font( lblCTime4->font() ); | 190 | QFont lblCTime4_font( lblCTime4->font() ); |
191 | lblCTime4_font.setPointSize( 10 ); | 191 | lblCTime4_font.setPointSize( 10 ); |
192 | lblCTime4->setFont( lblCTime4_font ); | 192 | lblCTime4->setFont( lblCTime4_font ); |
193 | lblCTime4->setText( tr( "" ) ); | 193 | lblCTime4->setText( tr( "" ) ); |
194 | lblCTime4->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 194 | lblCTime4->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
195 | 195 | ||
196 | Layout2->addWidget( lblCTime4, 3, 1 ); | 196 | Layout2->addWidget( lblCTime4, 3, 1 ); |
197 | 197 | ||
198 | cmdCity5 = new QToolButton( buttonWidget, "cmdCity5" ); | 198 | cmdCity5 = new QToolButton( buttonWidget, "cmdCity5" ); |
199 | cmdCity5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity5->sizePolicy().hasHeightForWidth() ) ); | 199 | cmdCity5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity5->sizePolicy().hasHeightForWidth() ) ); |
200 | QFont cmdCity5_font( cmdCity5->font() ); | 200 | QFont cmdCity5_font( cmdCity5->font() ); |
201 | cmdCity5_font.setBold( TRUE ); | 201 | cmdCity5_font.setBold( TRUE ); |
202 | cmdCity5->setFont( cmdCity5_font ); | 202 | cmdCity5->setFont( cmdCity5_font ); |
203 | cmdCity5->setFocusPolicy( QToolButton::TabFocus ); | 203 | cmdCity5->setFocusPolicy( QToolButton::TabFocus ); |
204 | cmdCity5->setText( tr( "" ) ); | 204 | cmdCity5->setText( tr( "" ) ); |
205 | cmdCity5->setToggleButton( TRUE ); | 205 | cmdCity5->setToggleButton( TRUE ); |
206 | cmdCity5->setToggleButton( TRUE ); | 206 | cmdCity5->setToggleButton( TRUE ); |
207 | 207 | ||
208 | Layout2->addWidget( cmdCity5, 4, 0 ); | 208 | Layout2->addWidget( cmdCity5, 4, 0 ); |
209 | 209 | ||
210 | lblCTime3 = new QLabel( buttonWidget, "lblCTime3" ); | 210 | lblCTime3 = new QLabel( buttonWidget, "lblCTime3" ); |
211 | QFont lblCTime3_font( lblCTime3->font() ); | 211 | QFont lblCTime3_font( lblCTime3->font() ); |
212 | lblCTime3_font.setPointSize( 10 ); | 212 | lblCTime3_font.setPointSize( 10 ); |
213 | lblCTime3->setFont( lblCTime3_font ); | 213 | lblCTime3->setFont( lblCTime3_font ); |
214 | lblCTime3->setText( tr( "" ) ); | 214 | lblCTime3->setText( tr( "" ) ); |
215 | lblCTime3->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 215 | lblCTime3->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
216 | 216 | ||
217 | Layout2->addWidget( lblCTime3, 2, 1 ); | 217 | Layout2->addWidget( lblCTime3, 2, 1 ); |
218 | 218 | ||
219 | cmdCity9 = new QToolButton( buttonWidget, "cmdCity9" ); | 219 | cmdCity9 = new QToolButton( buttonWidget, "cmdCity9" ); |
220 | cmdCity9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity9->sizePolicy().hasHeightForWidth() ) ); | 220 | cmdCity9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity9->sizePolicy().hasHeightForWidth() ) ); |
221 | QFont cmdCity9_font( cmdCity9->font() ); | 221 | QFont cmdCity9_font( cmdCity9->font() ); |
222 | cmdCity9_font.setBold( TRUE ); | 222 | cmdCity9_font.setBold( TRUE ); |
223 | cmdCity9->setFont( cmdCity9_font ); | 223 | cmdCity9->setFont( cmdCity9_font ); |
224 | cmdCity9->setFocusPolicy( QToolButton::TabFocus ); | 224 | cmdCity9->setFocusPolicy( QToolButton::TabFocus ); |
225 | cmdCity9->setText( tr( "" ) ); | 225 | cmdCity9->setText( tr( "" ) ); |
226 | cmdCity9->setToggleButton( TRUE ); | 226 | cmdCity9->setToggleButton( TRUE ); |
227 | cmdCity9->setToggleButton( TRUE ); | 227 | cmdCity9->setToggleButton( TRUE ); |
228 | 228 | ||
229 | Layout2->addWidget( cmdCity9, 2, 2 ); | 229 | Layout2->addWidget( cmdCity9, 2, 2 ); |
230 | CityTimeBaseLayout->addWidget( buttonWidget ); | 230 | CityTimeBaseLayout->addWidget( buttonWidget ); |
231 | 231 | ||
232 | // signals and slots connections | 232 | // signals and slots connections |
233 | connect( frmMap, SIGNAL( signalTz(const QString &, const QString &) ), this, SLOT( slotNewTz(const QString &, const QString &) ) ); | 233 | connect( frmMap, SIGNAL( signalTz(const QString&,const QString&) ), this, SLOT( slotNewTz(const QString&,const QString&) ) ); |
234 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 234 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
235 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 235 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
236 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 236 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
237 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 237 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
238 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 238 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
239 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 239 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
240 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 240 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
241 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 241 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
242 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 242 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
243 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 243 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
244 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 244 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
245 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 245 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
246 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 246 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
247 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 247 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
248 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 248 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
249 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 249 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
250 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 250 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
251 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 251 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
252 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 252 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
253 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 253 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
254 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 254 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
255 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 255 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
256 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 256 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
257 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 257 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
258 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 258 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
259 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 259 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
260 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 260 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
261 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 261 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
262 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 262 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
263 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 263 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
264 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 264 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
265 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 265 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
266 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 266 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
267 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 267 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
268 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 268 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
269 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 269 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
270 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 270 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
271 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 271 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
272 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 272 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
273 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 273 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
274 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 274 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
275 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 275 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
276 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 276 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
277 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 277 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
278 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 278 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
279 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 279 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
280 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 280 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
281 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 281 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
diff --git a/core/settings/citytime/zonemap.cpp b/core/settings/citytime/zonemap.cpp index b83da59..b6843d2 100644 --- a/core/settings/citytime/zonemap.cpp +++ b/core/settings/citytime/zonemap.cpp | |||
@@ -142,102 +142,102 @@ ZoneMap::ZoneMap( QWidget *parent, const char* name ) | |||
142 | pRepaint( 0 ), | 142 | pRepaint( 0 ), |
143 | ox( 0 ), | 143 | ox( 0 ), |
144 | oy( 0 ), | 144 | oy( 0 ), |
145 | drawableW( -1 ), | 145 | drawableW( -1 ), |
146 | drawableH( -1 ), | 146 | drawableH( -1 ), |
147 | bZoom( FALSE ), | 147 | bZoom( FALSE ), |
148 | bIllum( TRUE ), | 148 | bIllum( TRUE ), |
149 | cursor( 0 ) | 149 | cursor( 0 ) |
150 | { | 150 | { |
151 | viewport()->setFocusPolicy( StrongFocus ); | 151 | viewport()->setFocusPolicy( StrongFocus ); |
152 | 152 | ||
153 | // set mouse tracking so we can use the mouse move event | 153 | // set mouse tracking so we can use the mouse move event |
154 | zones.setAutoDelete( true ); | 154 | zones.setAutoDelete( true ); |
155 | // get the map loaded | 155 | // get the map loaded |
156 | // just set the current image to point | 156 | // just set the current image to point |
157 | pixCurr = new QPixmap(); | 157 | pixCurr = new QPixmap(); |
158 | 158 | ||
159 | QPixmap pixZoom = Resource::loadPixmap( "mag" ); | 159 | QPixmap pixZoom = Resource::loadPixmap( "mag" ); |
160 | 160 | ||
161 | cmdZoom = new QToolButton( this, "Zoom command" ); | 161 | cmdZoom = new QToolButton( this, "Zoom command" ); |
162 | cmdZoom->setPixmap( pixZoom ); | 162 | cmdZoom->setPixmap( pixZoom ); |
163 | cmdZoom->setToggleButton( true ); | 163 | cmdZoom->setToggleButton( true ); |
164 | 164 | ||
165 | cmdZoom->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, | 165 | cmdZoom->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, |
166 | (QSizePolicy::SizeType)0, | 166 | (QSizePolicy::SizeType)0, |
167 | cmdZoom->sizePolicy().hasHeightForWidth() ) ); | 167 | cmdZoom->sizePolicy().hasHeightForWidth() ) ); |
168 | cmdZoom->setMaximumSize( cmdZoom->sizeHint() ); | 168 | cmdZoom->setMaximumSize( cmdZoom->sizeHint() ); |
169 | // probably don't need this, but just in case... | 169 | // probably don't need this, but just in case... |
170 | cmdZoom->move( width() - cmdZoom->width(), height() - cmdZoom->height() ); | 170 | cmdZoom->move( width() - cmdZoom->width(), height() - cmdZoom->height() ); |
171 | 171 | ||
172 | 172 | ||
173 | lblCity = new QLabel( tr( "CITY" ), this, "City Label" ); | 173 | lblCity = new QLabel( tr( "CITY" ), this, "City Label" ); |
174 | lblCity->setMinimumSize( lblCity->sizeHint() ); | 174 | lblCity->setMinimumSize( lblCity->sizeHint() ); |
175 | lblCity->setFrameStyle( QFrame::Plain | QFrame::Box ); | 175 | lblCity->setFrameStyle( QFrame::Plain | QFrame::Box ); |
176 | lblCity->setBackgroundColor( yellow ); | 176 | lblCity->setBackgroundColor( yellow ); |
177 | lblCity->hide(); | 177 | lblCity->hide(); |
178 | 178 | ||
179 | // A timer to make sure the label gets hidden | 179 | // A timer to make sure the label gets hidden |
180 | tHide = new QTimer( this, "Label Timer" ); | 180 | tHide = new QTimer( this, "Label Timer" ); |
181 | QObject::connect( tHide, SIGNAL( timeout() ), | 181 | QObject::connect( tHide, SIGNAL( timeout() ), |
182 | lblCity, SLOT( hide() ) ); | 182 | lblCity, SLOT( hide() ) ); |
183 | QObject::connect( tHide, SIGNAL( timeout() ), | 183 | QObject::connect( tHide, SIGNAL( timeout() ), |
184 | this, SLOT( slotRedraw() ) ); | 184 | this, SLOT( slotRedraw() ) ); |
185 | QTimer *tUpdate = new QTimer( this, "Update Timer" ); | 185 | QTimer *tUpdate = new QTimer( this, "Update Timer" ); |
186 | QObject::connect( tUpdate, SIGNAL( timeout() ), | 186 | QObject::connect( tUpdate, SIGNAL( timeout() ), |
187 | this, SLOT( slotUpdate() ) ); | 187 | this, SLOT( slotUpdate() ) ); |
188 | QObject::connect( qApp, SIGNAL( timeChanged() ), | 188 | QObject::connect( qApp, SIGNAL( timeChanged() ), |
189 | this, SLOT( slotUpdate() ) ); | 189 | this, SLOT( slotUpdate() ) ); |
190 | QObject::connect( cmdZoom, SIGNAL( toggled( bool ) ), | 190 | QObject::connect( cmdZoom, SIGNAL( toggled(bool) ), |
191 | this, SLOT( slotZoom( bool ) ) ); | 191 | this, SLOT( slotZoom(bool) ) ); |
192 | QObject::connect( &norm, SIGNAL( signalNewPoint( const QPoint& ) ), | 192 | QObject::connect( &norm, SIGNAL( signalNewPoint(const QPoint&) ), |
193 | this, SLOT( slotFindCity( const QPoint& ) ) ); | 193 | this, SLOT( slotFindCity(const QPoint&) ) ); |
194 | QObject::connect( qApp, SIGNAL( clockChanged( bool ) ), | 194 | QObject::connect( qApp, SIGNAL( clockChanged(bool) ), |
195 | this, SLOT( changeClock( bool ) ) ); | 195 | this, SLOT( changeClock(bool) ) ); |
196 | // update the sun's movement every 5 minutes | 196 | // update the sun's movement every 5 minutes |
197 | tUpdate->start( 5 * 60 * 1000 ); | 197 | tUpdate->start( 5 * 60 * 1000 ); |
198 | // May as well read in the timezone information too... | 198 | // May as well read in the timezone information too... |
199 | readZones(); | 199 | readZones(); |
200 | } | 200 | } |
201 | 201 | ||
202 | ZoneMap::~ZoneMap() | 202 | ZoneMap::~ZoneMap() |
203 | { | 203 | { |
204 | } | 204 | } |
205 | 205 | ||
206 | void ZoneMap::readZones( void ) | 206 | void ZoneMap::readZones( void ) |
207 | { | 207 | { |
208 | QFile fZone( strZONEINFO ); | 208 | QFile fZone( strZONEINFO ); |
209 | if ( !fZone.open( IO_ReadOnly ) ) { | 209 | if ( !fZone.open( IO_ReadOnly ) ) { |
210 | QMessageBox::warning (this, | 210 | QMessageBox::warning (this, |
211 | tr( "Unable to Find Timezone Info" ), | 211 | tr( "Unable to Find Timezone Info" ), |
212 | tr( "<p>Unable to find any timezone information in %1" ) | 212 | tr( "<p>Unable to find any timezone information in %1" ) |
213 | .arg( strZONEINFO )); | 213 | .arg( strZONEINFO )); |
214 | exit(-1); | 214 | exit(-1); |
215 | } else { | 215 | } else { |
216 | QTextStream tZone( &fZone ); | 216 | QTextStream tZone( &fZone ); |
217 | while ( !tZone.atEnd() ) { | 217 | while ( !tZone.atEnd() ) { |
218 | QString strLine = tZone.readLine(); | 218 | QString strLine = tZone.readLine(); |
219 | // only pass on lines that aren't comments | 219 | // only pass on lines that aren't comments |
220 | if ( strLine[0] != '#' ) { | 220 | if ( strLine[0] != '#' ) { |
221 | zones.append( new ZoneField( strLine ) ); | 221 | zones.append( new ZoneField( strLine ) ); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | fZone.close(); | 224 | fZone.close(); |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | void ZoneMap::viewportMousePressEvent( QMouseEvent* event ) | 228 | void ZoneMap::viewportMousePressEvent( QMouseEvent* event ) |
229 | { | 229 | { |
230 | // add the mouse event into the normalizer, and get the average, | 230 | // add the mouse event into the normalizer, and get the average, |
231 | // pass it along | 231 | // pass it along |
232 | slotRedraw(); | 232 | slotRedraw(); |
233 | norm.start(); | 233 | norm.start(); |
234 | norm.addEvent( event->pos() ); | 234 | norm.addEvent( event->pos() ); |
235 | } | 235 | } |
236 | 236 | ||
237 | void ZoneMap::viewportMouseMoveEvent( QMouseEvent* event ) | 237 | void ZoneMap::viewportMouseMoveEvent( QMouseEvent* event ) |
238 | { | 238 | { |
239 | norm.addEvent( event->pos() ); | 239 | norm.addEvent( event->pos() ); |
240 | } | 240 | } |
241 | 241 | ||
242 | void ZoneMap::viewportMouseReleaseEvent( QMouseEvent* ) | 242 | void ZoneMap::viewportMouseReleaseEvent( QMouseEvent* ) |
243 | { | 243 | { |
@@ -421,133 +421,133 @@ void ZoneMap::showCity( ZoneField *city ) | |||
421 | int repx, | 421 | int repx, |
422 | repy; | 422 | repy; |
423 | zoneToWin( pRepaint->x(), pRepaint->y(), repx, repy ); | 423 | zoneToWin( pRepaint->x(), pRepaint->y(), repx, repy ); |
424 | updateContents( repx - iCITYOFFSET, repy - iCITYOFFSET, | 424 | updateContents( repx - iCITYOFFSET, repy - iCITYOFFSET, |
425 | iCITYSIZE, iCITYSIZE ); | 425 | iCITYSIZE, iCITYSIZE ); |
426 | } | 426 | } |
427 | updateContents( tmpx - iCITYOFFSET, tmpy - iCITYOFFSET, iCITYSIZE, | 427 | updateContents( tmpx - iCITYOFFSET, tmpy - iCITYOFFSET, iCITYSIZE, |
428 | iCITYSIZE ); | 428 | iCITYSIZE ); |
429 | pRepaint = pLast; | 429 | pRepaint = pLast; |
430 | 430 | ||
431 | lblCity->move( x, y ); | 431 | lblCity->move( x, y ); |
432 | lblCity->show(); | 432 | lblCity->show(); |
433 | } | 433 | } |
434 | 434 | ||
435 | void ZoneMap::resizeEvent( QResizeEvent *e ) | 435 | void ZoneMap::resizeEvent( QResizeEvent *e ) |
436 | { | 436 | { |
437 | // keep the zoom button down in the corner | 437 | // keep the zoom button down in the corner |
438 | QSize _size = e->size(); | 438 | QSize _size = e->size(); |
439 | cmdZoom->move( _size.width() - cmdZoom->width(), | 439 | cmdZoom->move( _size.width() - cmdZoom->width(), |
440 | _size.height() - cmdZoom->height() ); | 440 | _size.height() - cmdZoom->height() ); |
441 | if ( !bZoom ) { | 441 | if ( !bZoom ) { |
442 | drawableW = width() - 2 * frameWidth(); | 442 | drawableW = width() - 2 * frameWidth(); |
443 | drawableH = height() - 2 * frameWidth(); | 443 | drawableH = height() - 2 * frameWidth(); |
444 | makeMap( drawableW, drawableH ); | 444 | makeMap( drawableW, drawableH ); |
445 | resizeContents( drawableW, drawableH ); | 445 | resizeContents( drawableW, drawableH ); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | 448 | ||
449 | void ZoneMap::showZones( void ) const | 449 | void ZoneMap::showZones( void ) const |
450 | { | 450 | { |
451 | // go through the zones in the list and just display the values... | 451 | // go through the zones in the list and just display the values... |
452 | QListIterator<ZoneField> itZone( zones ); | 452 | QListIterator<ZoneField> itZone( zones ); |
453 | for ( itZone.toFirst(); itZone.current(); ++itZone ) { | 453 | for ( itZone.toFirst(); itZone.current(); ++itZone ) { |
454 | ZoneField *pZone = itZone.current(); | 454 | ZoneField *pZone = itZone.current(); |
455 | pZone->showStructure(); | 455 | pZone->showStructure(); |
456 | } | 456 | } |
457 | } | 457 | } |
458 | 458 | ||
459 | 459 | ||
460 | QWidget* ZoneMap::selectionWidget( QWidget *parent) { | 460 | QWidget* ZoneMap::selectionWidget( QWidget *parent) { |
461 | 461 | ||
462 | QWidget *returnWidget = new QWidget( parent ); | 462 | QWidget *returnWidget = new QWidget( parent ); |
463 | 463 | ||
464 | QVBoxLayout *layout = new QVBoxLayout( returnWidget ); | 464 | QVBoxLayout *layout = new QVBoxLayout( returnWidget ); |
465 | QHBox *hBox = new QHBox( returnWidget ); | 465 | QHBox *hBox = new QHBox( returnWidget ); |
466 | QListView *continentView = new QListView( hBox ); | 466 | QListView *continentView = new QListView( hBox ); |
467 | continentView->addColumn( tr("Continent") ); | 467 | continentView->addColumn( tr("Continent") ); |
468 | QWhatsThis::add( continentView, tr("Select a continent/country here, then select a city") ); | 468 | QWhatsThis::add( continentView, tr("Select a continent/country here, then select a city") ); |
469 | connect ( continentView, SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( slotGetCities( QListViewItem * ) ) ); | 469 | connect ( continentView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( slotGetCities(QListViewItem*) ) ); |
470 | 470 | ||
471 | QStringList continentList; | 471 | QStringList continentList; |
472 | QListIterator<ZoneField> itZone( zones ); | 472 | QListIterator<ZoneField> itZone( zones ); |
473 | for ( itZone.toFirst(); itZone.current(); ++itZone ) { | 473 | for ( itZone.toFirst(); itZone.current(); ++itZone ) { |
474 | ZoneField *pZone = itZone.current(); | 474 | ZoneField *pZone = itZone.current(); |
475 | if ( continentList.contains( pZone->country() ) == 0 ) { | 475 | if ( continentList.contains( pZone->country() ) == 0 ) { |
476 | QString name; | 476 | QString name; |
477 | QListViewItem *item; | 477 | QListViewItem *item; |
478 | if ( !(pZone->country().length() > 24) ) { | 478 | if ( !(pZone->country().length() > 24) ) { |
479 | name = pZone->country().left(pZone->country().length()-1 ); | 479 | name = pZone->country().left(pZone->country().length()-1 ); |
480 | } else { | 480 | } else { |
481 | name = pZone->country().left( 24 ); | 481 | name = pZone->country().left( 24 ); |
482 | } | 482 | } |
483 | item = new QListViewItem( continentView, name, pZone->country() ); | 483 | item = new QListViewItem( continentView, name, pZone->country() ); |
484 | continentList.append( pZone->country() ); | 484 | continentList.append( pZone->country() ); |
485 | } | 485 | } |
486 | } | 486 | } |
487 | 487 | ||
488 | cityView = new QListView( hBox ); | 488 | cityView = new QListView( hBox ); |
489 | cityView->addColumn( tr("City") ); | 489 | cityView->addColumn( tr("City") ); |
490 | 490 | ||
491 | layout->addWidget( hBox ); | 491 | layout->addWidget( hBox ); |
492 | return returnWidget; | 492 | return returnWidget; |
493 | } | 493 | } |
494 | 494 | ||
495 | void ZoneMap::slotGetCities( QListViewItem * contItem) { | 495 | void ZoneMap::slotGetCities( QListViewItem * contItem) { |
496 | 496 | ||
497 | cityView->clear(); | 497 | cityView->clear(); |
498 | selectedCont = contItem->text( 1 ); | 498 | selectedCont = contItem->text( 1 ); |
499 | QListIterator<ZoneField> itZone( zones ); | 499 | QListIterator<ZoneField> itZone( zones ); |
500 | for ( itZone.toFirst(); itZone.current(); ++itZone ) { | 500 | for ( itZone.toFirst(); itZone.current(); ++itZone ) { |
501 | ZoneField *pZone = itZone.current(); | 501 | ZoneField *pZone = itZone.current(); |
502 | if ( pZone->country() == contItem->text( 1 ) ) { | 502 | if ( pZone->country() == contItem->text( 1 ) ) { |
503 | QListViewItem *item; | 503 | QListViewItem *item; |
504 | item = new QListViewItem( cityView, pZone->city() ); | 504 | item = new QListViewItem( cityView, pZone->city() ); |
505 | connect ( cityView, SIGNAL( clicked ( QListViewItem* ) ), this, SLOT( slotCitySelected( QListViewItem* ) ) ); | 505 | connect ( cityView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( slotCitySelected(QListViewItem*) ) ); |
506 | } | 506 | } |
507 | } | 507 | } |
508 | } | 508 | } |
509 | 509 | ||
510 | void ZoneMap::slotCitySelected( QListViewItem *cityItem ) { | 510 | void ZoneMap::slotCitySelected( QListViewItem *cityItem ) { |
511 | if ( cityItem ) { | 511 | if ( cityItem ) { |
512 | emit signalTz( selectedCont, cityItem->text( 0 ) ); | 512 | emit signalTz( selectedCont, cityItem->text( 0 ) ); |
513 | } | 513 | } |
514 | } | 514 | } |
515 | 515 | ||
516 | void ZoneMap::drawCities( QPainter *p ) | 516 | void ZoneMap::drawCities( QPainter *p ) |
517 | { | 517 | { |
518 | int x, y, j; | 518 | int x, y, j; |
519 | // draw in the cities | 519 | // draw in the cities |
520 | // for testing only as when you put it | 520 | // for testing only as when you put it |
521 | // on the small screen it looks awful and not to mention useless | 521 | // on the small screen it looks awful and not to mention useless |
522 | p->setPen( red ); | 522 | p->setPen( red ); |
523 | QListIterator<ZoneField> itZone( zones ); | 523 | QListIterator<ZoneField> itZone( zones ); |
524 | for ( itZone.toFirst(), j = 0; itZone.current(); ++itZone, j++ ) { | 524 | for ( itZone.toFirst(), j = 0; itZone.current(); ++itZone, j++ ) { |
525 | ZoneField *pZone = itZone.current(); | 525 | ZoneField *pZone = itZone.current(); |
526 | zoneToWin( pZone->x(), pZone->y(), x, y ); | 526 | zoneToWin( pZone->x(), pZone->y(), x, y ); |
527 | if ( x > wImg ) | 527 | if ( x > wImg ) |
528 | x = x - wImg; | 528 | x = x - wImg; |
529 | p->drawRect( x - iCITYOFFSET, y - iCITYOFFSET, iCITYSIZE, iCITYSIZE); | 529 | p->drawRect( x - iCITYOFFSET, y - iCITYOFFSET, iCITYSIZE, iCITYSIZE); |
530 | } | 530 | } |
531 | } | 531 | } |
532 | 532 | ||
533 | static void dayNight(QImage *pImage) | 533 | static void dayNight(QImage *pImage) |
534 | { | 534 | { |
535 | // create a mask the functions from sun.h | 535 | // create a mask the functions from sun.h |
536 | double dJulian, | 536 | double dJulian, |
537 | dSunRad, | 537 | dSunRad, |
538 | dSunDecl, | 538 | dSunDecl, |
539 | dSunRadius, | 539 | dSunRadius, |
540 | dSunLong; | 540 | dSunLong; |
541 | int wImage = pImage->width(), | 541 | int wImage = pImage->width(), |
542 | hImage = pImage->height(), | 542 | hImage = pImage->height(), |
543 | iStart, | 543 | iStart, |
544 | iStop, | 544 | iStop, |
545 | iMid, | 545 | iMid, |
546 | relw, | 546 | relw, |
547 | i; | 547 | i; |
548 | short wtab[ wImage ]; | 548 | short wtab[ wImage ]; |
549 | time_t tCurrent; | 549 | time_t tCurrent; |
550 | struct tm *pTm; | 550 | struct tm *pTm; |
551 | 551 | ||
552 | // get the position of the sun bassed on our current time... | 552 | // get the position of the sun bassed on our current time... |
553 | tCurrent = time( NULL ); | 553 | tCurrent = time( NULL ); |
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp index dc8e993..2b64c47 100644 --- a/core/settings/launcher/menusettings.cpp +++ b/core/settings/launcher/menusettings.cpp | |||
@@ -25,151 +25,151 @@ | |||
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "menusettings.h" | 29 | #include "menusettings.h" |
30 | 30 | ||
31 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | #include <qpe/qlibrary.h> | 32 | #include <qpe/qlibrary.h> |
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/menuappletinterface.h> | 34 | #include <qpe/menuappletinterface.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 35 | #include <qpe/qcopenvelope_qws.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qheader.h> | 40 | #include <qheader.h> |
41 | #include <qlayout.h> | 41 | #include <qlayout.h> |
42 | #include <qlabel.h> | 42 | #include <qlabel.h> |
43 | #include <qwhatsthis.h> | 43 | #include <qwhatsthis.h> |
44 | 44 | ||
45 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | 46 | ||
47 | 47 | ||
48 | MenuSettings::MenuSettings ( QWidget *parent, const char *name ) | 48 | MenuSettings::MenuSettings ( QWidget *parent, const char *name ) |
49 | : QWidget ( parent, name ) | 49 | : QWidget ( parent, name ) |
50 | { | 50 | { |
51 | m_applets_changed = false; | 51 | m_applets_changed = false; |
52 | 52 | ||
53 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 53 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
54 | 54 | ||
55 | QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); | 55 | QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); |
56 | lay-> addWidget ( l ); | 56 | lay-> addWidget ( l ); |
57 | 57 | ||
58 | m_list = new QListView ( this ); | 58 | m_list = new QListView ( this ); |
59 | m_list-> addColumn ( "foobar" ); | 59 | m_list-> addColumn ( "foobar" ); |
60 | m_list-> header ( )-> hide ( ); | 60 | m_list-> header ( )-> hide ( ); |
61 | 61 | ||
62 | lay-> addWidget ( m_list ); | 62 | lay-> addWidget ( m_list ); |
63 | 63 | ||
64 | m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); | 64 | m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); |
65 | lay-> addWidget ( m_menutabs ); | 65 | lay-> addWidget ( m_menutabs ); |
66 | 66 | ||
67 | m_menusubpopup = new QCheckBox ( tr( "Show Applications in Subpopups" ), this ); | 67 | m_menusubpopup = new QCheckBox ( tr( "Show Applications in Subpopups" ), this ); |
68 | lay-> addWidget ( m_menusubpopup ); | 68 | lay-> addWidget ( m_menusubpopup ); |
69 | 69 | ||
70 | QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." )); | 70 | QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." )); |
71 | QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." )); | 71 | QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." )); |
72 | 72 | ||
73 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); | 73 | connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged())); |
74 | 74 | ||
75 | init ( ); | 75 | init ( ); |
76 | } | 76 | } |
77 | 77 | ||
78 | void MenuSettings::init ( ) | 78 | void MenuSettings::init ( ) |
79 | { | 79 | { |
80 | Config cfg ( "StartMenu" ); | 80 | Config cfg ( "StartMenu" ); |
81 | cfg. setGroup ( "Applets" ); | 81 | cfg. setGroup ( "Applets" ); |
82 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 82 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
83 | 83 | ||
84 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 84 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
85 | #ifdef Q_OS_MACX | 85 | #ifdef Q_OS_MACX |
86 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); | 86 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); |
87 | #else | 87 | #else |
88 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 88 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
89 | #endif /* Q_OS_MACX */ | 89 | #endif /* Q_OS_MACX */ |
90 | 90 | ||
91 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 91 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
92 | QString name; | 92 | QString name; |
93 | QPixmap icon; | 93 | QPixmap icon; |
94 | MenuAppletInterface *iface = 0; | 94 | MenuAppletInterface *iface = 0; |
95 | 95 | ||
96 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 96 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
97 | lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface ); | 97 | lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface ); |
98 | if ( iface ) { | 98 | if ( iface ) { |
99 | QString lang = getenv( "LANG" ); | 99 | QString lang = getenv( "LANG" ); |
100 | QTranslator *trans = new QTranslator ( qApp ); | 100 | QTranslator *trans = new QTranslator ( qApp ); |
101 | QString type = (*it). left ((*it). find (".")); | 101 | QString type = (*it). left ((*it). find (".")); |
102 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; | 102 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; |
103 | if ( trans-> load ( tfn )) | 103 | if ( trans-> load ( tfn )) |
104 | qApp-> installTranslator ( trans ); | 104 | qApp-> installTranslator ( trans ); |
105 | else | 105 | else |
106 | delete trans; | 106 | delete trans; |
107 | name = iface-> name ( ); | 107 | name = iface-> name ( ); |
108 | icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); | 108 | icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); |
109 | iface-> release ( ); | 109 | iface-> release ( ); |
110 | lib-> unload ( ); | 110 | lib-> unload ( ); |
111 | 111 | ||
112 | QCheckListItem *item; | 112 | QCheckListItem *item; |
113 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); | 113 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); |
114 | if ( !icon. isNull ( )) | 114 | if ( !icon. isNull ( )) |
115 | item-> setPixmap ( 0, icon ); | 115 | item-> setPixmap ( 0, icon ); |
116 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); | 116 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); |
117 | m_applets [*it] = item; | 117 | m_applets [*it] = item; |
118 | } else { | 118 | } else { |
119 | delete lib; | 119 | delete lib; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | cfg. setGroup ( "Menu" ); | 123 | cfg. setGroup ( "Menu" ); |
124 | m_menutabs->setChecked( cfg.readBoolEntry( "LauncherTabs", true ) ); | 124 | m_menutabs->setChecked( cfg.readBoolEntry( "LauncherTabs", true ) ); |
125 | m_menusubpopup->setChecked( cfg.readBoolEntry( "LauncherSubPopup", true ) ); | 125 | m_menusubpopup->setChecked( cfg.readBoolEntry( "LauncherSubPopup", true ) ); |
126 | m_menusubpopup->setEnabled( m_menutabs->isChecked() ); | 126 | m_menusubpopup->setEnabled( m_menutabs->isChecked() ); |
127 | connect( m_menutabs, SIGNAL( stateChanged( int ) ), m_menusubpopup, SLOT( setEnabled( bool ) ) ); | 127 | connect( m_menutabs, SIGNAL( stateChanged(int) ), m_menusubpopup, SLOT( setEnabled(bool) ) ); |
128 | 128 | ||
129 | } | 129 | } |
130 | 130 | ||
131 | void MenuSettings::appletChanged() | 131 | void MenuSettings::appletChanged() |
132 | { | 132 | { |
133 | m_applets_changed = true; | 133 | m_applets_changed = true; |
134 | } | 134 | } |
135 | 135 | ||
136 | void MenuSettings::accept ( ) | 136 | void MenuSettings::accept ( ) |
137 | { | 137 | { |
138 | bool apps_changed = false; | 138 | bool apps_changed = false; |
139 | 139 | ||
140 | Config cfg ( "StartMenu" ); | 140 | Config cfg ( "StartMenu" ); |
141 | cfg. setGroup ( "Applets" ); | 141 | cfg. setGroup ( "Applets" ); |
142 | if ( m_applets_changed ) { | 142 | if ( m_applets_changed ) { |
143 | QStringList exclude; | 143 | QStringList exclude; |
144 | QMap <QString, QCheckListItem *>::Iterator it; | 144 | QMap <QString, QCheckListItem *>::Iterator it; |
145 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { | 145 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { |
146 | if ( !(*it)-> isOn ( )) | 146 | if ( !(*it)-> isOn ( )) |
147 | exclude << it. key ( ); | 147 | exclude << it. key ( ); |
148 | } | 148 | } |
149 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); | 149 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); |
150 | } | 150 | } |
151 | cfg. writeEntry ( "SafeMode", false ); | 151 | cfg. writeEntry ( "SafeMode", false ); |
152 | 152 | ||
153 | cfg. setGroup ( "Menu" ); | 153 | cfg. setGroup ( "Menu" ); |
154 | 154 | ||
155 | if ( m_menutabs-> isChecked ( ) != cfg. readBoolEntry ( "LauncherTabs", true )) { | 155 | if ( m_menutabs-> isChecked ( ) != cfg. readBoolEntry ( "LauncherTabs", true )) { |
156 | apps_changed = true; | 156 | apps_changed = true; |
157 | cfg. writeEntry ( "LauncherTabs", m_menutabs-> isChecked ( )); | 157 | cfg. writeEntry ( "LauncherTabs", m_menutabs-> isChecked ( )); |
158 | } | 158 | } |
159 | 159 | ||
160 | if ( m_menusubpopup-> isChecked ( ) != cfg. readBoolEntry ( "LauncherSubPopup", true )) { | 160 | if ( m_menusubpopup-> isChecked ( ) != cfg. readBoolEntry ( "LauncherSubPopup", true )) { |
161 | apps_changed = true; | 161 | apps_changed = true; |
162 | cfg. writeEntry ( "LauncherSubPopup", m_menusubpopup-> isChecked ( )); | 162 | cfg. writeEntry ( "LauncherSubPopup", m_menusubpopup-> isChecked ( )); |
163 | } | 163 | } |
164 | 164 | ||
165 | cfg. write ( ); | 165 | cfg. write ( ); |
166 | 166 | ||
167 | if ( m_applets_changed ) { | 167 | if ( m_applets_changed ) { |
168 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); | 168 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); |
169 | m_applets_changed = false; | 169 | m_applets_changed = false; |
170 | } | 170 | } |
171 | if ( apps_changed ) { | 171 | if ( apps_changed ) { |
172 | // currently use reloadApplets() since reloadApps is now used exclusive for server | 172 | // currently use reloadApplets() since reloadApps is now used exclusive for server |
173 | // to refresh the tabs. But what we want here is also a refresh of the startmenu entries | 173 | // to refresh the tabs. But what we want here is also a refresh of the startmenu entries |
174 | QCopEnvelope ( "QPE/TaskBar", "reloadApps()" ); | 174 | QCopEnvelope ( "QPE/TaskBar", "reloadApps()" ); |
175 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); | 175 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); |
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index f79ad40..c0d1cf2 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -274,198 +274,198 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
274 | tw-> addTab ( createFontTab ( tw ), "font", tr( "Font" )); | 274 | tw-> addTab ( createFontTab ( tw ), "font", tr( "Font" )); |
275 | tw-> addTab ( createIconTab ( tw ), "pixmap", tr( "Icons" ) ); | 275 | tw-> addTab ( createIconTab ( tw ), "pixmap", tr( "Icons" ) ); |
276 | 276 | ||
277 | tw-> setCurrentTab ( bgtab ); | 277 | tw-> setCurrentTab ( bgtab ); |
278 | 278 | ||
279 | QWidget *sample = new QVBox ( this ); | 279 | QWidget *sample = new QVBox ( this ); |
280 | QTabBar *tb = new QTabBar ( sample ); | 280 | QTabBar *tb = new QTabBar ( sample ); |
281 | QString name ( tr( "Previewing %1" ). arg ( tabname )); | 281 | QString name ( tr( "Previewing %1" ). arg ( tabname )); |
282 | 282 | ||
283 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); | 283 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); |
284 | 284 | ||
285 | m_sample = new SampleView ( sample ); | 285 | m_sample = new SampleView ( sample ); |
286 | 286 | ||
287 | lay-> addWidget ( tw, 10 ); | 287 | lay-> addWidget ( tw, 10 ); |
288 | lay-> addWidget ( sample, 1 ); | 288 | lay-> addWidget ( sample, 1 ); |
289 | 289 | ||
290 | m_iconsize-> setButton ( tc. m_view ); | 290 | m_iconsize-> setButton ( tc. m_view ); |
291 | iconSizeClicked ( tc. m_view ); | 291 | iconSizeClicked ( tc. m_view ); |
292 | //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); | 292 | //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); |
293 | iconColorClicked ( m_iconcolor-> color ( )); | 293 | iconColorClicked ( m_iconcolor-> color ( )); |
294 | m_bgtype-> setButton ( tc. m_bg_type ); | 294 | m_bgtype-> setButton ( tc. m_bg_type ); |
295 | //m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 295 | //m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
296 | m_bgimage = tc. m_bg_image; | 296 | m_bgimage = tc. m_bg_image; |
297 | bgTypeClicked ( tc. m_bg_type ); | 297 | bgTypeClicked ( tc. m_bg_type ); |
298 | m_fontuse-> setChecked ( tc. m_font_use ); | 298 | m_fontuse-> setChecked ( tc. m_font_use ); |
299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); | 299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); |
300 | m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); | 300 | m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); |
301 | fontClicked ( m_fontselect-> selectedFont ( )); | 301 | fontClicked ( m_fontselect-> selectedFont ( )); |
302 | 302 | ||
303 | QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); | 303 | QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); |
304 | } | 304 | } |
305 | 305 | ||
306 | 306 | ||
307 | TabDialog::~TabDialog ( ) | 307 | TabDialog::~TabDialog ( ) |
308 | { | 308 | { |
309 | } | 309 | } |
310 | 310 | ||
311 | QWidget *TabDialog::createFontTab ( QWidget *parent ) | 311 | QWidget *TabDialog::createFontTab ( QWidget *parent ) |
312 | { | 312 | { |
313 | QWidget *tab = new QWidget ( parent, "FontTab" ); | 313 | QWidget *tab = new QWidget ( parent, "FontTab" ); |
314 | QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); | 314 | QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); |
315 | 315 | ||
316 | m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); | 316 | m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); |
317 | vertLayout-> addWidget ( m_fontuse ); | 317 | vertLayout-> addWidget ( m_fontuse ); |
318 | 318 | ||
319 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); | 319 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); |
320 | vertLayout-> addWidget ( m_fontselect ); | 320 | vertLayout-> addWidget ( m_fontselect ); |
321 | 321 | ||
322 | connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool ))); | 322 | connect ( m_fontuse, SIGNAL( toggled(bool)), m_fontselect, SLOT( setEnabled(bool))); |
323 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 323 | connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), |
324 | this, SLOT( fontClicked ( const QFont & ))); | 324 | this, SLOT( fontClicked(const QFont&))); |
325 | 325 | ||
326 | return tab; | 326 | return tab; |
327 | } | 327 | } |
328 | 328 | ||
329 | QWidget *TabDialog::createBgTab ( QWidget *parent ) | 329 | QWidget *TabDialog::createBgTab ( QWidget *parent ) |
330 | { | 330 | { |
331 | QWidget *tab = new QWidget( parent, "BgTab" ); | 331 | QWidget *tab = new QWidget( parent, "BgTab" ); |
332 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 332 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
333 | 333 | ||
334 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 334 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
335 | gridLayout-> setColStretch ( 1, 10 ); | 335 | gridLayout-> setColStretch ( 1, 10 ); |
336 | 336 | ||
337 | QLabel* label = new QLabel( tr( "Type:" ), tab ); | 337 | QLabel* label = new QLabel( tr( "Type:" ), tab ); |
338 | gridLayout-> addWidget ( label, 0, 0 ); | 338 | gridLayout-> addWidget ( label, 0, 0 ); |
339 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); | 339 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); |
340 | m_bgtype-> hide ( ); | 340 | m_bgtype-> hide ( ); |
341 | m_bgtype-> setExclusive ( true ); | 341 | m_bgtype-> setExclusive ( true ); |
342 | 342 | ||
343 | QRadioButton *rb; | 343 | QRadioButton *rb; |
344 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); | 344 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); |
345 | m_bgtype-> insert ( rb, TabConfig::Ruled ); | 345 | m_bgtype-> insert ( rb, TabConfig::Ruled ); |
346 | gridLayout-> addWidget( rb, 0, 1 ); | 346 | gridLayout-> addWidget( rb, 0, 1 ); |
347 | 347 | ||
348 | QHBoxLayout *hb = new QHBoxLayout ( ); | 348 | QHBoxLayout *hb = new QHBoxLayout ( ); |
349 | hb-> setSpacing ( 3 ); | 349 | hb-> setSpacing ( 3 ); |
350 | 350 | ||
351 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); | 351 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); |
352 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); | 352 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); |
353 | hb-> addWidget ( rb ); | 353 | hb-> addWidget ( rb ); |
354 | hb-> addSpacing ( 10 ); | 354 | hb-> addSpacing ( 10 ); |
355 | 355 | ||
356 | m_solidcolor = new OColorButton ( tab, QColor ( m_tc. m_bg_color ) ); | 356 | m_solidcolor = new OColorButton ( tab, QColor ( m_tc. m_bg_color ) ); |
357 | connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & ))); | 357 | connect ( m_solidcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( bgColorClicked(const QColor&))); |
358 | hb-> addWidget ( m_solidcolor ); | 358 | hb-> addWidget ( m_solidcolor ); |
359 | hb-> addStretch ( 10 ); | 359 | hb-> addStretch ( 10 ); |
360 | 360 | ||
361 | gridLayout-> addLayout ( hb, 1, 1 ); | 361 | gridLayout-> addLayout ( hb, 1, 1 ); |
362 | 362 | ||
363 | hb = new QHBoxLayout ( ); | 363 | hb = new QHBoxLayout ( ); |
364 | hb-> setSpacing ( 3 ); | 364 | hb-> setSpacing ( 3 ); |
365 | 365 | ||
366 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); | 366 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); |
367 | m_bgtype-> insert ( rb, TabConfig::Image ); | 367 | m_bgtype-> insert ( rb, TabConfig::Image ); |
368 | hb-> addWidget( rb ); | 368 | hb-> addWidget( rb ); |
369 | hb-> addSpacing ( 10 ); | 369 | hb-> addSpacing ( 10 ); |
370 | 370 | ||
371 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); | 371 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); |
372 | connect ( m_imagebrowse, SIGNAL( clicked ( )), this, SLOT( bgImageClicked ( ))); | 372 | connect ( m_imagebrowse, SIGNAL( clicked()), this, SLOT( bgImageClicked())); |
373 | hb-> addWidget ( m_imagebrowse ); | 373 | hb-> addWidget ( m_imagebrowse ); |
374 | hb-> addStretch ( 10 ); | 374 | hb-> addStretch ( 10 ); |
375 | 375 | ||
376 | gridLayout-> addLayout ( hb, 2, 1 ); | 376 | gridLayout-> addLayout ( hb, 2, 1 ); |
377 | 377 | ||
378 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); | 378 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); |
379 | connect ( p, SIGNAL( clicked ( )), this, SLOT( bgDefaultClicked ( ))); | 379 | connect ( p, SIGNAL( clicked()), this, SLOT( bgDefaultClicked())); |
380 | gridLayout-> addWidget ( p, 3, 1 ); | 380 | gridLayout-> addWidget ( p, 3, 1 ); |
381 | 381 | ||
382 | connect ( m_bgtype, SIGNAL( clicked ( int )), this, SLOT( bgTypeClicked ( int ))); | 382 | connect ( m_bgtype, SIGNAL( clicked(int)), this, SLOT( bgTypeClicked(int))); |
383 | 383 | ||
384 | vertLayout-> addStretch ( 10 ); | 384 | vertLayout-> addStretch ( 10 ); |
385 | 385 | ||
386 | return tab; | 386 | return tab; |
387 | } | 387 | } |
388 | 388 | ||
389 | QWidget *TabDialog::createIconTab ( QWidget *parent ) | 389 | QWidget *TabDialog::createIconTab ( QWidget *parent ) |
390 | { | 390 | { |
391 | QWidget *tab = new QWidget( parent, "IconTab" ); | 391 | QWidget *tab = new QWidget( parent, "IconTab" ); |
392 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 392 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
393 | 393 | ||
394 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 394 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
395 | gridLayout-> setColStretch ( 1, 10 ); | 395 | gridLayout-> setColStretch ( 1, 10 ); |
396 | 396 | ||
397 | QLabel* label = new QLabel( tr( "Size:" ), tab ); | 397 | QLabel* label = new QLabel( tr( "Size:" ), tab ); |
398 | gridLayout-> addWidget ( label, 0, 0 ); | 398 | gridLayout-> addWidget ( label, 0, 0 ); |
399 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); | 399 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); |
400 | m_iconsize-> hide ( ); | 400 | m_iconsize-> hide ( ); |
401 | m_iconsize-> setExclusive ( true ); | 401 | m_iconsize-> setExclusive ( true ); |
402 | 402 | ||
403 | QRadioButton *rb; | 403 | QRadioButton *rb; |
404 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); | 404 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); |
405 | m_iconsize-> insert ( rb, TabConfig::List ); | 405 | m_iconsize-> insert ( rb, TabConfig::List ); |
406 | gridLayout-> addWidget( rb, 0, 1 ); | 406 | gridLayout-> addWidget( rb, 0, 1 ); |
407 | 407 | ||
408 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); | 408 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); |
409 | m_iconsize-> insert ( rb, TabConfig::Icon ); | 409 | m_iconsize-> insert ( rb, TabConfig::Icon ); |
410 | gridLayout-> addWidget( rb, 1, 1 ); | 410 | gridLayout-> addWidget( rb, 1, 1 ); |
411 | 411 | ||
412 | connect ( m_iconsize, SIGNAL( clicked ( int )), this, SLOT( iconSizeClicked ( int ))); | 412 | connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int))); |
413 | 413 | ||
414 | //vertLayout-> addSpacing ( 8 ); | 414 | //vertLayout-> addSpacing ( 8 ); |
415 | 415 | ||
416 | //gridLayout = new QGridLayout ( vertLayout ); | 416 | //gridLayout = new QGridLayout ( vertLayout ); |
417 | gridLayout-> addRowSpacing ( 2, 8 ); | 417 | gridLayout-> addRowSpacing ( 2, 8 ); |
418 | 418 | ||
419 | label = new QLabel ( tr( "Color:" ), tab ); | 419 | label = new QLabel ( tr( "Color:" ), tab ); |
420 | gridLayout-> addWidget ( label, 3, 0 ); | 420 | gridLayout-> addWidget ( label, 3, 0 ); |
421 | 421 | ||
422 | m_iconcolor = new OColorButton ( tab, QColor ( m_tc. m_text_color ) ); | 422 | m_iconcolor = new OColorButton ( tab, QColor ( m_tc. m_text_color ) ); |
423 | connect ( m_iconcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( iconColorClicked ( const QColor & ))); | 423 | connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&))); |
424 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); | 424 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); |
425 | 425 | ||
426 | vertLayout-> addStretch ( 10 ); | 426 | vertLayout-> addStretch ( 10 ); |
427 | 427 | ||
428 | return tab; | 428 | return tab; |
429 | } | 429 | } |
430 | 430 | ||
431 | 431 | ||
432 | void TabDialog::iconSizeClicked ( int s ) | 432 | void TabDialog::iconSizeClicked ( int s ) |
433 | { | 433 | { |
434 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); | 434 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); |
435 | } | 435 | } |
436 | 436 | ||
437 | void TabDialog::fontClicked ( const QFont &f ) | 437 | void TabDialog::fontClicked ( const QFont &f ) |
438 | { | 438 | { |
439 | m_sample-> setViewFont ( f ); | 439 | m_sample-> setViewFont ( f ); |
440 | } | 440 | } |
441 | 441 | ||
442 | void TabDialog::bgTypeClicked ( int t ) | 442 | void TabDialog::bgTypeClicked ( int t ) |
443 | { | 443 | { |
444 | QString s; | 444 | QString s; |
445 | 445 | ||
446 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) | 446 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) |
447 | m_bgtype-> setButton ( t ); | 447 | m_bgtype-> setButton ( t ); |
448 | 448 | ||
449 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); | 449 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); |
450 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); | 450 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); |
451 | 451 | ||
452 | if ( t == TabConfig::SolidColor ) | 452 | if ( t == TabConfig::SolidColor ) |
453 | s = m_solidcolor-> color ( ). name ( ); | 453 | s = m_solidcolor-> color ( ). name ( ); |
454 | else if ( t == TabConfig::Image ) | 454 | else if ( t == TabConfig::Image ) |
455 | s = Resource::findPixmap ( m_bgimage ); | 455 | s = Resource::findPixmap ( m_bgimage ); |
456 | 456 | ||
457 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); | 457 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); |
458 | } | 458 | } |
459 | 459 | ||
460 | void TabDialog::bgColorClicked ( const QColor & ) | 460 | void TabDialog::bgColorClicked ( const QColor & ) |
461 | { | 461 | { |
462 | bgTypeClicked ( TabConfig::SolidColor ); | 462 | bgTypeClicked ( TabConfig::SolidColor ); |
463 | } | 463 | } |
464 | 464 | ||
465 | void TabDialog::iconColorClicked ( const QColor &col ) | 465 | void TabDialog::iconColorClicked ( const QColor &col ) |
466 | { | 466 | { |
467 | m_sample-> setTextColor ( col ); | 467 | m_sample-> setTextColor ( col ); |
468 | } | 468 | } |
469 | 469 | ||
470 | void TabDialog::bgImageClicked ( ) | 470 | void TabDialog::bgImageClicked ( ) |
471 | { | 471 | { |
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 17a1609..e5a7087 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -21,105 +21,105 @@ | |||
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "tabssettings.h" | 28 | #include "tabssettings.h" |
29 | 29 | ||
30 | #include <qpe/resource.h> | 30 | #include <qpe/resource.h> |
31 | #include <qpe/applnk.h> | 31 | #include <qpe/applnk.h> |
32 | #include <qpe/mimetype.h> | 32 | #include <qpe/mimetype.h> |
33 | #include <qpe/qcopenvelope_qws.h> | 33 | #include <qpe/qcopenvelope_qws.h> |
34 | #include <qpe/config.h> | 34 | #include <qpe/config.h> |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | 36 | ||
37 | #include <qlistbox.h> | 37 | #include <qlistbox.h> |
38 | #include <qpushbutton.h> | 38 | #include <qpushbutton.h> |
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | #include <qlabel.h> | 40 | #include <qlabel.h> |
41 | #include <qwhatsthis.h> | 41 | #include <qwhatsthis.h> |
42 | #include <qcheckbox.h> | 42 | #include <qcheckbox.h> |
43 | 43 | ||
44 | #include "tabdialog.h" | 44 | #include "tabdialog.h" |
45 | 45 | ||
46 | #include <stdlib.h> | 46 | #include <stdlib.h> |
47 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
48 | 48 | ||
49 | 49 | ||
50 | #define GLOBALID ".global." | 50 | #define GLOBALID ".global." |
51 | 51 | ||
52 | 52 | ||
53 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | 53 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) |
54 | : QWidget ( parent, name ) | 54 | : QWidget ( parent, name ) |
55 | { | 55 | { |
56 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); | 56 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); |
57 | 57 | ||
58 | QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); | 58 | QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); |
59 | lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); | 59 | lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); |
60 | 60 | ||
61 | m_list = new QListBox ( this ); | 61 | m_list = new QListBox ( this ); |
62 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); | 62 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); |
63 | 63 | ||
64 | QWhatsThis::add ( m_list, tr( "foobar" )); | 64 | QWhatsThis::add ( m_list, tr( "foobar" )); |
65 | 65 | ||
66 | QPushButton *p1, *p2, *p3; | 66 | QPushButton *p1, *p2, *p3; |
67 | p1 = new QPushButton ( tr( "New" ), this ); | 67 | p1 = new QPushButton ( tr( "New" ), this ); |
68 | lay-> addWidget ( p1, 1, 1 ); | 68 | lay-> addWidget ( p1, 1, 1 ); |
69 | connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); | 69 | connect ( p1, SIGNAL( clicked()), this, SLOT( newClicked())); |
70 | 70 | ||
71 | p2 = new QPushButton ( tr( "Edit" ), this ); | 71 | p2 = new QPushButton ( tr( "Edit" ), this ); |
72 | lay-> addWidget ( p2, 2, 1 ); | 72 | lay-> addWidget ( p2, 2, 1 ); |
73 | connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); | 73 | connect ( p2, SIGNAL( clicked()), this, SLOT( editClicked())); |
74 | 74 | ||
75 | p3 = new QPushButton ( tr( "Delete" ), this ); | 75 | p3 = new QPushButton ( tr( "Delete" ), this ); |
76 | lay-> addWidget ( p3, 3, 1 ); | 76 | lay-> addWidget ( p3, 3, 1 ); |
77 | connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); | 77 | connect ( p3, SIGNAL( clicked()), this, SLOT( deleteClicked())); |
78 | 78 | ||
79 | lay-> setRowStretch ( 4, 10 ); | 79 | lay-> setRowStretch ( 4, 10 ); |
80 | 80 | ||
81 | m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); | 81 | m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); |
82 | lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); | 82 | lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); |
83 | 83 | ||
84 | m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); | 84 | m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); |
85 | lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); | 85 | lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); |
86 | 86 | ||
87 | p1-> setEnabled ( false ); | 87 | p1-> setEnabled ( false ); |
88 | p3-> setEnabled ( false ); | 88 | p3-> setEnabled ( false ); |
89 | 89 | ||
90 | init ( ); | 90 | init ( ); |
91 | 91 | ||
92 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); | 92 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); |
93 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 93 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
94 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); | 94 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); |
95 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 95 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
96 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); | 96 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); |
97 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); | 97 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); |
98 | } | 98 | } |
99 | 99 | ||
100 | void TabsSettings::init ( ) | 100 | void TabsSettings::init ( ) |
101 | { | 101 | { |
102 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); | 102 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); |
103 | QStringList types = rootFolder. types ( ); | 103 | QStringList types = rootFolder. types ( ); |
104 | 104 | ||
105 | m_list-> insertItem ( tr( "All Tabs" )); | 105 | m_list-> insertItem ( tr( "All Tabs" )); |
106 | m_ids << GLOBALID; | 106 | m_ids << GLOBALID; |
107 | 107 | ||
108 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 108 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
109 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); | 109 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); |
110 | m_ids << *it; | 110 | m_ids << *it; |
111 | } | 111 | } |
112 | QImage img ( Resource::loadImage ( "DocsIcon" )); | 112 | QImage img ( Resource::loadImage ( "DocsIcon" )); |
113 | QPixmap pix; | 113 | QPixmap pix; |
114 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); | 114 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); |
115 | m_list-> insertItem ( pix, tr( "Documents" )); | 115 | m_list-> insertItem ( pix, tr( "Documents" )); |
116 | m_ids += "Documents"; // No tr | 116 | m_ids += "Documents"; // No tr |
117 | 117 | ||
118 | Config cfg ( "Launcher" ); | 118 | Config cfg ( "Launcher" ); |
119 | 119 | ||
120 | readTabSettings ( cfg ); | 120 | readTabSettings ( cfg ); |
121 | 121 | ||
122 | cfg. setGroup ( "GUI" ); | 122 | cfg. setGroup ( "GUI" ); |
123 | m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); | 123 | m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); |
124 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); | 124 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); |
125 | } | 125 | } |
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp index badb98f..43886c9 100644 --- a/core/settings/launcher/taskbarsettings.cpp +++ b/core/settings/launcher/taskbarsettings.cpp | |||
@@ -17,97 +17,97 @@ | |||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "taskbarsettings.h" | 29 | #include "taskbarsettings.h" |
30 | 30 | ||
31 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | #include <qpe/qlibrary.h> | 32 | #include <qpe/qlibrary.h> |
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/taskbarappletinterface.h> | 34 | #include <qpe/taskbarappletinterface.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 35 | #include <qpe/qcopenvelope_qws.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | #include <qheader.h> | 39 | #include <qheader.h> |
40 | #include <qlayout.h> | 40 | #include <qlayout.h> |
41 | #include <qlabel.h> | 41 | #include <qlabel.h> |
42 | #include <qwhatsthis.h> | 42 | #include <qwhatsthis.h> |
43 | 43 | ||
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | 45 | ||
46 | 46 | ||
47 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) | 47 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) |
48 | : QWidget ( parent, name ) | 48 | : QWidget ( parent, name ) |
49 | { | 49 | { |
50 | m_applets_changed = false; | 50 | m_applets_changed = false; |
51 | 51 | ||
52 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 52 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
53 | 53 | ||
54 | QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); | 54 | QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); |
55 | lay-> addWidget ( l ); | 55 | lay-> addWidget ( l ); |
56 | 56 | ||
57 | m_list = new QListView ( this ); | 57 | m_list = new QListView ( this ); |
58 | m_list-> addColumn ( "foobar" ); | 58 | m_list-> addColumn ( "foobar" ); |
59 | m_list-> header ( )-> hide ( ); | 59 | m_list-> header ( )-> hide ( ); |
60 | 60 | ||
61 | lay-> addWidget ( m_list ); | 61 | lay-> addWidget ( m_list ); |
62 | 62 | ||
63 | QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); | 63 | QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); |
64 | 64 | ||
65 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); | 65 | connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged())); |
66 | 66 | ||
67 | init ( ); | 67 | init ( ); |
68 | } | 68 | } |
69 | 69 | ||
70 | void TaskbarSettings::init ( ) | 70 | void TaskbarSettings::init ( ) |
71 | { | 71 | { |
72 | Config cfg ( "Taskbar" ); | 72 | Config cfg ( "Taskbar" ); |
73 | cfg. setGroup ( "Applets" ); | 73 | cfg. setGroup ( "Applets" ); |
74 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 74 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
75 | 75 | ||
76 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 76 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
77 | #ifdef Q_OS_MACX | 77 | #ifdef Q_OS_MACX |
78 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); | 78 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); |
79 | #else | 79 | #else |
80 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 80 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
81 | #endif /* Q_OS_MACX */ | 81 | #endif /* Q_OS_MACX */ |
82 | 82 | ||
83 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 83 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
84 | QString name; | 84 | QString name; |
85 | QPixmap icon; | 85 | QPixmap icon; |
86 | TaskbarNamedAppletInterface *iface = 0; | 86 | TaskbarNamedAppletInterface *iface = 0; |
87 | 87 | ||
88 | qWarning("Load applet: %s", (*it).latin1() ); | 88 | qWarning("Load applet: %s", (*it).latin1() ); |
89 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 89 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
90 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); | 90 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); |
91 | qWarning("<1>"); | 91 | qWarning("<1>"); |
92 | if ( iface ) { | 92 | if ( iface ) { |
93 | qWarning("<2>"); | 93 | qWarning("<2>"); |
94 | QString lang = getenv( "LANG" ); | 94 | QString lang = getenv( "LANG" ); |
95 | QTranslator *trans = new QTranslator ( qApp ); | 95 | QTranslator *trans = new QTranslator ( qApp ); |
96 | QString type = (*it). left ((*it). find (".")); | 96 | QString type = (*it). left ((*it). find (".")); |
97 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; | 97 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; |
98 | if ( trans-> load ( tfn )) | 98 | if ( trans-> load ( tfn )) |
99 | qApp-> installTranslator ( trans ); | 99 | qApp-> installTranslator ( trans ); |
100 | else | 100 | else |
101 | delete trans; | 101 | delete trans; |
102 | name = iface-> name ( ); | 102 | name = iface-> name ( ); |
103 | icon = iface-> icon ( ); | 103 | icon = iface-> icon ( ); |
104 | iface-> release ( ); | 104 | iface-> release ( ); |
105 | } | 105 | } |
106 | qWarning("<3>"); | 106 | qWarning("<3>"); |
107 | if ( !iface ) { | 107 | if ( !iface ) { |
108 | qWarning("<4>"); | 108 | qWarning("<4>"); |
109 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); | 109 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); |
110 | 110 | ||
111 | if ( iface ) { | 111 | if ( iface ) { |
112 | qWarning("<5>"); | 112 | qWarning("<5>"); |
113 | name = (*it). mid ( 3 ); | 113 | name = (*it). mid ( 3 ); |
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 4baff8e..ce45836 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -127,133 +127,133 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
127 | contrast-> setValue ( contr ); | 127 | contrast-> setValue ( contr ); |
128 | } | 128 | } |
129 | 129 | ||
130 | // light sensor | 130 | // light sensor |
131 | auto_brightness-> setChecked ( config. readBoolEntry ( "LightSensor", false )); | 131 | auto_brightness-> setChecked ( config. readBoolEntry ( "LightSensor", false )); |
132 | m_sensordata = config. readListEntry ( "LightSensorData", ';' ); | 132 | m_sensordata = config. readListEntry ( "LightSensorData", ';' ); |
133 | 133 | ||
134 | config. setGroup ( "AC" ); | 134 | config. setGroup ( "AC" ); |
135 | 135 | ||
136 | // ac spinboxes | 136 | // ac spinboxes |
137 | interval_dim_ac-> setValue ( config. readNumEntry ( "Dim", 60 )); | 137 | interval_dim_ac-> setValue ( config. readNumEntry ( "Dim", 60 )); |
138 | interval_lightoff_ac-> setValue ( config. readNumEntry ( "LightOff", 120 )); | 138 | interval_lightoff_ac-> setValue ( config. readNumEntry ( "LightOff", 120 )); |
139 | interval_suspend_ac-> setValue ( config. readNumEntry ( "Suspend", 0 )); | 139 | interval_suspend_ac-> setValue ( config. readNumEntry ( "Suspend", 0 )); |
140 | 140 | ||
141 | // ac check and slider | 141 | // ac check and slider |
142 | LcdOffOnly_ac-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); | 142 | LcdOffOnly_ac-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); |
143 | 143 | ||
144 | // CPU frequency | 144 | // CPU frequency |
145 | frequency_ac->setCurrentItem( config.readNumEntry("Freq", 0) ); | 145 | frequency_ac->setCurrentItem( config.readNumEntry("Freq", 0) ); |
146 | 146 | ||
147 | // hinge action | 147 | // hinge action |
148 | closeHingeAction_ac->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); | 148 | closeHingeAction_ac->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); |
149 | 149 | ||
150 | bright = config. readNumEntry ( "Brightness", 255 ); | 150 | bright = config. readNumEntry ( "Brightness", 255 ); |
151 | brightness_ac-> setTickInterval ( QMAX( 16, 256 / m_bres )); | 151 | brightness_ac-> setTickInterval ( QMAX( 16, 256 / m_bres )); |
152 | brightness_ac-> setLineStep ( QMAX( 1, 256 / m_bres )); | 152 | brightness_ac-> setLineStep ( QMAX( 1, 256 / m_bres )); |
153 | brightness_ac-> setPageStep ( QMAX( 1, 256 / m_bres )); | 153 | brightness_ac-> setPageStep ( QMAX( 1, 256 / m_bres )); |
154 | brightness_ac-> setValue ( bright ); | 154 | brightness_ac-> setValue ( bright ); |
155 | 155 | ||
156 | if (m_cres) { | 156 | if (m_cres) { |
157 | contr = config. readNumEntry ( "Contrast", 127); | 157 | contr = config. readNumEntry ( "Contrast", 127); |
158 | contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); | 158 | contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); |
159 | contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); | 159 | contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); |
160 | contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); | 160 | contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); |
161 | contrast_ac-> setValue ( contr ); | 161 | contrast_ac-> setValue ( contr ); |
162 | } | 162 | } |
163 | 163 | ||
164 | // light sensor | 164 | // light sensor |
165 | auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); | 165 | auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); |
166 | m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); | 166 | m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); |
167 | 167 | ||
168 | // warnings | 168 | // warnings |
169 | config. setGroup ( "Warnings" ); | 169 | config. setGroup ( "Warnings" ); |
170 | warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); | 170 | warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); |
171 | lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); | 171 | lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); |
172 | criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); | 172 | criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); |
173 | 173 | ||
174 | m_resettimer = new QTimer ( this ); | 174 | m_resettimer = new QTimer ( this ); |
175 | connect ( m_resettimer, SIGNAL( timeout ( )), this, SLOT( resetBacklight ( ))); | 175 | connect ( m_resettimer, SIGNAL( timeout()), this, SLOT( resetBacklight())); |
176 | 176 | ||
177 | if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { | 177 | if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { |
178 | tabs-> setCurrentPage ( 0 ); | 178 | tabs-> setCurrentPage ( 0 ); |
179 | } | 179 | } |
180 | else { | 180 | else { |
181 | tabs-> setCurrentPage ( 1 ); | 181 | tabs-> setCurrentPage ( 1 ); |
182 | } | 182 | } |
183 | 183 | ||
184 | connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); | 184 | connect ( brightness, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); |
185 | connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); | 185 | connect ( brightness_ac, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); |
186 | if (m_cres) { | 186 | if (m_cres) { |
187 | connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); | 187 | connect ( contrast, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); |
188 | connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); | 188 | connect ( contrast_ac, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); |
189 | } | 189 | } |
190 | connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); | 190 | connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); |
191 | connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); | 191 | connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); |
192 | connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); | 192 | connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); |
193 | connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); | 193 | connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); |
194 | } | 194 | } |
195 | 195 | ||
196 | LightSettings::~LightSettings ( ) | 196 | LightSettings::~LightSettings ( ) |
197 | { | 197 | { |
198 | } | 198 | } |
199 | 199 | ||
200 | void LightSettings::calibrateSensor ( ) | 200 | void LightSettings::calibrateSensor ( ) |
201 | { | 201 | { |
202 | Sensor *s = new Sensor ( m_sensordata, this ); | 202 | Sensor *s = new Sensor ( m_sensordata, this ); |
203 | connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); | 203 | connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int))); |
204 | QPEApplication::execDialog( s ); | 204 | QPEApplication::execDialog( s ); |
205 | delete s; | 205 | delete s; |
206 | } | 206 | } |
207 | 207 | ||
208 | void LightSettings::calibrateSensorAC ( ) | 208 | void LightSettings::calibrateSensorAC ( ) |
209 | { | 209 | { |
210 | Sensor *s = new Sensor ( m_sensordata_ac, this ); | 210 | Sensor *s = new Sensor ( m_sensordata_ac, this ); |
211 | connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); | 211 | connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int))); |
212 | QPEApplication::execDialog ( s ); | 212 | QPEApplication::execDialog ( s ); |
213 | delete s; | 213 | delete s; |
214 | } | 214 | } |
215 | 215 | ||
216 | void LightSettings::setBacklight ( int bright ) | 216 | void LightSettings::setBacklight ( int bright ) |
217 | { | 217 | { |
218 | QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); | 218 | QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); |
219 | e << bright; | 219 | e << bright; |
220 | 220 | ||
221 | if ( bright != -1 ) { | 221 | if ( bright != -1 ) { |
222 | m_resettimer-> stop ( ); | 222 | m_resettimer-> stop ( ); |
223 | m_resettimer-> start ( 4000, true ); | 223 | m_resettimer-> start ( 4000, true ); |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | void LightSettings::setContrast ( int contr ) | 227 | void LightSettings::setContrast ( int contr ) |
228 | { | 228 | { |
229 | if (contr == -1) contr = m_oldcontrast; | 229 | if (contr == -1) contr = m_oldcontrast; |
230 | ODevice::inst ( )-> setDisplayContrast(contr); | 230 | ODevice::inst ( )-> setDisplayContrast(contr); |
231 | } | 231 | } |
232 | 232 | ||
233 | void LightSettings::setFrequency ( int index ) | 233 | void LightSettings::setFrequency ( int index ) |
234 | { | 234 | { |
235 | qWarning("LightSettings::setFrequency(%d)", index); | 235 | qWarning("LightSettings::setFrequency(%d)", index); |
236 | ODevice::inst ( )-> setCurrentCpuFrequency(index); | 236 | ODevice::inst ( )-> setCurrentCpuFrequency(index); |
237 | } | 237 | } |
238 | 238 | ||
239 | void LightSettings::resetBacklight ( ) | 239 | void LightSettings::resetBacklight ( ) |
240 | { | 240 | { |
241 | setBacklight ( -1 ); | 241 | setBacklight ( -1 ); |
242 | setContrast ( -1 ); | 242 | setContrast ( -1 ); |
243 | } | 243 | } |
244 | 244 | ||
245 | void LightSettings::setCloseHingeAction ( int index ) | 245 | void LightSettings::setCloseHingeAction ( int index ) |
246 | { | 246 | { |
247 | qWarning("LightSettings::setCloseHingeStatus(%d)", index); | 247 | qWarning("LightSettings::setCloseHingeStatus(%d)", index); |
248 | } | 248 | } |
249 | 249 | ||
250 | void LightSettings::accept ( ) | 250 | void LightSettings::accept ( ) |
251 | { | 251 | { |
252 | Config config ( "apm" ); | 252 | Config config ( "apm" ); |
253 | 253 | ||
254 | // bat | 254 | // bat |
255 | config. setGroup ( "Battery" ); | 255 | config. setGroup ( "Battery" ); |
256 | config. writeEntry ( "LcdOffOnly", LcdOffOnly-> isChecked ( )); | 256 | config. writeEntry ( "LcdOffOnly", LcdOffOnly-> isChecked ( )); |
257 | config. writeEntry ( "Dim", interval_dim-> value ( )); | 257 | config. writeEntry ( "Dim", interval_dim-> value ( )); |
258 | config. writeEntry ( "LightOff", interval_lightoff-> value ( )); | 258 | config. writeEntry ( "LightOff", interval_lightoff-> value ( )); |
259 | config. writeEntry ( "Suspend", interval_suspend-> value ( )); | 259 | config. writeEntry ( "Suspend", interval_suspend-> value ( )); |
diff --git a/core/settings/light-and-power/sensor.cpp b/core/settings/light-and-power/sensor.cpp index 41de851..013e655 100644 --- a/core/settings/light-and-power/sensor.cpp +++ b/core/settings/light-and-power/sensor.cpp | |||
@@ -28,75 +28,75 @@ | |||
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qslider.h> | 29 | #include <qslider.h> |
30 | #include <qspinbox.h> | 30 | #include <qspinbox.h> |
31 | 31 | ||
32 | #include <opie/odevice.h> | 32 | #include <opie/odevice.h> |
33 | 33 | ||
34 | using namespace Opie; | 34 | using namespace Opie; |
35 | 35 | ||
36 | #include "calibration.h" | 36 | #include "calibration.h" |
37 | #include "sensor.h" | 37 | #include "sensor.h" |
38 | 38 | ||
39 | Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | 39 | Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) |
40 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) | 40 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) |
41 | { | 41 | { |
42 | int steps = 12; | 42 | int steps = 12; |
43 | int inter = 2; | 43 | int inter = 2; |
44 | 44 | ||
45 | int smin = 40; | 45 | int smin = 40; |
46 | int smax = 215; | 46 | int smax = 215; |
47 | int lmin = 1; | 47 | int lmin = 1; |
48 | int lmax = 255; | 48 | int lmax = 255; |
49 | 49 | ||
50 | switch ( params. count ( )) { | 50 | switch ( params. count ( )) { |
51 | case 6: lmax = params [5]. toInt ( ); | 51 | case 6: lmax = params [5]. toInt ( ); |
52 | case 5: lmin = params [4]. toInt ( ); | 52 | case 5: lmin = params [4]. toInt ( ); |
53 | case 4: smax = params [3]. toInt ( ); | 53 | case 4: smax = params [3]. toInt ( ); |
54 | case 3: smin = params [2]. toInt ( ); | 54 | case 3: smin = params [2]. toInt ( ); |
55 | case 2: steps = params [1]. toInt ( ); | 55 | case 2: steps = params [1]. toInt ( ); |
56 | case 1: inter = params [0]. toInt ( ) / 1000; | 56 | case 1: inter = params [0]. toInt ( ) / 1000; |
57 | } | 57 | } |
58 | 58 | ||
59 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); | 59 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); |
60 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); | 60 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); |
61 | 61 | ||
62 | QVBoxLayout *lay = new QVBoxLayout ( frame ); | 62 | QVBoxLayout *lay = new QVBoxLayout ( frame ); |
63 | lay-> setMargin ( 2 ); | 63 | lay-> setMargin ( 2 ); |
64 | m_calib = new Calibration ( frame ); | 64 | m_calib = new Calibration ( frame ); |
65 | lay-> add ( m_calib ); | 65 | lay-> add ( m_calib ); |
66 | 66 | ||
67 | m_calib-> setScale ( QSize ( xscale, yscale )); | 67 | m_calib-> setScale ( QSize ( xscale, yscale )); |
68 | m_calib-> setLineSteps ( steps ); | 68 | m_calib-> setLineSteps ( steps ); |
69 | m_calib-> setInterval ( inter ); | 69 | m_calib-> setInterval ( inter ); |
70 | m_calib-> setStartPoint ( QPoint ( smin * xscale / 256, lmax * yscale / 256 )); | 70 | m_calib-> setStartPoint ( QPoint ( smin * xscale / 256, lmax * yscale / 256 )); |
71 | m_calib-> setEndPoint ( QPoint ( smax * xscale / 256, lmin * yscale / 256 )); | 71 | m_calib-> setEndPoint ( QPoint ( smax * xscale / 256, lmin * yscale / 256 )); |
72 | 72 | ||
73 | interval-> setValue ( inter ); | 73 | interval-> setValue ( inter ); |
74 | linesteps-> setValue ( steps ); | 74 | linesteps-> setValue ( steps ); |
75 | 75 | ||
76 | connect ( interval, SIGNAL( valueChanged ( int )), m_calib, SLOT( setInterval ( int ))); | 76 | connect ( interval, SIGNAL( valueChanged(int)), m_calib, SLOT( setInterval(int))); |
77 | connect ( linesteps, SIGNAL( valueChanged ( int )), m_calib, SLOT( setLineSteps ( int ))); | 77 | connect ( linesteps, SIGNAL( valueChanged(int)), m_calib, SLOT( setLineSteps(int))); |
78 | 78 | ||
79 | connect ( m_calib, SIGNAL( startPointChanged ( const QPoint & )), this, SLOT( pointDrag ( const QPoint & ))); | 79 | connect ( m_calib, SIGNAL( startPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&))); |
80 | connect ( m_calib, SIGNAL( endPointChanged ( const QPoint & )), this, SLOT( pointDrag ( const QPoint & ))); | 80 | connect ( m_calib, SIGNAL( endPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&))); |
81 | } | 81 | } |
82 | 82 | ||
83 | void Sensor::accept ( ) | 83 | void Sensor::accept ( ) |
84 | { | 84 | { |
85 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); | 85 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); |
86 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); | 86 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); |
87 | 87 | ||
88 | m_params. clear ( ); | 88 | m_params. clear ( ); |
89 | m_params << QString::number ( m_calib-> interval ( ) * 1000 ) | 89 | m_params << QString::number ( m_calib-> interval ( ) * 1000 ) |
90 | << QString::number ( m_calib-> lineSteps ( )) | 90 | << QString::number ( m_calib-> lineSteps ( )) |
91 | << QString::number ( m_calib-> startPoint ( ). x ( ) * 256 / xscale ) | 91 | << QString::number ( m_calib-> startPoint ( ). x ( ) * 256 / xscale ) |
92 | << QString::number ( m_calib-> endPoint ( ). x ( ) * 256 / xscale ) | 92 | << QString::number ( m_calib-> endPoint ( ). x ( ) * 256 / xscale ) |
93 | << QString::number ( m_calib-> endPoint ( ). y ( ) * 256 / yscale ) | 93 | << QString::number ( m_calib-> endPoint ( ). y ( ) * 256 / yscale ) |
94 | << QString::number ( m_calib-> startPoint ( ). y ( ) * 256 / yscale ); | 94 | << QString::number ( m_calib-> startPoint ( ). y ( ) * 256 / yscale ); |
95 | 95 | ||
96 | QDialog::accept ( ); | 96 | QDialog::accept ( ); |
97 | } | 97 | } |
98 | 98 | ||
99 | void Sensor::pointDrag ( const QPoint &p ) | 99 | void Sensor::pointDrag ( const QPoint &p ) |
100 | { | 100 | { |
101 | emit viewBacklight ( p. y ( )); | 101 | emit viewBacklight ( p. y ( )); |
102 | } | 102 | } |