show desktop names in some other places as well (and use utf8 rather than local 8 bit)

svn path=/trunk/kdebase/kwin/; revision=56902
This commit is contained in:
Matthias Ettrich 2000-07-14 19:56:47 +00:00
parent 9a69f2a87a
commit 7dcedd2f0d
3 changed files with 12 additions and 8 deletions

View file

@ -211,7 +211,6 @@ void TabBox::paintContents()
if ( currentClient() ) {
QString s;
if (!client->isOnDesktop(workspace()->currentDesktop())){
//### s = KWM::desktopName(client->desktop());
s.append(": ");
}
@ -253,7 +252,7 @@ void TabBox::paintContents()
}
}
} else { // DesktopMode
p.drawText( r, AlignCenter, QString::number( desk ) );
p.drawText( r, AlignCenter, workspace()->desktopName(desk) );
int x = (width() - workspace()->numberOfDesktops() * 20 )/2;
int y = height() - 26;
QFont f( font() );
@ -292,7 +291,7 @@ void TabBox::delayedShow()
KConfig * c(KGlobal::config());
c->setGroup("TabBox");
bool delay = c->readNumEntry("ShowDelay", false);
if (!delay) {
show();
return;

View file

@ -76,6 +76,10 @@ private:
};
QString Workspace::desktopName( int desk )
{
return QString::fromUtf8( rootInfo->desktopName( desk ) );
}
extern Time kwin_time;
extern void kwin_updateTime();
@ -1033,7 +1037,7 @@ void Workspace::requestFocus( Client* c)
{
if (!focusChangeEnabled())
return;
//TODO will be different for non-root clients. (subclassing?)
if ( !c ) {
focusToNull();
@ -2087,7 +2091,7 @@ void Workspace::desktopPopupAboutToShow()
desk_popup->insertSeparator( -1 );
int id;
for ( int i = 1; i <= numberOfDesktops(); i++ ) {
id = desk_popup->insertItem( QString("&%1 %2").arg(i).arg(rootInfo->desktopName(i)), i );
id = desk_popup->insertItem( QString("&%1 %2").arg(i).arg( desktopName(i) ) );
if ( popup_client && !popup_client->isSticky() && popup_client->desktop() == i )
desk_popup->setItemChecked( id, TRUE );
}
@ -2662,7 +2666,7 @@ void Workspace::saveDesktopSettings()
c.setGroup("Desktops");
c.writeEntry("Number", number_of_desktops );
for(int i = 1; i <= number_of_desktops; i++) {
QString s = QString::fromUtf8( rootInfo->desktopName( i ) );
QString s = desktopName( i );
if ( s.isEmpty() ) {
s = i18n("Desktop %1").arg(i);
rootInfo->setDesktopName( i, s.utf8().data() );

View file

@ -174,7 +174,8 @@ public:
void cascadeDesktop();
void unclutterDesktop();
void reconfigure();
QString desktopName( int desk );
public slots:
void setCurrentDesktop( int new_desktop );
@ -257,7 +258,7 @@ private:
// desktop names and number of desktops
void loadDesktopSettings();
void saveDesktopSettings();
// mouse emulation
WId getMouseEmulationWindow();
enum MouseEmulation { EmuPress, EmuRelease, EmuMove };