[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenonbeta/kopete/libkopete/ui
From: Daniel Molkentin <molkentin () kde ! org>
Date: 2002-12-08 21:52:28
[Download RAW message or body]
CVS commit by danimo:
In-place renaming for groups, too. Can't really test since my icq plugin
crashes on exit (seems unrelated to my changes)
M +22 -0 kopetegroupviewitem.cpp 1.5
M +10 -0 kopetegroupviewitem.h 1.3
--- kdenonbeta/kopete/libkopete/ui/kopetegroupviewitem.cpp #1.4:1.5
@@ -67,4 +67,5 @@ void KopeteGroupViewItem::refreshDisplay
}
+ m_renameText = text;
// text= QStyleSheet::escape(text)+ " <font color='gray' \
size='-1'><i>("+QString::number(onl)+"/"+QString::number(tot)+")</i></font>";
text= text +" ("+QString::number(onl)+"/"+QString::number(tot)+")";
@@ -79,4 +80,25 @@ QString KopeteGroupViewItem::key( int, b
return "M"+text(0);
}
+
+void KopeteGroupViewItem::startRename( int col )
+{
+ setText(0, group()->displayName());
+ QListViewItem::startRename(col);
+}
+
+void KopeteGroupViewItem::okRename( int col )
+{
+ QListViewItem::okRename(col);
+ if ( col == 0 )
+ group()->setDisplayName(text(0));
+ refreshDisplayName();
+}
+
+void KopeteGroupViewItem::cancelRename( int col )
+{
+ QListViewItem::cancelRename(col);
+ refreshDisplayName();
+}
+
--- kdenonbeta/kopete/libkopete/ui/kopetegroupviewitem.h #1.2:1.3
@@ -39,4 +39,10 @@ public:
{return m_group;};
+ virtual void startRename(int col);
+
+protected:
+ virtual void okRename(int col);
+ virtual void cancelRename(int col);
+
private:
@@ -42,5 +48,9 @@ private:
KopeteGroup *m_group;
+
QString key( int column, bool ascending ) const;
+
+ QString m_renameText;
+
public slots:
void refreshDisplayName();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic