FriendList:
- Removed avatar column - Removed state column - Added combined avatar and status icon - Added status icons in 64px - Renamed "Hide state" to "Show state" - Added sort by name and state RSTreeWidget: - Added version for load/save state - Added method setColumnCustomizable
|
@ -142,9 +142,7 @@ QList<int> sizes;
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
RsAutoUpdatePage::lockAllEvents();
|
RsAutoUpdatePage::lockAllEvents();
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_STATE, false);
|
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_LAST_CONTACT, false);
|
ui.friendList->setColumnVisible(FriendList::COLUMN_LAST_CONTACT, false);
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_AVATAR, true);
|
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_IP, false);
|
ui.friendList->setColumnVisible(FriendList::COLUMN_IP, false);
|
||||||
ui.friendList->setShowGroups(true);
|
ui.friendList->setShowGroups(true);
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
|
|
@ -142,13 +142,10 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
RsAutoUpdatePage::lockAllEvents();
|
RsAutoUpdatePage::lockAllEvents();
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_STATE, false);
|
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_LAST_CONTACT, false);
|
ui.friendList->setColumnVisible(FriendList::COLUMN_LAST_CONTACT, false);
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_AVATAR, true);
|
|
||||||
ui.friendList->setColumnVisible(FriendList::COLUMN_IP, false);
|
ui.friendList->setColumnVisible(FriendList::COLUMN_IP, false);
|
||||||
ui.friendList->setShowGroups(false);
|
ui.friendList->setShowGroups(false);
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
ui.friendList->setBigName(true);
|
|
||||||
RsAutoUpdatePage::unlockAllEvents();
|
RsAutoUpdatePage::unlockAllEvents();
|
||||||
|
|
||||||
// add self nick
|
// add self nick
|
||||||
|
|
|
@ -52,10 +52,14 @@ public:
|
||||||
enum Column
|
enum Column
|
||||||
{
|
{
|
||||||
COLUMN_NAME = 0,
|
COLUMN_NAME = 0,
|
||||||
COLUMN_AVATAR = 1,
|
COLUMN_LAST_CONTACT = 1,
|
||||||
COLUMN_STATE = 2,
|
COLUMN_IP = 2
|
||||||
COLUMN_LAST_CONTACT = 3,
|
};
|
||||||
COLUMN_IP = 4
|
|
||||||
|
enum SortMode
|
||||||
|
{
|
||||||
|
SORT_MODE_NAME = 1,
|
||||||
|
SORT_MODE_STATE = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -74,7 +78,9 @@ public:
|
||||||
|
|
||||||
virtual void updateDisplay();
|
virtual void updateDisplay();
|
||||||
void setColumnVisible(Column column, bool visible);
|
void setColumnVisible(Column column, bool visible);
|
||||||
void sortByColumn(Column column, Qt::SortOrder sortOrder);
|
|
||||||
|
void setSortMode(SortMode sortMode);
|
||||||
|
SortMode sortMode();
|
||||||
|
|
||||||
QColor textColorGroup() const { return mTextColorGroup; }
|
QColor textColorGroup() const { return mTextColorGroup; }
|
||||||
QColor textColorStatusOffline() const { return mTextColorStatus[RS_STATUS_OFFLINE]; }
|
QColor textColorStatusOffline() const { return mTextColorStatus[RS_STATUS_OFFLINE]; }
|
||||||
|
@ -92,11 +98,12 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void filterItems(const QString &text);
|
void filterItems(const QString &text);
|
||||||
|
void setSortByName();
|
||||||
|
void setSortByState();
|
||||||
|
|
||||||
void setBigName(bool bigName); // show customStateString in second line of the name cell
|
|
||||||
void setShowGroups(bool show);
|
void setShowGroups(bool show);
|
||||||
void setHideUnconnected(bool hidden);
|
void setHideUnconnected(bool hidden);
|
||||||
void setHideState(bool hidden);
|
void setShowState(bool show);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void peerTreeColumnVisibleChanged(int column, bool visible);
|
void peerTreeColumnVisibleChanged(int column, bool visible);
|
||||||
|
@ -107,12 +114,11 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FriendList *ui;
|
Ui::FriendList *ui;
|
||||||
RSTreeWidgetItemCompareRole *m_compareRole;
|
RSTreeWidgetItemCompareRole *mCompareRole;
|
||||||
|
|
||||||
// Settings for peer list display
|
// Settings for peer list display
|
||||||
bool mBigName;
|
|
||||||
bool mShowGroups;
|
bool mShowGroups;
|
||||||
bool mHideState;
|
bool mShowState;
|
||||||
bool mHideUnconnected;
|
bool mHideUnconnected;
|
||||||
|
|
||||||
QString mFilterText;
|
QString mFilterText;
|
||||||
|
@ -126,14 +132,12 @@ private:
|
||||||
QColor mTextColorStatus[RS_STATUS_COUNT];
|
QColor mTextColorStatus[RS_STATUS_COUNT];
|
||||||
|
|
||||||
QTreeWidgetItem *getCurrentPeer() const;
|
QTreeWidgetItem *getCurrentPeer() const;
|
||||||
void initializeHeader(bool afterLoadSettings);
|
|
||||||
void getSslIdsFromItem(QTreeWidgetItem *item, std::list<RsPeerId> &sslIds);
|
void getSslIdsFromItem(QTreeWidgetItem *item, std::list<RsPeerId> &sslIds);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void groupsChanged();
|
void groupsChanged();
|
||||||
void insertPeers();
|
void insertPeers();
|
||||||
void peerTreeWidgetCustomPopupMenu();
|
void peerTreeWidgetCustomPopupMenu();
|
||||||
void updateAvatar(const QString &);
|
|
||||||
void updateMenu();
|
void updateMenu();
|
||||||
|
|
||||||
void pastePerson();
|
void pastePerson();
|
||||||
|
|
|
@ -81,15 +81,6 @@
|
||||||
<height>38</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoExpandDelay">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="indentation">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
<property name="sortingEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="allColumnsShowFocus">
|
<property name="allColumnsShowFocus">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
@ -97,7 +88,7 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="columnCount">
|
<property name="columnCount">
|
||||||
<number>5</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="headerStretchLastSection">
|
<attribute name="headerStretchLastSection">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
@ -106,15 +97,8 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Friend nodes</string>
|
<string>Friend nodes</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
<property name="textAlignment">
|
||||||
<column>
|
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
||||||
<property name="text">
|
|
||||||
<string>Avatar</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Status</string>
|
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
|
@ -138,15 +122,37 @@
|
||||||
<string>Hide Offline Friends</string>
|
<string>Hide Offline Friends</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionHideState">
|
<action name="actionSortByName">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="enabled">
|
<property name="text">
|
||||||
<bool>false</bool>
|
<string>Name</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Sort by Name</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSortByState">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Hide State</string>
|
<string>State</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Sort by State</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionShowState">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Stow State</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Show State</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionShowGroups">
|
<action name="actionShowGroups">
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
|
|
||||||
RSTreeWidget::RSTreeWidget(QWidget *parent) : QTreeWidget(parent)
|
RSTreeWidget::RSTreeWidget(QWidget *parent) : QTreeWidget(parent)
|
||||||
{
|
{
|
||||||
mColumnCustomizable = false;
|
mEnableColumnCustomize = false;
|
||||||
|
mSettingsVersion = 0; // disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSTreeWidget::setPlaceholderText(const QString &text)
|
void RSTreeWidget::setPlaceholderText(const QString &text)
|
||||||
|
@ -117,32 +118,45 @@ bool RSTreeWidget::filterItem(QTreeWidgetItem *item, int filterColumn, const QSt
|
||||||
return (itemVisible || visibleChildCount);
|
return (itemVisible || visibleChildCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RSTreeWidget::setSettingsVersion(qint32 version)
|
||||||
|
{
|
||||||
|
mSettingsVersion = version;
|
||||||
|
}
|
||||||
|
|
||||||
void RSTreeWidget::processSettings(bool load)
|
void RSTreeWidget::processSettings(bool load)
|
||||||
{
|
{
|
||||||
if (load) {
|
if (load) {
|
||||||
// load settings
|
// Load settings
|
||||||
|
|
||||||
// state of tree widget
|
// State of tree widget
|
||||||
header()->restoreState(Settings->value(objectName()).toByteArray());
|
if (mSettingsVersion == 0 || Settings->value(QString("%1Version").arg(objectName())) == mSettingsVersion) {
|
||||||
|
// Compare version, because Qt can crash in restoreState after column changes
|
||||||
|
header()->restoreState(Settings->value(objectName()).toByteArray());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// save settings
|
// Save settings
|
||||||
|
|
||||||
// state of tree widget
|
// state of tree widget
|
||||||
Settings->setValue(objectName(), header()->saveState());
|
Settings->setValue(objectName(), header()->saveState());
|
||||||
|
|
||||||
|
// Save version
|
||||||
|
if (mSettingsVersion) {
|
||||||
|
Settings->setValue(QString("%1Version").arg(objectName()), mSettingsVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSTreeWidget::setColumnCustomizable(bool customizable)
|
void RSTreeWidget::enableColumnCustomize(bool customizable)
|
||||||
{
|
{
|
||||||
if (customizable == mColumnCustomizable) {
|
if (customizable == mEnableColumnCustomize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mColumnCustomizable = customizable;
|
mEnableColumnCustomize = customizable;
|
||||||
|
|
||||||
QHeaderView *h = header();
|
QHeaderView *h = header();
|
||||||
|
|
||||||
if (mColumnCustomizable) {
|
if (mEnableColumnCustomize) {
|
||||||
h->setContextMenuPolicy(Qt::CustomContextMenu);
|
h->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(h, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint)));
|
connect(h, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint)));
|
||||||
} else {
|
} else {
|
||||||
|
@ -151,9 +165,14 @@ void RSTreeWidget::setColumnCustomizable(bool customizable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RSTreeWidget::setColumnCustomizable(int column, bool customizable)
|
||||||
|
{
|
||||||
|
mColumnCustomizable[column] = customizable;
|
||||||
|
}
|
||||||
|
|
||||||
void RSTreeWidget::headerContextMenuRequested(const QPoint &pos)
|
void RSTreeWidget::headerContextMenuRequested(const QPoint &pos)
|
||||||
{
|
{
|
||||||
if (!mColumnCustomizable) {
|
if (!mEnableColumnCustomize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +181,10 @@ void RSTreeWidget::headerContextMenuRequested(const QPoint &pos)
|
||||||
QTreeWidgetItem *item = headerItem();
|
QTreeWidgetItem *item = headerItem();
|
||||||
int columnCount = item->columnCount();
|
int columnCount = item->columnCount();
|
||||||
for (int column = 0; column < columnCount; ++column) {
|
for (int column = 0; column < columnCount; ++column) {
|
||||||
|
QMap<int, bool>::const_iterator it = mColumnCustomizable.find(column);
|
||||||
|
if (it != mColumnCustomizable.end() && *it == false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
QAction *action = contextMenu.addAction(QIcon(), item->text(column), this, SLOT(columnVisible()));
|
QAction *action = contextMenu.addAction(QIcon(), item->text(column), this, SLOT(columnVisible()));
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
action->setData(column);
|
action->setData(column);
|
||||||
|
|
|
@ -37,9 +37,11 @@ public:
|
||||||
|
|
||||||
void filterItems(int filterColumn, const QString &text);
|
void filterItems(int filterColumn, const QString &text);
|
||||||
|
|
||||||
|
void setSettingsVersion(qint32 version);
|
||||||
void processSettings(bool load);
|
void processSettings(bool load);
|
||||||
|
|
||||||
void setColumnCustomizable(bool customizable);
|
void enableColumnCustomize(bool customizable);
|
||||||
|
void setColumnCustomizable(int column, bool customizable);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void signalMouseMiddleButtonClicked(QTreeWidgetItem *item);
|
void signalMouseMiddleButtonClicked(QTreeWidgetItem *item);
|
||||||
|
@ -58,7 +60,9 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mPlaceholderText;
|
QString mPlaceholderText;
|
||||||
bool mColumnCustomizable;
|
bool mEnableColumnCustomize;
|
||||||
|
quint32 mSettingsVersion;
|
||||||
|
QMap<int, bool> mColumnCustomizable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -86,15 +86,15 @@ const char *StatusDefs::imageStatus(unsigned int status)
|
||||||
{
|
{
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case RS_STATUS_OFFLINE:
|
case RS_STATUS_OFFLINE:
|
||||||
return ":/images/status/user-offline.png";
|
return ":/icons/user-offline_64.png";
|
||||||
case RS_STATUS_AWAY:
|
case RS_STATUS_AWAY:
|
||||||
return ":/images/status/user-away.png";
|
return ":/icons/user-away_64.png";
|
||||||
case RS_STATUS_BUSY:
|
case RS_STATUS_BUSY:
|
||||||
return ":/images/status/user-busy.png";
|
return ":/icons/user-busy_64.png";
|
||||||
case RS_STATUS_ONLINE:
|
case RS_STATUS_ONLINE:
|
||||||
return ":/images/status/user-online.png";
|
return ":/icons/user-online_64.png";
|
||||||
case RS_STATUS_INACTIVE:
|
case RS_STATUS_INACTIVE:
|
||||||
return ":/images/status/user-away-extended.png";
|
return ":/icons/user-away-extended_64.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "StatusDefs::imageUser: Unknown status requested " << status;
|
std::cerr << "StatusDefs::imageUser: Unknown status requested " << status;
|
||||||
|
|
|
@ -55,5 +55,10 @@
|
||||||
<file>icons/tile_downloaded_48.png</file>
|
<file>icons/tile_downloaded_48.png</file>
|
||||||
<file>icons/tile_downloading_48.png</file>
|
<file>icons/tile_downloading_48.png</file>
|
||||||
<file>icons/tile_inactive_48.png</file>
|
<file>icons/tile_inactive_48.png</file>
|
||||||
|
<file>icons/user-away_64.png</file>
|
||||||
|
<file>icons/user-away-extended_64.png</file>
|
||||||
|
<file>icons/user-busy_64.png</file>
|
||||||
|
<file>icons/user-offline_64.png</file>
|
||||||
|
<file>icons/user-online_64.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
BIN
retroshare-gui/src/gui/icons/user-away-extended_64.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
retroshare-gui/src/gui/icons/user-away_64.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
retroshare-gui/src/gui/icons/user-busy_64.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
retroshare-gui/src/gui/icons/user-offline_64.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
retroshare-gui/src/gui/icons/user-online_64.png
Normal file
After Width: | Height: | Size: 19 KiB |
|
@ -60,10 +60,7 @@
|
||||||
<file>images/btn_green.png</file>
|
<file>images/btn_green.png</file>
|
||||||
<file>images/btn_green_hover.png</file>
|
<file>images/btn_green_hover.png</file>
|
||||||
<file>images/btn_green_pressed.png</file>
|
<file>images/btn_green_pressed.png</file>
|
||||||
<file>images/connect_established.png</file>
|
|
||||||
<file>images/connect_established_low.png</file>
|
|
||||||
<file>images/connect_creating.png</file>
|
<file>images/connect_creating.png</file>
|
||||||
<file>images/connect_no.png</file>
|
|
||||||
<file>images/dht16.png</file>
|
<file>images/dht16.png</file>
|
||||||
<file>images/dht32.png</file>
|
<file>images/dht32.png</file>
|
||||||
<file>images/edit-clear-history.png</file>
|
<file>images/edit-clear-history.png</file>
|
||||||
|
@ -424,7 +421,6 @@
|
||||||
<file>images/replymail-pressed.png</file>
|
<file>images/replymail-pressed.png</file>
|
||||||
<file>images/replymail24.png</file>
|
<file>images/replymail24.png</file>
|
||||||
<file>images/replymailall24-hover.png</file>
|
<file>images/replymailall24-hover.png</file>
|
||||||
<file>images/reload24.png</file>
|
|
||||||
<file>images/reset.png</file>
|
<file>images/reset.png</file>
|
||||||
<file>images/resume.png</file>
|
<file>images/resume.png</file>
|
||||||
<file>images/security-high-16.png</file>
|
<file>images/security-high-16.png</file>
|
||||||
|
@ -694,11 +690,6 @@
|
||||||
<file>images/tags/dev-translator.png</file>
|
<file>images/tags/dev-translator.png</file>
|
||||||
<file>images/tags/dev-patcher.png</file>
|
<file>images/tags/dev-patcher.png</file>
|
||||||
<file>images/tags/developer.png</file>
|
<file>images/tags/developer.png</file>
|
||||||
<file>images/status/user-online.png</file>
|
|
||||||
<file>images/status/user-offline.png</file>
|
|
||||||
<file>images/status/user-busy.png</file>
|
|
||||||
<file>images/status/user-away-extended.png</file>
|
|
||||||
<file>images/status/user-away.png</file>
|
|
||||||
<file>images/circles/circles_32.png</file>
|
<file>images/circles/circles_32.png</file>
|
||||||
<file>images/circles/circles_64.png</file>
|
<file>images/circles/circles_64.png</file>
|
||||||
<file>images/newsfeed/news-feed-32.png</file>
|
<file>images/newsfeed/news-feed-32.png</file>
|
||||||
|
|
Before Width: | Height: | Size: 818 B |
Before Width: | Height: | Size: 856 B |
Before Width: | Height: | Size: 757 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |