author | mickeyl <mickeyl> | 2005-01-11 16:46:50 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-01-11 16:46:50 (UTC) |
commit | f82173157bdba4fa99afde9cc999bfe9b511ce07 (patch) (unidiff) | |
tree | 5285a7aef75f2acf78c40d8a992193d029c55446 /core/settings/launcher/tabssettings.cpp | |
parent | 0619c844b8a3054c6d6e480ba1c90e3f42e63873 (diff) | |
download | opie-f82173157bdba4fa99afde9cc999bfe9b511ce07.zip opie-f82173157bdba4fa99afde9cc999bfe9b511ce07.tar.gz opie-f82173157bdba4fa99afde9cc999bfe9b511ce07.tar.bz2 |
number of icon columns now also customizable through LauncherSettings
Diffstat (limited to 'core/settings/launcher/tabssettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 5ac625b..ab64331 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -126,24 +126,25 @@ void TabsSettings::init ( ) | |||
126 | 126 | ||
127 | 127 | ||
128 | void TabsSettings::readTabSettings ( Config &cfg ) | 128 | void TabsSettings::readTabSettings ( Config &cfg ) |
129 | { | 129 | { |
130 | QString grp ( "Tab %1" ); // No tr | 130 | QString grp ( "Tab %1" ); // No tr |
131 | m_tabs. clear ( ); | 131 | m_tabs. clear ( ); |
132 | 132 | ||
133 | TabConfig global_def; | 133 | TabConfig global_def; |
134 | global_def. m_view = TabConfig::Icon; | 134 | global_def. m_view = TabConfig::Icon; |
135 | global_def. m_bg_type = TabConfig::Ruled; | 135 | global_def. m_bg_type = TabConfig::Ruled; |
136 | global_def. m_bg_image = "launcher/opie-background"; | 136 | global_def. m_bg_image = "launcher/opie-background"; |
137 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); | 137 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); |
138 | global_def. m_iconcolumns = 0; // automatic | ||
138 | global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); | 139 | global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); |
139 | global_def. m_font_use = false; | 140 | global_def. m_font_use = false; |
140 | global_def. m_font_family = font ( ). family ( ); | 141 | global_def. m_font_family = font ( ). family ( ); |
141 | global_def. m_font_size = font ( ). pointSize ( ); | 142 | global_def. m_font_size = font ( ). pointSize ( ); |
142 | global_def. m_font_weight = 50; | 143 | global_def. m_font_weight = 50; |
143 | global_def. m_font_italic = false; | 144 | global_def. m_font_italic = false; |
144 | global_def. m_changed = false; | 145 | global_def. m_changed = false; |
145 | 146 | ||
146 | Config cfg2 = Config( "Launchersettings" ); | 147 | Config cfg2 = Config( "Launchersettings" ); |
147 | 148 | ||
148 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 149 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
149 | TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def; | 150 | TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def; |
@@ -159,24 +160,25 @@ void TabsSettings::readTabSettings ( Config &cfg ) | |||
159 | 160 | ||
160 | QString bgType = cfg. readEntry ( "BackgroundType" ); | 161 | QString bgType = cfg. readEntry ( "BackgroundType" ); |
161 | if ( bgType == "Image" ) | 162 | if ( bgType == "Image" ) |
162 | tc. m_bg_type = TabConfig::Image; | 163 | tc. m_bg_type = TabConfig::Image; |
163 | else if ( bgType == "SolidColor" ) | 164 | else if ( bgType == "SolidColor" ) |
164 | tc. m_bg_type = TabConfig::SolidColor; | 165 | tc. m_bg_type = TabConfig::SolidColor; |
165 | else if ( bgType == "Image" ) // No tr | 166 | else if ( bgType == "Image" ) // No tr |
166 | tc. m_bg_type = TabConfig::Image; | 167 | tc. m_bg_type = TabConfig::Image; |
167 | 168 | ||
168 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image ); | 169 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image ); |
169 | tc. m_last_directory = cfg2.readEntry( "DefaultDir", "" ); | 170 | tc. m_last_directory = cfg2.readEntry( "DefaultDir", "" ); |
170 | tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color ); | 171 | tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color ); |
172 | tc. m_iconcolumns = cfg. readNumEntry ( "Columns", tc. m_iconcolumns ); | ||
171 | tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color ); | 173 | tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color ); |
172 | QStringList f = cfg. readListEntry ( "Font", ',' ); | 174 | QStringList f = cfg. readListEntry ( "Font", ',' ); |
173 | if ( f. count ( ) == 4 ) { | 175 | if ( f. count ( ) == 4 ) { |
174 | tc. m_font_use = true; | 176 | tc. m_font_use = true; |
175 | tc. m_font_family = f [0]; | 177 | tc. m_font_family = f [0]; |
176 | tc. m_font_size = f [1]. toInt ( ); | 178 | tc. m_font_size = f [1]. toInt ( ); |
177 | tc. m_font_weight = f [2]. toInt ( ); | 179 | tc. m_font_weight = f [2]. toInt ( ); |
178 | tc. m_font_italic = ( f [3]. toInt ( )); | 180 | tc. m_font_italic = ( f [3]. toInt ( )); |
179 | } | 181 | } |
180 | m_tabs [*it] = tc; | 182 | m_tabs [*it] = tc; |
181 | } | 183 | } |
182 | 184 | ||
@@ -221,24 +223,25 @@ void TabsSettings::accept ( ) | |||
221 | cfg.writeEntry ( "View", "Icon" ); | 223 | cfg.writeEntry ( "View", "Icon" ); |
222 | break; | 224 | break; |
223 | case TabConfig::List: | 225 | case TabConfig::List: |
224 | cfg.writeEntry ( "View", "List" ); | 226 | cfg.writeEntry ( "View", "List" ); |
225 | break; | 227 | break; |
226 | } | 228 | } |
227 | 229 | ||
228 | QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" ); | 230 | QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" ); |
229 | e << *it << tc. m_view; | 231 | e << *it << tc. m_view; |
230 | 232 | ||
231 | cfg. writeEntry ( "BackgroundImage", tc. m_bg_image ); | 233 | cfg. writeEntry ( "BackgroundImage", tc. m_bg_image ); |
232 | cfg. writeEntry ( "BackgroundColor", tc. m_bg_color ); | 234 | cfg. writeEntry ( "BackgroundColor", tc. m_bg_color ); |
235 | cfg. writeEntry ( "Columns", tc. m_iconcolumns ); | ||
233 | cfg. writeEntry ( "TextColor", tc. m_text_color ); | 236 | cfg. writeEntry ( "TextColor", tc. m_text_color ); |
234 | cfg2. writeEntry ( "DefaultDir", tc.m_last_directory ); | 237 | cfg2. writeEntry ( "DefaultDir", tc.m_last_directory ); |
235 | 238 | ||
236 | if ( tc. m_font_use ) { | 239 | if ( tc. m_font_use ) { |
237 | QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" ); | 240 | QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" ); |
238 | cfg. writeEntry ( "Font", f ); | 241 | cfg. writeEntry ( "Font", f ); |
239 | } | 242 | } |
240 | else | 243 | else |
241 | cfg. removeEntry ( "Font" ); | 244 | cfg. removeEntry ( "Font" ); |
242 | 245 | ||
243 | QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" ); | 246 | QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" ); |
244 | 247 | ||