mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Added new url handler to QDesktopServices for the handling of RetroShare-Links application (RetroShare) wide.
Removed all connects of the signal anchorClicked of the QTextBrowser instances. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3814 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7a1cd7841c
commit
8c2f06d963
@ -26,7 +26,6 @@
|
|||||||
#include <QItemDelegate>
|
#include <QItemDelegate>
|
||||||
|
|
||||||
#include "ForumsDialog.h"
|
#include "ForumsDialog.h"
|
||||||
#include "RetroShareLink.h"
|
|
||||||
#include "forums/CreateForum.h"
|
#include "forums/CreateForum.h"
|
||||||
#include "forums/CreateForumMsg.h"
|
#include "forums/CreateForumMsg.h"
|
||||||
#include "forums/ForumDetails.h"
|
#include "forums/ForumDetails.h"
|
||||||
@ -154,7 +153,6 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
|||||||
connect( ui.threadTreeWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( changedThread () ) );
|
connect( ui.threadTreeWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( changedThread () ) );
|
||||||
connect( ui.threadTreeWidget, SIGNAL( itemClicked(QTreeWidgetItem*,int)), this, SLOT( clickedThread (QTreeWidgetItem*,int) ) );
|
connect( ui.threadTreeWidget, SIGNAL( itemClicked(QTreeWidgetItem*,int)), this, SLOT( clickedThread (QTreeWidgetItem*,int) ) );
|
||||||
connect( ui.viewBox, SIGNAL( currentIndexChanged ( int ) ), this, SLOT( changedViewBox () ) );
|
connect( ui.viewBox, SIGNAL( currentIndexChanged ( int ) ), this, SLOT( changedViewBox () ) );
|
||||||
connect( ui.postText, SIGNAL( anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
|
||||||
|
|
||||||
connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview()));
|
connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview()));
|
||||||
connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(previousMessage()));
|
connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(previousMessage()));
|
||||||
@ -200,9 +198,6 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
|||||||
forummenu->addSeparator();
|
forummenu->addSeparator();
|
||||||
ui.forumpushButton->setMenu(forummenu);
|
ui.forumpushButton->setMenu(forummenu);
|
||||||
|
|
||||||
ui.postText->setOpenExternalLinks ( false );
|
|
||||||
ui.postText->setOpenLinks ( false );
|
|
||||||
|
|
||||||
/* create forum tree */
|
/* create forum tree */
|
||||||
m_ItemFont = QFont("ARIAL", 10);
|
m_ItemFont = QFont("ARIAL", 10);
|
||||||
m_ItemFont.setBold(true);
|
m_ItemFont.setBold(true);
|
||||||
@ -1721,15 +1716,6 @@ void ForumsDialog::replytomessage()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ForumsDialog::anchorClicked (const QUrl& link )
|
|
||||||
{
|
|
||||||
#ifdef FORUM_DEBUG
|
|
||||||
std::cerr << "ForumsDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RetroShareLink::processUrl(link, RSLINK_PROCESS_NOTIFY_ALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ForumsDialog::filterRegExpChanged()
|
void ForumsDialog::filterRegExpChanged()
|
||||||
{
|
{
|
||||||
// QRegExp regExp(ui.filterPatternLineEdit->text(), Qt::CaseInsensitive , QRegExp::FixedString);
|
// QRegExp regExp(ui.filterPatternLineEdit->text(), Qt::CaseInsensitive , QRegExp::FixedString);
|
||||||
|
@ -38,7 +38,6 @@ public:
|
|||||||
virtual void updateDisplay();
|
virtual void updateDisplay();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void anchorClicked (const QUrl &);
|
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void forumListCustomPopupMenu( QPoint point );
|
void forumListCustomPopupMenu( QPoint point );
|
||||||
void threadListCustomPopupMenu( QPoint point );
|
void threadListCustomPopupMenu( QPoint point );
|
||||||
|
@ -1228,7 +1228,10 @@ border-image: url(:/images/closepressed.png)
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openLinks">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
#ifdef BLOGS
|
#ifdef BLOGS
|
||||||
#include "gui/unfinished/blogs/BlogsDialog.h"
|
#include "gui/unfinished/blogs/BlogsDialog.h"
|
||||||
@ -51,6 +53,7 @@
|
|||||||
#include "bwgraph/bwgraph.h"
|
#include "bwgraph/bwgraph.h"
|
||||||
#include "help/browser/helpbrowser.h"
|
#include "help/browser/helpbrowser.h"
|
||||||
#include "chat/PopupChatDialog.h"
|
#include "chat/PopupChatDialog.h"
|
||||||
|
#include "RetroShareLink.h"
|
||||||
|
|
||||||
#ifdef UNFINISHED
|
#ifdef UNFINISHED
|
||||||
#include "unfinished/ApplicationWindow.h"
|
#include "unfinished/ApplicationWindow.h"
|
||||||
@ -155,6 +158,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||||||
|
|
||||||
setWindowTitle(tr("RetroShare %1 a secure decentralised communication platform").arg(retroshareVersion()));
|
setWindowTitle(tr("RetroShare %1 a secure decentralised communication platform").arg(retroshareVersion()));
|
||||||
|
|
||||||
|
/* add url handler for RetroShare links */
|
||||||
|
QDesktopServices::setUrlHandler("retroshare", this, "linkActivated");
|
||||||
|
|
||||||
// Setting icons
|
// Setting icons
|
||||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||||
|
|
||||||
@ -1181,3 +1187,8 @@ void MainWindow::statusChangedComboBox(int index)
|
|||||||
/* no object known */
|
/* no object known */
|
||||||
setStatus(NULL, statusComboBox->itemData(index, Qt::UserRole).toInt());
|
setStatus(NULL, statusComboBox->itemData(index, Qt::UserRole).toInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::linkActivated(const QUrl &url)
|
||||||
|
{
|
||||||
|
RetroShareLink::processUrl(url, RSLINK_PROCESS_NOTIFY_ALL);
|
||||||
|
}
|
||||||
|
@ -196,6 +196,7 @@ private slots:
|
|||||||
|
|
||||||
void on_actionQuick_Start_Wizard_activated();
|
void on_actionQuick_Start_Wizard_activated();
|
||||||
|
|
||||||
|
void linkActivated(const QUrl &url);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include "MessagesDialog.h"
|
#include "MessagesDialog.h"
|
||||||
#include "msgs/MessageComposer.h"
|
#include "msgs/MessageComposer.h"
|
||||||
#include "gui/RetroShareLink.h"
|
|
||||||
#include "util/printpreview.h"
|
#include "util/printpreview.h"
|
||||||
#include "settings/rsharesettings.h"
|
#include "settings/rsharesettings.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
@ -238,8 +237,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||||||
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
|
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
|
||||||
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
|
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
|
||||||
|
|
||||||
connect( ui.msgText, SIGNAL( anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
|
||||||
|
|
||||||
connect(ui.actionTextBesideIcon, SIGNAL(triggered()), this, SLOT(buttonstextbesideicon()));
|
connect(ui.actionTextBesideIcon, SIGNAL(triggered()), this, SLOT(buttonstextbesideicon()));
|
||||||
connect(ui.actionIconOnly, SIGNAL(triggered()), this, SLOT(buttonsicononly()));
|
connect(ui.actionIconOnly, SIGNAL(triggered()), this, SLOT(buttonsicononly()));
|
||||||
connect(ui.actionTextUnderIcon, SIGNAL(triggered()), this, SLOT(buttonstextundericon()));
|
connect(ui.actionTextUnderIcon, SIGNAL(triggered()), this, SLOT(buttonstextundericon()));
|
||||||
@ -256,8 +253,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||||||
connect(ui.ccText, SIGNAL(linkActivated(QString)), this, SLOT(linkActivated(QString)));
|
connect(ui.ccText, SIGNAL(linkActivated(QString)), this, SLOT(linkActivated(QString)));
|
||||||
connect(ui.bccText, SIGNAL(linkActivated(QString)), this, SLOT(linkActivated(QString)));
|
connect(ui.bccText, SIGNAL(linkActivated(QString)), this, SLOT(linkActivated(QString)));
|
||||||
|
|
||||||
ui.msgText->setOpenLinks(false);
|
|
||||||
|
|
||||||
m_eListMode = LIST_NOTHING;
|
m_eListMode = LIST_NOTHING;
|
||||||
|
|
||||||
mCurrCertId = "";
|
mCurrCertId = "";
|
||||||
@ -1844,13 +1839,6 @@ void MessagesDialog::printpreview()
|
|||||||
preview->show();
|
preview->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesDialog::anchorClicked (const QUrl& link )
|
|
||||||
{
|
|
||||||
std::cerr << "MessagesDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
|
||||||
|
|
||||||
RetroShareLink::processUrl(link, RSLINK_PROCESS_NOTIFY_ALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MessagesDialog::fileSave()
|
bool MessagesDialog::fileSave()
|
||||||
{
|
{
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
|
@ -87,8 +87,6 @@ private slots:
|
|||||||
|
|
||||||
void emptyTrash();
|
void emptyTrash();
|
||||||
|
|
||||||
void anchorClicked (const QUrl &);
|
|
||||||
|
|
||||||
void getcurrentrecommended();
|
void getcurrentrecommended();
|
||||||
void getallrecommended();
|
void getallrecommended();
|
||||||
|
|
||||||
|
@ -1303,6 +1303,9 @@ padding: 4px;
|
|||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="openLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
|
@ -135,7 +135,6 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||||||
connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar()));
|
connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar()));
|
||||||
connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
|
connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
|
||||||
connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
||||||
connect( ui.msgText, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
|
||||||
|
|
||||||
connect(ui.actionAdd_Friend, SIGNAL(triggered()), this, SLOT(addFriend()));
|
connect(ui.actionAdd_Friend, SIGNAL(triggered()), this, SLOT(addFriend()));
|
||||||
connect(ui.action_Hide_Offline_Friends, SIGNAL(triggered()), this, SLOT(insertPeers()));
|
connect(ui.action_Hide_Offline_Friends, SIGNAL(triggered()), this, SLOT(insertPeers()));
|
||||||
@ -227,9 +226,6 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||||||
|
|
||||||
ui.menupushButton->setMenu(menu);
|
ui.menupushButton->setMenu(menu);
|
||||||
|
|
||||||
//ui.msgText->setOpenExternalLinks ( false );
|
|
||||||
//ui.msgText->setOpenLinks ( false );
|
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
ui.lineEdit->setAcceptDrops(false);
|
ui.lineEdit->setAcceptDrops(false);
|
||||||
|
|
||||||
@ -1868,15 +1864,6 @@ void PeersDialog::fileHashingFinished(AttachFileItem* file)
|
|||||||
setFont();
|
setFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeersDialog::anchorClicked (const QUrl& link )
|
|
||||||
{
|
|
||||||
#ifdef PEERS_DEBUG
|
|
||||||
std::cerr << "PeersDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RetroShareLink::processUrl(link, RSLINK_PROCESS_NOTIFY_ALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PeersDialog::dropEvent(QDropEvent *event)
|
void PeersDialog::dropEvent(QDropEvent *event)
|
||||||
{
|
{
|
||||||
if (!(Qt::CopyAction & event->possibleActions()))
|
if (!(Qt::CopyAction & event->possibleActions()))
|
||||||
|
@ -155,7 +155,6 @@ private slots:
|
|||||||
void loadmypersonalstatus();
|
void loadmypersonalstatus();
|
||||||
|
|
||||||
void addExtraFile();
|
void addExtraFile();
|
||||||
void anchorClicked (const QUrl &);
|
|
||||||
void addAttachment(std::string);
|
void addAttachment(std::string);
|
||||||
|
|
||||||
bool fileSave();
|
bool fileSave();
|
||||||
|
@ -721,9 +721,6 @@ background: white;}</string>
|
|||||||
<attribute name="headerDefaultSectionSize">
|
<attribute name="headerDefaultSectionSize">
|
||||||
<number>200</number>
|
<number>200</number>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="headerDefaultSectionSize">
|
|
||||||
<number>200</number>
|
|
||||||
</attribute>
|
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Friends</string>
|
<string>Friends</string>
|
||||||
@ -958,7 +955,7 @@ background: white;}</string>
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="openLinks">
|
<property name="openLinks">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="layoutWidget_2">
|
<widget class="QWidget" name="layoutWidget_2">
|
||||||
|
@ -126,7 +126,6 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
|
|||||||
connect(ui.actionSave_Chat_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
connect(ui.actionSave_Chat_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||||
connect(ui.actionClearOfflineMessages, SIGNAL(triggered()), this, SLOT(clearOfflineMessages()));
|
connect(ui.actionClearOfflineMessages, SIGNAL(triggered()), this, SLOT(clearOfflineMessages()));
|
||||||
|
|
||||||
connect(ui.textBrowser, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
|
||||||
|
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
|
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
||||||
@ -138,9 +137,6 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
|
|||||||
// Create the status bar
|
// Create the status bar
|
||||||
resetStatusBar();
|
resetStatusBar();
|
||||||
|
|
||||||
//ui.textBrowser->setOpenExternalLinks ( false );
|
|
||||||
//ui.textBrowser->setOpenLinks ( false );
|
|
||||||
|
|
||||||
ui.textboldButton->setIcon(QIcon(QString(":/images/edit-bold.png")));
|
ui.textboldButton->setIcon(QIcon(QString(":/images/edit-bold.png")));
|
||||||
ui.textunderlineButton->setIcon(QIcon(QString(":/images/edit-underline.png")));
|
ui.textunderlineButton->setIcon(QIcon(QString(":/images/edit-underline.png")));
|
||||||
ui.textitalicButton->setIcon(QIcon(QString(":/images/edit-italic.png")));
|
ui.textitalicButton->setIcon(QIcon(QString(":/images/edit-italic.png")));
|
||||||
@ -1002,7 +998,7 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
|
|||||||
message+= RetroShareLink(QString::fromUtf8(file->FileName().c_str()),file->FileSize(),QString::fromStdString(file->FileHash())).toHtmlSize();
|
message+= RetroShareLink(QString::fromUtf8(file->FileName().c_str()),file->FileSize(),QString::fromStdString(file->FileHash())).toHtmlSize();
|
||||||
|
|
||||||
#ifdef CHAT_DEBUG
|
#ifdef CHAT_DEBUG
|
||||||
std::cerr << "PopupChatDialog::anchorClicked message : " << message.toStdString() << std::endl;
|
std::cerr << "PopupChatDialog::fileHashingFinished message : " << message.toStdString() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::wstring msg = message.toStdWString();
|
std::wstring msg = message.toStdWString();
|
||||||
@ -1013,16 +1009,6 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::anchorClicked (const QUrl& link )
|
|
||||||
{
|
|
||||||
#ifdef CHAT_DEBUG
|
|
||||||
std::cerr << "PopupChatDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::list<std::string> srcIds;
|
|
||||||
RetroShareLink::processUrl(link, RSLINK_PROCESS_NOTIFY_ALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PopupChatDialog::dropEvent(QDropEvent *event)
|
void PopupChatDialog::dropEvent(QDropEvent *event)
|
||||||
{
|
{
|
||||||
if (!(Qt::CopyAction & event->possibleActions()))
|
if (!(Qt::CopyAction & event->possibleActions()))
|
||||||
|
@ -71,7 +71,6 @@ public slots:
|
|||||||
void resetStatusBar() ;
|
void resetStatusBar() ;
|
||||||
void updateStatusTyping() ;
|
void updateStatusTyping() ;
|
||||||
void updateStatusString(const QString& peer_id, const QString& statusString) ;
|
void updateStatusString(const QString& peer_id, const QString& statusString) ;
|
||||||
void anchorClicked (const QUrl &);
|
|
||||||
|
|
||||||
void updateStatus(const QString &peer_id, int status);
|
void updateStatus(const QString &peer_id, int status);
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="openLinks">
|
<property name="openLinks">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user