summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-11-04 11:36:29 +0100
committerDanny Baumann <dannybaumann@web.de>2008-11-04 11:36:29 +0100
commit48c2f792d02c0c66dbbc60b7b09f197174218b6e (patch)
tree0b8435d013c6cbb90b560645320e2b84c4810969
parent30418a532b2a1d00794499bc9d750c000d401284 (diff)
downloadsimple-ccsm-kde-48c2f792d02c0c66dbbc60b7b09f197174218b6e.tar.gz
simple-ccsm-kde-48c2f792d02c0c66dbbc60b7b09f197174218b6e.tar.bz2
Decode UTF-8 properly.
-rw-r--r--dialog.cpp51
1 files changed, 26 insertions, 25 deletions
diff --git a/dialog.cpp b/dialog.cpp
index ce40919..231f75a 100644
--- a/dialog.cpp
+++ b/dialog.cpp
@@ -343,10 +343,10 @@ void Dialog::setupAccessibility()
ui.screen_zoom_groupbox->setVisible( zoom );
if( zoom )
{
- ui.screen_zoom_checkbox->setText( zoom->shortDesc );
- ui.screen_zoom_checkbox->setToolTip( zoom->longDesc );
- ui.screen_zoom_groupbox->setTitle( zoom->shortDesc );
- ui.screen_zoom_groupbox->setToolTip( zoom->longDesc );
+ ui.screen_zoom_checkbox->setText( QString::fromUtf8 ( zoom->shortDesc ));
+ ui.screen_zoom_checkbox->setToolTip( QString::fromUtf8 (zoom->longDesc ));
+ ui.screen_zoom_groupbox->setTitle( QString::fromUtf8 (zoom->shortDesc ));
+ ui.screen_zoom_groupbox->setToolTip( QString::fromUtf8 (zoom->longDesc ));
setupKeyButton( zoom, "zoom_in_button", ui.screen_zoom_in_label, ui.screen_zoom_in_button );
setupKeyButton( zoom, "zoom_out_button", ui.screen_zoom_out_label, ui.screen_zoom_out_button );
}
@@ -355,10 +355,10 @@ void Dialog::setupAccessibility()
ui.area_zoom_groupbox->setVisible( area );
if( area )
{
- ui.area_zoom_checkbox->setText( area->shortDesc );
- ui.area_zoom_checkbox->setToolTip( area->longDesc );
- ui.area_zoom_groupbox->setTitle( area->shortDesc );
- ui.area_zoom_groupbox->setToolTip( area->longDesc );
+ ui.area_zoom_checkbox->setText( QString::fromUtf8 (area->shortDesc ));
+ ui.area_zoom_checkbox->setToolTip( QString::fromUtf8 (area->longDesc ));
+ ui.area_zoom_groupbox->setTitle( QString::fromUtf8 (area->shortDesc ));
+ ui.area_zoom_groupbox->setToolTip( QString::fromUtf8 (area->longDesc ));
setupKeyButton( area, "zoom_in_button", ui.area_zoom_in_label, ui.area_zoom_in_button );
setupKeyButton( area, "zoom_out_button", ui.area_zoom_out_label, ui.area_zoom_out_button );
}
@@ -406,7 +406,8 @@ void Dialog::addEdge( int edge, CCSPlugin* plugin, const char* option, int index
else
{
CCSSetting* s = setting( plugin, option );
- ui.edges_monitor->addEdgeItem( edge, QString( plugin->shortDesc ) + ":" + s->shortDesc );
+ QString edgeName = QString::fromUtf8( plugin->shortDesc ) + ":" + QString::fromUtf8 (s->shortDesc );
+ ui.edges_monitor->addEdgeItem( edge, edgeName );
unsigned int data;
ccsGetEdge( s, &data );
if( data & ( 1 << edge )) // TODO is there a libcompizconfig function for this?
@@ -449,9 +450,9 @@ void Dialog::setupCombo( CCSPlugin* p, const char* option, QLabel* label, QCombo
return;
}
CCSSetting* s = setting( p, option );
- label->setText( s->shortDesc );
- label->setToolTip( s->longDesc );
- combo->setToolTip( s->longDesc );
+ label->setText( QString::fromUtf8( s->shortDesc ));
+ label->setToolTip( QString::fromUtf8( s->longDesc ));
+ combo->setToolTip( QString::fromUtf8( s->longDesc ));
// kdDebug() << "TYPE:" << s->info.forList.listType;
if(( s->type == TypeList && s->info.forList.listType == TypeInt )
|| s->type == TypeInt )
@@ -509,9 +510,9 @@ void Dialog::setupAnimationCombo( const char* option, QLabel* label, QComboBox*
{
CCSPlugin* p = plugin( "animation" );
CCSSetting* s = setting( p, option );
- label->setText( s->shortDesc );
- label->setToolTip( s->longDesc );
- combo->setToolTip( s->longDesc );
+ label->setText( QString::fromUtf8( s->shortDesc ) );
+ label->setToolTip( QString::fromUtf8 ( s->longDesc ) );
+ combo->setToolTip( QString::fromUtf8 ( s->longDesc ) );
assert( s->type == TypeList && s->info.forList.listType == TypeString );
QString active = listStringOption( s );
// kdDebug() << "ACT:" << active;
@@ -575,9 +576,9 @@ void Dialog::setupSpinbox( CCSPlugin* p, const char* option, QLabel* label, QDou
return;
}
CCSSetting* s = setting( p, option );
- label->setText( s->shortDesc );
- label->setToolTip( s->longDesc );
- spinbox->setToolTip( s->longDesc );
+ label->setText( QString::fromUtf8( s->shortDesc ));
+ label->setToolTip( QString::fromUtf8( s->longDesc ));
+ spinbox->setToolTip( QString::fromUtf8( s->longDesc ));
if( s->type == TypeFloat )
{
spinbox->setRange( s->info.forFloat.min, s->info.forFloat.max );
@@ -620,8 +621,8 @@ void Dialog::setupCheckbox( CCSPlugin* plugin, const char* option, bool group, Q
return;
}
CCSSetting* s = setting( plugin, option );
- checkbox->setText( group ? s->group : s->shortDesc );
- checkbox->setToolTip( s->longDesc );
+ checkbox->setText( QString::fromUtf8( group ? s->group : s->shortDesc ));
+ checkbox->setToolTip( QString::fromUtf8( s->longDesc ));
Bool val;
ccsGetBool( s, &val );
checkbox->setChecked( val );
@@ -643,8 +644,8 @@ void Dialog::setupCheckbox( const char* pl, QCheckBox* checkbox )
checkbox->hide();
return;
}
- checkbox->setText( p->shortDesc );
- checkbox->setToolTip( p->longDesc );
+ checkbox->setText( QString::fromUtf8( p->shortDesc ));
+ checkbox->setToolTip( QString::fromUtf8( p->longDesc ));
checkbox->setChecked( ccsPluginIsActive( context, const_cast< char* >( pl )));
}
@@ -656,9 +657,9 @@ void Dialog::saveCheckbox( const char* pl, QCheckBox* checkbox )
void Dialog::setupKeyButton( CCSPlugin* plugin, const char* option, QLabel* label, QPushButton* button )
{
CCSSetting* s = setting( plugin, option );
- label->setText( s->shortDesc );
- label->setToolTip( s->longDesc );
- button->setToolTip( s->longDesc );
+ label->setText( QString::fromUtf8( s->shortDesc ));
+ label->setToolTip( QString::fromUtf8( s->longDesc ));
+ button->setToolTip( QString::fromUtf8( s->longDesc ));
CCSSettingButtonValue val;
ccsGetButton( s, &val );
KAcceleratorManager::setNoAccel( button );