00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "knotifywidgetbase.h"
00013
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <klistview.h>
00017 #include <kurlrequester.h>
00018 #include <klineedit.h>
00019 #include <kpushbutton.h>
00020 #include <kcombobox.h>
00021 #include <qpushbutton.h>
00022 #include <qheader.h>
00023 #include <qgroupbox.h>
00024 #include <qcheckbox.h>
00025 #include <qlayout.h>
00026 #include <qtooltip.h>
00027 #include <qwhatsthis.h>
00028
00029
00030
00031
00032
00033 KNotifyWidgetBase::KNotifyWidgetBase( QWidget* parent, const char* name, WFlags fl )
00034 : QWidget( parent, name, fl )
00035 {
00036 if ( !name )
00037 setName( "KNotifyWidgetBase" );
00038 KNotifyWidgetBaseLayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "KNotifyWidgetBaseLayout");
00039
00040 m_listview = new KListView( this, "m_listview" );
00041 m_listview->addColumn( QString::null );
00042 m_listview->header()->setResizeEnabled( FALSE, m_listview->header()->count() - 1 );
00043 m_listview->addColumn( QString::null );
00044 m_listview->header()->setResizeEnabled( FALSE, m_listview->header()->count() - 1 );
00045 m_listview->addColumn( QString::null );
00046 m_listview->header()->setResizeEnabled( FALSE, m_listview->header()->count() - 1 );
00047 m_listview->addColumn( QString::null );
00048 m_listview->header()->setResizeEnabled( FALSE, m_listview->header()->count() - 1 );
00049 m_listview->addColumn( QString::null );
00050 m_listview->header()->setResizeEnabled( FALSE, m_listview->header()->count() - 1 );
00051 m_listview->addColumn( QString::null );
00052 m_listview->header()->setResizeEnabled( FALSE, m_listview->header()->count() - 1 );
00053 m_listview->addColumn( tr2i18n( "Events" ) );
00054 m_listview->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 10, 0, m_listview->sizePolicy().hasHeightForWidth() ) );
00055 KNotifyWidgetBaseLayout->addWidget( m_listview );
00056
00057 m_controlsBox = new QGroupBox( this, "m_controlsBox" );
00058 m_controlsBox->setColumnLayout(0, Qt::Vertical );
00059 m_controlsBox->layout()->setSpacing( KDialog::spacingHint() );
00060 m_controlsBox->layout()->setMargin( KDialog::marginHint() );
00061 m_controlsBoxLayout = new QGridLayout( m_controlsBox->layout() );
00062 m_controlsBoxLayout->setAlignment( Qt::AlignTop );
00063
00064 m_affectAllApps = new QCheckBox( m_controlsBox, "m_affectAllApps" );
00065
00066 m_controlsBoxLayout->addMultiCellWidget( m_affectAllApps, 0, 0, 0, 3 );
00067 Spacer3_2 = new QSpacerItem( 30, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00068 m_controlsBoxLayout->addMultiCell( Spacer3_2, 1, 2, 0, 0 );
00069 Spacer17 = new QSpacerItem( 318, 16, QSizePolicy::Expanding, QSizePolicy::Minimum );
00070 m_controlsBoxLayout->addItem( Spacer17, 2, 3 );
00071
00072 m_buttonDisable = new QPushButton( m_controlsBox, "m_buttonDisable" );
00073
00074 m_controlsBoxLayout->addWidget( m_buttonDisable, 2, 1 );
00075
00076 m_buttonEnable = new QPushButton( m_controlsBox, "m_buttonEnable" );
00077
00078 m_controlsBoxLayout->addWidget( m_buttonEnable, 1, 1 );
00079
00080 m_comboEnable = new KComboBox( FALSE, m_controlsBox, "m_comboEnable" );
00081
00082 m_controlsBoxLayout->addWidget( m_comboEnable, 1, 2 );
00083
00084 m_comboDisable = new KComboBox( FALSE, m_controlsBox, "m_comboDisable" );
00085
00086 m_controlsBoxLayout->addWidget( m_comboDisable, 2, 2 );
00087 KNotifyWidgetBaseLayout->addWidget( m_controlsBox );
00088
00089 m_actionsBox = new QGroupBox( this, "m_actionsBox" );
00090 m_actionsBox->setColumnLayout(0, Qt::Vertical );
00091 m_actionsBox->layout()->setSpacing( KDialog::spacingHint() );
00092 m_actionsBox->layout()->setMargin( KDialog::marginHint() );
00093 m_actionsBoxLayout = new QGridLayout( m_actionsBox->layout() );
00094 m_actionsBoxLayout->setAlignment( Qt::AlignTop );
00095
00096 m_stderr = new QCheckBox( m_actionsBox, "m_stderr" );
00097
00098 m_actionsBoxLayout->addMultiCellWidget( m_stderr, 5, 5, 0, 2 );
00099
00100 m_messageBox = new QCheckBox( m_actionsBox, "m_messageBox" );
00101
00102 m_actionsBoxLayout->addMultiCellWidget( m_messageBox, 3, 3, 0, 2 );
00103
00104 m_execute = new QCheckBox( m_actionsBox, "m_execute" );
00105
00106 m_actionsBoxLayout->addMultiCellWidget( m_execute, 2, 2, 0, 1 );
00107
00108 Layout25 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout25");
00109
00110 m_playSound = new QCheckBox( m_actionsBox, "m_playSound" );
00111 Layout25->addWidget( m_playSound );
00112
00113 m_playButton = new QPushButton( m_actionsBox, "m_playButton" );
00114 Layout25->addWidget( m_playButton );
00115
00116 m_actionsBoxLayout->addMultiCellLayout( Layout25, 0, 0, 0, 1 );
00117
00118 m_taskbar = new QCheckBox( m_actionsBox, "m_taskbar" );
00119
00120 m_actionsBoxLayout->addMultiCellWidget( m_taskbar, 6, 6, 0, 2 );
00121
00122 m_logToFile = new QCheckBox( m_actionsBox, "m_logToFile" );
00123
00124 m_actionsBoxLayout->addMultiCellWidget( m_logToFile, 1, 1, 0, 1 );
00125 Spacer3 = new QSpacerItem( 30, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00126 m_actionsBoxLayout->addItem( Spacer3, 4, 0 );
00127
00128 m_executePath = new KURLRequester( m_actionsBox, "m_executePath" );
00129 m_executePath->setEnabled( FALSE );
00130 m_executePath->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 1, 0, m_executePath->sizePolicy().hasHeightForWidth() ) );
00131
00132 m_actionsBoxLayout->addWidget( m_executePath, 2, 2 );
00133
00134 m_logfilePath = new KURLRequester( m_actionsBox, "m_logfilePath" );
00135 m_logfilePath->setEnabled( FALSE );
00136 m_logfilePath->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 1, 0, m_logfilePath->sizePolicy().hasHeightForWidth() ) );
00137
00138 m_actionsBoxLayout->addWidget( m_logfilePath, 1, 2 );
00139
00140 m_soundPath = new KURLRequester( m_actionsBox, "m_soundPath" );
00141 m_soundPath->setEnabled( FALSE );
00142 m_soundPath->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, m_soundPath->sizePolicy().hasHeightForWidth() ) );
00143
00144 m_actionsBoxLayout->addWidget( m_soundPath, 0, 2 );
00145
00146 m_passivePopup = new QCheckBox( m_actionsBox, "m_passivePopup" );
00147 m_passivePopup->setEnabled( FALSE );
00148
00149 m_actionsBoxLayout->addMultiCellWidget( m_passivePopup, 4, 4, 1, 2 );
00150 KNotifyWidgetBaseLayout->addWidget( m_actionsBox );
00151
00152 Layout8 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout8");
00153
00154 m_extension = new QPushButton( this, "m_extension" );
00155 m_extension->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, 0, 0, m_extension->sizePolicy().hasHeightForWidth() ) );
00156 m_extension->setToggleButton( FALSE );
00157 Layout8->addWidget( m_extension );
00158 Spacer7 = new QSpacerItem( 20, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00159 Layout8->addItem( Spacer7 );
00160
00161 m_playerButton = new QPushButton( this, "m_playerButton" );
00162 Layout8->addWidget( m_playerButton );
00163 KNotifyWidgetBaseLayout->addLayout( Layout8 );
00164 languageChange();
00165 resize( QSize(487, 531).expandedTo(minimumSizeHint()) );
00166 clearWState( WState_Polished );
00167
00168
00169 connect( m_messageBox, SIGNAL( toggled(bool) ), m_passivePopup, SLOT( setEnabled(bool) ) );
00170 connect( m_execute, SIGNAL( toggled(bool) ), m_executePath, SLOT( setEnabled(bool) ) );
00171 connect( m_playSound, SIGNAL( toggled(bool) ), m_soundPath, SLOT( setEnabled(bool) ) );
00172 connect( m_logToFile, SIGNAL( toggled(bool) ), m_logfilePath, SLOT( setEnabled(bool) ) );
00173
00174
00175 setTabOrder( m_listview, m_playSound );
00176 setTabOrder( m_playSound, m_playButton );
00177 setTabOrder( m_playButton, m_soundPath );
00178 setTabOrder( m_soundPath, m_logToFile );
00179 setTabOrder( m_logToFile, m_logfilePath );
00180 setTabOrder( m_logfilePath, m_execute );
00181 setTabOrder( m_execute, m_executePath );
00182 setTabOrder( m_executePath, m_messageBox );
00183 setTabOrder( m_messageBox, m_passivePopup );
00184 setTabOrder( m_passivePopup, m_stderr );
00185 setTabOrder( m_stderr, m_affectAllApps );
00186 setTabOrder( m_affectAllApps, m_buttonEnable );
00187 setTabOrder( m_buttonEnable, m_comboEnable );
00188 setTabOrder( m_comboEnable, m_buttonDisable );
00189 setTabOrder( m_buttonDisable, m_comboDisable );
00190 setTabOrder( m_comboDisable, m_extension );
00191 setTabOrder( m_extension, m_playerButton );
00192 }
00193
00194
00195
00196
00197 KNotifyWidgetBase::~KNotifyWidgetBase()
00198 {
00199
00200 }
00201
00202
00203
00204
00205
00206 void KNotifyWidgetBase::languageChange()
00207 {
00208 m_listview->header()->setLabel( 0, QString::null );
00209 m_listview->header()->setLabel( 1, QString::null );
00210 m_listview->header()->setLabel( 2, QString::null );
00211 m_listview->header()->setLabel( 3, QString::null );
00212 m_listview->header()->setLabel( 4, QString::null );
00213 m_listview->header()->setLabel( 5, QString::null );
00214 m_listview->header()->setLabel( 6, tr2i18n( "Events" ) );
00215 m_controlsBox->setTitle( tr2i18n( "Quick Controls" ) );
00216 m_affectAllApps->setText( tr2i18n( "Apply to &all applications" ) );
00217 m_buttonDisable->setText( tr2i18n( "Turn O&ff All" ) );
00218 QToolTip::add( m_buttonDisable, tr2i18n( "Allows you to change the behavior for all events at once" ) );
00219 m_buttonEnable->setText( tr2i18n( "Turn O&n All" ) );
00220 QToolTip::add( m_buttonEnable, tr2i18n( "Allows you to change the behavior for all events at once" ) );
00221 m_actionsBox->setTitle( tr2i18n( "Actions" ) );
00222 m_stderr->setText( tr2i18n( "Print a message to standard &error output" ) );
00223 m_messageBox->setText( tr2i18n( "Show a &message in a pop-up window" ) );
00224 m_execute->setText( tr2i18n( "E&xecute a program:" ) );
00225 m_playSound->setText( tr2i18n( "Play a &sound:" ) );
00226 m_playButton->setText( QString::null );
00227 QToolTip::add( m_playButton, tr2i18n( "Test the Sound" ) );
00228 m_taskbar->setText( tr2i18n( "Mark &taskbar entry" ) );
00229 m_logToFile->setText( tr2i18n( "&Log to a file:" ) );
00230 m_passivePopup->setText( tr2i18n( "&Use a passive window that does not interrupt other work" ) );
00231 m_extension->setText( tr2i18n( "Less Options" ) );
00232 m_playerButton->setText( tr2i18n( "Player Settings" ) );
00233 }
00234
00235 #include "knotifywidgetbase.moc"