|
|
@ -19,17 +19,17 @@
|
|
|
|
#include "kbpickicondlg.h"
|
|
|
|
#include "kbpickicondlg.h"
|
|
|
|
#include "boldlistboxitem.h"
|
|
|
|
#include "boldlistboxitem.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <qlayout.h>
|
|
|
|
#include <ntqlayout.h>
|
|
|
|
#include <qlabel.h>
|
|
|
|
#include <ntqlabel.h>
|
|
|
|
#include <qcheckbox.h>
|
|
|
|
#include <ntqcheckbox.h>
|
|
|
|
#include <qwhatsthis.h>
|
|
|
|
#include <ntqwhatsthis.h>
|
|
|
|
#include <qvbox.h>
|
|
|
|
#include <ntqvbox.h>
|
|
|
|
#include <qstyle.h>
|
|
|
|
#include <ntqstyle.h>
|
|
|
|
#include <qgroupbox.h>
|
|
|
|
#include <ntqgroupbox.h>
|
|
|
|
#include <qheader.h>
|
|
|
|
#include <ntqheader.h>
|
|
|
|
#include <qobjectlist.h>
|
|
|
|
#include <ntqobjectlist.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <ntqpushbutton.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <ntqcombobox.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <kdeversion.h>
|
|
|
|
#include <kdeversion.h>
|
|
|
|
#include <klistbox.h>
|
|
|
|
#include <klistbox.h>
|
|
|
@ -50,12 +50,12 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class SmallerKeyChooser : public KKeyChooser {
|
|
|
|
class SmallerKeyChooser : public KKeyChooser {
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
QSize m_size_hint;
|
|
|
|
TQSize m_size_hint;
|
|
|
|
void calcSizeHint();
|
|
|
|
void calcSizeHint();
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
SmallerKeyChooser(KGlobalAccel *accel, QWidget *parent) :
|
|
|
|
SmallerKeyChooser(KGlobalAccel *accel, TQWidget *parent) :
|
|
|
|
KKeyChooser(accel, parent) { calcSizeHint(); }
|
|
|
|
KKeyChooser(accel, parent) { calcSizeHint(); }
|
|
|
|
virtual QSize sizeHint() const { return m_size_hint; }
|
|
|
|
virtual TQSize sizeHint() const { return m_size_hint; }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void SmallerKeyChooser::calcSizeHint()
|
|
|
|
void SmallerKeyChooser::calcSizeHint()
|
|
|
@ -63,28 +63,28 @@ void SmallerKeyChooser::calcSizeHint()
|
|
|
|
m_size_hint = KKeyChooser::sizeHint();
|
|
|
|
m_size_hint = KKeyChooser::sizeHint();
|
|
|
|
|
|
|
|
|
|
|
|
KListView *lv = NULL;
|
|
|
|
KListView *lv = NULL;
|
|
|
|
QGroupBox *gb = NULL;
|
|
|
|
TQGroupBox *gb = NULL;
|
|
|
|
const QObjectList *objects = children();
|
|
|
|
const TQObjectList *objects = children();
|
|
|
|
QObjectListIt iter(*objects);
|
|
|
|
TQObjectListIt iter(*objects);
|
|
|
|
QObject *obj;
|
|
|
|
TQObject *obj;
|
|
|
|
|
|
|
|
|
|
|
|
while ( (obj = iter.current()) ) {
|
|
|
|
while ( (obj = iter.current()) ) {
|
|
|
|
++iter;
|
|
|
|
++iter;
|
|
|
|
if (obj->inherits("KListView"))
|
|
|
|
if (obj->inherits("KListView"))
|
|
|
|
lv = dynamic_cast<KListView*>(obj);
|
|
|
|
lv = dynamic_cast<KListView*>(obj);
|
|
|
|
else if (obj->inherits("QGroupBox"))
|
|
|
|
else if (obj->inherits("TQGroupBox"))
|
|
|
|
gb = dynamic_cast<QGroupBox*>(obj);
|
|
|
|
gb = dynamic_cast<TQGroupBox*>(obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!lv || !gb) return; // oops, should not happen
|
|
|
|
if (!lv || !gb) return; // oops, should not happen
|
|
|
|
|
|
|
|
|
|
|
|
QListViewItem *item = lv->firstChild();
|
|
|
|
TQListViewItem *item = lv->firstChild();
|
|
|
|
if (!item) return;
|
|
|
|
if (!item) return;
|
|
|
|
|
|
|
|
|
|
|
|
int height = item->height() * (1 + item->childCount()) + lv->header()->height() +
|
|
|
|
int height = item->height() * (1 + item->childCount()) + lv->header()->height() +
|
|
|
|
style().pixelMetric(QStyle::PM_ScrollBarExtent) + gb->sizeHint().height() +
|
|
|
|
style().pixelMetric(TQStyle::PM_ScrollBarExtent) + gb->sizeHint().height() +
|
|
|
|
layout()->spacing() * 2;
|
|
|
|
layout()->spacing() * 2;
|
|
|
|
int width = lv->columnWidth(0) + lv->columnWidth(1);
|
|
|
|
int width = lv->columnWidth(0) + lv->columnWidth(1);
|
|
|
|
m_size_hint = QSize(width, height);
|
|
|
|
m_size_hint = TQSize(width, height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline bool iconTypeShowsFlag(KBConfig::IconStyle icon_style)
|
|
|
|
static inline bool iconTypeShowsFlag(KBConfig::IconStyle icon_style)
|
|
|
@ -92,14 +92,14 @@ static inline bool iconTypeShowsFlag(KBConfig::IconStyle icon_style)
|
|
|
|
return icon_style == KBConfig::ICON_FLAG || icon_style == KBConfig::ICON_CODE_AND_FLAG;
|
|
|
|
return icon_style == KBConfig::ICON_FLAG || icon_style == KBConfig::ICON_CODE_AND_FLAG;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KBConfigDlg::KBConfigDlg(KBConfig *kbconf, QWidget *parent, const char *name )
|
|
|
|
KBConfigDlg::KBConfigDlg(KBConfig *kbconf, TQWidget *parent, const char *name )
|
|
|
|
: KDialogBase(Tabbed, i18n("Configure")/*caption*/, Ok | Apply | Cancel | Help,
|
|
|
|
: KDialogBase(Tabbed, i18n("Configure")/*caption*/, Ok | Apply | Cancel | Help,
|
|
|
|
Ok, parent, name, true /*modal*/)
|
|
|
|
Ok, parent, name, true /*modal*/)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_kbconf = kbconf;
|
|
|
|
m_kbconf = kbconf;
|
|
|
|
m_default_groupno = m_kbconf->default_groupno();
|
|
|
|
m_default_groupno = m_kbconf->default_groupno();
|
|
|
|
|
|
|
|
|
|
|
|
setHelp(QString("configure-kkbswitch"));
|
|
|
|
setHelp(TQString("configure-kkbswitch"));
|
|
|
|
setButtonBoxOrientation(Horizontal);
|
|
|
|
setButtonBoxOrientation(Horizontal);
|
|
|
|
setupGeneralPage();
|
|
|
|
setupGeneralPage();
|
|
|
|
setupShortcutsPage();
|
|
|
|
setupShortcutsPage();
|
|
|
@ -113,64 +113,64 @@ KBConfigDlg::~KBConfigDlg(){
|
|
|
|
|
|
|
|
|
|
|
|
void KBConfigDlg::setupGeneralPage()
|
|
|
|
void KBConfigDlg::setupGeneralPage()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QFrame *page = addPage(i18n("&General")); //makeMainWidget();
|
|
|
|
TQFrame *page = addPage(i18n("&General")); //makeMainWidget();
|
|
|
|
QVBoxLayout *vlayout = new QVBoxLayout(page);
|
|
|
|
TQVBoxLayout *vlayout = new TQVBoxLayout(page);
|
|
|
|
vlayout->setSpacing(2);
|
|
|
|
vlayout->setSpacing(2);
|
|
|
|
|
|
|
|
|
|
|
|
QLabel *lbl = new QLabel(i18n("Available &keyboard layouts:"), page);
|
|
|
|
TQLabel *lbl = new TQLabel(i18n("Available &keyboard layouts:"), page);
|
|
|
|
vlayout->addWidget(lbl);
|
|
|
|
vlayout->addWidget(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
QHBoxLayout *groupsLayout = new QHBoxLayout(vlayout);
|
|
|
|
TQHBoxLayout *groupsLayout = new TQHBoxLayout(vlayout);
|
|
|
|
groupsLayout->setSpacing(2);
|
|
|
|
groupsLayout->setSpacing(2);
|
|
|
|
|
|
|
|
|
|
|
|
lbGroups = new KListBox(page);
|
|
|
|
lbGroups = new KListBox(page);
|
|
|
|
QObject::connect(lbGroups, SIGNAL(selectionChanged()), this, SLOT(slotLayoutSelected()));
|
|
|
|
TQObject::connect(lbGroups, SIGNAL(selectionChanged()), this, SLOT(slotLayoutSelected()));
|
|
|
|
QObject::connect(lbGroups, SIGNAL(doubleClicked(QListBoxItem *)), this,
|
|
|
|
TQObject::connect(lbGroups, SIGNAL(doubleClicked(TQListBoxItem *)), this,
|
|
|
|
SLOT(slotListBoxExecuted(QListBoxItem *)));
|
|
|
|
SLOT(slotListBoxExecuted(TQListBoxItem *)));
|
|
|
|
groupsLayout->addWidget(lbGroups);
|
|
|
|
groupsLayout->addWidget(lbGroups);
|
|
|
|
lbl->setBuddy(lbGroups);
|
|
|
|
lbl->setBuddy(lbGroups);
|
|
|
|
QWhatsThis::add(lbGroups, i18n("This list box shows keyboard layouts available in your system.\n"
|
|
|
|
TQWhatsThis::add(lbGroups, i18n("This list box shows keyboard layouts available in your system.\n"
|
|
|
|
"Select a layout and click \"Change Icon...\" button to change the icon for a layout.\n"
|
|
|
|
"Select a layout and click \"Change Icon...\" button to change the icon for a layout.\n"
|
|
|
|
"If you have configured a non-default icon, you can reset the icon to default with \"Use Default Icon\" button.\n"
|
|
|
|
"If you have configured a non-default icon, you can reset the icon to default with \"Use Default Icon\" button.\n"
|
|
|
|
"The layout shown is bold is the default layout. Use \"Set as default\" button "
|
|
|
|
"The layout shown is bold is the default layout. Use \"Set as default\" button "
|
|
|
|
"to set the default layout."));
|
|
|
|
"to set the default layout."));
|
|
|
|
|
|
|
|
|
|
|
|
QVBoxLayout *btnLayout = new QVBoxLayout(groupsLayout);
|
|
|
|
TQVBoxLayout *btnLayout = new TQVBoxLayout(groupsLayout);
|
|
|
|
btnLayout->setSpacing(2);
|
|
|
|
btnLayout->setSpacing(2);
|
|
|
|
|
|
|
|
|
|
|
|
btnChangeIcon = new QPushButton(i18n("Cha&nge Icon..."), page);
|
|
|
|
btnChangeIcon = new TQPushButton(i18n("Cha&nge Icon..."), page);
|
|
|
|
QObject::connect(btnChangeIcon, SIGNAL(clicked()), this, SLOT(slotPickIcon()));
|
|
|
|
TQObject::connect(btnChangeIcon, SIGNAL(clicked()), this, SLOT(slotPickIcon()));
|
|
|
|
btnLayout->addWidget(btnChangeIcon, 0, Qt::AlignTop);
|
|
|
|
btnLayout->addWidget(btnChangeIcon, 0, TQt::AlignTop);
|
|
|
|
QWhatsThis::add(btnChangeIcon, i18n("Click this button to change the icon for the "
|
|
|
|
TQWhatsThis::add(btnChangeIcon, i18n("Click this button to change the icon for the "
|
|
|
|
"layout selected in the list box to the left."));
|
|
|
|
"layout selected in the list box to the left."));
|
|
|
|
|
|
|
|
|
|
|
|
btnSetDefaultIcon = new QPushButton(i18n("Use &Default Icon"), page);
|
|
|
|
btnSetDefaultIcon = new TQPushButton(i18n("Use &Default Icon"), page);
|
|
|
|
QObject::connect(btnSetDefaultIcon, SIGNAL(clicked()), this, SLOT(slotSetDefaultIcon()));
|
|
|
|
TQObject::connect(btnSetDefaultIcon, SIGNAL(clicked()), this, SLOT(slotSetDefaultIcon()));
|
|
|
|
btnLayout->addWidget(btnSetDefaultIcon, 0, Qt::AlignTop);
|
|
|
|
btnLayout->addWidget(btnSetDefaultIcon, 0, TQt::AlignTop);
|
|
|
|
QWhatsThis::add(btnSetDefaultIcon, i18n("Click this button to use default icon for the "
|
|
|
|
TQWhatsThis::add(btnSetDefaultIcon, i18n("Click this button to use default icon for the "
|
|
|
|
"layout selected in the list box to the left."));
|
|
|
|
"layout selected in the list box to the left."));
|
|
|
|
|
|
|
|
|
|
|
|
btnSetDefaultGroup = new QPushButton(i18n("&Set as Default"), page);
|
|
|
|
btnSetDefaultGroup = new TQPushButton(i18n("&Set as Default"), page);
|
|
|
|
QObject::connect(btnSetDefaultGroup, SIGNAL(clicked()), this, SLOT(slotSetDefaultGroup()));
|
|
|
|
TQObject::connect(btnSetDefaultGroup, SIGNAL(clicked()), this, SLOT(slotSetDefaultGroup()));
|
|
|
|
btnLayout->addWidget(btnSetDefaultGroup, 0, Qt::AlignTop);
|
|
|
|
btnLayout->addWidget(btnSetDefaultGroup, 0, TQt::AlignTop);
|
|
|
|
QWhatsThis::add(btnSetDefaultGroup, i18n("Click this button to set the layout selected "
|
|
|
|
TQWhatsThis::add(btnSetDefaultGroup, i18n("Click this button to set the layout selected "
|
|
|
|
"in the list box to the left as the default"));
|
|
|
|
"in the list box to the left as the default"));
|
|
|
|
|
|
|
|
|
|
|
|
btnLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum,
|
|
|
|
btnLayout->addItem(new TQSpacerItem(1, 1, TQSizePolicy::Minimum,
|
|
|
|
QSizePolicy::MinimumExpanding));
|
|
|
|
TQSizePolicy::MinimumExpanding));
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new QLabel(i18n("Layout &icon style:"), page);
|
|
|
|
lbl = new TQLabel(i18n("Layout &icon style:"), page);
|
|
|
|
vlayout->addWidget(lbl);
|
|
|
|
vlayout->addWidget(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
cbxIconType = new QComboBox(page);
|
|
|
|
cbxIconType = new TQComboBox(page);
|
|
|
|
cbxIconType->setEditable(false);
|
|
|
|
cbxIconType->setEditable(false);
|
|
|
|
cbxIconType->insertItem(i18n("Country flag"));
|
|
|
|
cbxIconType->insertItem(i18n("Country flag"));
|
|
|
|
cbxIconType->insertItem(i18n("Language code"));
|
|
|
|
cbxIconType->insertItem(i18n("Language code"));
|
|
|
|
cbxIconType->insertItem(i18n("Flag and code"));
|
|
|
|
cbxIconType->insertItem(i18n("Flag and code"));
|
|
|
|
QObject::connect(cbxIconType, SIGNAL(activated(int)), this, SLOT(slotIconTypeSelected(int)));
|
|
|
|
TQObject::connect(cbxIconType, SIGNAL(activated(int)), this, SLOT(slotIconTypeSelected(int)));
|
|
|
|
vlayout->addWidget(cbxIconType);
|
|
|
|
vlayout->addWidget(cbxIconType);
|
|
|
|
lbl->setBuddy(cbxIconType);
|
|
|
|
lbl->setBuddy(cbxIconType);
|
|
|
|
QWhatsThis::add(cbxIconType, i18n("<p>Select the style of icons representing the "
|
|
|
|
TQWhatsThis::add(cbxIconType, i18n("<p>Select the style of icons representing the "
|
|
|
|
"current keyboard layout.\n"
|
|
|
|
"current keyboard layout.\n"
|
|
|
|
"You can choose from the following styles:"
|
|
|
|
"You can choose from the following styles:"
|
|
|
|
"<ul><li><b>Country flag</b> - displays the corresponding country flag"
|
|
|
|
"<ul><li><b>Country flag</b> - displays the corresponding country flag"
|
|
|
@ -178,17 +178,17 @@ void KBConfigDlg::setupGeneralPage()
|
|
|
|
"<li><b>Flag and code</b> - displays the language code superimposed over the country flag."
|
|
|
|
"<li><b>Flag and code</b> - displays the language code superimposed over the country flag."
|
|
|
|
"</ul></p>"));
|
|
|
|
"</ul></p>"));
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new QLabel(i18n("&Layout applies to:"), page);
|
|
|
|
lbl = new TQLabel(i18n("&Layout applies to:"), page);
|
|
|
|
vlayout->addWidget(lbl);
|
|
|
|
vlayout->addWidget(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
cbxGroupScope = new QComboBox(page);
|
|
|
|
cbxGroupScope = new TQComboBox(page);
|
|
|
|
cbxGroupScope->setEditable(false);
|
|
|
|
cbxGroupScope->setEditable(false);
|
|
|
|
cbxGroupScope->insertItem(i18n("All windows"));
|
|
|
|
cbxGroupScope->insertItem(i18n("All windows"));
|
|
|
|
cbxGroupScope->insertItem(i18n("Windows of one application"));
|
|
|
|
cbxGroupScope->insertItem(i18n("Windows of one application"));
|
|
|
|
cbxGroupScope->insertItem(i18n("One window"));
|
|
|
|
cbxGroupScope->insertItem(i18n("One window"));
|
|
|
|
vlayout->addWidget(cbxGroupScope);
|
|
|
|
vlayout->addWidget(cbxGroupScope);
|
|
|
|
lbl->setBuddy(cbxGroupScope);
|
|
|
|
lbl->setBuddy(cbxGroupScope);
|
|
|
|
QWhatsThis::add(cbxGroupScope, i18n("<p>Select what windows the currently selected "
|
|
|
|
TQWhatsThis::add(cbxGroupScope, i18n("<p>Select what windows the currently selected "
|
|
|
|
"keyboard layout applies to:\n"
|
|
|
|
"keyboard layout applies to:\n"
|
|
|
|
"<ul><li><b>All windows</b> - one layout applies to all windows on your desktop\n"
|
|
|
|
"<ul><li><b>All windows</b> - one layout applies to all windows on your desktop\n"
|
|
|
|
"<li><b>Windows of one application</b> - layout applies to one application; each "
|
|
|
|
"<li><b>Windows of one application</b> - layout applies to one application; each "
|
|
|
@ -196,30 +196,30 @@ void KBConfigDlg::setupGeneralPage()
|
|
|
|
"<li><b>One window</b> - layout applies to one window only; each window can have its own layout. "
|
|
|
|
"<li><b>One window</b> - layout applies to one window only; each window can have its own layout. "
|
|
|
|
"When you switch between windows, layout follows the active window.</ul></p>"));
|
|
|
|
"When you switch between windows, layout follows the active window.</ul></p>"));
|
|
|
|
|
|
|
|
|
|
|
|
chkToggleMode = new QCheckBox(i18n("Use \"&Toggle Mode\""), page);
|
|
|
|
chkToggleMode = new TQCheckBox(i18n("Use \"&Toggle Mode\""), page);
|
|
|
|
vlayout->addWidget(chkToggleMode);
|
|
|
|
vlayout->addWidget(chkToggleMode);
|
|
|
|
QWhatsThis::add(chkToggleMode, i18n("Toggle mode is useful when you have more than two keyboard "
|
|
|
|
TQWhatsThis::add(chkToggleMode, i18n("Toggle mode is useful when you have more than two keyboard "
|
|
|
|
"layouts defined. When toggle mode is on your normal layout switch key toggles between two most frequently used layouts. "
|
|
|
|
"layouts defined. When toggle mode is on your normal layout switch key toggles between two most frequently used layouts. "
|
|
|
|
"To activate other layouts use KKBSwitch's tray popup menu"));
|
|
|
|
"To activate other layouts use KKBSwitch's tray popup menu"));
|
|
|
|
|
|
|
|
|
|
|
|
/*chkPerwindowGroup = new QCheckBox(i18n("Use &per-window layout"), page);
|
|
|
|
/*chkPerwindowGroup = new TQCheckBox(i18n("Use &per-window layout"), page);
|
|
|
|
vlayout->addWidget(chkPerwindowGroup);
|
|
|
|
vlayout->addWidget(chkPerwindowGroup);
|
|
|
|
QWhatsThis::add(chkPerwindowGroup, i18n("When this checkbox is checked, "
|
|
|
|
TQWhatsThis::add(chkPerwindowGroup, i18n("When this checkbox is checked, "
|
|
|
|
"each window has its own current keyboard layout. When it's unchecked, "
|
|
|
|
"each window has its own current keyboard layout. When it's unchecked, "
|
|
|
|
"the current layout affects all windows"));*/
|
|
|
|
"the current layout affects all windows"));*/
|
|
|
|
|
|
|
|
|
|
|
|
chkAutostart = new QCheckBox(i18n("A&utostart"), page);
|
|
|
|
chkAutostart = new TQCheckBox(i18n("A&utostart"), page);
|
|
|
|
vlayout->addWidget(chkAutostart);
|
|
|
|
vlayout->addWidget(chkAutostart);
|
|
|
|
QWhatsThis::add(chkAutostart, i18n("When this checkbox is checked, KKBSwitch "
|
|
|
|
TQWhatsThis::add(chkAutostart, i18n("When this checkbox is checked, KKBSwitch "
|
|
|
|
"will start automatically when you log in"));
|
|
|
|
"will start automatically when you log in"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KBConfigDlg::setupShortcutsPage()
|
|
|
|
void KBConfigDlg::setupShortcutsPage()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QVBox *box = addVBoxPage(i18n("Sho&rtcuts"));
|
|
|
|
TQVBox *box = addVBoxPage(i18n("Sho&rtcuts"));
|
|
|
|
chkUseShortcuts = new QCheckBox(i18n("Use shortcuts to &activate keyboard layouts"), box);
|
|
|
|
chkUseShortcuts = new TQCheckBox(i18n("Use shortcuts to &activate keyboard layouts"), box);
|
|
|
|
connect(chkUseShortcuts, SIGNAL(toggled(bool)), this, SLOT(slotUseShortcutsToggled(bool)));
|
|
|
|
connect(chkUseShortcuts, SIGNAL(toggled(bool)), this, SLOT(slotUseShortcutsToggled(bool)));
|
|
|
|
QWhatsThis::add(chkUseShortcuts, i18n("Check this checkbox to be able to quickly "
|
|
|
|
TQWhatsThis::add(chkUseShortcuts, i18n("Check this checkbox to be able to quickly "
|
|
|
|
"activate any keyboard layout with keyboard shorcuts. Once this checkbox "
|
|
|
|
"activate any keyboard layout with keyboard shorcuts. Once this checkbox "
|
|
|
|
"is checked, you can adjust the shortcuts at the key chooser pane below. "
|
|
|
|
"is checked, you can adjust the shortcuts at the key chooser pane below. "
|
|
|
|
"Especially useful if you have three or four keyboard layouts configured"));
|
|
|
|
"Especially useful if you have three or four keyboard layouts configured"));
|
|
|
@ -256,11 +256,11 @@ void KBConfigDlg::showConfig(){
|
|
|
|
/** Fire up "Pick Icon" dialog */
|
|
|
|
/** Fire up "Pick Icon" dialog */
|
|
|
|
void KBConfigDlg::slotPickIcon(){
|
|
|
|
void KBConfigDlg::slotPickIcon(){
|
|
|
|
int index = lbGroups->currentItem();
|
|
|
|
int index = lbGroups->currentItem();
|
|
|
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
|
|
|
TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor));
|
|
|
|
KBPickIconDlg dlg(m_iconpaths[index], *(lbGroups->pixmap(index)), this);
|
|
|
|
KBPickIconDlg dlg(m_iconpaths[index], *(lbGroups->pixmap(index)), this);
|
|
|
|
QApplication::restoreOverrideCursor();
|
|
|
|
TQApplication::restoreOverrideCursor();
|
|
|
|
if (dlg.exec()) {
|
|
|
|
if (dlg.exec()) {
|
|
|
|
QString path = dlg.getIconPath();
|
|
|
|
TQString path = dlg.getIconPath();
|
|
|
|
KBGroup *group = m_kbconf->getGroup(index);
|
|
|
|
KBGroup *group = m_kbconf->getGroup(index);
|
|
|
|
if (!path.isEmpty() && path != group->getIconPath()) {
|
|
|
|
if (!path.isEmpty() && path != group->getIconPath()) {
|
|
|
|
kapp->config()->writeEntry(group->getName()/*KBConfig::entryForGroup(index)*/, path);
|
|
|
|
kapp->config()->writeEntry(group->getName()/*KBConfig::entryForGroup(index)*/, path);
|
|
|
@ -277,7 +277,7 @@ void KBConfigDlg::slotSetDefaultGroup()
|
|
|
|
BoldListBoxItem *item = dynamic_cast<BoldListBoxItem*>(lbGroups->item(m_default_groupno));
|
|
|
|
BoldListBoxItem *item = dynamic_cast<BoldListBoxItem*>(lbGroups->item(m_default_groupno));
|
|
|
|
item->setBold(false);
|
|
|
|
item->setBold(false);
|
|
|
|
m_default_groupno = new_default_group;
|
|
|
|
m_default_groupno = new_default_group;
|
|
|
|
// NB: don't use selectedItem(); it's not present in Qt 3.0, and
|
|
|
|
// NB: don't use selectedItem(); it's not present in TQt 3.0, and
|
|
|
|
// we want to maintain compatibility with it
|
|
|
|
// we want to maintain compatibility with it
|
|
|
|
int curitem = lbGroups->currentItem();
|
|
|
|
int curitem = lbGroups->currentItem();
|
|
|
|
if (curitem > -1) { // should not be -1, but just in case
|
|
|
|
if (curitem > -1) { // should not be -1, but just in case
|
|
|
@ -298,15 +298,15 @@ void KBConfigDlg::slotLayoutSelected(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** No descriptions */
|
|
|
|
/** No descriptions */
|
|
|
|
void KBConfigDlg::slotListBoxExecuted(QListBoxItem *){
|
|
|
|
void KBConfigDlg::slotListBoxExecuted(TQListBoxItem *){
|
|
|
|
if (iconTypeShowsFlag(KBConfig::IconStyle(cbxIconType->currentItem())))
|
|
|
|
if (iconTypeShowsFlag(KBConfig::IconStyle(cbxIconType->currentItem())))
|
|
|
|
slotPickIcon();
|
|
|
|
slotPickIcon();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** No descriptions */
|
|
|
|
/** No descriptions */
|
|
|
|
void KBConfigDlg::saveConfig(){
|
|
|
|
void KBConfigDlg::saveConfig(){
|
|
|
|
QString path;
|
|
|
|
TQString path;
|
|
|
|
const QPixmap *pix;
|
|
|
|
const TQPixmap *pix;
|
|
|
|
KConfig *conf = kapp->config();
|
|
|
|
KConfig *conf = kapp->config();
|
|
|
|
conf->setGroup(ICONS_SECTION);
|
|
|
|
conf->setGroup(ICONS_SECTION);
|
|
|
|
for (int i = 0; i < m_kbconf->groupCount(); i++) {
|
|
|
|
for (int i = 0; i < m_kbconf->groupCount(); i++) {
|
|
|
@ -353,10 +353,10 @@ void KBConfigDlg::slotIconTypeSelected(int index)
|
|
|
|
|
|
|
|
|
|
|
|
void KBConfigDlg::redrawIcons(KBConfig::IconStyle icon_style)
|
|
|
|
void KBConfigDlg::redrawIcons(KBConfig::IconStyle icon_style)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QValueVector<QPixmap> pixlist;
|
|
|
|
TQValueVector<TQPixmap> pixlist;
|
|
|
|
m_kbconf->drawIcons(icon_style, &pixlist, &m_iconpaths);
|
|
|
|
m_kbconf->drawIcons(icon_style, &pixlist, &m_iconpaths);
|
|
|
|
int curIndex = lbGroups->currentItem();
|
|
|
|
int curIndex = lbGroups->currentItem();
|
|
|
|
// NB: don't use count(), use size(); count() is not present in Qt 3.0, and
|
|
|
|
// NB: don't use count(), use size(); count() is not present in TQt 3.0, and
|
|
|
|
// we want to maintain compatibility with it
|
|
|
|
// we want to maintain compatibility with it
|
|
|
|
for (unsigned int i = 0; i < pixlist.size(); i++) {
|
|
|
|
for (unsigned int i = 0; i < pixlist.size(); i++) {
|
|
|
|
BoldListBoxItem *curItem = dynamic_cast<BoldListBoxItem*>(lbGroups->item(i));
|
|
|
|
BoldListBoxItem *curItem = dynamic_cast<BoldListBoxItem*>(lbGroups->item(i));
|
|
|
|