From d0a2d63fdfa2426c7080dbeaf713c6d2a09a4d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 10 Nov 2004 11:07:51 +0000 Subject: [PATCH] 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 --- kcmkwin/kwinrules/main.cpp | 2 +- kcmkwin/kwinrules/ruleslist.cpp | 4 +-- kcmkwin/kwinrules/ruleswidget.cpp | 10 +++++- kcmkwin/kwinrules/ruleswidget.h | 3 +- kcmkwin/kwinrules/ruleswidgetbase.ui | 51 ++++++++++++++++++++++++++-- 5 files changed, 63 insertions(+), 7 deletions(-) diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index c124997f97..bf8aa2442c 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -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 ); diff --git a/kcmkwin/kwinrules/ruleslist.cpp b/kcmkwin/kwinrules/ruleslist.cpp index 1cb417d2fa..cd079cf9bc 100644 --- a/kcmkwin/kwinrules/ruleslist.cpp +++ b/kcmkwin/kwinrules/ruleslist.cpp @@ -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 ]; diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 3938d8b058..da19abba6a 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #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; } diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index 215cc84d45..17476d20fb 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -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: diff --git a/kcmkwin/kwinrules/ruleswidgetbase.ui b/kcmkwin/kwinrules/ruleswidgetbase.ui index 81b8118b8f..88df680784 100644 --- a/kcmkwin/kwinrules/ruleswidgetbase.ui +++ b/kcmkwin/kwinrules/ruleswidgetbase.ui @@ -24,7 +24,7 @@ - tabWidget2 + tabs @@ -1930,6 +1930,8 @@ + + detect1 @@ -1969,7 +1971,7 @@ - tabWidget2 + tabs description wmclass whole_wmclass @@ -2066,4 +2068,49 @@ + + kcombobox.h + kpushbutton.h + kcombobox.h + kpushbutton.h + kpushbutton.h + klistbox.h + kcombobox.h + kpushbutton.h + kcombobox.h + kpushbutton.h + kcombobox.h + kpushbutton.h + kcombobox.h + krestrictedline.h + krestrictedline.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + kcombobox.h + krestrictedline.h + kcombobox.h + kcombobox.h + krestrictedline.h + kcombobox.h +