editshortcutbase.cpp
00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "editshortcutbase.h"
00013
00014 #include <qvariant.h>
00015 #include <qlabel.h>
00016 #include <qframe.h>
00017 #include <klineedit.h>
00018 #include <qpushbutton.h>
00019 #include <qlayout.h>
00020 #include <qtooltip.h>
00021 #include <qwhatsthis.h>
00022
00023
00024
00025
00026
00027 EditShortcutBase::EditShortcutBase( QWidget* parent, const char* name, WFlags fl )
00028 : QWidget( parent, name, fl )
00029 {
00030 if ( !name )
00031 setName( "EditShortcutBase" );
00032 EditShortcutBaseLayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint(), "EditShortcutBaseLayout");
00033
00034 textLabel2 = new QLabel( this, "textLabel2" );
00035 textLabel2->setTextFormat( QLabel::RichText );
00036 EditShortcutBaseLayout->addWidget( textLabel2 );
00037
00038 line1 = new QFrame( this, "line1" );
00039 line1->setFrameShape( QFrame::HLine );
00040 line1->setFrameShadow( QFrame::Sunken );
00041 line1->setFrameShape( QFrame::HLine );
00042 EditShortcutBaseLayout->addWidget( line1 );
00043
00044 shortcut = new KLineEdit( this, "shortcut" );
00045 EditShortcutBaseLayout->addWidget( shortcut );
00046
00047 layout2 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout2");
00048 spacer1 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00049 layout2->addItem( spacer1 );
00050
00051 pushButton1 = new QPushButton( this, "pushButton1" );
00052 layout2->addWidget( pushButton1 );
00053 spacer2 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00054 layout2->addItem( spacer2 );
00055
00056 pushButton2 = new QPushButton( this, "pushButton2" );
00057 layout2->addWidget( pushButton2 );
00058 spacer3 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00059 layout2->addItem( spacer3 );
00060 EditShortcutBaseLayout->addLayout( layout2 );
00061
00062 line2 = new QFrame( this, "line2" );
00063 line2->setFrameShape( QFrame::HLine );
00064 line2->setFrameShadow( QFrame::Sunken );
00065 line2->setFrameShape( QFrame::HLine );
00066 EditShortcutBaseLayout->addWidget( line2 );
00067 languageChange();
00068 resize( QSize(587, 402).expandedTo(minimumSizeHint()) );
00069 clearWState( WState_Polished );
00070
00071
00072 connect( pushButton1, SIGNAL( clicked() ), this, SLOT( editShortcut() ) );
00073 connect( pushButton2, SIGNAL( clicked() ), this, SLOT( clearShortcut() ) );
00074 }
00075
00076
00077
00078
00079 EditShortcutBase::~EditShortcutBase()
00080 {
00081
00082 }
00083
00084
00085
00086
00087
00088 void EditShortcutBase::languageChange()
00089 {
00090 textLabel2->setText( tr2i18n( "A single shortcut can be easily assigned or cleared using the two buttons. Only shortcuts with modifiers can be used.<p>\n"
00091 "It is possible to have several possible shortcuts, and the first available shortcut will be used. The shortcuts are specified using space-separated shortcut sets. One set is specified as <i>base</i>+(<i>list</i>), where base are modifiers and list is a list of keys.<br>\n"
00092 "For example \"<b>Shift+Alt+(123) Shift+Ctrl+(ABC)</b>\" will first try <b>Shift+Alt+1</b>, then others with <b>Shift+Ctrl+C</b> as the last one." ) );
00093 pushButton1->setText( tr2i18n( "&Single Shortcut" ) );
00094 pushButton2->setText( tr2i18n( "C&lear" ) );
00095 }
00096
00097 #include "editshortcutbase.moc"
This file is part of the documentation for kwin Library Version 3.4.2.