Revision: 6709
Author: nogu.dev
Date: Tue Aug 10 07:17:05 2010
Log: * qt4/switcher/qt4.cpp
- (UimImSwitcher::createGUI): Add apply button.
We sort the three buttons in the KDE style.
- (UimImSwitcher::slotChangeInputMethodAndQuit): New function.
- (UimImSwitcher::slotChangeInputMethod): Don't quit in this function.
* qt4/switcher/qt4.h
- (UimImSwitcher): Add UimImSwitcher::slotChangeInputMethodAndQuit()
and remove UimImSwitcher::okButton and UimImSwitcher::cancelButton.
http://code.google.com/p/uim/source/detail?r=6709
Modified:
/trunk/qt4/switcher/qt4.cpp
/trunk/qt4/switcher/qt4.h
=======================================
--- /trunk/qt4/switcher/qt4.cpp Tue Aug 10 06:46:16 2010
+++ /trunk/qt4/switcher/qt4.cpp Tue Aug 10 07:17:05 2010
@@ -133,18 +133,25 @@
QGroupBox *groupBox = new QGroupBox( _( "Effective coverage" ) );
groupBox->setLayout( vbox );
- /* cancel & ok button */
- okButton = new QPushButton( this );
+ /* cancel, apply & ok button */
+ QPushButton *okButton = new QPushButton( this );
okButton->setText( _( "OK" ) );
connect( okButton, SIGNAL( clicked() ),
+ this, SLOT( slotChangeInputMethodAndQuit() ) );
+
+ QPushButton *applyButton = new QPushButton( this );
+ applyButton->setText( _( "Apply" ) );
+ connect( applyButton, SIGNAL( clicked() ),
this, SLOT( slotChangeInputMethod() ) );
- cancelButton = new QPushButton( this );
+
+ QPushButton *cancelButton = new QPushButton( this );
cancelButton->setText( _( "Cancel" ) );
connect( cancelButton, SIGNAL( clicked() ),
QApplication::instance(), SLOT( quit() ) );
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addStretch( 0 );
buttonLayout->addWidget( okButton );
+ buttonLayout->addWidget( applyButton );
buttonLayout->addWidget( cancelButton );
// main layout
@@ -178,6 +185,12 @@
uim_fd = -1;
disconnect( notifier, SIGNAL( activated( int ) ), 0, 0 );
}
+
+void UimImSwitcher::slotChangeInputMethodAndQuit()
+{
+ slotChangeInputMethod();
+ QApplication::instance()->quit();
+}
void UimImSwitcher::slotChangeInputMethod()
{
@@ -190,8 +203,6 @@
sendMessageImChange( "im_change_this_application_only\n" );
else if ( textButton->isChecked() )
sendMessageImChange( "im_change_this_text_area_only\n" );
-
- QApplication::instance()->quit();
}
void UimImSwitcher::sendMessageImChange( const QString &change_type )
=======================================
--- /trunk/qt4/switcher/qt4.h Tue Jul 20 20:46:46 2010
+++ /trunk/qt4/switcher/qt4.h Tue Aug 10 07:17:05 2010
@@ -68,6 +68,7 @@
protected slots:
void slotStdinActivated();
+ void slotChangeInputMethodAndQuit();
void slotChangeInputMethod();
protected:
@@ -75,8 +76,6 @@
QRadioButton *wholeButton;
QRadioButton *applicationButton;
QRadioButton *textButton;
- QPushButton *okButton;
- QPushButton *cancelButton;
};
#endif /* Not def: UIM_QT_IM_SWITCHER_QT_H */