Give at least some hint about how to use the window-specific settings.

svn path=/trunk/KDE/kdebase/kwin/; revision=450916
icc-effect-5.14.5
Luboš Luňák 2005-08-19 13:46:45 +00:00
parent 7abacfa2fb
commit 2c1534b2b1
4 changed files with 23 additions and 5 deletions

View File

@ -236,7 +236,7 @@ static int edit( Window wid, bool whole_app )
Rules* orig_rule = findRule( rules, wid, whole_app ); Rules* orig_rule = findRule( rules, wid, whole_app );
RulesDialog dlg; RulesDialog dlg;
// dlg.edit() creates new Rules instance if edited // 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()) if( edited_rule == NULL || edited_rule->isEmpty())
{ {
rules.remove( orig_rule ); rules.remove( orig_rule );

View File

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

View File

@ -31,6 +31,7 @@
#include <assert.h> #include <assert.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <qtabwidget.h> #include <qtabwidget.h>
#include <qtimer.h>
#include "../../rules.h" #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 // window is set only for Alt+F3/Window-specific settings, because the dialog
// is then related to one specific window // 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; rules = r;
widget->setRules( rules ); widget->setRules( rules );
if( window != 0 ) if( window != 0 )
widget->prepareWindowSpecific( window ); widget->prepareWindowSpecific( window );
if( show_hints )
QTimer::singleShot( 0, this, SLOT( displayHints()));
exec(); exec();
return rules; return rules;
} }
void RulesDialog::displayHints()
{
QString str = "<qt><p>";
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 += "</p><p>" + i18n( "Consult the documentation for more details." );
#endif
str += "</p></qt>";
KMessageBox::information( this, str, QString::null, "displayhints" );
}
void RulesDialog::accept() void RulesDialog::accept()
{ {
if( !widget->finalCheck()) if( !widget->finalCheck())

View File

@ -100,9 +100,11 @@ class RulesDialog
Q_OBJECT Q_OBJECT
public: public:
RulesDialog( QWidget* parent = NULL, const char* name = NULL ); RulesDialog( QWidget* parent = NULL, const char* name = NULL );
Rules* edit( Rules* r, WId window ); Rules* edit( Rules* r, WId window, bool show_hints );
protected: protected:
virtual void accept(); virtual void accept();
private slots:
void displayHints();
private: private:
RulesWidget* widget; RulesWidget* widget;
Rules* rules; Rules* rules;