diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtChatView.cpp | 5 | ||||
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 2 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtRosterWidget.cpp | 6 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.cpp | 2 |
5 files changed, 16 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp index d51f74c..cb7f901 100644 --- a/Swift/QtUI/QtChatView.cpp +++ b/Swift/QtUI/QtChatView.cpp @@ -43,23 +43,28 @@ QtChatView::QtChatView(QtChatTheme* theme, QWidget* parent) : QWidget(parent), f /* To give a border on Linux, where it looks bad without */ QStackedWidget* stack = new QStackedWidget(this); stack->addWidget(webView_); stack->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); stack->setLineWidth(2); mainLayout->addWidget(stack); #else mainLayout->addWidget(webView_); #endif + +#ifdef SWIFT_EXPERIMENTAL_FT setAcceptDrops(true); +#endif webPage_ = new QWebPage(this); webPage_->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); +#ifdef SWIFT_EXPERIMENTAL_FT webPage_->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); +#endif webView_->setPage(webPage_); connect(webPage_, SIGNAL(selectionChanged()), SLOT(copySelectionToClipboard())); viewReady_ = false; isAtBottom_ = true; resetView(); } void QtChatView::handleClearRequested() { diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index 238100a..fa039de 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -49,19 +49,21 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt unreadCount_ = 0; inputEnabled_ = true; completer_ = NULL; theme_ = theme; isCorrection_ = false; correctionEnabled_ = Maybe; updateTitleWithUnreadCount(); QtSettingsProvider settings; +#ifdef SWIFT_EXPERIMENTAL_FT setAcceptDrops(true); +#endif alertStyleSheet_ = "background: rgb(255, 255, 153); color: black"; QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); layout->setContentsMargins(0,0,0,0); layout->setSpacing(2); alertWidget_ = new QWidget(this); QHBoxLayout* alertLayout = new QHBoxLayout(alertWidget_); diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 543af65..0db6071 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -162,21 +162,23 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow(), forg QAction* aboutAction = new QAction(QString(tr("&About %1")).arg("Swift"), this); #endif connect(aboutAction, SIGNAL(triggered()), SLOT(handleAbout())); swiftMenu_->addAction(aboutAction); xmlConsoleAction_ = new QAction(tr("&Show Debug Console"), this); connect(xmlConsoleAction_, SIGNAL(triggered()), SLOT(handleShowXMLConsole())); generalMenu_->addAction(xmlConsoleAction_); +#ifdef SWIFT_EXPERIMENTAL_FT fileTransferOverviewAction_ = new QAction(tr("Show &File Transfer Overview"), this); connect(fileTransferOverviewAction_, SIGNAL(triggered()), SLOT(handleShowFileTransferOverview())); generalMenu_->addAction(fileTransferOverviewAction_); +#endif toggleSoundsAction_ = new QAction(tr("&Play Sounds"), this); toggleSoundsAction_->setCheckable(true); toggleSoundsAction_->setChecked(true); connect(toggleSoundsAction_, SIGNAL(toggled(bool)), SLOT(handleToggleSounds(bool))); generalMenu_->addAction(toggleSoundsAction_); toggleNotificationsAction_ = new QAction(tr("Display Pop-up &Notifications"), this); toggleNotificationsAction_->setCheckable(true); diff --git a/Swift/QtUI/Roster/QtRosterWidget.cpp b/Swift/QtUI/Roster/QtRosterWidget.cpp index f3b0441..3d9b273 100644 --- a/Swift/QtUI/Roster/QtRosterWidget.cpp +++ b/Swift/QtUI/Roster/QtRosterWidget.cpp @@ -50,37 +50,41 @@ void QtRosterWidget::contextMenuEvent(QContextMenuEvent* event) { QModelIndex index = indexAt(event->pos()); if (!index.isValid()) { return; } RosterItem* item = static_cast<RosterItem*>(index.internalPointer()); QMenu contextMenu; if (ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item)) { QAction* editContact = contextMenu.addAction(tr("Edit")); QAction* removeContact = contextMenu.addAction(tr("Remove")); +#ifdef SWIFT_EXPERIMENTAL_FT QAction* sendFile = NULL; if (contact->supportsFeature(ContactRosterItem::FileTransferFeature)) { sendFile = contextMenu.addAction(tr("Send File")); } +#endif QAction* result = contextMenu.exec(event->globalPos()); if (result == editContact) { eventStream_->send(boost::make_shared<RequestContactEditorUIEvent>(contact->getJID())); } else if (result == removeContact) { if (QtContactEditWindow::confirmContactDeletion(contact->getJID())) { eventStream_->send(boost::make_shared<RemoveRosterItemUIEvent>(contact->getJID())); } } - else if (result == sendFile) { +#ifdef SWIFT_EXPERIMENTAL_FT + else if (sendFile && result == sendFile) { QString fileName = QFileDialog::getOpenFileName(this, tr("Send File"), "", tr("All Files (*);;")); if (!fileName.isEmpty()) { eventStream_->send(boost::make_shared<SendFileUIEvent>(contact->getJID(), fileName.toStdString())); } } +#endif } else if (GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(item)) { QAction* renameGroupAction = contextMenu.addAction(tr("Rename")); QAction* result = contextMenu.exec(event->globalPos()); if (result == renameGroupAction) { renameGroup(group); } } } diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp index 79dd6a2..2e37ba2 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.cpp +++ b/Swift/QtUI/Roster/QtTreeWidget.cpp @@ -28,19 +28,21 @@ QtTreeWidget::QtTreeWidget(UIEventStream* eventStream, QWidget* parent) : QTreeV setItemDelegate(delegate_); setHeaderHidden(true); #ifdef SWIFT_PLATFORM_MACOSX setAlternatingRowColors(true); #endif setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); expandAll(); setAnimated(true); setIndentation(0); +#ifdef SWIFT_EXPERIMENTAL_FT setAcceptDrops(true); +#endif setRootIsDecorated(true); connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(handleItemActivated(const QModelIndex&))); connect(model_, SIGNAL(itemExpanded(const QModelIndex&, bool)), this, SLOT(handleModelItemExpanded(const QModelIndex&, bool))); connect(this, SIGNAL(expanded(const QModelIndex&)), this, SLOT(handleExpanded(const QModelIndex&))); connect(this, SIGNAL(collapsed(const QModelIndex&)), this, SLOT(handleCollapsed(const QModelIndex&))); connect(this, SIGNAL(clicked(const QModelIndex&)), this, SLOT(handleClicked(const QModelIndex&))); } QtTreeWidget::~QtTreeWidget() { |