Give at least some hint about how to use the window-specific settings.
svn path=/trunk/KDE/kdebase/kwin/; revision=450916
This commit is contained in:
parent
7abacfa2fb
commit
2c1534b2b1
4 changed files with 23 additions and 5 deletions
|
@ -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 );
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <assert.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <qtabwidget.h>
|
||||
#include <qtimer.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
|
||||
// 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 = "<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()
|
||||
{
|
||||
if( !widget->finalCheck())
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue