Commit 0518355b authored by Robert Knight's avatar Robert Knight
Browse files

Translate color names in color scheme editor and make them more presentable. ...

Translate color names in color scheme editor and make them more presentable.  Shorten menu bar option text in profile editor.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=680720
parent d62867d0
......@@ -84,6 +84,29 @@ const char* ColorScheme::colorNames[TABLE_COLORS] =
"Color6Intense",
"Color7Intense"
};
const QString ColorScheme::translatedColorNames[TABLE_COLORS] =
{
i18n("Foreground"),
i18n("Background"),
i18n("Color 1"),
i18n("Color 2"),
i18n("Color 3"),
i18n("Color 4"),
i18n("Color 5"),
i18n("Color 6"),
i18n("Color 7"),
i18n("Color 8"),
i18n("Foreground (Intense)"),
i18n("Background (Intense)"),
i18n("Color 1 (Intense)"),
i18n("Color 2 (Intense)"),
i18n("Color 3 (Intense)"),
i18n("Color 4 (Intense)"),
i18n("Color 5 (Intense)"),
i18n("Color 6 (Intense)"),
i18n("Color 7 (Intense)"),
i18n("Color 8 (Intense)")
};
ColorSchemeManager* ColorSchemeManager::_instance = 0;
......@@ -174,7 +197,12 @@ QString ColorScheme::colorNameForIndex(int index)
return QString(colorNames[index]);
}
QString ColorScheme::translatedColorNameForIndex(int index)
{
Q_ASSERT( index >= 0 && index < TABLE_COLORS );
return QString(translatedColorNames[index]);
}
ColorEntry ColorScheme::readColorEntry(KConfig& config , const QString& colorName)
{
KConfigGroup configGroup(&config,colorName);
......
......@@ -118,6 +118,8 @@ public:
//int cursorShape() const;
static QString colorNameForIndex(int index);
static QString translatedColorNameForIndex(int index);
private:
// reads a single colour entry from a KConfig source
ColorEntry readColorEntry(KConfig& config , const QString& colorName);
......@@ -131,6 +133,8 @@ private:
// color scheme is being used
static const char* colorNames[TABLE_COLORS];
static const QString translatedColorNames[TABLE_COLORS];
static const ColorEntry defaultTable[]; // table of default color entries
};
......
......@@ -181,7 +181,7 @@ void ColorSchemeEditor::setupColorTable(const ColorScheme* colors)
for ( int row = 0 ; row < TABLE_COLORS ; row++ )
{
QTableWidgetItem* nameItem = new QTableWidgetItem( colors->colorNameForIndex(row) );
QTableWidgetItem* nameItem = new QTableWidgetItem( ColorScheme::translatedColorNameForIndex(row) );
QTableWidgetItem* colorItem = new QTableWidgetItem();
colorItem->setBackground( table[row].color );
colorItem->setFlags( colorItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable );
......
......@@ -180,6 +180,9 @@
</item>
<item row="4" column="1" >
<widget class="QPushButton" name="environmentEditButton" >
<property name="toolTip" >
<string>Edit the list of environment variables and associated values</string>
</property>
<property name="text" >
<string>Edit...</string>
</property>
......@@ -206,10 +209,10 @@
</sizepolicy>
</property>
<property name="toolTip" >
<string>Show or hide the menu bar in terminal windows using this profile</string>
<string>Show or hide the menu bar in terminal windows</string>
</property>
<property name="text" >
<string>Show menu bar in new windows created from this profile</string>
<string>Show menu bar in new windows</string>
</property>
</widget>
</item>
......@@ -326,6 +329,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string/>
</property>
</widget>
</item>
<item row="2" column="0" >
......
......@@ -266,13 +266,13 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position , QObject*
SLOT(showContextMenu(QWidget*,const QPoint&)));
}
void TabbedViewContainer::currentTabChanged(int tab)
{
if ( tab >= 0 )
{
emit activeViewChanged( _tabWidget->widget(tab) );
}
}
......@@ -427,6 +427,7 @@ TabbedViewContainerV2::TabbedViewContainerV2(NavigationPosition position , QObje
_tabBar->setDrawBase(true);
connect( _tabBar , SIGNAL(currentChanged(int)) , this , SLOT(currentTabChanged(int)) );
connect( _tabBar , SIGNAL(mouseDoubleClick(int)) , this , SLOT(tabDoubleClicked(int)) );
_layout = new TabbedViewContainerV2Layout;
_layout->setSpacing(0);
......@@ -525,6 +526,15 @@ TabbedViewContainerV2::~TabbedViewContainerV2()
{
_containerWidget->deleteLater();
}
void TabbedViewContainerV2::tabDoubleClicked(int tab)
{
qDebug() << __FUNCTION__ << ", tab index =" << tab;
if ( tab < 0 )
{
//emit duplicateRequest();
}
}
void TabbedViewContainerV2::currentTabChanged(int index)
{
_stackWidget->setCurrentIndex(index);
......
......@@ -211,7 +211,10 @@ signals:
/** Emitted when the container has no more children */
void empty(ViewContainer* container);
/** Emitted when the user requests to close the a view */
/** Emitted when the user requests to duplicate a view */
void duplicateRequest( ViewProperties* properties );
/** Emitted when the user requests to close a view */
void closeRequest(QWidget* activeView);
/** Emitted when the active view changes */
......@@ -369,7 +372,9 @@ private slots:
void updateIcon(ViewProperties* item);
void updateActivity(ViewProperties* item);
void currentTabChanged(int index);
void tabDoubleClicked(int index);
private:
void dynamicTabBarVisibility();
void setTabBarVisible(bool visible);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment