summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kicker/applets/minipager/pagerapplet.cpp3
-rw-r--r--kicker/applets/minipager/pagerbutton.cpp36
2 files changed, 25 insertions, 14 deletions
diff --git a/kicker/applets/minipager/pagerapplet.cpp b/kicker/applets/minipager/pagerapplet.cpp
index eadb23b91..a4aa1bde1 100644
--- a/kicker/applets/minipager/pagerapplet.cpp
+++ b/kicker/applets/minipager/pagerapplet.cpp
@@ -770,9 +770,6 @@ void KMiniPager::aboutToShowContextMenu()
m_contextMenu->setItemChecked(Cycle, m_settings->cycle());
m_contextMenu->setItemChecked(Border3D, m_settings->border3D());
m_contextMenu->setItemEnabled(WindowIcons, m_settings->preview());
- m_contextMenu->setItemEnabled(RenameDesktop,
- m_settings->labelType() ==
- PagerSettings::EnumLabelType::LabelName);
}
void KMiniPager::slotShowMenu(const TQPoint& pos, int desktop)
diff --git a/kicker/applets/minipager/pagerbutton.cpp b/kicker/applets/minipager/pagerbutton.cpp
index 5c4bf71e8..32eeae31b 100644
--- a/kicker/applets/minipager/pagerbutton.cpp
+++ b/kicker/applets/minipager/pagerbutton.cpp
@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqstylesheet.h>
+#include <tqinputdialog.h>
#include <netwm.h>
#include <dcopclient.h>
@@ -703,17 +704,30 @@ void KMiniPagerButton::slotClicked()
void KMiniPagerButton::rename()
{
- if ( !m_lineEdit ) {
- m_lineEdit = new TQLineEdit( this );
- connect( m_lineEdit, TQ_SIGNAL( returnPressed() ), m_lineEdit, TQ_SLOT( hide() ) );
- m_lineEdit->installEventFilter( this );
- }
- m_lineEdit->setGeometry( rect() );
- m_lineEdit->setText(m_desktopName);
- m_lineEdit->show();
- m_lineEdit->setFocus();
- m_lineEdit->selectAll();
- m_pager->emitRequestFocus();
+ if (m_pager->labelType() == PagerSettings::EnumLabelType::LabelName)
+ {
+ if ( !m_lineEdit ) {
+ m_lineEdit = new TQLineEdit(this);
+ connect(m_lineEdit, TQ_SIGNAL(returnPressed()), m_lineEdit, TQ_SLOT(hide()));
+ m_lineEdit->installEventFilter(this);
+ }
+ m_lineEdit->setGeometry(rect());
+ m_lineEdit->setText(m_desktopName);
+ m_lineEdit->show();
+ m_lineEdit->setFocus();
+ m_lineEdit->selectAll();
+ m_pager->emitRequestFocus();
+ }
+ else
+ {
+ m_pager->twin()->setDesktopName(
+ m_desktop,
+ TQInputDialog::getText(
+ i18n("Renaming desktop %1").arg(m_desktopName),
+ i18n("Enter a new name for desktop %1 (%2):").arg(m_desktop).arg(m_desktopName)
+ )
+ );
+ }
}
void KMiniPagerButton::slotToggled( bool b )