From 2c1534b2b1b27a3bb103a8dccf9e2e66718ce18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 19 Aug 2005 13:46:45 +0000 Subject: [PATCH] Give at least some hint about how to use the window-specific settings. svn path=/trunk/KDE/kdebase/kwin/; revision=450916 --- kcmkwin/kwinrules/main.cpp | 2 +- kcmkwin/kwinrules/ruleslist.cpp | 4 ++-- kcmkwin/kwinrules/ruleswidget.cpp | 18 +++++++++++++++++- kcmkwin/kwinrules/ruleswidget.h | 4 +++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index 41ccfa5123..41b1dbfe42 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -236,7 +236,7 @@ static int edit( Window wid, bool whole_app ) Rules* orig_rule = findRule( rules, wid, whole_app ); RulesDialog dlg; // dlg.edit() creates new Rules instance if edited - Rules* edited_rule = dlg.edit( orig_rule, wid ); + Rules* edited_rule = dlg.edit( orig_rule, wid, 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 4cd774569f..69a8dad237 100644 --- a/kcmkwin/kwinrules/ruleslist.cpp +++ b/kcmkwin/kwinrules/ruleslist.cpp @@ -74,7 +74,7 @@ void KCMRulesList::activeChanged( Q3ListBoxItem* item ) void KCMRulesList::newClicked() { RulesDialog dlg; - Rules* rule = dlg.edit( NULL, 0 ); + Rules* rule = dlg.edit( NULL, 0, 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 ], 0 ); + Rules* rule = dlg.edit( rules[ pos ], 0, false ); if( rule == rules[ pos ] ) return; delete rules[ pos ]; diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 3039746c1d..9db11902d0 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "../../rules.h" @@ -694,16 +695,31 @@ RulesDialog::RulesDialog( QWidget* parent, const char* name ) // window is set only for Alt+F3/Window-specific settings, because the dialog // is then related to one specific window -Rules* RulesDialog::edit( Rules* r, WId window ) +Rules* RulesDialog::edit( Rules* r, WId window, bool show_hints ) { rules = r; widget->setRules( rules ); if( window != 0 ) widget->prepareWindowSpecific( window ); + if( show_hints ) + QTimer::singleShot( 0, this, SLOT( displayHints())); exec(); return rules; } +void RulesDialog::displayHints() + { + QString str = "

"; + str += i18n( "This configuration dialog allows altering settings only for the selected window" + " or application. Find the setting you want to affect, enable the setting using the checkbox," + " select in what way the setting should be affected and to which value." ); +#if 0 // maybe later + str += "

" + i18n( "Consult the documentation for more details." ); +#endif + str += "

"; + KMessageBox::information( this, str, QString::null, "displayhints" ); + } + void RulesDialog::accept() { if( !widget->finalCheck()) diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index 8130b6fa0c..b64575751d 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -100,9 +100,11 @@ class RulesDialog Q_OBJECT public: RulesDialog( QWidget* parent = NULL, const char* name = NULL ); - Rules* edit( Rules* r, WId window ); + Rules* edit( Rules* r, WId window, bool show_hints ); protected: virtual void accept(); + private slots: + void displayHints(); private: RulesWidget* widget; Rules* rules;