-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(extensions): UI updates for extension support
Added a UI element to indicate extension support of the chatroom. For all groups it will always be red since we do not support extensions in groups. In a 1-1 chat the indicator will either be green/yellow/red depending on if the friend has support for all/some/none of qTox's desired extension set.
- Loading branch information
1 parent
5f5f612
commit b715815
Showing
11 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
Copyright © 2019-2020 by The qTox Project Contributors | ||
This file is part of qTox, a Qt-based graphical interface for Tox. | ||
qTox is libre software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
qTox is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with qTox. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "extensionstatus.h" | ||
|
||
#include <QIcon> | ||
|
||
ExtensionStatus::ExtensionStatus(QWidget* parent) | ||
: QLabel(parent) | ||
{ | ||
// Initialize with 0 extensions | ||
onExtensionSetUpdate(ExtensionSet()); | ||
} | ||
|
||
void ExtensionStatus::onExtensionSetUpdate(ExtensionSet extensionSet) | ||
{ | ||
QString iconName; | ||
QString hoverText; | ||
if (extensionSet.all()) { | ||
iconName = ":/img/status/extensions_available.svg"; | ||
hoverText = tr("All extensions supported"); | ||
} else if (extensionSet.none()) { | ||
iconName = ":/img/status/extensions_unavailable.svg"; | ||
hoverText = tr("No extensions supported"); | ||
} else { | ||
iconName = ":/img/status/extensions_partial.svg"; | ||
hoverText = tr("Not all extensions supported"); | ||
} | ||
|
||
hoverText += "\n"; | ||
hoverText += tr("Multipart Messages: "); | ||
hoverText += extensionSet[ExtensionType::messages] ? "✔" : "❌"; | ||
|
||
auto pixmap = QIcon(iconName).pixmap(QSize(16, 16)); | ||
|
||
setPixmap(pixmap); | ||
setToolTip(hoverText); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
Copyright © 2019-2020 by The qTox Project Contributors | ||
This file is part of qTox, a Qt-based graphical interface for Tox. | ||
qTox is libre software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
qTox is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with qTox. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "src/core/extension.h" | ||
|
||
#include <QLabel> | ||
|
||
class ExtensionStatus : public QLabel | ||
{ | ||
Q_OBJECT | ||
public: | ||
ExtensionStatus(QWidget* parent = nullptr); | ||
|
||
public slots: | ||
void onExtensionSetUpdate(ExtensionSet extensionSet); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters