Fill (or pre-fill) more values from the detect dialog for matching the window.

svn path=/trunk/kdebase/kwin/; revision=334154
This commit is contained in:
Luboš Luňák 2004-07-30 13:35:55 +00:00
parent 9ca3abced6
commit 3966017ccd
3 changed files with 56 additions and 0 deletions

View file

@ -127,6 +127,33 @@ QCString DetectDialog::selectedRole() const
return "";
}
QString DetectDialog::selectedTitle() const
{
return title;
}
Rules::StringMatch DetectDialog::titleMatch() const
{
#if KDE_IS_VERSION( 3, 3, 90 )
#warning Offer possibilities here
#endif
return Rules::UnimportantMatch;
}
bool DetectDialog::selectedWholeApp() const
{
return widget->use_class->isChecked();
}
NET::WindowType DetectDialog::selectedType() const
{
return type;
}
QCString DetectDialog::selectedMachine() const
{
return machine;
}
void DetectDialog::selectWindow()
{

View file

@ -25,6 +25,8 @@
#include <kdialogbase.h>
#include <netwm_def.h>
#include "../../rules.h"
namespace KWinInternal
{
@ -46,6 +48,11 @@ class DetectDialog
QCString selectedClass() const;
bool selectedWholeClass() const;
QCString selectedRole() const;
bool selectedWholeApp() const;
NET::WindowType selectedType() const;
QString selectedTitle() const;
Rules::StringMatch titleMatch() const;
QCString selectedMachine() const;
signals:
void detectionDone( bool );
protected:

View file

@ -518,6 +518,28 @@ void RulesWidget::detected( bool ok )
role_match->setCurrentItem( detect_dlg->selectedRole().isEmpty()
? Rules::UnimportantMatch : Rules::ExactMatch );
roleMatchChanged();
if( detect_dlg->selectedWholeApp())
{
for( unsigned int i = 0;
i < types->count();
++i )
types->setSelected( i, true );
}
else
{
NET::WindowType type = detect_dlg->selectedType();
for( unsigned int i = 0;
i < types->count();
++i )
types->setSelected( i, false );
types->setSelected( typeToCombo( type ), true );
}
title->setText( detect_dlg->selectedTitle());
title_match->setCurrentItem( detect_dlg->titleMatch());
titleMatchChanged();
machine->setText( detect_dlg->selectedMachine());
machine_match->setCurrentItem( Rules::UnimportantMatch );
machineMatchChanged();
}
delete detect_dlg;
detect_dlg = NULL;