When using Alt+F3/Window-specific settings, activate directly first tab

with settings, now that it tries to find the right matching rules itself.

svn path=/trunk/kdebase/kwin/; revision=361961
This commit is contained in:
Luboš Luňák 2004-11-10 11:07:51 +00:00
parent 3a45567573
commit d0a2d63fdf
5 changed files with 63 additions and 7 deletions

View file

@ -199,7 +199,7 @@ static int edit( Window wid )
Rules* orig_rule = findRule( rules, wid );
RulesDialog dlg;
// dlg.edit() creates new Rules instance if edited
Rules* edited_rule = dlg.edit( orig_rule );
Rules* edited_rule = dlg.edit( orig_rule, true );
if( edited_rule == NULL || edited_rule->isEmpty())
{
rules.remove( orig_rule );

View file

@ -74,7 +74,7 @@ void KCMRulesList::activeChanged( QListBoxItem* item )
void KCMRulesList::newClicked()
{
RulesDialog dlg;
Rules* rule = dlg.edit( NULL );
Rules* rule = dlg.edit( NULL, false );
if( rule == NULL )
return;
int pos = rules_listbox->currentItem() + 1;
@ -90,7 +90,7 @@ void KCMRulesList::modifyClicked()
if ( pos == -1 )
return;
RulesDialog dlg;
Rules* rule = dlg.edit( rules[ pos ] );
Rules* rule = dlg.edit( rules[ pos ], false );
if( rule == rules[ pos ] )
return;
delete rules[ pos ];

View file

@ -30,6 +30,7 @@
#include <qwhatsthis.h>
#include <assert.h>
#include <kmessagebox.h>
#include <qtabwidget.h>
#include "../../rules.h"
@ -599,6 +600,11 @@ bool RulesWidget::finalCheck()
return true;
}
void RulesWidget::focusSettings()
{
tabs->setCurrentPage( 2 ); // geometry tab, skip tabs for window identification
}
RulesDialog::RulesDialog( QWidget* parent, const char* name )
: KDialogBase( parent, name, true, "", Ok | Cancel )
{
@ -606,10 +612,12 @@ RulesDialog::RulesDialog( QWidget* parent, const char* name )
setMainWidget( widget );
}
Rules* RulesDialog::edit( Rules* r )
Rules* RulesDialog::edit( Rules* r, bool focus_settings )
{
rules = r;
widget->setRules( rules );
if( focus_settings )
widget->focusSettings();
exec();
return rules;
}

View file

@ -39,6 +39,7 @@ class RulesWidget
void setRules( Rules* r );
Rules* rules() const;
bool finalCheck();
void focusSettings();
signals:
void changed( bool state );
protected slots:
@ -89,7 +90,7 @@ class RulesDialog
Q_OBJECT
public:
RulesDialog( QWidget* parent = NULL, const char* name = NULL );
Rules* edit( Rules* r );
Rules* edit( Rules* r, bool focus_settings );
protected:
virtual void accept();
private:

View file

@ -24,7 +24,7 @@
</property>
<widget class="QTabWidget">
<property name="name">
<cstring>tabWidget2</cstring>
<cstring>tabs</cstring>
</property>
<widget class="QWidget">
<property name="name">
@ -1930,6 +1930,8 @@
</widget>
</vbox>
</widget>
<customwidgets>
</customwidgets>
<connections>
<connection>
<sender>detect1</sender>
@ -1969,7 +1971,7 @@
</connection>
</connections>
<tabstops>
<tabstop>tabWidget2</tabstop>
<tabstop>tabs</tabstop>
<tabstop>description</tabstop>
<tabstop>wmclass</tabstop>
<tabstop>whole_wmclass</tabstop>
@ -2066,4 +2068,49 @@
</slots>
<layoutdefaults spacing="6" margin="11"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
<includehints>
<includehint>kcombobox.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>klistbox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>krestrictedline.h</includehint>
<includehint>krestrictedline.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>krestrictedline.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>krestrictedline.h</includehint>
<includehint>kcombobox.h</includehint>
</includehints>
</UI>