示例#1
0
void KScoringManager::editRule( KScoringRule *e, QWidget *w )
{
  KScoringEditor *edit = KScoringEditor::createEditor( this, w );
  edit->setRule( e );
  edit->show();
  delete edit;
}
示例#2
0
void KNScoringManager::configure()
{
  KScoringEditor *dlg = KScoringEditor::createEditor(this, knGlobals.topWidget);

  if (dlg) {
    dlg->show();
    KWin::activateWindow(dlg->winId());
  }
}
示例#3
0
void KNScoringManager::configure()
{
  KScoringEditor *dlg = KScoringEditor::createEditor(this, knGlobals.topWidget);

  if (dlg) {
    dlg->show();
#ifdef Q_OS_UNIX    
    KWindowSystem::activateWindow(dlg->winId());
#endif    
  }
}
示例#4
0
KScoringRule *KScoringManager::addRule( const ScorableArticle &a,
                                        const QString &group, short score )
{
  KScoringRule *rule = new KScoringRule( findUniqueName() );
  rule->addGroup( group );
  rule->addExpression( new KScoringExpression( "From","CONTAINS", a.from(), "0" ) );
  if ( score ) {
    rule->addAction( new ActionSetScore( score ) );
  }
  rule->setExpireDate( QDate::currentDate().addDays( 30 ) );
  KScoringEditor *edit = KScoringEditor::createEditor( this );
  // Note: the call to createEditor() call this->pushRuleList(). So addRule(KScoringRule)
  // must be place after it, otherwise the cancel button of the editor is not effective (bug #101092).
  addRule( rule );
  edit->setRule( rule );
  edit->show();
  setCacheValid( false );
  return rule;
}