convert rules dialog to qt4 format; remove qt3support dependency
svn path=/trunk/KDE/kdebase/workspace/; revision=770234
This commit is contained in:
parent
214d575aa3
commit
dbb57de9d5
5 changed files with 2613 additions and 2792 deletions
|
@ -1,17 +1,16 @@
|
|||
ADD_DEFINITIONS(-DKCMRULES -DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
|
||||
ADD_DEFINITIONS(-DKCMRULES)
|
||||
########### next target ###############
|
||||
|
||||
set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp)
|
||||
|
||||
kde4_add_ui_files(kwinrules_SRCS ruleslist.ui detectwidget.ui editshortcut.ui)
|
||||
kde4_add_ui3_files(kwinrules_SRCS ruleswidgetbase.ui)
|
||||
kde4_add_ui_files(kwinrules_SRCS ruleslist.ui detectwidget.ui editshortcut.ui ruleswidgetbase.ui)
|
||||
|
||||
set(kwin_rules_dialog_KDEINIT_SRCS main.cpp ${kwinrules_SRCS})
|
||||
|
||||
|
||||
kde4_add_kdeinit_executable( kwin_rules_dialog ${kwin_rules_dialog_KDEINIT_SRCS})
|
||||
|
||||
target_link_libraries(kdeinit_kwin_rules_dialog ${QT_QT3SUPPORT_LIBRARY}
|
||||
target_link_libraries(kdeinit_kwin_rules_dialog
|
||||
${KDE4_KDEUI_LIBS} )
|
||||
|
||||
install(TARGETS kdeinit_kwin_rules_dialog DESTINATION ${LIB_INSTALL_DIR} )
|
||||
|
@ -26,8 +25,7 @@ set(kcm_kwinrules_PART_SRCS kcm.cpp ${kwinrules_SRCS})
|
|||
|
||||
kde4_add_plugin(kcm_kwinrules ${kcm_kwinrules_PART_SRCS})
|
||||
|
||||
target_link_libraries(kcm_kwinrules ${KDE4_KDEUI_LIBS}
|
||||
${QT_QT3SUPPORT_LIBRARY} )
|
||||
target_link_libraries(kcm_kwinrules ${KDE4_KDEUI_LIBS} )
|
||||
|
||||
install(TARGETS kcm_kwinrules DESTINATION ${PLUGIN_INSTALL_DIR} )
|
||||
|
||||
|
|
|
@ -1,232 +1,222 @@
|
|||
<ui version="4.0" stdsetdef="1" >
|
||||
<author></author>
|
||||
<comment></comment>
|
||||
<exportmacro></exportmacro>
|
||||
<class>KWin::DetectWidget</class>
|
||||
<widget class="QWidget" name="KWin::DetectWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>523</width>
|
||||
<height>325</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item rowspan="1" row="9" column="0" colspan="2" >
|
||||
<spacer name="spacer1" >
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</spacer>
|
||||
<ui version="4.0" >
|
||||
<class>KWin::DetectWidget</class>
|
||||
<widget class="QWidget" name="KWin::DetectWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>417</width>
|
||||
<height>362</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" colspan="2" >
|
||||
<widget class="QLabel" name="textLabel9" >
|
||||
<property name="text" >
|
||||
<string>Information About Selected Window</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2" >
|
||||
<widget class="Line" name="line1" >
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="textLabel1" >
|
||||
<property name="text" >
|
||||
<string>Class:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QLabel" name="class_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="textLabel3" >
|
||||
<property name="text" >
|
||||
<string>Role:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QLabel" name="role_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" >
|
||||
<widget class="QLabel" name="textLabel4" >
|
||||
<property name="text" >
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" >
|
||||
<widget class="QLabel" name="type_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" >
|
||||
<widget class="QLabel" name="textLabel8" >
|
||||
<property name="text" >
|
||||
<string>Title:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" >
|
||||
<widget class="QLabel" name="title_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" >
|
||||
<widget class="QLabel" name="textLabel11" >
|
||||
<property name="text" >
|
||||
<string>Extra role:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" >
|
||||
<widget class="QLabel" name="extrarole_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" >
|
||||
<widget class="QLabel" name="textLabel13" >
|
||||
<property name="text" >
|
||||
<string>Machine:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" >
|
||||
<widget class="QLabel" name="machine_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2" >
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<item>
|
||||
<widget class="QRadioButton" name="use_class" >
|
||||
<property name="whatsThis" >
|
||||
<string>For selecting all windows belonging to a specific application, selecting only window class should usually work.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Use window &class (whole application)</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" >
|
||||
<widget class="QLabel" name="textLabel11" >
|
||||
<property name="text" >
|
||||
<string>Extra role:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="use_role" >
|
||||
<property name="whatsThis" >
|
||||
<string>For selecting a specific window in an application, both window class and window role should be selected. Window class will determine the application, and window role the specific window in the application; many applications do not provide useful window roles though.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Use window class and window &role (specific window)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="textLabel1" >
|
||||
<property name="text" >
|
||||
<string>Class:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="use_whole_class" >
|
||||
<property name="whatsThis" >
|
||||
<string>With some (non-KDE) applications whole window class can be sufficient for selecting a specific window in an application, as they set whole window class to contain both application and window role.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Use &whole window class (specific window)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="textLabel3" >
|
||||
<property name="text" >
|
||||
<string>Role:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="match_title" >
|
||||
<property name="text" >
|
||||
<string>Match also window &title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" >
|
||||
<widget class="QLabel" name="type_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" >
|
||||
<widget class="QLabel" name="textLabel8" >
|
||||
<property name="text" >
|
||||
<string>Title:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QLabel" name="class_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QLabel" name="role_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" >
|
||||
<widget class="QLabel" name="title_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" >
|
||||
<widget class="QLabel" name="machine_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" >
|
||||
<widget class="QLabel" name="textLabel4" >
|
||||
<property name="text" >
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" >
|
||||
<widget class="QLabel" name="extrarole_label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" >
|
||||
<widget class="QLabel" name="textLabel13" >
|
||||
<property name="text" >
|
||||
<string>Machine:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="1" row="1" column="0" colspan="2" >
|
||||
<widget class="Line" name="line1" >
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="1" row="0" column="0" colspan="2" >
|
||||
<widget class="QLabel" name="textLabel9" >
|
||||
<property name="text" >
|
||||
<string>Information About Selected Window</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="1" row="8" column="0" colspan="2" >
|
||||
<widget class="Q3ButtonGroup" name="buttonGroup1" >
|
||||
<property name="title" >
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="use_class" >
|
||||
<property name="text" >
|
||||
<string>Use window &class (whole application)</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0" >
|
||||
<string>For selecting all windows belonging to a specific application, selecting only window class should usually work.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="use_role" >
|
||||
<property name="text" >
|
||||
<string>Use window class and window &role (specific window)</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0" >
|
||||
<string>For selecting a specific window in an application, both window class and window role should be selected. Window class will determine the application, and window role the specific window in the application; many applications do not provide useful window roles though.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="use_whole_class" >
|
||||
<property name="text" >
|
||||
<string>Use &whole window class (specific window)</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0" >
|
||||
<string>With some (non-KDE) applications whole window class can be sufficient for selecting a specific window in an application, as they set whole window class to contain both application and window role.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="match_title" >
|
||||
<property name="text" >
|
||||
<string>Match also window &title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutfunction spacing="KDialog::spacingHint" margin="KDialog::marginHint" />
|
||||
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>161</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutfunction spacing="KDialog::spacingHint" margin="KDialog::marginHint" />
|
||||
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -48,9 +48,10 @@ namespace KWin
|
|||
rule_##var->setWhatsThis( type##RuleDesc );
|
||||
|
||||
RulesWidget::RulesWidget( QWidget* parent )
|
||||
: RulesWidgetBase( parent )
|
||||
, detect_dlg( NULL )
|
||||
: detect_dlg( NULL )
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
QString enableDesc =
|
||||
i18n( "Enable this checkbox to alter this window property for the specified window(s)." );
|
||||
QString setRuleDesc =
|
||||
|
@ -122,7 +123,7 @@ RulesWidget::RulesWidget( QWidget* parent )
|
|||
void RulesWidget::updateEnable##var() \
|
||||
{ \
|
||||
/* leave the label readable label_##var->setEnabled( enable_##var->isChecked() && rule_##var->currentIndex() != 0 );*/ \
|
||||
Ui_RulesWidgetBase::var->setEnabled( enable_##var->isChecked() && rule_##var->currentIndex() != 0 ); \
|
||||
Ui::RulesWidgetBase::var->setEnabled( enable_##var->isChecked() && rule_##var->currentIndex() != 0 ); \
|
||||
}
|
||||
|
||||
// geometry tab
|
||||
|
@ -352,14 +353,14 @@ static NET::WindowType comboToType( int val )
|
|||
{ \
|
||||
enable_##var->setChecked( false ); \
|
||||
rule_##var->setCurrentIndex( 0 ); \
|
||||
Ui_RulesWidgetBase::var->uimethod0; \
|
||||
Ui::RulesWidgetBase::var->uimethod0; \
|
||||
updateEnable##var(); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
enable_##var->setChecked( true ); \
|
||||
rule_##var->setCurrentIndex( type##_rule_to_combo[ rules->var##rule ] ); \
|
||||
Ui_RulesWidgetBase::var->uimethod( func( rules->var )); \
|
||||
Ui::RulesWidgetBase::var->uimethod( func( rules->var )); \
|
||||
updateEnable##var(); \
|
||||
}
|
||||
|
||||
|
@ -443,7 +444,7 @@ void RulesWidget::setRules( Rules* rules )
|
|||
if( enable_##var->isChecked() && rule_##var->currentIndex() >= 0) \
|
||||
{ \
|
||||
rules->var##rule = combo_to_##type##_rule[ rule_##var->currentIndex() ]; \
|
||||
rules->var = func( Ui_RulesWidgetBase::var->uimethod()); \
|
||||
rules->var = func( Ui::RulesWidgetBase::var->uimethod()); \
|
||||
} \
|
||||
else \
|
||||
rules->var##rule = Rules::Unused##Type##Rule;
|
||||
|
@ -599,7 +600,7 @@ void RulesWidget::detected( bool ok )
|
|||
#define GENERIC_PREFILL( var, func, info, uimethod ) \
|
||||
if( !enable_##var->isChecked()) \
|
||||
{ \
|
||||
Ui_RulesWidgetBase::var->uimethod( func( info )); \
|
||||
Ui::RulesWidgetBase::var->uimethod( func( info )); \
|
||||
}
|
||||
|
||||
#define CHECKBOX_PREFILL( var, func, info ) GENERIC_PREFILL( var, func, info, setChecked )
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <kwindowsystem.h>
|
||||
#include <kkeysequencewidget.h>
|
||||
|
||||
#include "ruleswidgetbase.h"
|
||||
#include "ui_ruleswidgetbase.h"
|
||||
#include "ui_editshortcut.h"
|
||||
|
||||
namespace KWin
|
||||
|
@ -34,7 +34,7 @@ class Rules;
|
|||
class DetectDialog;
|
||||
|
||||
class RulesWidget
|
||||
: public RulesWidgetBase
|
||||
: public QWidget, public Ui::RulesWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -46,13 +46,13 @@ class RulesWidget
|
|||
signals:
|
||||
void changed( bool state );
|
||||
protected slots:
|
||||
virtual void detectClicked();
|
||||
virtual void wmclassMatchChanged();
|
||||
virtual void roleMatchChanged();
|
||||
virtual void titleMatchChanged();
|
||||
virtual void extraMatchChanged();
|
||||
virtual void machineMatchChanged();
|
||||
virtual void shortcutEditClicked();
|
||||
void detectClicked();
|
||||
void wmclassMatchChanged();
|
||||
void roleMatchChanged();
|
||||
void titleMatchChanged();
|
||||
void extraMatchChanged();
|
||||
void machineMatchChanged();
|
||||
void shortcutEditClicked();
|
||||
private slots:
|
||||
// geometry tab
|
||||
void updateEnableposition();
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue