[uim-commit] r2481 - trunk/qt

ekato at freedesktop.org ekato at freedesktop.org
Fri Dec 9 01:36:06 PST 2005


Author: ekato
Date: 2005-12-09 01:36:02 -0800 (Fri, 09 Dec 2005)
New Revision: 2481

Modified:
   trunk/qt/pref-qt.cpp
   trunk/qt/pref-qt.h
Log:
* qt/pref-qt.h (class UimPrefDialog) : Add confirmQuit() member.
* qt/pref-qt.cpp (UimPrefDialog::slotSelectionChanged) : Don't
  confirm according to [Anthy-dev 1795].
(UimPrefDialog::confirmQuit) : New.
(UimPrefDialog::slotCancel) : Confirm at slotCancel according to
  [Anthy-dev 1795].


Modified: trunk/qt/pref-qt.cpp
===================================================================
--- trunk/qt/pref-qt.cpp	2005-12-09 08:58:04 UTC (rev 2480)
+++ trunk/qt/pref-qt.cpp	2005-12-09 09:36:02 UTC (rev 2481)
@@ -212,15 +212,24 @@
  */
 void UimPrefDialog::slotSelectionChanged( QListViewItem * item )
 {
+    /*
+     * Don't confirm on each change in slot selection according to
+     * [Anthy-dev 1795].
+     * Dec 09 2005 ekato
+     */
+#if 0
     /* confirm if save the change */
     if( m_isValueChanged )    
         confirmChange();
+#endif
     
     /* switch group widget */
     QString grpname = item->text( 0 );
     m_groupWidgetStack->raiseWidget( m_groupWidgetsDict[grpname] );
 
+#if 0
     m_applyButton->setEnabled( false );
+#endif
 }
 
 void UimPrefDialog::slotCustomValueChanged()
@@ -247,6 +256,27 @@
     }
 }
 
+void UimPrefDialog::confirmQuit()
+{
+    int result = QMessageBox::question( this,
+                                        _("Quit Confirm"),
+                                        _("Some value(s) have been changed.\n"
+                                          "Do you realy quit this program?"),
+                                        _("Yes"),
+                                        _("No"),
+                                        QString::null, 0, 1);
+    switch(result)
+    {
+    case 0:
+        reject();
+        break;
+    case 1:
+        break;
+    default:
+        break;
+    }
+}
+
 void UimPrefDialog::slotSetDefault()
 {
     QWidget *w = m_groupWidgetStack->visibleWidget();
@@ -282,11 +312,14 @@
 void UimPrefDialog::slotCancel()
 {
     /*
+     * Enable confirmation since each change in slot selection is not
+     * checked strictly according to [Anthy-dev 1795].
+     * Dec 09 2005 ekato
+     */
     if( m_isValueChanged )
-        confirmChange();
-    */
-
-    reject();
+        confirmQuit();
+    else
+        reject();
 }
 
 //-------------------------------------------------------------------------------------

Modified: trunk/qt/pref-qt.h
===================================================================
--- trunk/qt/pref-qt.h	2005-12-09 08:58:04 UTC (rev 2480)
+++ trunk/qt/pref-qt.h	2005-12-09 09:36:02 UTC (rev 2481)
@@ -68,6 +68,7 @@
     void createGroupWidgets();
 
     void confirmChange();
+    void confirmQuit();
     
 protected slots:
     void slotSetDefault();



More information about the uim-commit mailing list