-rw-r--r-- | core/settings/launcher/opie-launcher-settings.control | 9 | ||||
-rw-r--r-- | core/settings/launcher/tabconfig.h | 3 | ||||
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 16 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 14 |
4 files changed, 29 insertions, 13 deletions
diff --git a/core/settings/launcher/opie-launcher-settings.control b/core/settings/launcher/opie-launcher-settings.control new file mode 100644 index 0000000..e0c5005 --- a/dev/null +++ b/core/settings/launcher/opie-launcher-settings.control | |||
@@ -0,0 +1,9 @@ | |||
1 | Files: bin/launchersettings apps/Settings/Launcher.desktop pics/launchersettings | ||
2 | Priority: optional | ||
3 | Section: opie/settings | ||
4 | Maintainer: Robert Griebl <sandman@handhelds.org> | ||
5 | Architecture: arm | ||
6 | Version: $QPE_VERSION-$SUB_VERSION | ||
7 | Depends: opie-base ($QPE_VERSION) | ||
8 | Description: Launcher settings dialog | ||
9 | For the Opie environment. | ||
diff --git a/core/settings/launcher/tabconfig.h b/core/settings/launcher/tabconfig.h index 1c2e94d..8b6b103 100644 --- a/core/settings/launcher/tabconfig.h +++ b/core/settings/launcher/tabconfig.h | |||
@@ -35,18 +35,19 @@ struct TabConfig { | |||
35 | enum BackgroundType { | 35 | enum BackgroundType { |
36 | Ruled, | 36 | Ruled, |
37 | SolidColor, | 37 | SolidColor, |
38 | Image | 38 | Image |
39 | }; | 39 | }; |
40 | 40 | ||
41 | ViewMode m_view; | 41 | ViewMode m_view; |
42 | BackgroundType m_bg_type; | 42 | BackgroundType m_bg_type; |
43 | QString m_bg_image; | 43 | QString m_bg_image; |
44 | QString m_bg_color; | 44 | QString m_bg_color; |
45 | QString m_text_color; | 45 | QString m_text_color; |
46 | QString m_font_family; | 46 | QString m_font_family; |
47 | QString m_font_style; | ||
48 | int m_font_size; | 47 | int m_font_size; |
48 | int m_font_weight; | ||
49 | bool m_font_italic; | ||
49 | bool m_changed; | 50 | bool m_changed; |
50 | }; | 51 | }; |
51 | 52 | ||
52 | #endif | 53 | #endif |
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 86202f0..75a3de5 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -287,25 +287,25 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
287 | 287 | ||
288 | lay-> addWidget ( tw, 10 ); | 288 | lay-> addWidget ( tw, 10 ); |
289 | lay-> addWidget ( sample, 1 ); | 289 | lay-> addWidget ( sample, 1 ); |
290 | 290 | ||
291 | m_iconsize-> setButton ( tc. m_view ); | 291 | m_iconsize-> setButton ( tc. m_view ); |
292 | iconSizeClicked ( tc. m_view ); | 292 | iconSizeClicked ( tc. m_view ); |
293 | m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); | 293 | m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); |
294 | iconColorClicked ( m_iconcolor-> color ( )); | 294 | iconColorClicked ( m_iconcolor-> color ( )); |
295 | m_bgtype-> setButton ( tc. m_bg_type ); | 295 | m_bgtype-> setButton ( tc. m_bg_type ); |
296 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 296 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
297 | m_bgimage = tc. m_bg_image; | 297 | m_bgimage = tc. m_bg_image; |
298 | bgTypeClicked ( tc. m_bg_type ); | 298 | bgTypeClicked ( tc. m_bg_type ); |
299 | m_fontselect-> setSelectedFont ( tc. m_font_family, tc. m_font_style, tc. m_font_size ); | 299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); |
300 | fontClicked ( m_fontselect-> selectedFont ( )); | 300 | fontClicked ( m_fontselect-> selectedFont ( )); |
301 | } | 301 | } |
302 | 302 | ||
303 | 303 | ||
304 | TabDialog::~TabDialog ( ) | 304 | TabDialog::~TabDialog ( ) |
305 | { | 305 | { |
306 | } | 306 | } |
307 | 307 | ||
308 | QWidget *TabDialog::createFontTab ( QWidget *parent ) | 308 | QWidget *TabDialog::createFontTab ( QWidget *parent ) |
309 | { | 309 | { |
310 | m_fontselect = new OFontSelector ( parent, "FontTab" ); | 310 | m_fontselect = new OFontSelector ( parent, "FontTab" ); |
311 | 311 | ||
@@ -432,25 +432,25 @@ void TabDialog::bgTypeClicked ( int t ) | |||
432 | { | 432 | { |
433 | QString s; | 433 | QString s; |
434 | 434 | ||
435 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) | 435 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) |
436 | m_bgtype-> setButton ( t ); | 436 | m_bgtype-> setButton ( t ); |
437 | 437 | ||
438 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); | 438 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); |
439 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); | 439 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); |
440 | 440 | ||
441 | if ( t == TabConfig::SolidColor ) | 441 | if ( t == TabConfig::SolidColor ) |
442 | s = m_solidcolor-> color ( ). name ( ); | 442 | s = m_solidcolor-> color ( ). name ( ); |
443 | else if ( t == TabConfig::Image ) | 443 | else if ( t == TabConfig::Image ) |
444 | s = m_bgimage; | 444 | s = Resource::findPixmap ( m_bgimage ); |
445 | 445 | ||
446 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); | 446 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); |
447 | } | 447 | } |
448 | 448 | ||
449 | void TabDialog::bgColorClicked ( const QColor & ) | 449 | void TabDialog::bgColorClicked ( const QColor & ) |
450 | { | 450 | { |
451 | bgTypeClicked ( TabConfig::SolidColor ); | 451 | bgTypeClicked ( TabConfig::SolidColor ); |
452 | } | 452 | } |
453 | 453 | ||
454 | void TabDialog::iconColorClicked ( const QColor &col ) | 454 | void TabDialog::iconColorClicked ( const QColor &col ) |
455 | { | 455 | { |
456 | m_sample-> setTextColor ( col ); | 456 | m_sample-> setTextColor ( col ); |
@@ -466,29 +466,33 @@ void TabDialog::bgImageClicked ( ) | |||
466 | list << "image/*"; | 466 | list << "image/*"; |
467 | types. insert ( "Images", list ); | 467 | types. insert ( "Images", list ); |
468 | 468 | ||
469 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); | 469 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); |
470 | if ( !file. isEmpty ( )) { | 470 | if ( !file. isEmpty ( )) { |
471 | m_bgimage = DocLnk ( file ). file ( ); | 471 | m_bgimage = DocLnk ( file ). file ( ); |
472 | bgTypeClicked ( TabConfig::Image ); | 472 | bgTypeClicked ( TabConfig::Image ); |
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | void TabDialog::bgDefaultClicked ( ) | 476 | void TabDialog::bgDefaultClicked ( ) |
477 | { | 477 | { |
478 | m_bgimage = Resource::findPixmap ( "launcher/opie-background.jpg" ); | 478 | m_bgimage = "launcher/opie-background"; |
479 | bgTypeClicked ( TabConfig::Image ); | 479 | bgTypeClicked ( TabConfig::Image ); |
480 | } | 480 | } |
481 | 481 | ||
482 | void TabDialog::accept ( ) | 482 | void TabDialog::accept ( ) |
483 | { | 483 | { |
484 | m_tc. m_view = (TabConfig::ViewMode) m_iconsize-> id ( m_iconsize-> selected ( )); | 484 | m_tc. m_view = (TabConfig::ViewMode) m_iconsize-> id ( m_iconsize-> selected ( )); |
485 | m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( )); | 485 | m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( )); |
486 | m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); | 486 | m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); |
487 | m_tc. m_bg_image = m_bgimage; | 487 | m_tc. m_bg_image = m_bgimage; |
488 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); | 488 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); |
489 | m_tc. m_font_family = m_fontselect-> fontFamily ( ); | 489 | |
490 | m_tc. m_font_size = m_fontselect-> fontSize ( ); | 490 | QFont f = m_fontselect-> selectedFont ( ); |
491 | m_tc. m_font_style = m_fontselect-> fontStyle ( ); | 491 | |
492 | m_tc. m_font_family = f. family ( ); | ||
493 | m_tc. m_font_size = f. pointSize ( ); | ||
494 | m_tc. m_font_weight = f. weight ( ); | ||
495 | m_tc. m_font_italic = f. italic ( ); | ||
492 | 496 | ||
493 | QDialog::accept ( ); | 497 | QDialog::accept ( ); |
494 | } | 498 | } |
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 0faaea3..8f5f7fa 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -105,42 +105,44 @@ void TabsSettings::readTabSettings ( ) | |||
105 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 105 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
106 | TabConfig tc; | 106 | TabConfig tc; |
107 | tc. m_view = TabConfig::Icon; | 107 | tc. m_view = TabConfig::Icon; |
108 | tc. m_bg_type = TabConfig::Ruled; | 108 | tc. m_bg_type = TabConfig::Ruled; |
109 | tc. m_changed = false; | 109 | tc. m_changed = false; |
110 | 110 | ||
111 | cfg. setGroup ( grp. arg ( *it )); | 111 | cfg. setGroup ( grp. arg ( *it )); |
112 | 112 | ||
113 | QString view = cfg. readEntry ( "View", "Icon" ); | 113 | QString view = cfg. readEntry ( "View", "Icon" ); |
114 | if ( view == "List" ) // No tr | 114 | if ( view == "List" ) // No tr |
115 | tc. m_view = TabConfig::List; | 115 | tc. m_view = TabConfig::List; |
116 | 116 | ||
117 | QString bgType = cfg. readEntry ( "BackgroundType", "Ruled" ); | 117 | QString bgType = cfg. readEntry ( "BackgroundType", "Image" ); |
118 | if ( bgType == "SolidColor" ) | 118 | if ( bgType == "SolidColor" ) |
119 | tc. m_bg_type = TabConfig::SolidColor; | 119 | tc. m_bg_type = TabConfig::SolidColor; |
120 | else if ( bgType == "Image" ) // No tr | 120 | else if ( bgType == "Image" ) // No tr |
121 | tc. m_bg_type = TabConfig::Image; | 121 | tc. m_bg_type = TabConfig::Image; |
122 | 122 | ||
123 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", "wallpaper/opie" ); | 123 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", "launcher/opie-background" ); |
124 | tc. m_bg_color = cfg. readEntry ( "BackgroundColor", colorGroup ( ). color ( QColorGroup::Base ). name ( )); | 124 | tc. m_bg_color = cfg. readEntry ( "BackgroundColor", colorGroup ( ). color ( QColorGroup::Base ). name ( )); |
125 | tc. m_text_color = cfg. readEntry ( "TextColor", colorGroup ( ). color ( QColorGroup::Text ). name ( )); | 125 | tc. m_text_color = cfg. readEntry ( "TextColor", colorGroup ( ). color ( QColorGroup::Text ). name ( )); |
126 | QStringList f = cfg. readListEntry ( "Font", ',' ); | 126 | QStringList f = cfg. readListEntry ( "Font", ',' ); |
127 | if ( f. count ( ) == 4 ) { | 127 | if ( f. count ( ) == 4 ) { |
128 | tc. m_font_family = f [0]; | 128 | tc. m_font_family = f [0]; |
129 | tc. m_font_size = f [1]. toInt ( ); | 129 | tc. m_font_size = f [1]. toInt ( ); |
130 | tc. m_font_style = f [2]; | 130 | tc. m_font_weight = f [2]. toInt ( ); |
131 | tc. m_font_italic = ( f [3]. toInt ( )); | ||
131 | } else { | 132 | } else { |
132 | tc. m_font_family = font ( ). family ( ); | 133 | tc. m_font_family = font ( ). family ( ); |
133 | tc. m_font_size = font ( ). pointSize ( ); | 134 | tc. m_font_size = font ( ). pointSize ( ); |
134 | tc. m_font_style = "Regular"; | 135 | tc. m_font_weight = 50; |
136 | tc. m_font_italic = false; | ||
135 | } | 137 | } |
136 | m_tabs [*it] = tc; | 138 | m_tabs [*it] = tc; |
137 | } | 139 | } |
138 | } | 140 | } |
139 | 141 | ||
140 | 142 | ||
141 | void TabsSettings::accept ( ) | 143 | void TabsSettings::accept ( ) |
142 | { | 144 | { |
143 | Config cfg ( "Launcher" ); | 145 | Config cfg ( "Launcher" ); |
144 | 146 | ||
145 | // Launcher Tab | 147 | // Launcher Tab |
146 | QString grp ( "Tab %1" ); // No tr | 148 | QString grp ( "Tab %1" ); // No tr |
@@ -158,50 +160,50 @@ void TabsSettings::accept ( ) | |||
158 | case TabConfig::List: | 160 | case TabConfig::List: |
159 | cfg.writeEntry ( "View", "List" ); | 161 | cfg.writeEntry ( "View", "List" ); |
160 | break; | 162 | break; |
161 | } | 163 | } |
162 | 164 | ||
163 | QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" ); | 165 | QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" ); |
164 | e << *it << tc. m_view; | 166 | e << *it << tc. m_view; |
165 | 167 | ||
166 | cfg. writeEntry ( "BackgroundImage", tc. m_bg_image ); | 168 | cfg. writeEntry ( "BackgroundImage", tc. m_bg_image ); |
167 | cfg. writeEntry ( "BackgroundColor", tc. m_bg_color ); | 169 | cfg. writeEntry ( "BackgroundColor", tc. m_bg_color ); |
168 | cfg. writeEntry ( "TextColor", tc. m_text_color ); | 170 | cfg. writeEntry ( "TextColor", tc. m_text_color ); |
169 | 171 | ||
170 | QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + tc. m_font_style + ",0"; | 172 | QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" ); |
171 | cfg. writeEntry ( "Font", f ); | 173 | cfg. writeEntry ( "Font", f ); |
172 | QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" ); | 174 | QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" ); |
173 | 175 | ||
174 | switch ( tc. m_bg_type ) { | 176 | switch ( tc. m_bg_type ) { |
175 | case TabConfig::Ruled: | 177 | case TabConfig::Ruled: |
176 | cfg.writeEntry( "BackgroundType", "Ruled" ); | 178 | cfg.writeEntry( "BackgroundType", "Ruled" ); |
177 | be << *it << tc. m_bg_type << QString(""); | 179 | be << *it << tc. m_bg_type << QString(""); |
178 | break; | 180 | break; |
179 | case TabConfig::SolidColor: | 181 | case TabConfig::SolidColor: |
180 | cfg.writeEntry( "BackgroundType", "SolidColor" ); | 182 | cfg.writeEntry( "BackgroundType", "SolidColor" ); |
181 | be << *it << tc. m_bg_type << tc. m_bg_color; | 183 | be << *it << tc. m_bg_type << tc. m_bg_color; |
182 | break; | 184 | break; |
183 | case TabConfig::Image: | 185 | case TabConfig::Image: |
184 | cfg.writeEntry( "BackgroundType", "Image" ); | 186 | cfg.writeEntry( "BackgroundType", "Image" ); |
185 | be << *it << tc. m_bg_type << tc. m_bg_image; | 187 | be << *it << tc. m_bg_type << tc. m_bg_image; |
186 | break; | 188 | break; |
187 | } | 189 | } |
188 | 190 | ||
189 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); | 191 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); |
190 | te << *it << tc. m_text_color; | 192 | te << *it << tc. m_text_color; |
191 | 193 | ||
192 | QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); | 194 | QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); |
193 | fe << *it << tc. m_font_family; | 195 | fe << *it << tc. m_font_family; |
194 | fe << tc. m_font_size; | 196 | fe << tc. m_font_size; |
195 | fe << 50 << 0; | 197 | fe << tc. m_font_weight << ( tc. m_font_italic ? 1 : 0 ); |
196 | 198 | ||
197 | tc. m_changed = false; | 199 | tc. m_changed = false; |
198 | } | 200 | } |
199 | } | 201 | } |
200 | 202 | ||
201 | void TabsSettings::newClicked ( ) | 203 | void TabsSettings::newClicked ( ) |
202 | { | 204 | { |
203 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); | 205 | QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); |
204 | } | 206 | } |
205 | 207 | ||
206 | void TabsSettings::deleteClicked ( ) | 208 | void TabsSettings::deleteClicked ( ) |
207 | { | 209 | { |