mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04: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 "ForumsDialog.h"
|
||||
#include "RetroShareLink.h"
|
||||
#include "forums/CreateForum.h"
|
||||
#include "forums/CreateForumMsg.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( itemClicked(QTreeWidgetItem*,int)), this, SLOT( clickedThread (QTreeWidgetItem*,int) ) );
|
||||
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.previousButton, SIGNAL(clicked()), this, SLOT(previousMessage()));
|
||||
@ -200,9 +198,6 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
||||
forummenu->addSeparator();
|
||||
ui.forumpushButton->setMenu(forummenu);
|
||||
|
||||
ui.postText->setOpenExternalLinks ( false );
|
||||
ui.postText->setOpenLinks ( false );
|
||||
|
||||
/* create forum tree */
|
||||
m_ItemFont = QFont("ARIAL", 10);
|
||||
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()
|
||||
{
|
||||
// QRegExp regExp(ui.filterPatternLineEdit->text(), Qt::CaseInsensitive , QRegExp::FixedString);
|
||||
|
@ -38,7 +38,6 @@ public:
|
||||
virtual void updateDisplay();
|
||||
|
||||
private slots:
|
||||
void anchorClicked (const QUrl &);
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void forumListCustomPopupMenu( QPoint point );
|
||||
void threadListCustomPopupMenu( QPoint point );
|
||||
|
@ -1228,7 +1228,10 @@ border-image: url(:/images/closepressed.png)
|
||||
</font>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <QIcon>
|
||||
#include <QPixmap>
|
||||
#include <QColorDialog>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#ifdef BLOGS
|
||||
#include "gui/unfinished/blogs/BlogsDialog.h"
|
||||
@ -51,6 +53,7 @@
|
||||
#include "bwgraph/bwgraph.h"
|
||||
#include "help/browser/helpbrowser.h"
|
||||
#include "chat/PopupChatDialog.h"
|
||||
#include "RetroShareLink.h"
|
||||
|
||||
#ifdef UNFINISHED
|
||||
#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()));
|
||||
|
||||
/* add url handler for RetroShare links */
|
||||
QDesktopServices::setUrlHandler("retroshare", this, "linkActivated");
|
||||
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
|
||||
@ -1181,3 +1187,8 @@ void MainWindow::statusChangedComboBox(int index)
|
||||
/* no object known */
|
||||
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 linkActivated(const QUrl &url);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
#include "MessagesDialog.h"
|
||||
#include "msgs/MessageComposer.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "util/printpreview.h"
|
||||
#include "settings/rsharesettings.h"
|
||||
#include "util/misc.h"
|
||||
@ -238,8 +237,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
||||
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
|
||||
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.actionIconOnly, SIGNAL(triggered()), this, SLOT(buttonsicononly()));
|
||||
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.bccText, SIGNAL(linkActivated(QString)), this, SLOT(linkActivated(QString)));
|
||||
|
||||
ui.msgText->setOpenLinks(false);
|
||||
|
||||
m_eListMode = LIST_NOTHING;
|
||||
|
||||
mCurrCertId = "";
|
||||
@ -1844,13 +1839,6 @@ void MessagesDialog::printpreview()
|
||||
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()
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
|
@ -87,8 +87,6 @@ private slots:
|
||||
|
||||
void emptyTrash();
|
||||
|
||||
void anchorClicked (const QUrl &);
|
||||
|
||||
void getcurrentrecommended();
|
||||
void getallrecommended();
|
||||
|
||||
|
@ -1303,6 +1303,9 @@ padding: 4px;
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<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_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
|
||||
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.action_Hide_Offline_Friends, SIGNAL(triggered()), this, SLOT(insertPeers()));
|
||||
@ -227,9 +226,6 @@ PeersDialog::PeersDialog(QWidget *parent)
|
||||
|
||||
ui.menupushButton->setMenu(menu);
|
||||
|
||||
//ui.msgText->setOpenExternalLinks ( false );
|
||||
//ui.msgText->setOpenLinks ( false );
|
||||
|
||||
setAcceptDrops(true);
|
||||
ui.lineEdit->setAcceptDrops(false);
|
||||
|
||||
@ -1868,15 +1864,6 @@ void PeersDialog::fileHashingFinished(AttachFileItem* file)
|
||||
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)
|
||||
{
|
||||
if (!(Qt::CopyAction & event->possibleActions()))
|
||||
|
@ -155,7 +155,6 @@ private slots:
|
||||
void loadmypersonalstatus();
|
||||
|
||||
void addExtraFile();
|
||||
void anchorClicked (const QUrl &);
|
||||
void addAttachment(std::string);
|
||||
|
||||
bool fileSave();
|
||||
|
@ -721,9 +721,6 @@ background: white;}</string>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>200</number>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Friends</string>
|
||||
@ -958,7 +955,7 @@ background: white;}</string>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<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.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(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
|
||||
resetStatusBar();
|
||||
|
||||
//ui.textBrowser->setOpenExternalLinks ( false );
|
||||
//ui.textBrowser->setOpenLinks ( false );
|
||||
|
||||
ui.textboldButton->setIcon(QIcon(QString(":/images/edit-bold.png")));
|
||||
ui.textunderlineButton->setIcon(QIcon(QString(":/images/edit-underline.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();
|
||||
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "PopupChatDialog::anchorClicked message : " << message.toStdString() << std::endl;
|
||||
std::cerr << "PopupChatDialog::fileHashingFinished message : " << message.toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
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)
|
||||
{
|
||||
if (!(Qt::CopyAction & event->possibleActions()))
|
||||
|
@ -71,7 +71,6 @@ public slots:
|
||||
void resetStatusBar() ;
|
||||
void updateStatusTyping() ;
|
||||
void updateStatusString(const QString& peer_id, const QString& statusString) ;
|
||||
void anchorClicked (const QUrl &);
|
||||
|
||||
void updateStatus(const QString &peer_id, int status);
|
||||
|
||||
|
@ -751,7 +751,7 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user