summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/tools/qtconfig
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-23 17:13:36 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-23 17:13:36 -0500
commitd3f7a9d6f1b8f6e24fb49aaa8caeaa7623ae48b5 (patch)
treebaeeba639393f46abab749f4700a250091c3cc16 /tqtinterface/qt4/tools/qtconfig
parentd7be1694839bacae31e500ea9e36b3c13257ce28 (diff)
downloadexperimental-d3f7a9d6.tar.gz
experimental-d3f7a9d6.zip
Apply all Qt3.3.8d patches
NOTE: This will *likely* break compilation of TQt4 Please wait a few days for fixes to be committed as needed!
Diffstat (limited to 'tqtinterface/qt4/tools/qtconfig')
-rw-r--r--tqtinterface/qt4/tools/qtconfig/mainwindow.cpp70
-rw-r--r--tqtinterface/qt4/tools/qtconfig/mainwindow.h1
-rw-r--r--tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui21
3 files changed, 90 insertions, 2 deletions
diff --git a/tqtinterface/qt4/tools/qtconfig/mainwindow.cpp b/tqtinterface/qt4/tools/qtconfig/mainwindow.cpp
index 754f139..7aaf211 100644
--- a/tqtinterface/qt4/tools/qtconfig/mainwindow.cpp
+++ b/tqtinterface/qt4/tools/qtconfig/mainwindow.cpp
@@ -40,6 +40,7 @@
#include <tqapplication.h>
#include <tqcombobox.h>
#include <tqstylefactory.h>
+#include <tqinputcontextfactory.h>
#include <tqobjectlist.h>
#include <tqfontdatabase.h>
#include <tqlineedit.h>
@@ -374,13 +375,73 @@ MainWindow::MainWindow()
rtlExtensions->setChecked( settings.readBoolEntry( "/qt/useRtlExtensions", FALSE ) );
-#ifdef TQ_WS_X11
+#if defined(TQ_WS_X11)
inputStyle->setCurrentText( settings.readEntry( "/qt/XIMInputStyle", trUtf8( "On The Spot" ) ) );
#else
inputStyle->hide();
inputStyleLabel->hide();
#endif
+#if defined(TQ_WS_X11) && !defined(TQT_NO_IM_EXTENSIONS)
+ /*
+ This code makes it possible to set up default input method.
+
+ The list of identifier names of input method which can be used
+ is acquired using TQInputContextFactory::keys(). And it is
+ translated to display name and set to inputMethodCombo which
+ displays the list of input method.
+ */
+ inputMethodIdentifiers = TQInputContextFactory::keys();
+ TQStringList imDispNames;
+ {
+ // input method switcher should named with "imsw-" prefix to
+ // prevent to be listed in ordinary input method list.
+ TQStringList::Iterator imIt = inputMethodIdentifiers.begin();
+ while (imIt != inputMethodIdentifiers.end()) {
+ if ((*imIt).tqfind("imsw-") == 0)
+ imIt = inputMethodIdentifiers.remove(imIt);
+ else
+ imIt++;
+ }
+ // we should not sort the list
+ //inputMethodIdentifiers.sort();
+ for (imIt = inputMethodIdentifiers.begin();
+ imIt != inputMethodIdentifiers.end();
+ imIt++) {
+ TQString dispName = TQInputContextFactory::displayName(*imIt);
+ if (dispName.isNull() || dispName.isEmpty())
+ dispName = *imIt;
+ imDispNames << dispName;
+ }
+ }
+ //inputMethodCombo->insertStringList(inputMethodIdentifiers);
+ inputMethodCombo->insertStringList(imDispNames);
+
+ /*
+ input method set up as a default in the past is chosen.
+ If nothing is set up, default input method in the platform is chosen.
+ */
+ // default input method is XIM in X11.
+ TQString currentIM = settings.readEntry("/qt/DefaultInputMethod", "xim");
+ {
+ int index = inputMethodIdentifiers.findIndex(currentIM);
+ // set up Selected input method.
+ if (0 <= index && index < inputMethodIdentifiers.count()) {
+ inputMethodCombo->setCurrentItem(index);
+ } else {
+ // Give up. this part is executed when specified IM is not
+ // installed.
+ TQString dispName = tr("Unknown Input Method") + " (" + currentIM + ")";
+ inputMethodCombo->insertItem(dispName);
+ inputMethodCombo->setCurrentItem(inputMethodCombo->count() - 1);
+ inputMethodIdentifiers << currentIM;
+ }
+ }
+#else
+ inputMethodCombo->hide();
+ inputMethodLabel->hide();
+#endif
+
fontembeddingcheckbox->setChecked( settings.readBoolEntry("/qt/embedFonts", TRUE) );
fontpaths = settings.readListEntry("/qt/fontPath", ':');
fontpathlistbox->insertStringList(fontpaths);
@@ -457,6 +518,13 @@ void MainWindow::fileSave()
else if ( style == trUtf8( "Root" ) )
str = "Root";
settings.writeEntry( "/qt/XIMInputStyle", inputStyle->currentText() );
+
+#if !defined(TQT_NO_IM_EXTENSIONS)
+ TQString imSwitcher = settings.readEntry("/qt/DefaultInputMethodSwitcher", "imsw-multi");
+ settings.writeEntry("/qt/DefaultInputMethodSwitcher", imSwitcher);
+ int imIndex = inputMethodCombo->currentItem();
+ settings.writeEntry("/qt/DefaultInputMethod", inputMethodIdentifiers[imIndex]);
+#endif
#endif
TQStringList effects;
diff --git a/tqtinterface/qt4/tools/qtconfig/mainwindow.h b/tqtinterface/qt4/tools/qtconfig/mainwindow.h
index 6f22c06..66acb8c 100644
--- a/tqtinterface/qt4/tools/qtconfig/mainwindow.h
+++ b/tqtinterface/qt4/tools/qtconfig/mainwindow.h
@@ -97,6 +97,7 @@ private:
TQPalette editPalette, previewPalette;
TQStyle *previewstyle;
TQStringList fontpaths;
+ TQStringList inputMethodIdentifiers;
bool modified;
};
diff --git a/tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui b/tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui
index fb56464..fc770b0 100644
--- a/tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui
+++ b/tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui
@@ -1029,6 +1029,19 @@
<number>0</number>
</property>
</widget>
+ <widget class=TQLABEL_OBJECT_NAME_STRING>
+ <property name="name">
+ <cstring>inputMethodLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Default Input Method:</string>
+ </property>
+ </widget>
+ <widget class=TQCOMBOBOX_OBJECT_NAME_STRING>
+ <property name="name">
+ <cstring>inputMethodCombo</cstring>
+ </property>
+ </widget>
<spacer>
<property name="name">
<cstring>spacer5</cstring>
@@ -1042,7 +1055,7 @@
<property name="tqsizeHint">
<size>
<width>20</width>
- <height>40</height>
+ <height>30</height>
</size>
</property>
</spacer>
@@ -1718,6 +1731,12 @@
<slot>somethingModified()</slot>
</connection>
<connection>
+ <sender>inputMethodCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
<sender>gstylecombo</sender>
<signal>activated(const TQString&amp;)</signal>
<receiver>MainWindowBase</receiver>