summaryrefslogtreecommitdiff
path: root/core/settings/launcher/tabssettings.cpp
Unidiff
Diffstat (limited to 'core/settings/launcher/tabssettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabssettings.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index 42f0568..fca6b20 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -62,87 +62,92 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
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
87 m_staticbackground = new QCheckBox( tr( "Enable static background pixmap" ), this );
88 lay->addMultiCellWidget( m_staticbackground, 7, 7, 0, 1 );
86 89
87 p1-> setEnabled ( false ); 90 p1-> setEnabled ( false );
88 p3-> setEnabled ( false ); 91 p3-> setEnabled ( false );
89 92
90 init ( ); 93 init ( );
91 94
92 QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); 95 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>." )); 96 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." )); 97 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>." )); 98 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." )); 99 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." )); 100 QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." ));
101 QWhatsThis::add ( m_staticbackground, tr( "Activate this, if you want the background pixmap not to scroll with the icons." ));
98} 102}
99 103
100void TabsSettings::init ( ) 104void TabsSettings::init ( )
101{ 105{
102 AppLnkSet rootFolder( MimeType::appsFolderName ( )); 106 AppLnkSet rootFolder( MimeType::appsFolderName ( ));
103 QStringList types = rootFolder. types ( ); 107 QStringList types = rootFolder. types ( );
104 108
105 m_list-> insertItem ( tr( "All Tabs" )); 109 m_list-> insertItem ( tr( "All Tabs" ));
106 m_ids << GLOBALID; 110 m_ids << GLOBALID;
107 111
108 for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { 112 for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) {
109 m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); 113 m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it ));
110 m_ids << *it; 114 m_ids << *it;
111 } 115 }
112 QImage img ( Resource::loadImage ( "DocsIcon" )); 116 QImage img ( Resource::loadImage ( "DocsIcon" ));
113 QPixmap pix; 117 QPixmap pix;
114 pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); 118 pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( ));
115 m_list-> insertItem ( pix, tr( "Documents" )); 119 m_list-> insertItem ( pix, tr( "Documents" ));
116 m_ids += "Documents"; // No tr 120 m_ids += "Documents"; // No tr
117 121
118 Config cfg ( "Launcher" ); 122 Config cfg ( "Launcher" );
119 123
120 readTabSettings ( cfg ); 124 readTabSettings ( cfg );
121 125
122 cfg. setGroup ( "GUI" ); 126 cfg. setGroup ( "GUI" );
123 m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); 127 m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" );
124 m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); 128 m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) );
129 m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) );
125} 130}
126 131
127 132
128void TabsSettings::readTabSettings ( Config &cfg ) 133void TabsSettings::readTabSettings ( Config &cfg )
129{ 134{
130 QString grp ( "Tab %1" ); // No tr 135 QString grp ( "Tab %1" ); // No tr
131 m_tabs. clear ( ); 136 m_tabs. clear ( );
132 137
133 TabConfig global_def; 138 TabConfig global_def;
134 global_def. m_view = TabConfig::Icon; 139 global_def. m_view = TabConfig::Icon;
135 global_def. m_bg_type = TabConfig::Ruled; 140 global_def. m_bg_type = TabConfig::Ruled;
136 global_def. m_bg_image = "launcher/opie-background"; 141 global_def. m_bg_image = "launcher/opie-background";
137 global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); 142 global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( );
138 global_def. m_iconcolumns = 0; // automatic 143 global_def. m_iconcolumns = 0; // automatic
139 global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); 144 global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( );
140 global_def. m_font_use = false; 145 global_def. m_font_use = false;
141 global_def. m_font_family = font ( ). family ( ); 146 global_def. m_font_family = font ( ). family ( );
142 global_def. m_font_size = font ( ). pointSize ( ); 147 global_def. m_font_size = font ( ). pointSize ( );
143 global_def. m_font_weight = 50; 148 global_def. m_font_weight = 50;
144 global_def. m_font_italic = false; 149 global_def. m_font_italic = false;
145 global_def. m_changed = false; 150 global_def. m_changed = false;
146 151
147 Config cfg2 = Config( "Launchersettings" ); 152 Config cfg2 = Config( "Launchersettings" );
148 153
@@ -258,55 +263,59 @@ void TabsSettings::accept ( )
258 case TabConfig::Image: 263 case TabConfig::Image:
259 cfg.writeEntry( "BackgroundType", "Image" ); 264 cfg.writeEntry( "BackgroundType", "Image" );
260 be << *it << tc. m_bg_type << tc. m_bg_image; 265 be << *it << tc. m_bg_type << tc. m_bg_image;
261 break; 266 break;
262 } 267 }
263 268
264 QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); 269 QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" );
265 te << *it << tc. m_text_color; 270 te << *it << tc. m_text_color;
266 271
267 QCopEnvelope ic( "QPE/Launcher", "setIconColumns(QString,int)" ); 272 QCopEnvelope ic( "QPE/Launcher", "setIconColumns(QString,int)" );
268 ic << *it << tc. m_iconcolumns; 273 ic << *it << tc. m_iconcolumns;
269 274
270 QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); 275 QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" );
271 fe << *it; 276 fe << *it;
272 fe << ( tc. m_font_use ? tc. m_font_family : QString::null ); 277 fe << ( tc. m_font_use ? tc. m_font_family : QString::null );
273 fe << tc. m_font_size; 278 fe << tc. m_font_size;
274 fe << tc. m_font_weight; 279 fe << tc. m_font_weight;
275 fe << ( tc. m_font_italic ? 1 : 0 ); 280 fe << ( tc. m_font_italic ? 1 : 0 );
276 281
277 tc. m_changed = false; 282 tc. m_changed = false;
278 } 283 }
279 cfg. setGroup ( "GUI" ); 284 cfg. setGroup ( "GUI" );
280 QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" ); 285 QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" );
281 cfg. writeEntry ( "BusyType", busytype ); 286 cfg. writeEntry ( "BusyType", busytype );
282 287 cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
283 cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) ); 288 cfg. writeEntry ( "StaticBackground", m_staticbackground->isChecked( ) );
284 289
285 { 290 {
286 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); 291 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" );
287 e << busytype; 292 e << busytype;
288 } 293 }
294 {
295 QCopEnvelope e ( "QPE/Launcher", "setStaticBackground(bool)" );
296 e << m_staticbackground->isChecked();
297 }
289} 298}
290 299
291void TabsSettings::newClicked ( ) 300void TabsSettings::newClicked ( )
292{ 301{
293 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 302 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
294} 303}
295 304
296void TabsSettings::deleteClicked ( ) 305void TabsSettings::deleteClicked ( )
297{ 306{
298 int ind = m_list-> currentItem ( ); 307 int ind = m_list-> currentItem ( );
299 308
300 if ( ind < 0 ) 309 if ( ind < 0 )
301 return; 310 return;
302 311
303 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 312 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
304} 313}
305 314
306void TabsSettings::editClicked ( ) 315void TabsSettings::editClicked ( )
307{ 316{
308 int ind = m_list-> currentItem ( ); 317 int ind = m_list-> currentItem ( );
309 318
310 if ( ind < 0 ) 319 if ( ind < 0 )
311 return; 320 return;
312 321