diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 29bdb2cab..5776c7fa4 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -320,36 +320,29 @@ void ForumsDialog::forumListCustomPopupMenu( QPoint point ) { QMenu contextMnu( this ); - QAction *subForumAct = new QAction(QIcon(IMAGE_SUBSCRIBE), tr( "Subscribe to Forum" ), &contextMnu ); - subForumAct->setDisabled (m_bIsForumSubscribed); - connect( subForumAct , SIGNAL( triggered() ), this, SLOT( subscribeToForum() ) ); + QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe to Forum"), this, SLOT(subscribeToForum())); + action->setDisabled (m_bIsForumSubscribed); - QAction *unsubForumAct = new QAction(QIcon(IMAGE_UNSUBSCRIBE), tr( "Unsubscribe to Forum" ), &contextMnu ); - unsubForumAct->setEnabled (m_bIsForumSubscribed); - connect( unsubForumAct , SIGNAL( triggered() ), this, SLOT( unsubscribeToForum() ) ); + action = contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe to Forum"), this, SLOT(unsubscribeToForum())); + action->setEnabled (m_bIsForumSubscribed); - QAction *newForumAct = new QAction(QIcon(IMAGE_NEWFORUM), tr( "New Forum" ), &contextMnu ); - connect( newForumAct , SIGNAL( triggered() ), this, SLOT( newforum() ) ); - - QAction *detailsForumAct = new QAction(QIcon(IMAGE_INFO), tr( "Show Forum Details" ), &contextMnu ); - detailsForumAct->setDisabled (true); - connect( detailsForumAct , SIGNAL( triggered() ), this, SLOT( showForumDetails() ) ); - - QAction *editForumDetailsAct = new QAction(QIcon(":/images/settings16.png"), tr("Edit Forum Details"), this); - editForumDetailsAct->setDisabled (true); - connect( editForumDetailsAct, SIGNAL( triggered() ), this, SLOT( editForumDetails() ) ); - - if (!mCurrForumId.empty ()) { - detailsForumAct->setEnabled (true); - editForumDetailsAct->setEnabled(m_bIsForumAdmin); - } - - contextMnu.addAction( subForumAct ); - contextMnu.addAction( unsubForumAct ); contextMnu.addSeparator(); - contextMnu.addAction( newForumAct ); - contextMnu.addAction( detailsForumAct ); - contextMnu.addAction( editForumDetailsAct ); + + contextMnu.addAction(QIcon(IMAGE_NEWFORUM), tr("New Forum"), this, SLOT(newforum())); + + action = contextMnu.addAction(QIcon(IMAGE_INFO), tr("Show Forum Details"), this, SLOT(showForumDetails())); + action->setEnabled (!mCurrForumId.empty ()); + + action = contextMnu.addAction(QIcon(":/images/settings16.png"), tr("Edit Forum Details"), this, SLOT(editForumDetails())); + action->setEnabled (!mCurrForumId.empty () && m_bIsForumAdmin); + + contextMnu.addSeparator(); + + action = contextMnu.addAction(QIcon(":/images/message-mail-read.png"), tr("Mark all as read"), this, SLOT(markMsgAsReadAll())); + action->setEnabled (!mCurrForumId.empty () && m_bIsForumSubscribed); + + action = contextMnu.addAction(QIcon(":/images/message-mail.png"), tr("Mark all as unread"), this, SLOT(markMsgAsUnreadAll())); + action->setEnabled (!mCurrForumId.empty () && m_bIsForumSubscribed); contextMnu.exec(QCursor::pos()); } @@ -377,14 +370,14 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point ) QAction *markMsgAsRead = new QAction(QIcon(":/images/message-mail-read.png"), tr("Mark as read"), &contextMnu); connect(markMsgAsRead , SIGNAL(triggered()), this, SLOT(markMsgAsRead())); - QAction *markMsgAsReadAll = new QAction(QIcon(":/images/message-mail-read.png"), tr("Mark as read") + " (" + tr ("with children") + ")", &contextMnu); - connect(markMsgAsReadAll, SIGNAL(triggered()), this, SLOT(markMsgAsReadAll())); + QAction *markMsgAsReadChildren = new QAction(QIcon(":/images/message-mail-read.png"), tr("Mark as read") + " (" + tr ("with children") + ")", &contextMnu); + connect(markMsgAsReadChildren, SIGNAL(triggered()), this, SLOT(markMsgAsReadChildren())); QAction *markMsgAsUnread = new QAction(QIcon(":/images/message-mail.png"), tr("Mark as unread"), &contextMnu); connect(markMsgAsUnread , SIGNAL(triggered()), this, SLOT(markMsgAsUnread())); - QAction *markMsgAsUnreadAll = new QAction(QIcon(":/images/message-mail.png"), tr("Mark as unread") + " (" + tr ("with children") + ")", &contextMnu); - connect(markMsgAsUnreadAll , SIGNAL(triggered()), this, SLOT(markMsgAsUnreadAll())); + QAction *markMsgAsUnreadChildren = new QAction(QIcon(":/images/message-mail.png"), tr("Mark as unread") + " (" + tr ("with children") + ")", &contextMnu); + connect(markMsgAsUnreadChildren , SIGNAL(triggered()), this, SLOT(markMsgAsUnreadChildren())); if (m_bIsForumSubscribed) { QList Rows; @@ -411,8 +404,8 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point ) bHasReadChildren = true; } } - markMsgAsReadAll->setEnabled(bHasUnreadChildren); - markMsgAsUnreadAll->setEnabled(bHasReadChildren); + markMsgAsReadChildren->setEnabled(bHasUnreadChildren); + markMsgAsUnreadChildren->setEnabled(bHasReadChildren); if (nCount == 1) { replyAct->setEnabled (true); @@ -423,9 +416,9 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point ) } } else { markMsgAsRead->setDisabled(true); - markMsgAsReadAll->setDisabled(true); + markMsgAsReadChildren->setDisabled(true); markMsgAsUnread->setDisabled(true); - markMsgAsUnreadAll->setDisabled(true); + markMsgAsUnreadChildren->setDisabled(true); replyAct->setDisabled (true); replyauthorAct->setDisabled (true); } @@ -435,9 +428,9 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point ) contextMnu.addAction( replyauthorAct); contextMnu.addSeparator(); contextMnu.addAction(markMsgAsRead); - contextMnu.addAction(markMsgAsReadAll); + contextMnu.addAction(markMsgAsReadChildren); contextMnu.addAction(markMsgAsUnread); - contextMnu.addAction(markMsgAsUnreadAll); + contextMnu.addAction(markMsgAsUnreadChildren); contextMnu.addSeparator(); contextMnu.addAction( expandAll); contextMnu.addAction( collapseAll); @@ -1536,7 +1529,7 @@ void ForumsDialog::setMsgAsReadUnread(QList &Rows, bool bRead) } } -void ForumsDialog::markMsgAsReadUnread (bool bRead, bool bAll) +void ForumsDialog::markMsgAsReadUnread (bool bRead, bool bChildren, bool bForum) { if (mCurrForumId.empty() || m_bIsForumSubscribed == false) { return; @@ -1544,9 +1537,16 @@ void ForumsDialog::markMsgAsReadUnread (bool bRead, bool bAll) /* get selected messages */ QList Rows; - getSelectedMsgCount (&Rows, NULL, NULL); + if (bForum) { + int itemCount = ui.threadTreeWidget->topLevelItemCount(); + for (int item = 0; item < itemCount; item++) { + Rows.push_back(ui.threadTreeWidget->topLevelItem(item)); + } + } else { + getSelectedMsgCount (&Rows, NULL, NULL); + } - if (bAll) { + if (bChildren) { /* add children */ QList AllRows; @@ -1580,22 +1580,32 @@ void ForumsDialog::markMsgAsReadUnread (bool bRead, bool bAll) void ForumsDialog::markMsgAsRead() { - markMsgAsReadUnread(true, false); + markMsgAsReadUnread(true, false, false); +} + +void ForumsDialog::markMsgAsReadChildren() +{ + markMsgAsReadUnread(true, true, false); } void ForumsDialog::markMsgAsReadAll() { - markMsgAsReadUnread(true, true); + markMsgAsReadUnread(true, true, true); } void ForumsDialog::markMsgAsUnread() { - markMsgAsReadUnread(false, false); + markMsgAsReadUnread(false, false, false); +} + +void ForumsDialog::markMsgAsUnreadChildren() +{ + markMsgAsReadUnread(false, true, false); } void ForumsDialog::markMsgAsUnreadAll() { - markMsgAsReadUnread(false, true); + markMsgAsReadUnread(false, true, true); } void ForumsDialog::newforum() @@ -1604,7 +1614,6 @@ void ForumsDialog::newforum() cf.exec (); } - void ForumsDialog::createmessage() { if (mCurrForumId.empty () || m_bIsForumSubscribed == false) { diff --git a/retroshare-gui/src/gui/ForumsDialog.h b/retroshare-gui/src/gui/ForumsDialog.h index 177400dd5..8ea3c24b4 100644 --- a/retroshare-gui/src/gui/ForumsDialog.h +++ b/retroshare-gui/src/gui/ForumsDialog.h @@ -55,9 +55,11 @@ private slots: //void removemessage(); void markMsgAsRead(); + void markMsgAsReadChildren(); void markMsgAsReadAll(); void markMsgAsUnread(); void markMsgAsUnreadAll(); + void markMsgAsUnreadChildren(); /* handle splitter */ void togglethreadview(); @@ -93,7 +95,7 @@ private: int getSelectedMsgCount(QList *pRows, QList *pRowsRead, QList *pRowsUnread); void setMsgAsReadUnread(QList &Rows, bool bRead); - void markMsgAsReadUnread(bool bRead, bool bAll); + void markMsgAsReadUnread(bool bRead, bool bChildren, bool bForum); void CalculateIconsAndFonts(QTreeWidgetItem *pItem = NULL); void CalculateIconsAndFonts(QTreeWidgetItem *pItem, bool &bHasReadChilddren, bool &bHasUnreadChilddren); diff --git a/retroshare-gui/src/lang/retroshare_de.qm b/retroshare-gui/src/lang/retroshare_de.qm index 8cf119fae..48afb63e4 100644 Binary files a/retroshare-gui/src/lang/retroshare_de.qm and b/retroshare-gui/src/lang/retroshare_de.qm differ diff --git a/retroshare-gui/src/lang/retroshare_de.ts b/retroshare-gui/src/lang/retroshare_de.ts index 3388d8580..553ef572a 100644 --- a/retroshare-gui/src/lang/retroshare_de.ts +++ b/retroshare-gui/src/lang/retroshare_de.ts @@ -3506,27 +3506,37 @@ p, li { white-space: pre-wrap; } Forum abonnieren - + Unsubscribe to Forum Forum abbestellen - + New Forum Neues Forum - + Show Forum Details Zeige Foren-Details - + Edit Forum Details Forum-Details bearbeiten - + + Mark all as read + Alle als gelesen markieren + + + + Mark all as unread + Alle als ungelesen markieren + + + Reply Antwort @@ -3581,7 +3591,7 @@ p, li { white-space: pre-wrap; } keine - + RetroShare @@ -3597,7 +3607,7 @@ p, li { white-space: pre-wrap; } Du kannst einem anonymen Autor nicht antworten - + Your Forums Deine Foren @@ -3739,8 +3749,8 @@ p, li { white-space: pre-wrap; } Druckvorschau - - + + Start New Thread Erstelle neues Thema @@ -3768,7 +3778,7 @@ p, li { white-space: pre-wrap; } Inhalt - + Mark as read Als gelesen markieren @@ -4252,7 +4262,7 @@ Fill in your GPG password when asked, to sign your new key. GraphWidget - + Click and drag the nodes around, and zoom with the mouse wheel or the '+' and '-' keys @@ -5860,7 +5870,7 @@ Willst Du die Nachricht speichern ? MessagesDialog - + New Message Neue Nachricht @@ -5876,14 +5886,14 @@ Willst Du die Nachricht speichern ? - + Date Datum - + From Von @@ -6056,7 +6066,7 @@ p, li { white-space: pre-wrap; } - + Subject Betreff @@ -6096,7 +6106,7 @@ p, li { white-space: pre-wrap; } Gewählte Nachricht weiterleiten - + Remove Messages Löschen @@ -6131,8 +6141,8 @@ p, li { white-space: pre-wrap; } HTML-Dateien (*.htm *.html);;Alle Dateien (*) - - + + Reply to All Allen antworten @@ -6151,7 +6161,7 @@ p, li { white-space: pre-wrap; } - + Content Inhalt @@ -6159,7 +6169,7 @@ p, li { white-space: pre-wrap; } - + Tags Schlagwörter @@ -6461,7 +6471,7 @@ p, li { white-space: pre-wrap; } NetworkDialog - + Select a pem/pqi File Wählen einer PEM- oder PQI-Datei @@ -6666,7 +6676,7 @@ p, li { white-space: pre-wrap; } Unbekannt - + Authentication matrix Authentifizierungsmatrix @@ -6676,7 +6686,7 @@ p, li { white-space: pre-wrap; } Netzwerk Ansicht - + Authenticated Authentifiziert @@ -6856,7 +6866,7 @@ p, li { white-space: pre-wrap; } Erneuern - + Basic @@ -6871,12 +6881,12 @@ p, li { white-space: pre-wrap; } - + Display mode: - + Friends level: @@ -7951,7 +7961,7 @@ p, li { white-space: pre-wrap; } Nachrichten, die Du versendest gehen bei diesem Freund erst wieder ein wenn er Online ist - + Bold Fett