From 4852a7efa534c3903f38082d2ddb4ace3dc0ba70 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Wed, 25 Feb 2015 12:02:52 +0100 Subject: [PATCH 01/28] Text: Tooltips (issue #1238) --- src/chatlog/content/text.cpp | 21 +++++++++++++++++++-- src/chatlog/content/text.h | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index 90c287ac5..b5a61476a 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -221,6 +221,9 @@ void Text::hoverMoveEvent(QGraphicsSceneHoverEvent *event) setCursor(QCursor(Qt::PointingHandCursor)); else setCursor(QCursor()); + + // tooltip + setToolTip(extractImgTooltip(cursorFromPos(event->scenePos(), false))); } QString Text::getText() const @@ -287,10 +290,10 @@ QSizeF Text::idealSize() return size; } -int Text::cursorFromPos(QPointF scenePos) const +int Text::cursorFromPos(QPointF scenePos, bool fuzzy) const { if(doc) - return doc->documentLayout()->hitTest(mapFromScene(scenePos), Qt::FuzzyHit); + return doc->documentLayout()->hitTest(mapFromScene(scenePos), fuzzy ? Qt::FuzzyHit : Qt::ExactHit); return -1; } @@ -348,3 +351,17 @@ QString Text::extractSanitizedText(int from, int to) const return txt; } + +QString Text::extractImgTooltip(int pos) const +{ + for(QTextBlock::Iterator itr = doc->firstBlock().begin(); itr!=doc->firstBlock().end(); ++itr) + { + if(itr.fragment().contains(pos) && itr.fragment().charFormat().isImageFormat()) + { + QTextImageFormat imgFmt = itr.fragment().charFormat().toImageFormat(); + return imgFmt.toolTip(); + } + } + + return QString(); +} diff --git a/src/chatlog/content/text.h b/src/chatlog/content/text.h index 292d2396d..898a8fec8 100644 --- a/src/chatlog/content/text.h +++ b/src/chatlog/content/text.h @@ -61,11 +61,12 @@ protected: void freeResources(); QSizeF idealSize(); - int cursorFromPos(QPointF scenePos) const; + int cursorFromPos(QPointF scenePos, bool fuzzy = true) const; int getSelectionEnd() const; int getSelectionStart() const; bool hasSelection() const; QString extractSanitizedText(int from, int to) const; + QString extractImgTooltip(int pos) const; private: QTextDocument* doc = nullptr; From 00af059a4fcf8b9c340f6425e19b46bc3522cc63 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sun, 1 Mar 2015 10:43:43 +0100 Subject: [PATCH 02/28] use QUrl::fromLocalFile (fix #1305) --- src/chatlog/content/filetransferwidget.cpp | 2 +- src/widget/widget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chatlog/content/filetransferwidget.cpp b/src/chatlog/content/filetransferwidget.cpp index 3a11d6c09..cf8cd441a 100644 --- a/src/chatlog/content/filetransferwidget.cpp +++ b/src/chatlog/content/filetransferwidget.cpp @@ -435,7 +435,7 @@ void FileTransferWidget::handleButton(QPushButton *btn) else if (btn->objectName() == "dir") { QString dirPath = QFileInfo(fileInfo.filePath).dir().path(); - QDesktopServices::openUrl(QUrl("file://" + dirPath, QUrl::TolerantMode)); + QDesktopServices::openUrl(QUrl::fromLocalFile(dirPath)); } } diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index e7aadbeb2..9aaf8eb01 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -519,7 +519,7 @@ void Widget::confirmExecutableOpen(const QFileInfo file) } else { - QDesktopServices::openUrl(QUrl("file://" + file.filePath(), QUrl::TolerantMode)); + QDesktopServices::openUrl(QUrl::fromLocalFile(file.filePath())); } } From b155830e4c2000718921a8adc3dfc8d075113ef7 Mon Sep 17 00:00:00 2001 From: Ovidiu Sabou Date: Tue, 3 Mar 2015 22:29:01 +0200 Subject: [PATCH 03/28] Move the identity settings tab into its own dedicated profile page Make the page directly accessible from the main screen by clicking the avatar or the username. Changing the avatar or the username are now possible only from the profile page --- qtox.pro | 4 +- src/mainwindow.ui | 9 +- .../identityform.cpp => profileform.cpp} | 138 ++++++++++++------ .../identityform.h => profileform.h} | 17 ++- src/widget/form/settings/identitysettings.ui | 74 +++++----- src/widget/form/settingswidget.cpp | 4 +- src/widget/form/settingswidget.h | 1 - src/widget/widget.cpp | 66 +++------ src/widget/widget.h | 5 +- 9 files changed, 174 insertions(+), 144 deletions(-) rename src/widget/form/{settings/identityform.cpp => profileform.cpp} (70%) rename src/widget/form/{settings/identityform.h => profileform.h} (85%) diff --git a/qtox.pro b/qtox.pro index afe4fa11d..8931e0856 100644 --- a/qtox.pro +++ b/qtox.pro @@ -315,10 +315,10 @@ contains(ENABLE_SYSTRAY_GTK_BACKEND, NO) { src/widget/form/settingswidget.h \ src/widget/form/settings/genericsettings.h \ src/widget/form/settings/generalform.h \ - src/widget/form/settings/identityform.h \ src/widget/form/settings/privacyform.h \ src/widget/form/settings/avform.h \ src/widget/form/filesform.h \ + src/widget/form/profileform.h \ src/widget/tool/chattextedit.h \ src/widget/tool/friendrequestdialog.h \ src/widget/friendwidget.h \ @@ -343,9 +343,9 @@ contains(ENABLE_SYSTRAY_GTK_BACKEND, NO) { src/widget/form/addfriendform.cpp \ src/widget/form/settingswidget.cpp \ src/widget/form/settings/generalform.cpp \ - src/widget/form/settings/identityform.cpp \ src/widget/form/settings/privacyform.cpp \ src/widget/form/settings/avform.cpp \ + src/widget/form/profileform.cpp \ src/widget/form/filesform.cpp \ src/widget/tool/chattextedit.cpp \ src/widget/tool/friendrequestdialog.cpp \ diff --git a/src/mainwindow.ui b/src/mainwindow.ui index f2f289e1b..a60fffd1f 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -855,6 +855,9 @@ QSplitter:handle{ true + + PointingHandCursor + Your name @@ -1037,8 +1040,8 @@ QSplitter:handle{ 0 0 - 284 - 399 + 285 + 381 @@ -1779,7 +1782,7 @@ QSplitter:handle{ 0 0 775 - 20 + 22 diff --git a/src/widget/form/settings/identityform.cpp b/src/widget/form/profileform.cpp similarity index 70% rename from src/widget/form/settings/identityform.cpp rename to src/widget/form/profileform.cpp index 9197f860e..c0d9357af 100644 --- a/src/widget/form/settings/identityform.cpp +++ b/src/widget/form/profileform.cpp @@ -15,9 +15,11 @@ */ #include "src/core.h" +#include "src/nexus.h" #include "ui_identitysettings.h" -#include "identityform.h" +#include "profileform.h" #include "src/widget/form/settingswidget.h" +#include "src/widget/maskablepixmapwidget.h" #include "src/misc/settings.h" #include "src/widget/croppinglabel.h" #include "src/widget/widget.h" @@ -26,13 +28,16 @@ #include "src/misc/style.h" #include #include +#include #include #include #include #include +#include -IdentityForm::IdentityForm() : - GenericForm(tr("Identity"), QPixmap(":/img/settings/identity.png")) + +ProfileForm::ProfileForm(QWidget *parent) : + QWidget(parent) { bodyUI = new Ui::IdentitySettings; bodyUI->setupUi(this); @@ -46,42 +51,50 @@ IdentityForm::IdentityForm() : bodyUI->toxGroup->layout()->addWidget(toxId); + profilePicture = new MaskablePixmapWidget(this, QSize(64, 64), ":/img/avatar_mask.png"); + profilePicture->setPixmap(QPixmap(":/img/contact_dark.png")); + profilePicture->setClickable(true); + connect(profilePicture, SIGNAL(clicked()), this, SLOT(onAvatarClicked())); + QHBoxLayout *publicGrouplayout = qobject_cast(bodyUI->publicGroup->layout()); + publicGrouplayout->insertWidget(0, profilePicture); + publicGrouplayout->insertSpacing(1, 7); + timer.setInterval(750); timer.setSingleShot(true); connect(&timer, &QTimer::timeout, this, [=]() {bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text().replace(" ✔", "")); hasCheck = false;}); connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked())); connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked())); - connect(core, &Core::idSet, this, &IdentityForm::setToxId); + connect(core, &Core::idSet, this, &ProfileForm::setToxId); connect(bodyUI->userName, SIGNAL(editingFinished()), this, SLOT(onUserNameEdited())); connect(bodyUI->statusMessage, SIGNAL(editingFinished()), this, SLOT(onStatusMessageEdited())); - connect(bodyUI->loadButton, &QPushButton::clicked, this, &IdentityForm::onLoadClicked); - connect(bodyUI->renameButton, &QPushButton::clicked, this, &IdentityForm::onRenameClicked); - connect(bodyUI->exportButton, &QPushButton::clicked, this, &IdentityForm::onExportClicked); - connect(bodyUI->deleteButton, &QPushButton::clicked, this, &IdentityForm::onDeleteClicked); - connect(bodyUI->importButton, &QPushButton::clicked, this, &IdentityForm::onImportClicked); - connect(bodyUI->newButton, &QPushButton::clicked, this, &IdentityForm::onNewClicked); + connect(bodyUI->loadButton, &QPushButton::clicked, this, &ProfileForm::onLoadClicked); + connect(bodyUI->renameButton, &QPushButton::clicked, this, &ProfileForm::onRenameClicked); + connect(bodyUI->exportButton, &QPushButton::clicked, this, &ProfileForm::onExportClicked); + connect(bodyUI->deleteButton, &QPushButton::clicked, this, &ProfileForm::onDeleteClicked); + connect(bodyUI->importButton, &QPushButton::clicked, this, &ProfileForm::onImportClicked); + connect(bodyUI->newButton, &QPushButton::clicked, this, &ProfileForm::onNewClicked); - connect(core, &Core::avStart, this, &IdentityForm::disableSwitching); - connect(core, &Core::avStarting, this, &IdentityForm::disableSwitching); - connect(core, &Core::avInvite, this, &IdentityForm::disableSwitching); - connect(core, &Core::avRinging, this, &IdentityForm::disableSwitching); - connect(core, &Core::avCancel, this, &IdentityForm::enableSwitching); - connect(core, &Core::avEnd, this, &IdentityForm::enableSwitching); - connect(core, &Core::avEnding, this, &IdentityForm::enableSwitching); - connect(core, &Core::avPeerTimeout, this, &IdentityForm::enableSwitching); - connect(core, &Core::avRequestTimeout, this, &IdentityForm::enableSwitching); + connect(core, &Core::avStart, this, &ProfileForm::disableSwitching); + connect(core, &Core::avStarting, this, &ProfileForm::disableSwitching); + connect(core, &Core::avInvite, this, &ProfileForm::disableSwitching); + connect(core, &Core::avRinging, this, &ProfileForm::disableSwitching); + connect(core, &Core::avCancel, this, &ProfileForm::enableSwitching); + connect(core, &Core::avEnd, this, &ProfileForm::enableSwitching); + connect(core, &Core::avEnding, this, &ProfileForm::enableSwitching); + connect(core, &Core::avPeerTimeout, this, &ProfileForm::enableSwitching); + connect(core, &Core::avRequestTimeout, this, &ProfileForm::enableSwitching); connect(core, &Core::usernameSet, this, [=](const QString& val) { bodyUI->userName->setText(val); }); connect(core, &Core::statusMessageSet, this, [=](const QString& val) { bodyUI->statusMessage->setText(val); }); } -IdentityForm::~IdentityForm() +ProfileForm::~ProfileForm() { delete bodyUI; } -void IdentityForm::copyIdClicked() +void ProfileForm::copyIdClicked() { toxId->selectAll(); QString txt = toxId->text(); @@ -97,38 +110,75 @@ void IdentityForm::copyIdClicked() timer.start(); } -void IdentityForm::onUserNameEdited() +void ProfileForm::onUserNameEdited() { Core::getInstance()->setUsername(bodyUI->userName->text()); } -void IdentityForm::onStatusMessageEdited() +void ProfileForm::onStatusMessageEdited() { Core::getInstance()->setStatusMessage(bodyUI->statusMessage->text()); } -void IdentityForm::present() +void ProfileForm::onSelfAvatarLoaded(const QPixmap& pic) { - toxId->setText(Core::getInstance()->getSelfId().toString()); - toxId->setCursorPosition(0); - bodyUI->profiles->clear(); - for (QString profile : Settings::getInstance().searchProfiles()) - bodyUI->profiles->addItem(profile); - QString current = Settings::getInstance().getCurrentProfile(); - if (current != "") - bodyUI->profiles->setCurrentText(current); - - bodyUI->userName->setText(Core::getInstance()->getUsername()); - bodyUI->statusMessage->setText(Core::getInstance()->getStatusMessage()); + profilePicture->setPixmap(pic); } -void IdentityForm::setToxId(const QString& id) +void ProfileForm::setToxId(const QString& id) { toxId->setText(id); toxId->setCursorPosition(0); } -void IdentityForm::onLoadClicked() +void ProfileForm::onAvatarClicked() +{ + QString filename = QFileDialog::getOpenFileName(this, + tr("Choose a profile picture"), + QDir::homePath(), + Nexus::getSupportedImageFilter()); + if (filename.isEmpty()) + return; + QFile file(filename); + file.open(QIODevice::ReadOnly); + if (!file.isOpen()) + { + QMessageBox::critical(this, tr("Error"), tr("Unable to open this file")); + return; + } + + QPixmap pic; + if (!pic.loadFromData(file.readAll())) + { + QMessageBox::critical(this, tr("Error"), tr("Unable to read this image")); + return; + } + + QByteArray bytes; + QBuffer buffer(&bytes); + buffer.open(QIODevice::WriteOnly); + pic.save(&buffer, "PNG"); + buffer.close(); + + if (bytes.size() >= TOX_AVATAR_MAX_DATA_LENGTH) + { + pic = pic.scaled(64,64, Qt::KeepAspectRatio, Qt::SmoothTransformation); + bytes.clear(); + buffer.open(QIODevice::WriteOnly); + pic.save(&buffer, "PNG"); + buffer.close(); + } + + if (bytes.size() >= TOX_AVATAR_MAX_DATA_LENGTH) + { + QMessageBox::critical(this, tr("Error"), tr("This image is too big")); + return; + } + + Nexus::getCore()->setAvatar(TOX_AVATAR_FORMAT_PNG, bytes); +} + +void ProfileForm::onLoadClicked() { if (bodyUI->profiles->currentText() != Settings::getInstance().getCurrentProfile()) { @@ -141,7 +191,7 @@ void IdentityForm::onLoadClicked() } } -void IdentityForm::onRenameClicked() +void ProfileForm::onRenameClicked() { QString cur = bodyUI->profiles->currentText(); QString title = tr("Rename \"%1\"", "renaming a profile").arg(cur); @@ -169,7 +219,7 @@ void IdentityForm::onRenameClicked() } while (true); } -void IdentityForm::onExportClicked() +void ProfileForm::onExportClicked() { QString current = bodyUI->profiles->currentText() + Core::TOX_EXT; QString path = QFileDialog::getSaveFileName(this, tr("Export profile", "save dialog title"), @@ -194,7 +244,7 @@ void IdentityForm::onExportClicked() } } -void IdentityForm::onDeleteClicked() +void ProfileForm::onDeleteClicked() { if (Settings::getInstance().getCurrentProfile() == bodyUI->profiles->currentText()) { @@ -219,7 +269,7 @@ void IdentityForm::onDeleteClicked() } } -void IdentityForm::onImportClicked() +void ProfileForm::onImportClicked() { QString path = QFileDialog::getOpenFileName(this, tr("Import profile", "import dialog title"), @@ -249,18 +299,18 @@ void IdentityForm::onImportClicked() bodyUI->profiles->addItem(profile); } -void IdentityForm::onNewClicked() +void ProfileForm::onNewClicked() { emit Widget::getInstance()->changeProfile(QString()); } -void IdentityForm::disableSwitching() +void ProfileForm::disableSwitching() { bodyUI->loadButton->setEnabled(false); bodyUI->newButton->setEnabled(false); } -void IdentityForm::enableSwitching() +void ProfileForm::enableSwitching() { if (!core->anyActiveCalls()) { diff --git a/src/widget/form/settings/identityform.h b/src/widget/form/profileform.h similarity index 85% rename from src/widget/form/settings/identityform.h rename to src/widget/form/profileform.h index fb2da7839..796341e36 100644 --- a/src/widget/form/settings/identityform.h +++ b/src/widget/form/profileform.h @@ -17,15 +17,13 @@ #ifndef IDENTITYFORM_H #define IDENTITYFORM_H -#include "genericsettings.h" -#include -#include #include #include #include class CroppingLabel; class Core; +class MaskablePixmapWidget; namespace Ui { class IdentitySettings; @@ -42,22 +40,24 @@ protected: void mouseReleaseEvent(QMouseEvent*) {emit clicked();} }; -class IdentityForm : public GenericForm +class ProfileForm : public QWidget { Q_OBJECT public: - IdentityForm(); - ~IdentityForm(); - - virtual void present(); + ProfileForm(QWidget *parent = nullptr); + ~ProfileForm(); signals: void userNameChanged(QString); void statusMessageChanged(QString); +public slots: + void onSelfAvatarLoaded(const QPixmap &pic); + private slots: void setToxId(const QString& id); void copyIdClicked(); + void onAvatarClicked(); void onUserNameEdited(); void onStatusMessageEdited(); void onLoadClicked(); @@ -71,6 +71,7 @@ private slots: private: Ui::IdentitySettings* bodyUI; + MaskablePixmapWidget* profilePicture; Core* core; QTimer timer; bool hasCheck = false; diff --git a/src/widget/form/settings/identitysettings.ui b/src/widget/form/settings/identitysettings.ui index c2d85d082..58633511a 100644 --- a/src/widget/form/settings/identitysettings.ui +++ b/src/widget/form/settings/identitysettings.ui @@ -47,44 +47,48 @@ 9 - + Public Information - + - - - Name - - - - - - - - - - Status - - - - - + + + + + Name + + + + + + + + + + Status + + + + + + + - - Tox ID - This bunch of characters tells other Tox clients how to contact you. Share it with your friends to communicate. + + Tox ID + @@ -113,15 +117,15 @@ Share it with your friends to communicate. - - Currently selected profile. - 0 0 + + Currently selected profile. + @@ -140,23 +144,23 @@ Share it with your friends to communicate. - - Rename - Rename selected profile. + + Rename + - - Export - Allows you to export your Tox profile to a file. Profile does not contain your history. + + Export + @@ -175,12 +179,12 @@ Profile does not contain your history. - - Import a profile - Import Tox profile from a .tox file. + + Import a profile + diff --git a/src/widget/form/settingswidget.cpp b/src/widget/form/settingswidget.cpp index ad4a95091..4226bfb78 100644 --- a/src/widget/form/settingswidget.cpp +++ b/src/widget/form/settingswidget.cpp @@ -19,7 +19,6 @@ #include "ui_mainwindow.h" #include "src/video/camera.h" #include "src/widget/form/settings/generalform.h" -#include "src/widget/form/settings/identityform.h" #include "src/widget/form/settings/privacyform.h" #include "src/widget/form/settings/avform.h" #include "src/widget/form/settings/advancedform.h" @@ -52,12 +51,11 @@ SettingsWidget::SettingsWidget(QWidget* parent) bodyLayout->addWidget(settingsWidgets); GeneralForm* gfrm = new GeneralForm(this); - IdentityForm* ifrm = new IdentityForm; PrivacyForm* pfrm = new PrivacyForm; AVForm* avfrm = new AVForm; AdvancedForm *expfrm = new AdvancedForm; - GenericForm* cfgForms[] = { gfrm, ifrm, pfrm, avfrm, expfrm }; + GenericForm* cfgForms[] = { gfrm, pfrm, avfrm, expfrm }; for (GenericForm* cfgForm : cfgForms) settingsWidgets->addTab(cfgForm, cfgForm->getFormIcon(), cfgForm->getFormName()); diff --git a/src/widget/form/settingswidget.h b/src/widget/form/settingswidget.h index 0449e16cf..1cdafabbe 100644 --- a/src/widget/form/settingswidget.h +++ b/src/widget/form/settingswidget.h @@ -24,7 +24,6 @@ class Camera; class GenericForm; class GeneralForm; -class IdentityForm; class PrivacyForm; class AVForm; class QLabel; diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index e7aadbeb2..bc4c42975 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -49,8 +49,6 @@ #include #include #include -#include -#include #include #include #include @@ -189,7 +187,6 @@ void Widget::init() ui->friendList->setWidget(contactListWidget); ui->friendList->setLayoutDirection(Qt::RightToLeft); - ui->nameLabel->setEditable(true); ui->statusLabel->setEditable(true); ui->statusPanel->setStyleSheet(Style::getStylesheet(":/ui/window/statusPanel.css")); @@ -215,17 +212,19 @@ void Widget::init() filesForm = new FilesForm(); addFriendForm = new AddFriendForm; + profileForm = new ProfileForm(); settingsWidget = new SettingsWidget(); Core* core = Nexus::getCore(); connect(core, SIGNAL(fileDownloadFinished(const QString&)), filesForm, SLOT(onFileDownloadComplete(const QString&))); connect(core, SIGNAL(fileUploadFinished(const QString&)), filesForm, SLOT(onFileUploadComplete(const QString&))); connect(settingsWidget, &SettingsWidget::setShowSystemTray, this, &Widget::onSetShowSystemTray); + connect(core, SIGNAL(selfAvatarChanged(QPixmap)), profileForm, SLOT(onSelfAvatarLoaded(QPixmap))); connect(ui->addButton, SIGNAL(clicked()), this, SLOT(onAddClicked())); connect(ui->groupButton, SIGNAL(clicked()), this, SLOT(onGroupClicked())); connect(ui->transferButton, SIGNAL(clicked()), this, SLOT(onTransferClicked())); connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(onSettingsClicked())); - connect(ui->nameLabel, SIGNAL(textChanged(QString, QString)), this, SLOT(onUsernameChanged(QString, QString))); + connect(ui->nameLabel, SIGNAL(clicked()), this, SLOT(onUsernameClicked())); connect(ui->statusLabel, SIGNAL(textChanged(QString, QString)), this, SLOT(onStatusMessageChanged(QString, QString))); connect(ui->mainSplitter, &QSplitter::splitterMoved, this, &Widget::onSplitterMoved); connect(profilePicture, SIGNAL(clicked()), this, SLOT(onAvatarClicked())); @@ -283,6 +282,7 @@ Widget::~Widget() AutoUpdater::abortUpdates(); icon->hide(); hideMainForms(); + delete profileForm; delete settingsWidget; delete addFriendForm; delete filesForm; @@ -348,49 +348,7 @@ QString Widget::getUsername() void Widget::onAvatarClicked() { - QString filename = QFileDialog::getOpenFileName(this, - tr("Choose a profile picture"), - QDir::homePath(), - Nexus::getSupportedImageFilter()); - if (filename.isEmpty()) - return; - QFile file(filename); - file.open(QIODevice::ReadOnly); - if (!file.isOpen()) - { - QMessageBox::critical(this, tr("Error"), tr("Unable to open this file")); - return; - } - - QPixmap pic; - if (!pic.loadFromData(file.readAll())) - { - QMessageBox::critical(this, tr("Error"), tr("Unable to read this image")); - return; - } - - QByteArray bytes; - QBuffer buffer(&bytes); - buffer.open(QIODevice::WriteOnly); - pic.save(&buffer, "PNG"); - buffer.close(); - - if (bytes.size() >= TOX_AVATAR_MAX_DATA_LENGTH) - { - pic = pic.scaled(64,64, Qt::KeepAspectRatio, Qt::SmoothTransformation); - bytes.clear(); - buffer.open(QIODevice::WriteOnly); - pic.save(&buffer, "PNG"); - buffer.close(); - } - - if (bytes.size() >= TOX_AVATAR_MAX_DATA_LENGTH) - { - QMessageBox::critical(this, tr("Error"), tr("This image is too big")); - return; - } - - Nexus::getCore()->setAvatar(TOX_AVATAR_FORMAT_PNG, bytes); + showProfile(); } void Widget::onSelfAvatarLoaded(const QPixmap& pic) @@ -588,6 +546,20 @@ void Widget::onUsernameChanged(const QString& newUsername, const QString& oldUse Nexus::getCore()->setUsername(newUsername); } +void Widget::showProfile() +{ + hideMainForms(); + ui->mainContent->layout()->addWidget(profileForm); + profileForm->show(); + setWindowTitle(tr("Profile")); + activeChatroomWidget = nullptr; +} + +void Widget::onUsernameClicked() +{ + showProfile(); +} + void Widget::setUsername(const QString& username) { ui->nameLabel->setText(username); diff --git a/src/widget/widget.h b/src/widget/widget.h index 30310cc13..4ca46738d 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -23,7 +23,7 @@ #include #include "form/addfriendform.h" #include "form/settingswidget.h" -#include "form/settings/identityform.h" +#include "form/profileform.h" #include "form/filesform.h" #include "src/corestructs.h" @@ -77,6 +77,7 @@ public: void reloadTheme(); + void showProfile(); public slots: void onSettingsClicked(); void setWindowTitle(const QString& title); @@ -120,6 +121,7 @@ private slots: void onGroupClicked(); void onTransferClicked(); void onAvatarClicked(); + void onUsernameClicked(); void onUsernameChanged(const QString& newUsername, const QString& oldUsername); void onStatusMessageChanged(const QString& newStatusMessage, const QString& oldStatusMessage); void onChatroomWidgetClicked(GenericChatroomWidget *); @@ -157,6 +159,7 @@ private: QSplitter *centralLayout; QPoint dragPosition; AddFriendForm* addFriendForm; + ProfileForm* profileForm; SettingsWidget* settingsWidget; FilesForm* filesForm; static Widget* instance; From 75f5901aec3bd5c025d124a84456f85d8fe32fbb Mon Sep 17 00:00:00 2001 From: Ovidiu Sabou Date: Wed, 4 Mar 2015 00:04:16 +0200 Subject: [PATCH 04/28] Refresh the available profiles when the profile page is shown. Fix regression for #1012 I carelessly removed perfectly good code from the present() method and this commit brings that back --- src/widget/form/profileform.cpp | 16 ++++++++++++++++ src/widget/form/profileform.h | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index c0d9357af..9084a23c3 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -36,6 +36,16 @@ #include +void ProfileForm::refreshProfiles() +{ + bodyUI->profiles->clear(); + for (QString profile : Settings::getInstance().searchProfiles()) + bodyUI->profiles->addItem(profile); + QString current = Settings::getInstance().getCurrentProfile(); + if (current != "") + bodyUI->profiles->setCurrentText(current); +} + ProfileForm::ProfileForm(QWidget *parent) : QWidget(parent) { @@ -318,3 +328,9 @@ void ProfileForm::enableSwitching() bodyUI->newButton->setEnabled(true); } } + +void ProfileForm::showEvent(QShowEvent *event) +{ + refreshProfiles(); + QWidget::showEvent(event); +} diff --git a/src/widget/form/profileform.h b/src/widget/form/profileform.h index 796341e36..daca69c20 100644 --- a/src/widget/form/profileform.h +++ b/src/widget/form/profileform.h @@ -69,7 +69,11 @@ private slots: void disableSwitching(); void enableSwitching(); +protected: + virtual void showEvent(QShowEvent *); + private: + void refreshProfiles(); Ui::IdentitySettings* bodyUI; MaskablePixmapWidget* profilePicture; Core* core; From c3dd28586430a026c8f6ddfdf76a089454ff7e3f Mon Sep 17 00:00:00 2001 From: Ovidiu Sabou Date: Wed, 4 Mar 2015 21:35:34 +0200 Subject: [PATCH 05/28] Set a header to be consistent and to have the profile page remain open when switching profiles --- src/widget/form/profileform.cpp | 17 +++++++++++++++++ src/widget/form/profileform.h | 6 ++++++ src/widget/widget.cpp | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 9084a23c3..6159f71b2 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -18,6 +18,7 @@ #include "src/nexus.h" #include "ui_identitysettings.h" #include "profileform.h" +#include "ui_mainwindow.h" #include "src/widget/form/settingswidget.h" #include "src/widget/maskablepixmapwidget.h" #include "src/misc/settings.h" @@ -53,6 +54,14 @@ ProfileForm::ProfileForm(QWidget *parent) : bodyUI->setupUi(this); core = Core::getInstance(); + head = new QWidget(); + QFont bold; + bold.setBold(true); + head->setLayout(&headLayout); + headLabel.setText(tr("User Profile")); + headLabel.setFont(bold); + headLayout.addWidget(&headLabel); + // tox toxId = new ClickableTE(); toxId->setReadOnly(true); @@ -102,6 +111,14 @@ ProfileForm::ProfileForm(QWidget *parent) : ProfileForm::~ProfileForm() { delete bodyUI; + delete head; +} + +void ProfileForm::show(Ui::MainWindow &ui) +{ + ui.mainHead->layout()->addWidget(head); + head->show(); + QWidget::show(); } void ProfileForm::copyIdClicked() diff --git a/src/widget/form/profileform.h b/src/widget/form/profileform.h index daca69c20..c9daadf23 100644 --- a/src/widget/form/profileform.h +++ b/src/widget/form/profileform.h @@ -20,6 +20,7 @@ #include #include #include +#include class CroppingLabel; class Core; @@ -27,6 +28,7 @@ class MaskablePixmapWidget; namespace Ui { class IdentitySettings; +class MainWindow; } class ClickableTE : public QLineEdit @@ -46,6 +48,7 @@ class ProfileForm : public QWidget public: ProfileForm(QWidget *parent = nullptr); ~ProfileForm(); + void show(Ui::MainWindow &ui); signals: void userNameChanged(QString); @@ -76,6 +79,9 @@ private: void refreshProfiles(); Ui::IdentitySettings* bodyUI; MaskablePixmapWidget* profilePicture; + QWidget *head; + QLabel headLabel; + QVBoxLayout headLayout; Core* core; QTimer timer; bool hasCheck = false; diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index bc4c42975..3f4334143 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -550,7 +550,7 @@ void Widget::showProfile() { hideMainForms(); ui->mainContent->layout()->addWidget(profileForm); - profileForm->show(); + profileForm->show(*ui); setWindowTitle(tr("Profile")); activeChatroomWidget = nullptr; } From e8465c73dd196974eba98056ff08d4808cfb3ff2 Mon Sep 17 00:00:00 2001 From: Ovidiu Sabou Date: Thu, 5 Mar 2015 20:09:58 +0200 Subject: [PATCH 06/28] Fix a crash bug when closing the application --- src/widget/form/profileform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 6159f71b2..1460e7fce 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -111,7 +111,7 @@ ProfileForm::ProfileForm(QWidget *parent) : ProfileForm::~ProfileForm() { delete bodyUI; - delete head; + head->deleteLater(); } void ProfileForm::show(Ui::MainWindow &ui) From 1444b851a2857e83d134216bdd45ec183166934a Mon Sep 17 00:00:00 2001 From: Ovidiu Sabou Date: Thu, 5 Mar 2015 20:35:19 +0200 Subject: [PATCH 07/28] Refresh the profile list when the new id is available in the core The status set signal (when getting online) seems to correspond with the availability of the new profile in the list --- src/widget/form/profileform.cpp | 6 ++++++ src/widget/form/profileform.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 1460e7fce..e37e3149c 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -85,6 +85,7 @@ ProfileForm::ProfileForm(QWidget *parent) : connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked())); connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked())); connect(core, &Core::idSet, this, &ProfileForm::setToxId); + connect(core, &Core::statusSet, this, &ProfileForm::onStatusSet); connect(bodyUI->userName, SIGNAL(editingFinished()), this, SLOT(onUserNameEdited())); connect(bodyUI->statusMessage, SIGNAL(editingFinished()), this, SLOT(onStatusMessageEdited())); connect(bodyUI->loadButton, &QPushButton::clicked, this, &ProfileForm::onLoadClicked); @@ -326,6 +327,11 @@ void ProfileForm::onImportClicked() bodyUI->profiles->addItem(profile); } +void ProfileForm::onStatusSet(Status status) +{ + refreshProfiles(); +} + void ProfileForm::onNewClicked() { emit Widget::getInstance()->changeProfile(QString()); diff --git a/src/widget/form/profileform.h b/src/widget/form/profileform.h index c9daadf23..b8d0e91ad 100644 --- a/src/widget/form/profileform.h +++ b/src/widget/form/profileform.h @@ -21,6 +21,7 @@ #include #include #include +#include "src/core.h" class CroppingLabel; class Core; @@ -56,6 +57,7 @@ signals: public slots: void onSelfAvatarLoaded(const QPixmap &pic); + void onStatusSet(Status status); private slots: void setToxId(const QString& id); From 69678c011be89e34ba3e4ef0cf208856ad39ac4a Mon Sep 17 00:00:00 2001 From: Ovidiu Sabou Date: Thu, 5 Mar 2015 20:39:26 +0200 Subject: [PATCH 08/28] Silence warning --- src/widget/form/profileform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index e37e3149c..906d52855 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -327,7 +327,7 @@ void ProfileForm::onImportClicked() bodyUI->profiles->addItem(profile); } -void ProfileForm::onStatusSet(Status status) +void ProfileForm::onStatusSet(Status) { refreshProfiles(); } From 38f5c4f2dcd8ca21041e3bab2a26084aa0984d1c Mon Sep 17 00:00:00 2001 From: kushagra Date: Sun, 8 Mar 2015 22:30:57 +0530 Subject: [PATCH 09/28] solves issue 1309 --- src/widget/form/groupchatform.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index d00f671ee..3efa71f2a 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -98,6 +98,7 @@ void GroupChatForm::onSendTriggered() if (msg.isEmpty()) return; + msgEdit->setLastMessage(msg); msgEdit->clear(); if (msg.startsWith("/me ")) From b659612bd46033380ae12e79ecef9bb5167bbbdb Mon Sep 17 00:00:00 2001 From: TheLastProject Date: Sun, 8 Mar 2015 21:01:34 +0100 Subject: [PATCH 10/28] Use QImage scaling and base64 encoding for sharper previews --- src/chatlog/content/filetransferwidget.cpp | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/chatlog/content/filetransferwidget.cpp b/src/chatlog/content/filetransferwidget.cpp index ed2e7b9f9..476893cae 100644 --- a/src/chatlog/content/filetransferwidget.cpp +++ b/src/chatlog/content/filetransferwidget.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -451,22 +452,13 @@ void FileTransferWidget::showPreview(const QString &filename) ui->previewLabel->setPixmap(pmap); ui->previewLabel->show(); - // Show preview, but make sure it's not larger than 50% of the screen width/height - QRect maxSize = QApplication::desktop()->screenGeometry(); - maxSize.setWidth(0.5*maxSize.width()); - maxSize.setHeight(0.5*maxSize.height()); - - QImage image = QImage(filename); - QSize imageSize(image.width(), image.height()); - if (imageSize.width() > maxSize.width() || imageSize.height() > maxSize.height()) - { - imageSize.scale(maxSize.width(), maxSize.height(), Qt::KeepAspectRatio); - ui->previewLabel->setToolTip(""); - } - else - { - ui->previewLabel->setToolTip(""); - } + // Show mouseover preview, but make sure it's not larger than 50% of the screen width/height + QRect desktopSize = QApplication::desktop()->screenGeometry(); + QImage image = QImage(filename).scaled(0.5*desktopSize.width(), 0.5*desktopSize.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + QByteArray imageData; + QBuffer buffer(&imageData); + image.save(&buffer, "PNG"); + ui->previewLabel->setToolTip(""); } } From 03329d81714dcb526ab837e80d953dce4ccada8d Mon Sep 17 00:00:00 2001 From: Shane McKee Date: Fri, 6 Mar 2015 03:01:12 -0800 Subject: [PATCH 11/28] Issue #1119 fixed OS X fullscreen bug --- src/widget/form/chatform.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index bd5047d24..7a74391e5 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -387,7 +387,6 @@ void ChatForm::onAvEnd(int FriendId, int) enableCallButtons(); stopCounter(); - netcam->hide(); } @@ -562,6 +561,12 @@ void ChatForm::onAnswerCallTriggered() void ChatForm::onHangupCallTriggered() { qDebug() << "onHangupCallTriggered"; + + //Fixes an OS X bug with ending a call while in full screen + if(netcam->isFullScreen()) + { + netcam->showNormal(); + } audioInputFlag = false; audioOutputFlag = false; From fb63232318c20fee03fac9836671e075cddd40c9 Mon Sep 17 00:00:00 2001 From: Dubslow Date: Tue, 10 Mar 2015 21:01:13 -0500 Subject: [PATCH 12/28] Tidying new profile form Fixing up Widget code for simplicity and consistency, add picture to form heading --- src/widget/form/profileform.cpp | 20 +++++++++++++++----- src/widget/form/profileform.h | 2 -- src/widget/widget.cpp | 31 ++++++++++--------------------- src/widget/widget.h | 4 +--- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 906d52855..631ec6212 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -54,13 +54,22 @@ ProfileForm::ProfileForm(QWidget *parent) : bodyUI->setupUi(this); core = Core::getInstance(); - head = new QWidget(); + head = new QWidget(this); + QHBoxLayout* headLayout = new QHBoxLayout(); + head->setLayout(headLayout); + + QLabel* imgLabel = new QLabel(); + headLayout->addWidget(imgLabel); + + QLabel* nameLabel = new QLabel(); QFont bold; bold.setBold(true); - head->setLayout(&headLayout); - headLabel.setText(tr("User Profile")); - headLabel.setFont(bold); - headLayout.addWidget(&headLabel); + nameLabel->setFont(bold); + headLayout->addWidget(nameLabel); + headLayout->addStretch(1); + + nameLabel->setText(tr("User Profile")); + imgLabel->setPixmap(QPixmap(":/img/settings/identity.png").scaledToHeight(40, Qt::SmoothTransformation)); // tox toxId = new ClickableTE(); @@ -118,6 +127,7 @@ ProfileForm::~ProfileForm() void ProfileForm::show(Ui::MainWindow &ui) { ui.mainHead->layout()->addWidget(head); + ui.mainContent->layout()->addWidget(this); head->show(); QWidget::show(); } diff --git a/src/widget/form/profileform.h b/src/widget/form/profileform.h index b8d0e91ad..830e486db 100644 --- a/src/widget/form/profileform.h +++ b/src/widget/form/profileform.h @@ -82,8 +82,6 @@ private: Ui::IdentitySettings* bodyUI; MaskablePixmapWidget* profilePicture; QWidget *head; - QLabel headLabel; - QVBoxLayout headLayout; Core* core; QTimer timer; bool hasCheck = false; diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index e8dcf8529..a3d08b981 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -184,10 +184,10 @@ void Widget::init() connect(ui->groupButton, SIGNAL(clicked()), this, SLOT(onGroupClicked())); connect(ui->transferButton, SIGNAL(clicked()), this, SLOT(onTransferClicked())); connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(onSettingsClicked())); - connect(ui->nameLabel, SIGNAL(clicked()), this, SLOT(onUsernameClicked())); + connect(profilePicture, &MaskablePixmapWidget::clicked, this, &Widget::showProfile); + connect(ui->nameLabel, &CroppingLabel::clicked, this, &Widget::showProfile); connect(ui->statusLabel, SIGNAL(textChanged(QString, QString)), this, SLOT(onStatusMessageChanged(QString, QString))); connect(ui->mainSplitter, &QSplitter::splitterMoved, this, &Widget::onSplitterMoved); - connect(profilePicture, SIGNAL(clicked()), this, SLOT(onAvatarClicked())); connect(addFriendForm, SIGNAL(friendRequested(QString, QString)), this, SIGNAL(friendRequested(QString, QString))); connect(timer, &QTimer::timeout, this, &Widget::onUserAwayCheck); connect(timer, &QTimer::timeout, this, &Widget::onEventIconTick); @@ -310,11 +310,6 @@ QString Widget::getUsername() return Nexus::getCore()->getUsername(); } -void Widget::onAvatarClicked() -{ - showProfile(); -} - void Widget::onSelfAvatarLoaded(const QPixmap& pic) { profilePicture->setPixmap(pic); @@ -490,6 +485,14 @@ void Widget::onSettingsClicked() activeChatroomWidget = nullptr; } +void Widget::showProfile() // onAvatarClicked, onUsernameClicked +{ + hideMainForms(); + profileForm->show(*ui); + setWindowTitle(tr("Profile")); + activeChatroomWidget = nullptr; +} + void Widget::hideMainForms() { QLayoutItem* item; @@ -510,20 +513,6 @@ void Widget::onUsernameChanged(const QString& newUsername, const QString& oldUse Nexus::getCore()->setUsername(newUsername); } -void Widget::showProfile() -{ - hideMainForms(); - ui->mainContent->layout()->addWidget(profileForm); - profileForm->show(*ui); - setWindowTitle(tr("Profile")); - activeChatroomWidget = nullptr; -} - -void Widget::onUsernameClicked() -{ - showProfile(); -} - void Widget::setUsername(const QString& username) { ui->nameLabel->setText(username); diff --git a/src/widget/widget.h b/src/widget/widget.h index f8a00d714..e019b0915 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -77,7 +77,6 @@ public: void reloadTheme(); - void showProfile(); public slots: void onSettingsClicked(); void setWindowTitle(const QString& title); @@ -122,8 +121,7 @@ private slots: void onAddClicked(); void onGroupClicked(); void onTransferClicked(); - void onAvatarClicked(); - void onUsernameClicked(); + void showProfile(); void onUsernameChanged(const QString& newUsername, const QString& oldUsername); void onStatusMessageChanged(const QString& newStatusMessage, const QString& oldStatusMessage); void onChatroomWidgetClicked(GenericChatroomWidget *); From 4920f2a2d47734acfaf96082eeb4bde41fd6a168 Mon Sep 17 00:00:00 2001 From: Flakebi Date: Wed, 11 Mar 2015 03:20:36 +0100 Subject: [PATCH 13/28] Allow writing messages in a lonely groupchat --- src/widget/form/groupchatform.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 3efa71f2a..324f41dd8 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -101,12 +101,22 @@ void GroupChatForm::onSendTriggered() msgEdit->setLastMessage(msg); msgEdit->clear(); - if (msg.startsWith("/me ")) + bool isAction = msg.startsWith("/me "); + + if (group->getPeersCount() != 1) { - msg = msg.right(msg.length() - 4); - emit sendAction(group->getGroupId(), msg); - } else { - emit sendMessage(group->getGroupId(), msg); + if (isAction) + { + msg = msg.right(msg.length() - 4); + emit sendAction(group->getGroupId(), msg); + } + else + emit sendMessage(group->getGroupId(), msg); + } + else + { + QDateTime timestamp = QDateTime::currentDateTime(); + addSelfMessage(msg, isAction, timestamp, true); } } From 76ede245013d87895475e38ff0d4072950f6e907 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 11 Mar 2015 10:01:18 +0100 Subject: [PATCH 14/28] Italian translation: update --- translations/it.ts | 529 +++++++++++++++++++++++---------------------- 1 file changed, 267 insertions(+), 262 deletions(-) diff --git a/translations/it.ts b/translations/it.ts index 5abd10ec5..8486a4f7f 100644 --- a/translations/it.ts +++ b/translations/it.ts @@ -288,80 +288,80 @@ Ignorare le impostazioni del proxy e connettersi direttamente alla rete Tox? ChatForm - + Load chat history... Carica cronologia chat... - + Send a file Invia un file - - + + File not read Impossibile leggere il file - - + + qTox wasn't able to open %1 qTox non è riuscito ad aprire %1 - - + + Bad Idea Pessima idea - - + + You're trying to send a special (sequential) file, that's not going to work! Stai cercando di inviare un file speciale (sequenziale), questo non funzionerà! - + Accept video call Accetta videochiamata - + Accept audio call Accetta chiamata - + %1 calling %1 ti sta chiamando - + End video call Termina videochiamata - + End audio call Termina chiamata - - + + Mute microphone Disattiva microfono - - + + Mute call Disattiva audio - + %1 stopped calling %1 ha fermato la chiamata @@ -381,37 +381,37 @@ Ignorare le impostazioni del proxy e connettersi direttamente alla rete Tox?Stai chiamando %1 - + Start audio call Avvia chiamata - + Start video call Avvia videochiamata - + Unmute microphone Attiva microfono - + Unmute call Attiva audio - + Failed to send file "%1" Invio del file "%1" fallito - + Call with %1 ended. %2 Chiamata con %1 terminata. %2 - + Call duration: Durata chiamata: @@ -590,37 +590,37 @@ Disabilitando la cronologia delle chat lascerà la cronologia criptata intatta ( [anteprima] - + Waiting to send... file transfer widget In attesa di inviare... - + Accept to receive this file file transfer widget Accetta la ricezione di questo file - + Location not writable Title of permissions popup Errore - + You do not have permission to write that location. Choose another, or cancel the save dialog. text of permissions popup Non hai sufficienti permessi per scrivere in questa locazione. Scegli un'altra posizione, o annulla il salvataggio. - + paused file transfer widget in pausa - + Save a file Title of the file saving dialog Salva file @@ -684,47 +684,47 @@ Disabilitando la cronologia delle chat lascerà la cronologia criptata intatta ( FriendWidget - + Copy friend ID Menu to copy the Tox ID of that friend Copia Tox ID del contatto - + Auto accept files from this friend context menu entry Accetta automaticamente i files inviati da questo contatto - + Invite to group Menu to invite a friend to a groupchat Invita nel gruppo - + Set alias... Imposta soprannome... - + Remove friend Menu to remove the friend from our friendlist Rimuovi contatto - + Choose an auto accept directory popup title Scegli dove salvare i files accettati automaticamente - + User alias Rinomina contatto - + You can also set this by clicking the chat form name. Alias: Per impostare un soprannome puoi anche cliccare sul nome direttamente dalla chat. @@ -1117,7 +1117,7 @@ will be sent to them when they will appear online to you. - + Save chat log Salva il log della chat @@ -1127,12 +1127,12 @@ will be sent to them when they will appear online to you. Rimuovi messaggi visualizzati - + Not sent Non inviato - + Cleared Pulito @@ -1146,39 +1146,39 @@ will be sent to them when they will appear online to you. %1 utenti in chat - + %1 users in chat %1 utenti in chat - - + + Mute microphone Disattiva microfono - + Unmute microphone Attiva microfono - - + + Mute call Disattiva audio - + Unmute call Attiva audio - + End audio call Termina chiamata - + Start audio call Avvia chiamata @@ -1221,136 +1221,6 @@ Title: Nome gruppo: - - IdentityForm - - - Identity - Identità - - - - Call active - popup title - Chiamata in corso - - - - You can't switch profiles while a call is active! - popup text - Non puoi cambiare profilo durante una chiamata! - - - - Rename "%1" - renaming a profile - Rinomina "%1" - - - - Profile already exists - rename confirm title - Profilo già esistente - - - - A profile named "%1" already exists. Do you want to erase it? - rename confirm text - Un profilo chiamato "%1" esiste già. Vuoi sovrascriverlo? - - - - Export profile - save dialog title - Esporta profilo - - - - Tox save file (*.tox) - save dialog filter - Tox save file (*.tox) - - - - Failed to remove file - Impossibile rimuovere il file - - - - The file you chose to overwrite could not be removed first. - Il file che hai scelto di sovrascrivere non può essere prima rimosso. - - - - Failed to copy file - Impossibile copiare il file - - - - The file you chose could not be written to. - Il file che hai scelto non può essere copiato. - - - - Profile currently loaded - current profile deletion warning title - Profilo attualmente in uso - - - - This profile is currently in use. Please load a different profile before deleting this one. - current profile deletion warning text - Questo profilo è attualmente in uso. Per favore carica un profilo differente prima di eliminare questo. - - - - Deletion imminent! - deletion confirmation title - Eliminazione imminente! - - - - Are you sure you want to delete this profile? - deletion confirmation text - Sei sicuro di voler eliminare questo profilo? - - - - Import profile - import dialog title - Importa profilo - - - - Tox save file (*.tox) - import dialog filter - Tox save file (*.tox) - - - - Ignoring non-Tox file - popup title - File ignorato - - - - Warning: you've chosen a file that is not a Tox save file; ignoring. - popup text - Attenzione: hai scelto un file che non contiente un profilo Tox.\nQuesto file verrà ignorato. - - - - Profile already exists - import confirm title - Profilo già esistente - - - - A profile named "%1" already exists. Do you want to erase it? - import confirm text - Un profilo chiamato "%1" esiste già. Vuoi sovrascriverlo? - - IdentitySettings @@ -1359,22 +1229,22 @@ Nome gruppo: Informazioni Pubbliche - + Name Nome - + Status Stato - + Tox ID Tox ID - + This bunch of characters tells other Tox clients how to contact you. Share it with your friends to communicate. Tox ID tooltip @@ -1382,58 +1252,58 @@ Share it with your friends to communicate. Condivilo con chi vuoi comunicare. - + Your Tox ID (click to copy) (clicca qui per copiare) - + Profiles Gestione Profili - + Available profiles: Profili disponibili: - + Currently selected profile. toolTip for currently set profile Profilo corrente. - + Load selected profile and switch to it. tooltip for loading profile button Carica il profilo selezionato. - + Load load profile button Carica - + Rename rename profile button Rinomina - + Rename selected profile. tooltip for renaming profile button Rinomina il profilo selezionato. - + Export export profile button Esporta - + Allows you to export your Tox profile to a file. Profile does not contain your history. tooltip for profile exporting button @@ -1441,37 +1311,37 @@ Profile does not contain your history. I profili non contengono la cronologia messaggi. - + Delete selected profile. delete profile button tooltip Elimina il profilo selezionato. - + Delete delete profile button Elimina - + Import a profile import profile button Importa profilo - + Import Tox profile from a .tox file. tooltip for importing profile button Importa un profilo da un file ".tox". - + Create new Tox ID and switch to it. tooltip for creating new Tox ID button Crea un nuovo profilo (Tox ID) e iniza subito ad usarlo. - + New Tox ID new profile button Nuovo profilo @@ -1493,37 +1363,37 @@ I profili non contengono la cronologia messaggi. MainWindow - + Your name qTox User - + Your status Toxing on qTox - + Add friends Aggiungi contatto - + Create a group chat Crea un gruppo - + View completed file transfers Visualizza i trasferimenti completati - + Change your settings Cambia le impostazioni - + Close Chiudi @@ -1722,6 +1592,163 @@ ma i nuovi contatti dovranno conoscere il tuo nuovo Tox ID per aggiungerti.Genera valore nospam casuale + + ProfileForm + + + User Profile + Profilo Utente + + + + Choose a profile picture + Scegli un'immagine per il profilo + + + + + + Error + Errore + + + + Unable to open this file + Impossibile aprire il file + + + + Unable to read this image + Impossibile leggere l'immagine + + + + This image is too big + L'immagine è troppo grande + + + + Call active + popup title + Chiamata in corso + + + + You can't switch profiles while a call is active! + popup text + Non puoi cambiare profilo durante una chiamata! + + + + Rename "%1" + renaming a profile + Rinomina "%1" + + + + Profile already exists + rename confirm title + Profilo già esistente + + + + A profile named "%1" already exists. Do you want to erase it? + rename confirm text + Un profilo chiamato "%1" esiste già. Vuoi sovrascriverlo? + + + + Export profile + save dialog title + Esporta profilo + + + + Tox save file (*.tox) + save dialog filter + Tox save file (*.tox) + + + + Failed to remove file + Impossibile rimuovere il file + + + + The file you chose to overwrite could not be removed first. + Il file che hai scelto di sovrascrivere non può essere prima rimosso. + + + + Failed to copy file + Impossibile copiare il file + + + + The file you chose could not be written to. + Il file che hai scelto non può essere copiato. + + + + Profile currently loaded + current profile deletion warning title + Profilo attualmente in uso + + + + This profile is currently in use. Please load a different profile before deleting this one. + current profile deletion warning text + Questo profilo è attualmente in uso. Per favore carica un profilo differente prima di eliminare questo. + + + + Deletion imminent! + deletion confirmation title + Eliminazione imminente! + + + + Are you sure you want to delete this profile? + deletion confirmation text + Sei sicuro di voler eliminare questo profilo? + + + + Import profile + import dialog title + Importa profilo + + + + Tox save file (*.tox) + import dialog filter + Tox save file (*.tox) + + + + Ignoring non-Tox file + popup title + File ignorato + + + + Warning: you've chosen a file that is not a Tox save file; ignoring. + popup text + Attenzione: hai scelto un file che non contiente un profilo Tox.\nQuesto file verrà ignorato. + + + + Profile already exists + import confirm title + Profilo già esistente + + + + A profile named "%1" already exists. Do you want to erase it? + import confirm text + Un profilo chiamato "%1" esiste già. Vuoi sovrascriverlo? + + QObject @@ -1772,17 +1799,17 @@ It will be installed when qTox restarts. Verrà installata al riavvio del programma. - + Tox URI to parse URI Tox da interpretare - + Starts new instance and loads specified profile. Avvia una nuova istanza caricando il profilo selezionato. - + profile profilo @@ -1974,153 +2001,131 @@ Se non sei sicuro, scegli "No", così le informazioni inviate al serve Widget - + &Quit &Esci - + Online Button to set your status to 'Online' Online - + Away Button to set your status to 'Away' Assente - + Busy Button to set your status to 'Busy' Occupato - - Choose a profile picture - Scegli un'immagine per il profilo - - - - - - Error - Errore - - - - Unable to open this file - Impossibile aprire il file - - - - Unable to read this image - Impossibile leggere l'immagine - - - - This image is too big - L'immagine è troppo grande - - - + Toxcore failed to start, the application will terminate after you close this message. Impossibile avviare Toxcore.\nqTox terminerà dopo che avrai chiuso questo messaggio. - + toxcore failed to start with your proxy settings. qTox cannot run; please modify your settings and restart. popup text Impossibile avviare Toxcore con le tue impostazione proxy.\nqTox non può funzionare correttamente, per favore modifica le impostazioni e riavvia il programma. - + Add friend Aggiungi contatto - + File transfers Files trasferiti - + Executable file popup title File eseguibile - + You have asked qTox to open an executable file. Executable files can potentially damage your computer. Are you sure want to open this file? popup text Hai chiesto a qTox di aprire un file eseguibile. I files eseguibili possono danneggiare il tuo computer. Sei sicuro di voler aprire questo file? - + Settings Impostazioni - + + Profile + Profilo + + + Couldn't request friendship Impossibile inviare la richiesta d'amicizia - + away contact status assente - + busy contact status occupato - + offline contact status offline - + online contact status online - + %1 is now %2 e.g. "Dubslow is now online" %1 è ora %2 - + Group invite popup title Invito chat di gruppo - + %1 has invited you to a groupchat. Would you like to join? popup text %1 ti ha invitato in una chat di gruppo. Vuoi partecipare? - + <Unknown> Placeholder when we don't know someone's name in a group chat <Sconosciuto> - + %1 has set the title to %2 %1 ha impostato il titolo in %2 - + Message failed to send Impossibile inviare il messaggio From 95649f247617650f615db94402ef2de85b6e3d59 Mon Sep 17 00:00:00 2001 From: novist Date: Wed, 11 Mar 2015 13:01:10 +0200 Subject: [PATCH 15/28] Support for theming qTox tray and window icons This patch adds ability to override qTox window and tray icons with ones from user's desktop theme. Some people prefer keeping tray icons consistent to achieve best looks. Following theme icons used: * qtox: general window icon which is also used in taskbar * qtox-online, qtox-offline, qtox-busy, qtox-away, qtox-invisible, qtox-event: tray icons If theme icon is not available then default built-in icon will be used. --- src/widget/systemtrayicon.cpp | 2 +- src/widget/systemtrayicon.h | 2 +- src/widget/widget.cpp | 20 ++++++++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/widget/systemtrayicon.cpp b/src/widget/systemtrayicon.cpp index 329c9ce42..343a48071 100644 --- a/src/widget/systemtrayicon.cpp +++ b/src/widget/systemtrayicon.cpp @@ -331,7 +331,7 @@ void SystemTrayIcon::setVisible(bool newState) } } -void SystemTrayIcon::setIcon(QIcon &&icon) +void SystemTrayIcon::setIcon(QIcon &icon) { if (false); #ifdef ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND diff --git a/src/widget/systemtrayicon.h b/src/widget/systemtrayicon.h index 1d062acfa..f15dec04a 100644 --- a/src/widget/systemtrayicon.h +++ b/src/widget/systemtrayicon.h @@ -17,7 +17,7 @@ public: void show(); void hide(); void setVisible(bool); - void setIcon(QIcon&& icon); + void setIcon(QIcon &icon); signals: void activated(QSystemTrayIcon::ActivationReason); diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index a3d08b981..6549e8273 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -92,6 +92,10 @@ void Widget::init() { ui->setupUi(this); + QIcon themeIcon = QIcon::fromTheme("qtox"); + if (!themeIcon.isNull()) + setWindowIcon(themeIcon); + timer = new QTimer(); timer->start(1000); offlineMsgTimer = new QTimer(); @@ -224,6 +228,9 @@ void Widget::setTranslation() void Widget::updateTrayIcon() { + if (!icon) + return; + QString status; if (eventIcon) status = "event"; @@ -233,10 +240,15 @@ void Widget::updateTrayIcon() if (!status.length()) status = "offline"; } - QString color = Settings::getInstance().getLightTrayIcon() ? "light" : "dark"; - QString pic = ":img/taskbar/" + color + "/taskbar_" + status + ".svg"; - if (icon) - icon->setIcon(QIcon(pic)); + + QIcon ico = QIcon::fromTheme("qtox-" + status); + if (ico.isNull()) + { + QString color = Settings::getInstance().getLightTrayIcon() ? "light" : "dark"; + ico = QIcon(":img/taskbar/" + color + "/taskbar_" + status + ".svg"); + } + + icon->setIcon(ico); } Widget::~Widget() From b489e7f712f4be5bb95ced97831c2d1ac788da01 Mon Sep 17 00:00:00 2001 From: agilob Date: Wed, 11 Mar 2015 11:12:08 +0000 Subject: [PATCH 16/28] probably closes tux3/qtox#1330 --- src/widget/groupwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget/groupwidget.cpp b/src/widget/groupwidget.cpp index 60c5d2297..f6762593f 100644 --- a/src/widget/groupwidget.cpp +++ b/src/widget/groupwidget.cpp @@ -71,6 +71,7 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event) emit g->getChatForm()->groupTitleChanged(groupId, alias.left(128)); } } + this->repaint(); } void GroupWidget::onUserListChanged() From 1abef6c0c65f9a8e0ad84bef4de5adeea8429822 Mon Sep 17 00:00:00 2001 From: agilob Date: Wed, 11 Mar 2015 11:20:27 +0000 Subject: [PATCH 17/28] prevent segfault ;_; repaint only after changing alias --- src/widget/groupwidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widget/groupwidget.cpp b/src/widget/groupwidget.cpp index f6762593f..b180fc3c0 100644 --- a/src/widget/groupwidget.cpp +++ b/src/widget/groupwidget.cpp @@ -51,7 +51,7 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event) { QPoint pos = event->globalPos(); QMenu menu; - QAction* setAlias = menu.addAction(tr("Set title...")); + QAction* setTitle = menu.addAction(tr("Set title...")); QAction* quitGroup = menu.addAction(tr("Quit group","Menu to quit a groupchat")); QAction* selectedItem = menu.exec(pos); @@ -59,7 +59,7 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event) { if (selectedItem == quitGroup) emit removeGroup(groupId); - else if (selectedItem == setAlias) + else if (selectedItem == setTitle) { bool ok; Group* g = GroupList::findGroup(groupId); @@ -69,9 +69,9 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event) if (ok && alias != nameLabel->fullText()) emit g->getChatForm()->groupTitleChanged(groupId, alias.left(128)); + this->repaint(); } } - this->repaint(); } void GroupWidget::onUserListChanged() From 804cd4f88aec784550fce0f26702ff31f951ca51 Mon Sep 17 00:00:00 2001 From: Flakebi Date: Wed, 11 Mar 2015 16:01:24 +0100 Subject: [PATCH 18/28] Inline funtion calls --- src/widget/form/groupchatform.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 324f41dd8..32bed5cc5 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -101,11 +101,9 @@ void GroupChatForm::onSendTriggered() msgEdit->setLastMessage(msg); msgEdit->clear(); - bool isAction = msg.startsWith("/me "); - if (group->getPeersCount() != 1) { - if (isAction) + if (msg.startsWith("/me ")) { msg = msg.right(msg.length() - 4); emit sendAction(group->getGroupId(), msg); @@ -114,10 +112,7 @@ void GroupChatForm::onSendTriggered() emit sendMessage(group->getGroupId(), msg); } else - { - QDateTime timestamp = QDateTime::currentDateTime(); - addSelfMessage(msg, isAction, timestamp, true); - } + addSelfMessage(msg, msg.startsWith("/me "), QDateTime::currentDateTime(), true); } void GroupChatForm::onUserListChanged() From 4f0798bde7a8ace42b9cb2272dc24cdacdda9d25 Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 11 Mar 2015 10:15:53 -0500 Subject: [PATCH 19/28] Rename widget/form/settings/identitysettings.ui to widget/form/profileform.ui --- qtox.pro | 2 +- src/widget/form/profileform.cpp | 2 +- .../form/{settings/identitysettings.ui => profileform.ui} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/widget/form/{settings/identitysettings.ui => profileform.ui} (100%) diff --git a/qtox.pro b/qtox.pro index ec3bb4084..d1fe9def5 100644 --- a/qtox.pro +++ b/qtox.pro @@ -29,8 +29,8 @@ FORMS += \ src/mainwindow.ui \ src/widget/form/settings/generalsettings.ui \ src/widget/form/settings/avsettings.ui \ - src/widget/form/settings/identitysettings.ui \ src/widget/form/settings/privacysettings.ui \ + src/widget/form/profileform.ui \ src/widget/form/loadhistorydialog.ui \ src/widget/form/setpassworddialog.ui \ src/chatlog/content/filetransferwidget.ui \ diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 631ec6212..57dd99699 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -16,7 +16,7 @@ #include "src/core.h" #include "src/nexus.h" -#include "ui_identitysettings.h" +#include "ui_profileform.h" #include "profileform.h" #include "ui_mainwindow.h" #include "src/widget/form/settingswidget.h" diff --git a/src/widget/form/settings/identitysettings.ui b/src/widget/form/profileform.ui similarity index 100% rename from src/widget/form/settings/identitysettings.ui rename to src/widget/form/profileform.ui From 5554412a72497bee4ea4001f11f840cad3000995 Mon Sep 17 00:00:00 2001 From: novist Date: Wed, 11 Mar 2015 20:04:29 +0200 Subject: [PATCH 20/28] Window icon is set same as tray icon Removed use of "qtox" theme icon as it is no longer relevant --- src/widget/form/settings/generalform.cpp | 2 +- src/widget/widget.cpp | 22 +++++++++------------- src/widget/widget.h | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/widget/form/settings/generalform.cpp b/src/widget/form/settings/generalform.cpp index 73dd64c4f..58d193d5f 100644 --- a/src/widget/form/settings/generalform.cpp +++ b/src/widget/form/settings/generalform.cpp @@ -199,7 +199,7 @@ void GeneralForm::onSetCloseToTray() void GeneralForm::onSetLightTrayIcon() { Settings::getInstance().setLightTrayIcon(bodyUI->lightTrayIcon->isChecked()); - Widget::getInstance()->updateTrayIcon(); + Widget::getInstance()->updateIcons(); } void GeneralForm::onSetMinimizeToTray() diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 6549e8273..46f01c255 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -92,10 +92,6 @@ void Widget::init() { ui->setupUi(this); - QIcon themeIcon = QIcon::fromTheme("qtox"); - if (!themeIcon.isNull()) - setWindowIcon(themeIcon); - timer = new QTimer(); timer->start(1000); offlineMsgTimer = new QTimer(); @@ -173,6 +169,7 @@ void Widget::init() Style::setThemeColor(Settings::getInstance().getThemeColor()); reloadTheme(); + updateIcons(); filesForm = new FilesForm(); addFriendForm = new AddFriendForm; @@ -226,11 +223,8 @@ void Widget::setTranslation() QCoreApplication::installTranslator(translator); } -void Widget::updateTrayIcon() +void Widget::updateIcons() { - if (!icon) - return; - QString status; if (eventIcon) status = "event"; @@ -248,7 +242,9 @@ void Widget::updateTrayIcon() ico = QIcon(":img/taskbar/" + color + "/taskbar_" + status + ".svg"); } - icon->setIcon(ico); + setWindowIcon(ico); + if (icon) + icon->setIcon(ico); } Widget::~Widget() @@ -394,7 +390,7 @@ void Widget::onStatusSet(Status status) ui->statusButton->setIcon(QIcon(":img/status/dot_away_2x.png")); break; } - updateTrayIcon(); + updateIcons(); } void Widget::setWindowTitle(const QString& title) @@ -986,7 +982,7 @@ bool Widget::event(QEvent * e) { eventFlag = false; eventIcon = false; - updateTrayIcon(); + updateIcons(); } default: break; @@ -1028,7 +1024,7 @@ void Widget::onEventIconTick() if (eventFlag) { eventIcon ^= true; - updateTrayIcon(); + updateIcons(); } } @@ -1040,7 +1036,7 @@ void Widget::onTryCreateTrayIcon() if (QSystemTrayIcon::isSystemTrayAvailable()) { icon = new SystemTrayIcon; - updateTrayIcon(); + updateIcons(); trayMenu = new QMenu; actionQuit = new QAction(tr("&Quit"), this); diff --git a/src/widget/widget.h b/src/widget/widget.h index e019b0915..9be484659 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -63,7 +63,7 @@ public: bool getIsWindowMinimized(); void clearContactsList(); void setTranslation(); - void updateTrayIcon(); + void updateIcons(); ~Widget(); virtual void closeEvent(QCloseEvent *event); From e9babcee0734ace26e8d27d568a622ed040a37fa Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 11 Mar 2015 21:13:18 -0500 Subject: [PATCH 21/28] Filter audio checkbox has effect mid-call --- src/coreav.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/coreav.cpp b/src/coreav.cpp index cc5f8650f..3e9491bc0 100644 --- a/src/coreav.cpp +++ b/src/coreav.cpp @@ -76,7 +76,7 @@ void Core::prepareCall(int friendId, int callId, ToxAv* toxav, bool videoEnabled #ifdef QTOX_FILTER_AUDIO if (Settings::getInstance().getFilterAudio()) { - Core::filterer[callId] = new AudioFilterer(); + filterer[callId] = new AudioFilterer(); filterer[callId]->startFilter(48000); } else @@ -257,13 +257,23 @@ void Core::sendCallAudio(int callId, ToxAv* toxav) if (Audio::tryCaptureSamples(buf, framesize)) { #ifdef QTOX_FILTER_AUDIO - if (filterer[callId]) + if (Settings::getInstance().getFilterAudio()) { + if (!filterer[callId]) + { + filterer[callId] = new AudioFilterer(); + filterer[callId]->startFilter(48000); + } // is a null op #ifndef ALC_LOOPBACK_CAPTURE_SAMPLES Audio::getEchoesToFilter(filterer[callId], framesize); filterer[callId]->filterAudio((int16_t*) buf, framesize); } + else if (filterer[callId]) + { + delete filterer[callId]; + filterer[callId] = nullptr; + } #endif uint8_t dest[bufsize]; From 21780b9d315da00e1354b37223306a79cd7f1bfc Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 11 Mar 2015 21:17:52 -0500 Subject: [PATCH 22/28] remove duplicate code --- src/widget/form/addfriendform.cpp | 16 ++++------------ src/widget/form/addfriendform.h | 3 --- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/widget/form/addfriendform.cpp b/src/widget/form/addfriendform.cpp index cfb259fb0..7ae0259ad 100644 --- a/src/widget/form/addfriendform.cpp +++ b/src/widget/form/addfriendform.cpp @@ -26,6 +26,7 @@ #include "src/misc/cdata.h" #include "src/toxdns.h" #include "src/misc/settings.h" +#include "src/widget/gui.h" AddFriendForm::AddFriendForm() { @@ -73,15 +74,6 @@ QString AddFriendForm::getMessage() const return !msg.isEmpty() ? msg : message.placeholderText(); } -void AddFriendForm::showWarning(const QString &message) const -{ - QMessageBox warning(main); - warning.setWindowTitle("Tox"); - warning.setText(message); - warning.setIcon(QMessageBox::Warning); - warning.exec(); -} - void AddFriendForm::onUsernameSet(const QString& username) { message.setPlaceholderText(tr("%1 here! Tox me maybe?","Default message in friend requests if the field is left blank. Write something appropriate!").arg(username)); @@ -92,10 +84,10 @@ void AddFriendForm::onSendTriggered() QString id = toxId.text().trimmed(); if (id.isEmpty()) { - showWarning(tr("Please fill in a valid Tox ID","Tox ID of the friend you're sending a friend request to")); + GUI::showWarning(tr("Couldn't add friend"), tr("Please fill in a valid Tox ID","Tox ID of the friend you're sending a friend request to")); } else if (ToxID::isToxId(id)) { if (id.toUpper() == Core::getInstance()->getSelfId().toString().toUpper()) - showWarning(tr("You can't add yourself as a friend!","When trying to add your own Tox ID as friend")); + GUI::showWarning(tr("Couldn't add friend"), tr("You can't add yourself as a friend!","When trying to add your own Tox ID as friend")); else emit friendRequested(id, getMessage()); this->toxId.clear(); @@ -113,7 +105,7 @@ Ignore the proxy and connect to the Internet directly?"), QMessageBox::Yes|QMess if (toxId.toString().isEmpty()) { - showWarning(tr("This Tox ID does not exist","DNS error")); + GUI::showWarning(tr("Couldn't add friend"), tr("This Tox ID does not exist","DNS error")); return; } diff --git a/src/widget/form/addfriendform.h b/src/widget/form/addfriendform.h index 523d58045..513eab065 100644 --- a/src/widget/form/addfriendform.h +++ b/src/widget/form/addfriendform.h @@ -38,9 +38,6 @@ public: signals: void friendRequested(const QString& friendAddress, const QString& message); -protected: - void showWarning(const QString& message) const; - public slots: void onUsernameSet(const QString& userName); From 561682645dae5285780515bc49e06cdbe5f63b6c Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 11 Mar 2015 21:37:26 -0500 Subject: [PATCH 23/28] Slightly better error message --- src/coreencryption.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreencryption.cpp b/src/coreencryption.cpp index 3f64fe7b3..b886d3504 100644 --- a/src/coreencryption.cpp +++ b/src/coreencryption.cpp @@ -303,7 +303,7 @@ void Core::saveConfiguration(const QString& path) if (!pwsaltedkeys[ptMain]) { // probably zero chance event - GUI::showWarning(tr("NO Password"), tr("Encryption is enabled, but there is no password! Encryption will be disabled.")); + GUI::showWarning(tr("NO Password"), tr("Local file encryption is enabled, but there is no password! It will be disabled.")); Settings::getInstance().setEncryptTox(false); tox_save(tox, data); } From 50c1e09a5c7ccc3150f34891a52d7cd4f11d823d Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 11 Mar 2015 22:00:54 -0500 Subject: [PATCH 24/28] Autofocus name edit in profileform fixes #1364 --- src/widget/form/profileform.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 57dd99699..5bf2d4d7d 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -130,6 +130,8 @@ void ProfileForm::show(Ui::MainWindow &ui) ui.mainContent->layout()->addWidget(this); head->show(); QWidget::show(); + bodyUI->userName->setFocus(Qt::OtherFocusReason); + bodyUI->userName->selectAll(); } void ProfileForm::copyIdClicked() From 6e751eaf8397ab5f02898c3f433fb173d18c4ddf Mon Sep 17 00:00:00 2001 From: Dubslow Date: Wed, 11 Mar 2015 22:02:10 -0500 Subject: [PATCH 25/28] Attempted fix for #1352 --- src/misc/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/settings.h b/src/misc/settings.h index 921745565..e69a39e89 100644 --- a/src/misc/settings.h +++ b/src/misc/settings.h @@ -293,7 +293,7 @@ private: bool enableLogging; bool encryptLogs; - bool encryptTox; + bool encryptTox = false; int autoAwayTime; From b6175ac96fb3b0198a6b5b7653dbcb719c452684 Mon Sep 17 00:00:00 2001 From: Dubslow Date: Fri, 13 Mar 2015 01:00:12 -0500 Subject: [PATCH 26/28] Mark which peers are playing, styling is open to suggestions closes #757 --- src/audio.cpp | 3 ++- src/core.h | 1 + src/group.cpp | 23 +++++++++-------- src/group.h | 5 +++- src/nexus.cpp | 39 ++++++++++++++-------------- src/widget/form/groupchatform.cpp | 43 +++++++++++++++++++++++++------ src/widget/form/groupchatform.h | 5 ++++ src/widget/widget.cpp | 9 +++++++ src/widget/widget.h | 1 + 9 files changed, 89 insertions(+), 40 deletions(-) diff --git a/src/audio.cpp b/src/audio.cpp index 58ab8963e..697a71e73 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -242,11 +242,12 @@ void Audio::playMono16Sound(const QByteArray& data) } void Audio::playGroupAudioQueued(Tox*,int group, int peer, const int16_t* data, - unsigned samples, uint8_t channels, unsigned sample_rate,void*) + unsigned samples, uint8_t channels, unsigned sample_rate, void* core) { QMetaObject::invokeMethod(instance, "playGroupAudio", Qt::BlockingQueuedConnection, Q_ARG(int,group), Q_ARG(int,peer), Q_ARG(const int16_t*,data), Q_ARG(unsigned,samples), Q_ARG(uint8_t,channels), Q_ARG(unsigned,sample_rate)); + emit static_cast(core)->groupPeerAudioPlaying(group, peer); } void Audio::playGroupAudio(int group, int peer, const int16_t* data, diff --git a/src/core.h b/src/core.h index 7f87fbfa9..55094ec32 100644 --- a/src/core.h +++ b/src/core.h @@ -171,6 +171,7 @@ signals: void groupMessageReceived(int groupnumber, int peernumber, const QString& message, bool isAction); void groupNamelistChanged(int groupnumber, int peernumber, uint8_t change); void groupTitleChanged(int groupnumber, const QString& author, const QString& title); + void groupPeerAudioPlaying(int groupnumber, int peernumber); void usernameSet(const QString& username); void statusMessageSet(const QString& message); diff --git a/src/group.cpp b/src/group.cpp index c54601c44..80b09a3dd 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -72,7 +72,6 @@ void Group::updatePeer(int peerId, QString name) QString toxid = id.publicKey; peers[peerId] = name; toxids[toxid] = name; - Friend *f = FriendList::findFriend(id); if (f) { @@ -95,17 +94,16 @@ void Group::setName(const QString& name) void Group::regeneratePeerList() { - QList peerLst = Core::getInstance()->getGroupPeerNames(groupId); - peers.clear(); + peers = Core::getInstance()->getGroupPeerNames(groupId); toxids.clear(); - nPeers = peerLst.size(); - for (int i = 0; i < peerLst.size(); i++) + nPeers = peers.size(); + for (int i = 0; i < nPeers; i++) { ToxID id = Core::getInstance()->getGroupPeerToxID(groupId, i); + if (id.isMine()) + selfPeerNum = i; QString toxid = id.publicKey; - peers[i] = peerLst.at(i); - toxids[toxid] = peerLst.at(i); - + toxids[toxid] = peers[i]; Friend *f = FriendList::findFriend(id); if (f) { @@ -145,9 +143,12 @@ GroupWidget *Group::getGroupWidget() QStringList Group::getPeerList() const { - QStringList peerNames(peers.values()); - peerNames.sort(Qt::CaseInsensitive); - return peerNames; + return peers; +} + +bool Group::isSelfPeerNumber(int num) const +{ + return num == selfPeerNum; } void Group::setEventFlag(int f) diff --git a/src/group.h b/src/group.h index 971e6f5c2..f28c32685 100644 --- a/src/group.h +++ b/src/group.h @@ -19,6 +19,7 @@ #include #include +#include #define RETRY_PEER_INFO_INTERVAL 500 @@ -39,6 +40,7 @@ public: int getPeersCount() const; void regeneratePeerList(); QStringList getPeerList() const; + bool isSelfPeerNumber(int peernumber) const; GroupChatForm *getChatForm(); GroupWidget *getGroupWidget(); @@ -62,11 +64,12 @@ public: private: GroupWidget* widget; GroupChatForm* chatForm; - QMap peers; + QStringList peers; QMap toxids; int hasNewMessages, userWasMentioned; int groupId; int nPeers; + int selfPeerNum = -1; bool avGroupchat; }; diff --git a/src/nexus.cpp b/src/nexus.cpp index d94bb4c0a..90372b636 100644 --- a/src/nexus.cpp +++ b/src/nexus.cpp @@ -93,26 +93,27 @@ void Nexus::start() //connect(androidgui, &AndroidGUI::friendRequestAccepted, core, &Core::acceptFriendRequest); //connect(androidgui, &AndroidGUI::changeProfile, core, &Core::switchConfiguration); #else - connect(core, &Core::connected, widget, &Widget::onConnected); - connect(core, &Core::disconnected, widget, &Widget::onDisconnected); - connect(core, &Core::failedToStart, widget, &Widget::onFailedToStartCore); - connect(core, &Core::badProxy, widget, &Widget::onBadProxyCore); - connect(core, &Core::statusSet, widget, &Widget::onStatusSet); - connect(core, &Core::usernameSet, widget, &Widget::setUsername); - connect(core, &Core::statusMessageSet, widget, &Widget::setStatusMessage); - connect(core, &Core::selfAvatarChanged, widget, &Widget::onSelfAvatarLoaded); - connect(core, &Core::friendAdded, widget, &Widget::addFriend); - connect(core, &Core::failedToAddFriend, widget, &Widget::addFriendFailed); - connect(core, &Core::friendUsernameChanged, widget, &Widget::onFriendUsernameChanged); - connect(core, &Core::friendStatusChanged, widget, &Widget::onFriendStatusChanged); + connect(core, &Core::connected, widget, &Widget::onConnected); + connect(core, &Core::disconnected, widget, &Widget::onDisconnected); + connect(core, &Core::failedToStart, widget, &Widget::onFailedToStartCore); + connect(core, &Core::badProxy, widget, &Widget::onBadProxyCore); + connect(core, &Core::statusSet, widget, &Widget::onStatusSet); + connect(core, &Core::usernameSet, widget, &Widget::setUsername); + connect(core, &Core::statusMessageSet, widget, &Widget::setStatusMessage); + connect(core, &Core::selfAvatarChanged, widget, &Widget::onSelfAvatarLoaded); + connect(core, &Core::friendAdded, widget, &Widget::addFriend); + connect(core, &Core::failedToAddFriend, widget, &Widget::addFriendFailed); + connect(core, &Core::friendUsernameChanged, widget, &Widget::onFriendUsernameChanged); + connect(core, &Core::friendStatusChanged, widget, &Widget::onFriendStatusChanged); connect(core, &Core::friendStatusMessageChanged, widget, &Widget::onFriendStatusMessageChanged); - connect(core, &Core::friendRequestReceived, widget, &Widget::onFriendRequestReceived); - connect(core, &Core::friendMessageReceived, widget, &Widget::onFriendMessageReceived); - connect(core, &Core::receiptRecieved, widget, &Widget::onReceiptRecieved); - connect(core, &Core::groupInviteReceived, widget, &Widget::onGroupInviteReceived); - connect(core, &Core::groupMessageReceived, widget, &Widget::onGroupMessageReceived); - connect(core, &Core::groupNamelistChanged, widget, &Widget::onGroupNamelistChanged); - connect(core, &Core::groupTitleChanged, widget, &Widget::onGroupTitleChanged); + connect(core, &Core::friendRequestReceived, widget, &Widget::onFriendRequestReceived); + connect(core, &Core::friendMessageReceived, widget, &Widget::onFriendMessageReceived); + connect(core, &Core::receiptRecieved, widget, &Widget::onReceiptRecieved); + connect(core, &Core::groupInviteReceived, widget, &Widget::onGroupInviteReceived); + connect(core, &Core::groupMessageReceived, widget, &Widget::onGroupMessageReceived); + connect(core, &Core::groupNamelistChanged, widget, &Widget::onGroupNamelistChanged); + connect(core, &Core::groupTitleChanged, widget, &Widget::onGroupTitleChanged); + connect(core, &Core::groupPeerAudioPlaying, widget, &Widget::onGroupPeerAudioPlaying); connect(core, &Core::emptyGroupCreated, widget, &Widget::onEmptyGroupCreated); connect(core, &Core::avInvite, widget, &Widget::playRingtone); connect(core, &Core::blockingClearContacts, widget, &Widget::clearContactsList, Qt::BlockingQueuedConnection); diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 32bed5cc5..f1a2ca381 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -29,6 +29,7 @@ #include "src/historykeeper.h" #include "src/misc/flowlayout.h" #include +#include GroupChatForm::GroupChatForm(Group* chatGroup) : group(chatGroup), inCall{false} @@ -126,19 +127,45 @@ void GroupChatForm::onUserListChanged() delete child->widget(); delete child; } + peerLabels.clear(); - QStringList names(group->getPeerList()); + // the list needs peers in peernumber order, nameLayout needs alphabetical + QMap orderizer; + + // first traverse in peer number order, storing the QLabels as necessary + QStringList names = group->getPeerList(); unsigned nNames = names.size(); for (unsigned i=0; isetObjectName("peersLabel"); - nameLabel->setTextFormat(Qt::PlainText); - namesListLayout->addWidget(nameLabel); + peerLabels.append(new QLabel(names[i])); + peerLabels[i]->setTextFormat(Qt::PlainText); + orderizer[names[i]] = peerLabels[i]; + if (group->isSelfPeerNumber(i)) + peerLabels[i]->setStyleSheet("QLabel {color : green;}"); } + // now alphabetize and add to layout + names.sort(Qt::CaseInsensitive); + for (unsigned i=0; isetText(label->text() + ", "); + namesListLayout->addWidget(label); + } +} + +void GroupChatForm::peerAudioPlaying(int peer) +{ + peerLabels[peer]->setStyleSheet("QLabel {color : red;}"); + if (!peerAudioTimers[peer]) + { + peerAudioTimers[peer] = new QTimer(this); + peerAudioTimers[peer]->setSingleShot(true); + connect(peerAudioTimers[peer], &QTimer::timeout, [=]{this->peerLabels[peer]->setStyleSheet(""); + delete this->peerAudioTimers[peer]; + this->peerAudioTimers[peer] = nullptr;}); + } + peerAudioTimers[peer]->start(500); } void GroupChatForm::dragEnterEvent(QDragEnterEvent *ev) diff --git a/src/widget/form/groupchatform.h b/src/widget/form/groupchatform.h index 221b1ceae..73c3e3ced 100644 --- a/src/widget/form/groupchatform.h +++ b/src/widget/form/groupchatform.h @@ -18,11 +18,13 @@ #define GROUPCHATFORM_H #include "genericchatform.h" +#include namespace Ui {class MainWindow;} class Group; class TabCompleter; class FlowLayout; +class QTimer; class GroupChatForm : public GenericChatForm { @@ -31,6 +33,7 @@ public: GroupChatForm(Group* chatGroup); void onUserListChanged(); + void peerAudioPlaying(int peer); void keyPressEvent(QKeyEvent* ev); void keyReleaseEvent(QKeyEvent* ev); @@ -51,6 +54,8 @@ protected: private: Group* group; + QList peerLabels; // maps peernumbers to the QLabels in namesListLayout + QMap peerAudioTimers; // timeout = peer stopped sending audio FlowLayout* namesListLayout; QLabel *nusersLabel; TabCompleter* tabber; diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 33fa2e8bc..199eb3699 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -906,6 +906,15 @@ void Widget::onGroupTitleChanged(int groupnumber, const QString& author, const Q g->getChatForm()->addSystemInfoMessage(tr("%1 has set the title to %2").arg(author, title), ChatMessage::INFO, QDateTime::currentDateTime()); } +void Widget::onGroupPeerAudioPlaying(int groupnumber, int peernumber) +{ + Group* g = GroupList::findGroup(groupnumber); + if (!g) + return; + + g->getChatForm()->peerAudioPlaying(peernumber); +} + void Widget::removeGroup(Group* g, bool fake) { g->getGroupWidget()->setAsInactiveChatroom(); diff --git a/src/widget/widget.h b/src/widget/widget.h index 9be484659..bf73699b1 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -102,6 +102,7 @@ public slots: void onGroupMessageReceived(int groupnumber, int peernumber, const QString& message, bool isAction); void onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t change); void onGroupTitleChanged(int groupnumber, const QString& author, const QString& title); + void onGroupPeerAudioPlaying(int groupnumber, int peernumber); void playRingtone(); void onFriendTypingChanged(int friendId, bool isTyping); void nextContact(); From ee1fbaf0fde833bfbbee33a539599bd7bb8f8046 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Fri, 13 Mar 2015 11:11:48 +0100 Subject: [PATCH 27/28] Italian translation: update --- translations/it.ts | 194 +++++++++++++++++++++++---------------------- 1 file changed, 101 insertions(+), 93 deletions(-) diff --git a/translations/it.ts b/translations/it.ts index 8486a4f7f..b03c4c8b9 100644 --- a/translations/it.ts +++ b/translations/it.ts @@ -116,55 +116,62 @@ qualità video elevate, questo può causare problemi con le chiamate video. AddFriendForm - + Add Friends Aggiungi Contatto - + Tox ID Tox ID of the person you're sending a friend request to Tox ID - + Message The message you send in friend requests Messaggio - + Send friend request Invia richiesta d'amicizia - + %1 here! Tox me maybe? Default message in friend requests if the field is left blank. Write something appropriate! Ciao, sono %1. Permettimi di aggiungerti alla mia lista contatti. - + Please fill in a valid Tox ID Tox ID of the friend you're sending a friend request to Inserisci un Tox ID valido - + + + + Couldn't add friend + Impossibile aggiungere il contatto + + + You can't add yourself as a friend! When trying to add your own Tox ID as friend Non puoi aggiungere te stesso come contatto! - + qTox needs to use the Tox DNS, but can't do it through a proxy. Ignore the proxy and connect to the Internet directly? qTox deve usare Tox DNS, ma non può farlo attraverso un proxy. Ignorare le impostazioni del proxy e connettersi direttamente alla rete Tox? - + This Tox ID does not exist DNS error Questo Tox ID non esiste @@ -543,8 +550,9 @@ Disabilitando la cronologia delle chat lascerà la cronologia criptata intatta ( - Encryption is enabled, but there is no password! Encryption will be disabled. - La criptazione è abilitata, ma non c'è nessuna password! LA criptazione sarà disabilitata. + Local file encryption is enabled, but there is no password! It will be disabled. + La crittografia dei files locali è abilitata, ma non è stata immessa nessuna password! +Per questo motivo sarà disabilitata. @@ -1140,45 +1148,45 @@ will be sent to them when they will appear online to you. GroupChatForm - + %1 users in chat Number of users in chat %1 utenti in chat - + %1 users in chat %1 utenti in chat - - + + Mute microphone Disattiva microfono - + Unmute microphone Attiva microfono - - + + Mute call Disattiva audio - + Unmute call Attiva audio - + End audio call Termina chiamata - + Start audio call Avvia chiamata @@ -1187,13 +1195,13 @@ will be sent to them when they will appear online to you. GroupWidget - + %1 users in chat %1 utenti in chat - + 0 users in chat 0 utenti in chat @@ -1224,27 +1232,27 @@ Nome gruppo: IdentitySettings - + Public Information Informazioni Pubbliche - + Name Nome - + Status Stato - + Tox ID Tox ID - + This bunch of characters tells other Tox clients how to contact you. Share it with your friends to communicate. Tox ID tooltip @@ -1252,58 +1260,58 @@ Share it with your friends to communicate. Condivilo con chi vuoi comunicare. - + Your Tox ID (click to copy) (clicca qui per copiare) - + Profiles Gestione Profili - + Available profiles: Profili disponibili: - + Currently selected profile. toolTip for currently set profile Profilo corrente. - + Load selected profile and switch to it. tooltip for loading profile button Carica il profilo selezionato. - + Load load profile button Carica - + Rename rename profile button Rinomina - + Rename selected profile. tooltip for renaming profile button Rinomina il profilo selezionato. - + Export export profile button Esporta - + Allows you to export your Tox profile to a file. Profile does not contain your history. tooltip for profile exporting button @@ -1311,37 +1319,37 @@ Profile does not contain your history. I profili non contengono la cronologia messaggi. - + Delete selected profile. delete profile button tooltip Elimina il profilo selezionato. - + Delete delete profile button Elimina - + Import a profile import profile button Importa profilo - + Import Tox profile from a .tox file. tooltip for importing profile button Importa un profilo da un file ".tox". - + Create new Tox ID and switch to it. tooltip for creating new Tox ID button Crea un nuovo profilo (Tox ID) e iniza subito ad usarlo. - + New Tox ID new profile button Nuovo profilo @@ -1409,7 +1417,7 @@ I profili non contengono la cronologia messaggi. Nexus - + Images (%1) filetype filter Immagini (%1) @@ -1600,150 +1608,150 @@ ma i nuovi contatti dovranno conoscere il tuo nuovo Tox ID per aggiungerti.Profilo Utente - + Choose a profile picture Scegli un'immagine per il profilo - - - + + + Error Errore - + Unable to open this file Impossibile aprire il file - + Unable to read this image Impossibile leggere l'immagine - + This image is too big L'immagine è troppo grande - + Call active popup title Chiamata in corso - + You can't switch profiles while a call is active! popup text Non puoi cambiare profilo durante una chiamata! - + Rename "%1" renaming a profile Rinomina "%1" - + Profile already exists rename confirm title Profilo già esistente - + A profile named "%1" already exists. Do you want to erase it? rename confirm text Un profilo chiamato "%1" esiste già. Vuoi sovrascriverlo? - + Export profile save dialog title Esporta profilo - + Tox save file (*.tox) save dialog filter Tox save file (*.tox) - + Failed to remove file Impossibile rimuovere il file - + The file you chose to overwrite could not be removed first. Il file che hai scelto di sovrascrivere non può essere prima rimosso. - + Failed to copy file Impossibile copiare il file - + The file you chose could not be written to. Il file che hai scelto non può essere copiato. - + Profile currently loaded current profile deletion warning title Profilo attualmente in uso - + This profile is currently in use. Please load a different profile before deleting this one. current profile deletion warning text Questo profilo è attualmente in uso. Per favore carica un profilo differente prima di eliminare questo. - + Deletion imminent! deletion confirmation title Eliminazione imminente! - + Are you sure you want to delete this profile? deletion confirmation text Sei sicuro di voler eliminare questo profilo? - + Import profile import dialog title Importa profilo - + Tox save file (*.tox) import dialog filter Tox save file (*.tox) - + Ignoring non-Tox file popup title File ignorato - + Warning: you've chosen a file that is not a Tox save file; ignoring. popup text Attenzione: hai scelto un file che non contiente un profilo Tox.\nQuesto file verrà ignorato. - + Profile already exists import confirm title Profilo già esistente - + A profile named "%1" already exists. Do you want to erase it? import confirm text Un profilo chiamato "%1" esiste già. Vuoi sovrascriverlo? @@ -2001,7 +2009,7 @@ Se non sei sicuro, scegli "No", così le informazioni inviate al serve Widget - + &Quit &Esci @@ -2024,108 +2032,108 @@ Se non sei sicuro, scegli "No", così le informazioni inviate al serve Occupato - + Toxcore failed to start, the application will terminate after you close this message. Impossibile avviare Toxcore.\nqTox terminerà dopo che avrai chiuso questo messaggio. - + toxcore failed to start with your proxy settings. qTox cannot run; please modify your settings and restart. popup text Impossibile avviare Toxcore con le tue impostazione proxy.\nqTox non può funzionare correttamente, per favore modifica le impostazioni e riavvia il programma. - + Add friend Aggiungi contatto - + File transfers Files trasferiti - + Executable file popup title File eseguibile - + You have asked qTox to open an executable file. Executable files can potentially damage your computer. Are you sure want to open this file? popup text Hai chiesto a qTox di aprire un file eseguibile. I files eseguibili possono danneggiare il tuo computer. Sei sicuro di voler aprire questo file? - + Settings Impostazioni - + Profile Profilo - + Couldn't request friendship Impossibile inviare la richiesta d'amicizia - + away contact status assente - + busy contact status occupato - + offline contact status offline - + online contact status online - + %1 is now %2 e.g. "Dubslow is now online" %1 è ora %2 - + Group invite popup title Invito chat di gruppo - + %1 has invited you to a groupchat. Would you like to join? popup text %1 ti ha invitato in una chat di gruppo. Vuoi partecipare? - + <Unknown> Placeholder when we don't know someone's name in a group chat <Sconosciuto> - + %1 has set the title to %2 %1 ha impostato il titolo in %2 - + Message failed to send Impossibile inviare il messaggio From 9ed4b3fb7db9a2b3eeafc87251618e6759fd3670 Mon Sep 17 00:00:00 2001 From: Zetok Zalbavar Date: Sat, 14 Mar 2015 08:12:42 +0000 Subject: [PATCH 28/28] Add missing comment for #1367 --- src/widget/groupwidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/widget/groupwidget.cpp b/src/widget/groupwidget.cpp index b180fc3c0..ead2cb4d4 100644 --- a/src/widget/groupwidget.cpp +++ b/src/widget/groupwidget.cpp @@ -69,6 +69,12 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event) if (ok && alias != nameLabel->fullText()) emit g->getChatForm()->groupTitleChanged(groupId, alias.left(128)); + /* according to agilob: + * “Moving mouse pointer over groupwidget results in CSS effect + * mouse-over(?). Changing group title repaints only changed + * element - title, the rest of the widget stays in the same CSS as it + * was on mouse over. Repainting whole widget fixes style problem.” + */ this->repaint(); } }