|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
KDE/kdenetwork/kopeteSVN commit 830078 by rjarosz:
Allow Kopete to show accounts in status bar of contact list as it was in KDE 3.5. Remember last opened identity status widget and show it on startup. We need new animated icons for all protocols. BUG: 164569 GUI: M +6 -5 kopete/CMakeLists.txt M +95 -70 kopete/config/appearance/appearanceconfig_contactlist.ui A kopete/kopeteaccountstatusbaricon.cpp [License: GPL (v2+)] A kopete/kopeteaccountstatusbaricon.h [License: GPL (v2+)] M +4 -3 kopete/kopeteapplication.cpp M +104 -13 kopete/kopetewindow.cpp M +5 -0 libkopete/kopeteappearancesettings.kcfg --- trunk/KDE/kdenetwork/kopete/kopete/CMakeLists.txt #830077:830078 @@ -51,12 +51,13 @@ set(kopete_SRCS ${kopetecontactlist_SRCS} - main.cpp - kopeteapplication.cpp + main.cpp + kopeteapplication.cpp kanimatedsystemtrayicon.cpp - systemtray.cpp - kopetewindow.cpp - kopeteidentitystatusbaricon.cpp + systemtray.cpp + kopetewindow.cpp + kopeteidentitystatusbaricon.cpp + kopeteaccountstatusbaricon.cpp kopetedbusinterface.cpp infoeventwidget.cpp ) --- trunk/KDE/kdenetwork/kopete/kopete/config/appearance/appearanceconfig_contactlist.ui #830077:830078 @@ -5,15 +5,15 @@ <rect> <x>0</x> <y>0</y> - <width>577</width> - <height>268</height> + <width>387</width> + <height>244</height> </rect> </property> <property name="windowTitle" > <string>Contact List Appearance</string> </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" colspan="3" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> <layout class="QHBoxLayout" name="horizontalLayout" > <item> <widget class="QLabel" name="label" > @@ -49,7 +49,7 @@ </item> </layout> </item> - <item row="1" column="0" colspan="3" > + <item> <widget class="QCheckBox" name="kcfg_contactListIconMode" > <property name="sizePolicy" > <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > @@ -62,7 +62,7 @@ </property> </widget> </item> - <item row="2" column="0" colspan="3" > + <item> <widget class="QCheckBox" name="kcfg_groupContactByGroup" > <property name="sizePolicy" > <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > @@ -75,7 +75,7 @@ </property> </widget> </item> - <item row="3" column="0" colspan="3" > + <item> <widget class="QCheckBox" name="kcfg_contactListTreeView" > <property name="sizePolicy" > <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > @@ -88,39 +88,43 @@ </property> </widget> </item> - <item row="4" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0" > - <size> - <width>16</width> - <height>16</height> - </size> - </property> - </spacer> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>16</width> + <height>16</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QCheckBox" name="kcfg_contactListIndentContact" > + <property name="enabled" > + <bool>true</bool> + </property> + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>In&dent contacts</string> + </property> + </widget> + </item> + </layout> </item> - <item row="4" column="1" colspan="2" > - <widget class="QCheckBox" name="kcfg_contactListIndentContact" > - <property name="enabled" > - <bool>true</bool> - </property> - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>In&dent contacts</string> - </property> - </widget> - </item> - <item row="5" column="0" colspan="2" > + <item> <widget class="QCheckBox" name="kcfg_contactListHideVerticalScrollBar" > <property name="sizePolicy" > <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > @@ -136,36 +140,47 @@ </property> </widget> </item> - <item row="6" column="0" colspan="2" > - <widget class="QPushButton" name="mEditTooltips" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <item> + <widget class="QCheckBox" name="kcfg_showIdentityIcons" > <property name="text" > - <string>Change &Tooltip Contents...</string> + <string>Show identities in status bar instead of accounts</string> </property> </widget> </item> - <item row="6" column="2" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Preferred</enum> - </property> - <property name="sizeHint" stdset="0" > - <size> - <width>16</width> - <height>16</height> - </size> - </property> - </spacer> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3" > + <item> + <widget class="QPushButton" name="mEditTooltips" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Change &Tooltip Contents...</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>16</width> + <height>16</height> + </size> + </property> + </spacer> + </item> + </layout> </item> - <item row="7" column="2" > + <item> <spacer> <property name="orientation" > <enum>Qt::Vertical</enum> @@ -175,14 +190,24 @@ </property> <property name="sizeHint" stdset="0" > <size> - <width>381</width> - <height>41</height> + <width>20</width> + <height>0</height> </size> </property> </spacer> </item> </layout> </widget> + <tabstops> + <tabstop>kcfg_contactListDisplayMode</tabstop> + <tabstop>kcfg_contactListIconMode</tabstop> + <tabstop>kcfg_groupContactByGroup</tabstop> + <tabstop>kcfg_contactListTreeView</tabstop> + <tabstop>kcfg_contactListIndentContact</tabstop> + <tabstop>kcfg_contactListHideVerticalScrollBar</tabstop> + <tabstop>kcfg_showIdentityIcons</tabstop> + <tabstop>mEditTooltips</tabstop> + </tabstops> <resources/> <connections> <connection> @@ -192,12 +217,12 @@ <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>65</y> + <x>114</x> + <y>116</y> </hint> <hint type="destinationlabel" > - <x>112</x> - <y>89</y> + <x>137</x> + <y>144</y> </hint> </hints> </connection> --- trunk/KDE/kdenetwork/kopete/kopete/kopeteapplication.cpp #830077:830078 @@ -55,15 +55,16 @@ { setQuitOnLastWindowClosed( false ); m_isShuttingDown = false; + + //Create the identity manager + Kopete::IdentityManager::self()->load(); + m_mainWindow = new KopeteWindow( 0 ); Kopete::PluginManager::self(); Kopete::UI::Global::setMainWidget( m_mainWindow ); - //Create the identity manager - Kopete::IdentityManager::self()->load(); - /* * FIXME: This is a workaround for a quite odd problem: * When starting up kopete and the msn plugin gets loaded it can bring up --- trunk/KDE/kdenetwork/kopete/kopete/kopetewindow.cpp #830077:830078 @@ -77,6 +77,7 @@ #include "kopeteapplication.h" #include "kopeteaccount.h" #include "kopeteaccountmanager.h" +#include "kopeteaccountstatusbaricon.h" #include "kopeteidentitystatusbaricon.h" #include "kopetebehaviorsettings.h" #include "kopetecontact.h" @@ -159,6 +160,7 @@ actionShowOfflineUsers ( 0 ), actionShowEmptyGroups ( 0 ), docked ( 0 ), deskRight ( 0 ), statusBarWidget ( 0 ), tray ( 0 ), hidden ( false ), autoHide ( false ), autoHideTimeout ( 0 ), autoHideTimer ( 0 ), addContactMapper ( 0 ), + showIdentityIcons( Kopete::AppearanceSettings::self()->showIdentityIcons() ), globalStatusMessage ( 0 ) {} @@ -205,7 +207,9 @@ QTimer *autoResizeTimer; QSignalMapper *addContactMapper; + bool showIdentityIcons; QHash<const Kopete::Identity*, KopeteIdentityStatusBarIcon*> identityStatusBarIcons; + QHash<const Kopete::Account*, KopeteAccountStatusBarIcon*> accountStatusBarIcons; KSqueezedTextLabel *globalStatusMessage; }; @@ -614,6 +618,12 @@ cg.writeEntry ( "State", "Shown" ); } + Kopete::Identity *identity = d->identitywidget->identity(); + if ( identity ) + cg.writeEntry ( "ShownIdentityId", identity->id() ); + else + cg.deleteEntry( "ShownIdentityId" ); + cg.sync(); } @@ -646,6 +656,53 @@ d->actionShowAllOfflineEmpty->setChecked ( Kopete::AppearanceSettings::self()->showOfflineUsers() && Kopete::AppearanceSettings::self()->showEmptyGroups() ); d->actionShowOfflineUsers->setChecked ( Kopete::AppearanceSettings::self()->showOfflineUsers() ); d->actionShowEmptyGroups->setChecked ( Kopete::AppearanceSettings::self()->showEmptyGroups() ); + + if ( d->showIdentityIcons != Kopete::AppearanceSettings::self()->showIdentityIcons() ) + { + // Delete status bar icons + if ( d->showIdentityIcons ) + { + if ( d->identitywidget->isVisible() ) + { + d->identitywidget->setIdentity( 0 ); + d->identitywidget->setVisible( false ); + } + + qDeleteAll( d->identityStatusBarIcons ); + d->identityStatusBarIcons.clear(); + } + else + { + qDeleteAll( d->accountStatusBarIcons ); + d->accountStatusBarIcons.clear(); + } + + // Add new status bar icons + d->showIdentityIcons = Kopete::AppearanceSettings::self()->showIdentityIcons(); + if ( d->showIdentityIcons ) + { + Kopete::Identity::List identityList = Kopete::IdentityManager::self()->identities(); + foreach ( Kopete::Identity *identity, identityList ) + { + KopeteIdentityStatusBarIcon *sbIcon = new KopeteIdentityStatusBarIcon ( identity, d->statusBarWidget ); + connect ( sbIcon, SIGNAL(leftClicked(Kopete::Identity*, const QPoint&)), this, + SLOT(slotIdentityStatusIconLeftClicked(Kopete::Identity*, const QPoint&)) ); + + d->identityStatusBarIcons.insert ( identity, sbIcon ); + slotIdentityStatusIconChanged ( identity ); + slotIdentityToolTipChanged ( identity ); + } + } + else + { + QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts(); + foreach ( Kopete::Account *account, accountList ) + { + KopeteAccountStatusBarIcon *sbIcon = new KopeteAccountStatusBarIcon ( account, d->statusBarWidget ); + d->accountStatusBarIcons.insert ( account, sbIcon ); + } + } + } } void KopeteWindow::slotContactListAppearanceChanged() @@ -792,6 +849,19 @@ { // actionConnect->setEnabled(true); d->actionDisconnect->setEnabled ( true ); + + KConfigGroup cg( KGlobal::config(), "General Options" ); + + if ( d->showIdentityIcons ) + { + QString identityId = cg.readEntry( "ShownIdentityId" ); + if ( !identityId.isEmpty() ) + { + Kopete::Identity* identity = Kopete::IdentityManager::self()->findIdentity( identityId ); + if ( identity ) + slotIdentityStatusIconLeftClicked( identity, QPoint() ); + } + } } void KopeteWindow::slotIdentityRegistered ( Kopete::Identity *identity ) @@ -806,11 +876,15 @@ connect ( identity, SIGNAL(toolTipChanged(Kopete::Identity*)), this, SLOT(slotIdentityToolTipChanged(Kopete::Identity*)) ); - KopeteIdentityStatusBarIcon *sbIcon = new KopeteIdentityStatusBarIcon ( identity, d->statusBarWidget ); - connect ( sbIcon, SIGNAL ( leftClicked ( Kopete::Identity *, const QPoint & ) ), - SLOT ( slotIdentityStatusIconLeftClicked ( Kopete::Identity *, const QPoint & ) ) ); + if ( d->showIdentityIcons ) + { + KopeteIdentityStatusBarIcon *sbIcon = new KopeteIdentityStatusBarIcon ( identity, d->statusBarWidget ); + connect ( sbIcon, SIGNAL ( leftClicked ( Kopete::Identity *, const QPoint & ) ), + SLOT ( slotIdentityStatusIconLeftClicked ( Kopete::Identity *, const QPoint & ) ) ); - d->identityStatusBarIcons.insert ( identity, sbIcon ); + d->identityStatusBarIcons.insert ( identity, sbIcon ); + } + slotIdentityStatusIconChanged ( identity ); slotIdentityToolTipChanged( identity ); } @@ -819,14 +893,16 @@ { kDebug ( 14000 ) ; - KopeteIdentityStatusBarIcon *sbIcon = d->identityStatusBarIcons[identity]; + if ( d->showIdentityIcons ) + { + KopeteIdentityStatusBarIcon *sbIcon = d->identityStatusBarIcons.value ( identity, 0 ); + if ( sbIcon ) + { + d->identityStatusBarIcons.remove ( identity ); + delete sbIcon; + } + } - if ( !sbIcon ) - return; - - d->identityStatusBarIcons.remove ( identity ); - delete sbIcon; - makeTrayToolTip(); } @@ -835,7 +911,7 @@ { // Adds tooltip for each status icon, useful in case you have many accounts // over one protocol - KopeteIdentityStatusBarIcon *i = d->identityStatusBarIcons[ identity ]; + KopeteIdentityStatusBarIcon *i = d->identityStatusBarIcons.value ( identity, 0 ); if ( i ) i->setToolTip ( identity->toolTip() ); @@ -862,7 +938,7 @@ //Kopete::StatusManager::self()->setGlobalStatusMessage( identity->property( Kopete::Global::Properties::self()->statusMessage() ).value().toString() ); } - KopeteIdentityStatusBarIcon *i = d->identityStatusBarIcons[ identity ]; + KopeteIdentityStatusBarIcon *i = d->identityStatusBarIcons.value ( identity, 0 ); if ( !i ) return; @@ -983,6 +1059,11 @@ d->addContactMapper->setMapping ( action, account->protocol()->pluginId() + QChar ( 0xE000 ) + account->accountId() ); d->actionAddContact->addAction ( action ); + if ( !d->showIdentityIcons ) + { + KopeteAccountStatusBarIcon *sbIcon = new KopeteAccountStatusBarIcon ( account, d->statusBarWidget ); + d->accountStatusBarIcons.insert ( account, sbIcon ); + } } void KopeteWindow::slotAccountUnregistered ( const Kopete::Account *account ) @@ -1003,6 +1084,16 @@ d->addContactMapper->removeMappings ( action ); d->actionAddContact->removeAction ( action ); } + + if ( !d->showIdentityIcons ) + { + KopeteAccountStatusBarIcon *sbIcon = d->accountStatusBarIcons.value ( account, 0 ); + if ( sbIcon ) + { + d->accountStatusBarIcons.remove ( account ); + delete sbIcon; + } + } } void KopeteWindow::slotTrayAboutToShowMenu ( KMenu * popup ) --- trunk/KDE/kdenetwork/kopete/libkopete/kopeteappearancesettings.kcfg #830077:830078 @@ -225,5 +225,10 @@ <default>false</default> <emit signal="contactListAppearanceChanged" /> </entry> + + <entry key="showIdentityIcons" type="Bool"> + <label>Show identities in status bar instead of accounts.</label> + <default>true</default> + </entry> </group> </kcfg> _______________________________________________ kde-docbook mailing list kde-docbook@... https://mail.kde.org/mailman/listinfo/kde-docbook |
| Free embeddable forum powered by Nabble | Forum Help |