I guess Laurent is right about this - don't show non-existent virtual
desktops. svn path=/trunk/kdebase/kwin/; revision=353961
This commit is contained in:
parent
1161bd5713
commit
be90fd3f6a
2 changed files with 8 additions and 10 deletions
|
@ -99,10 +99,6 @@ RulesWidget::RulesWidget( QWidget* parent, const char* name )
|
||||||
i <= module.numberOfDesktops();
|
i <= module.numberOfDesktops();
|
||||||
++i )
|
++i )
|
||||||
desktop->insertItem( QString::number( i ).rightJustify( 2 ) + ":" + module.desktopName( i ));
|
desktop->insertItem( QString::number( i ).rightJustify( 2 ) + ":" + module.desktopName( i ));
|
||||||
for(;
|
|
||||||
i <= 16;
|
|
||||||
++i )
|
|
||||||
desktop->insertItem( QString::number( i ).rightJustify( 2 ));
|
|
||||||
desktop->insertItem( i18n( "All Desktops" ));
|
desktop->insertItem( i18n( "All Desktops" ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,16 +200,16 @@ static QSize strToSize( const QString& str )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int desktopToCombo( int desktop )
|
int RulesWidget::desktopToCombo( int d ) const
|
||||||
{
|
{
|
||||||
if( desktop >= 1 && desktop <= 16 )
|
if( d >= 1 && d < desktop->count())
|
||||||
return desktop - 1;
|
return d - 1;
|
||||||
return 16; // on all desktops
|
return desktop->count() - 1; // on all desktops
|
||||||
}
|
}
|
||||||
|
|
||||||
static int comboToDesktop( int val )
|
int RulesWidget::comboToDesktop( int val ) const
|
||||||
{
|
{
|
||||||
if( val == 16 )
|
if( val == desktop->count() - 1 )
|
||||||
return NET::OnAllDesktops;
|
return NET::OnAllDesktops;
|
||||||
return val + 1;
|
return val + 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ class RulesWidget
|
||||||
// internal
|
// internal
|
||||||
void detected( bool );
|
void detected( bool );
|
||||||
private:
|
private:
|
||||||
|
int desktopToCombo( int d ) const;
|
||||||
|
int comboToDesktop( int val ) const;
|
||||||
DetectDialog* detect_dlg;
|
DetectDialog* detect_dlg;
|
||||||
bool detect_dlg_ok;
|
bool detect_dlg_ok;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue