summaryrefslogtreecommitdiffstats
path: root/kxkb/kxkbtraywindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kxkb/kxkbtraywindow.cpp')
-rw-r--r--kxkb/kxkbtraywindow.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/kxkb/kxkbtraywindow.cpp b/kxkb/kxkbtraywindow.cpp
index ec91df670..573b0b4ef 100644
--- a/kxkb/kxkbtraywindow.cpp
+++ b/kxkb/kxkbtraywindow.cpp
@@ -1,7 +1,7 @@
//
// C++ Implementation: kxkbtraywindow
//
-// Description:
+// Description:
//
//
// Author: Andriy Rysin <rysin@kde.org>, (C) 2006
@@ -25,7 +25,7 @@
#include "kxkbconfig.h"
-KxkbLabelController::KxkbLabelController(TQLabel* label_, TQPopupMenu* contextMenu_) :
+KxkbLabelController::KxkbLabelController(TQLabel* label_, TDEPopupMenu* contextMenu_) :
label(label_),
contextMenu(contextMenu_),
m_menuStartIndex(contextMenu_->count()),
@@ -51,7 +51,7 @@ void KxkbLabelController::setPixmap(const TQPixmap& pixmap)
void KxkbLabelController::setCurrentLayout(const LayoutUnit& layoutUnit)
{
setToolTip(m_descriptionMap[layoutUnit.toPair()]);
- setPixmap( LayoutIcon::getInstance().findPixmap(layoutUnit.layout, m_showFlag, layoutUnit.displayName) );
+ setPixmap( LayoutIcon::getInstance().findPixmap(layoutUnit.layout, PIXMAP_STYLE_INDICATOR, layoutUnit.displayName) );
}
@@ -60,14 +60,14 @@ void KxkbLabelController::setError(const TQString& layoutInfo)
TQString msg = i18n("Error changing keyboard layout to '%1'").arg(layoutInfo);
setToolTip(msg);
- label->setPixmap(LayoutIcon::getInstance().findPixmap("error", m_showFlag));
+ label->setPixmap(LayoutIcon::getInstance().findPixmap("error", PIXMAP_STYLE_NORMAL));
}
void KxkbLabelController::initLayoutList(const TQValueList<LayoutUnit>& layouts, const XkbRules& rules)
{
-// TDEPopupMenu* menu = contextMenu();
- TQPopupMenu* menu = contextMenu;
+ TDEPopupMenu* menu = contextMenu;
+// TQPopupMenu* menu = contextMenu;
// int index = menu->indexOf(0);
m_descriptionMap.clear();
@@ -80,30 +80,32 @@ void KxkbLabelController::initLayoutList(const TQValueList<LayoutUnit>& layouts,
}
/* menu->removeItem(CONFIG_MENU_ID);
menu->removeItem(HELP_MENU_ID);*/
-
+
TDEIconEffect iconeffect;
-
+
int cnt = 0;
TQValueList<LayoutUnit>::ConstIterator it;
for (it=layouts.begin(); it != layouts.end(); ++it)
{
const TQString layoutName = (*it).layout;
const TQString variantName = (*it).variant;
-
- const TQPixmap& layoutPixmap = LayoutIcon::getInstance().findPixmap(layoutName, m_showFlag, (*it).displayName);
- const TQPixmap pix = iconeffect.apply(layoutPixmap, TDEIcon::Small, TDEIcon::DefaultState);
-
- TQString fullName = i18n((rules.layouts()[layoutName]));
- if( variantName.isEmpty() == false )
- fullName += " (" + variantName + ")";
- contextMenu->insertItem(pix, fullName, START_MENU_ID + cnt, m_menuStartIndex + cnt);
+
+ const TQPixmap& layoutPixmap = LayoutIcon::getInstance().findPixmap(
+ (*it).layout, PIXMAP_STYLE_CONTEXTMENU, (*it).displayName);
+ const TQPixmap pix = iconeffect.apply(layoutPixmap, TDEIcon::Small,
+ TDEIcon::DefaultState);
+
+ TQString fullName = rules.getLayoutName((*it));
+ contextMenu->insertItem(pix, fullName, START_MENU_ID + cnt,
+ m_menuStartIndex + cnt);
+
m_descriptionMap.insert((*it).toPair(), fullName);
-
+
cnt++;
}
m_prevLayoutCount = cnt;
-
+
// if show config, if show help
if( menu->indexOf(CONFIG_MENU_ID) == -1 ) {
contextMenu->insertSeparator();
@@ -114,7 +116,7 @@ void KxkbLabelController::initLayoutList(const TQValueList<LayoutUnit>& layouts,
/* if( index != -1 ) { //not first start
menu->insertSeparator();
- TDEAction* quitAction = KStdAction::quit(this, TQT_SIGNAL(quitSelected()), actionCollection());
+ TDEAction* quitAction = KStdAction::quit(this, TQ_SIGNAL(quitSelected()), actionCollection());
if (quitAction)
quitAction->plug(menu);
}*/