Merge pull request 'Upgrade libCwtch + Formatting Pass' (#82) from fix-reconnect into trunk
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #82 Reviewed-by: erinn <erinn@openprivacy.ca>
This commit is contained in:
commit
1a8d91548e
|
@ -1 +1 @@
|
|||
v1.0.0-12-g2e0b6ef-2021-06-29-23-42
|
||||
v1.0.0-20-gf8eedca-2021-06-30-20-48
|
|
@ -115,6 +115,5 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''');
|
||||
|
||||
|
||||
yield LicenseEntryWithLineBreaks(["flaticons"], "Icons made by Freepik (https://www.freepik.com) from Flaticon (www.flaticon.com)");
|
||||
}
|
||||
|
|
|
@ -190,7 +190,8 @@ class FlwtchState extends State<Flwtch> {
|
|||
},
|
||||
),
|
||||
);
|
||||
} else { //dual pane
|
||||
} else {
|
||||
//dual pane
|
||||
Provider.of<AppState>(navKey.currentContext!, listen: false).selectedProfile = args["ProfileOnion"];
|
||||
Provider.of<AppState>(navKey.currentContext!, listen: false).selectedConversation = args["Handle"];
|
||||
}
|
||||
|
|
|
@ -22,10 +22,7 @@ class LinuxNotificationsManager implements NotificationsManager {
|
|||
}
|
||||
Future<void> notify(String message) async {
|
||||
var iconPath = Uri.file(path.join(path.current, "cwtch.png"));
|
||||
client.notify(message, appName: "cwtch",
|
||||
appIcon: iconPath.toString(),
|
||||
replacesId: this.previous_id).then((Notification value) =>
|
||||
previous_id = value.id);
|
||||
client.notify(message, appName: "cwtch", appIcon: iconPath.toString(), replacesId: this.previous_id).then((Notification value) => previous_id = value.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -314,7 +314,6 @@ abstract class OpaqueThemeType {
|
|||
double contactOnionTextSize() {
|
||||
return 18;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class OpaqueDark extends OpaqueThemeType {
|
||||
|
|
|
@ -162,25 +162,39 @@ class Settings extends ChangeNotifier {
|
|||
List<int> uiColumns(bool isLandscape) {
|
||||
var m = (!isLandscape || uiColumnModeLandscape == DualpaneMode.CopyPortrait) ? uiColumnModePortrait : uiColumnModeLandscape;
|
||||
switch (m) {
|
||||
case DualpaneMode.Single: return [1];
|
||||
case DualpaneMode.Dual1to2: return [1, 2];
|
||||
case DualpaneMode.Dual1to4: return [1, 4];
|
||||
case DualpaneMode.Single:
|
||||
return [1];
|
||||
case DualpaneMode.Dual1to2:
|
||||
return [1, 2];
|
||||
case DualpaneMode.Dual1to4:
|
||||
return [1, 4];
|
||||
}
|
||||
print("impossible column configuration: portrait/$uiColumnModePortrait landscape/$uiColumnModeLandscape");
|
||||
return [1];
|
||||
}
|
||||
|
||||
static List<DualpaneMode> uiColumnModeOptions(bool isLandscape) {
|
||||
if (isLandscape) return [DualpaneMode.CopyPortrait, DualpaneMode.Single, DualpaneMode.Dual1to2, DualpaneMode.Dual1to4,];
|
||||
else return [DualpaneMode.Single, DualpaneMode.Dual1to2, DualpaneMode.Dual1to4];
|
||||
if (isLandscape)
|
||||
return [
|
||||
DualpaneMode.CopyPortrait,
|
||||
DualpaneMode.Single,
|
||||
DualpaneMode.Dual1to2,
|
||||
DualpaneMode.Dual1to4,
|
||||
];
|
||||
else
|
||||
return [DualpaneMode.Single, DualpaneMode.Dual1to2, DualpaneMode.Dual1to4];
|
||||
}
|
||||
|
||||
static DualpaneMode uiColumnModeFromString(String m) {
|
||||
switch (m) {
|
||||
case "DualpaneMode.Single": return DualpaneMode.Single;
|
||||
case "DualpaneMode.Dual1to2": return DualpaneMode.Dual1to2;
|
||||
case "DualpaneMode.Dual1to4": return DualpaneMode.Dual1to4;
|
||||
case "DualpaneMode.CopyPortrait": return DualpaneMode.CopyPortrait;
|
||||
case "DualpaneMode.Single":
|
||||
return DualpaneMode.Single;
|
||||
case "DualpaneMode.Dual1to2":
|
||||
return DualpaneMode.Dual1to2;
|
||||
case "DualpaneMode.Dual1to4":
|
||||
return DualpaneMode.Dual1to4;
|
||||
case "DualpaneMode.CopyPortrait":
|
||||
return DualpaneMode.CopyPortrait;
|
||||
}
|
||||
print("Error: ui requested translation of column mode [$m] which doesn't exist");
|
||||
return DualpaneMode.Single;
|
||||
|
@ -189,10 +203,14 @@ class Settings extends ChangeNotifier {
|
|||
static String uiColumnModeToString(DualpaneMode m) {
|
||||
// todo: translate
|
||||
switch (m) {
|
||||
case DualpaneMode.Single: return "Single";
|
||||
case DualpaneMode.Dual1to2: return "Double (1:2)";
|
||||
case DualpaneMode.Dual1to4: return "Double (1:4)";
|
||||
case DualpaneMode.CopyPortrait: return "Same as portrait mode setting";
|
||||
case DualpaneMode.Single:
|
||||
return "Single";
|
||||
case DualpaneMode.Dual1to2:
|
||||
return "Double (1:2)";
|
||||
case DualpaneMode.Dual1to4:
|
||||
return "Double (1:4)";
|
||||
case DualpaneMode.CopyPortrait:
|
||||
return "Same as portrait mode setting";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,10 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
|||
autoFillHints: [AutofillHints.newPassword],
|
||||
validator: (value) {
|
||||
// Password field can be empty when just updating the profile, not on creation
|
||||
if (Provider.of<ProfileInfoState>(context).isEncrypted && Provider.of<ProfileInfoState>(context, listen: false).onion.isEmpty && value.isEmpty && usePassword) {
|
||||
if (Provider.of<ProfileInfoState>(context).isEncrypted &&
|
||||
Provider.of<ProfileInfoState>(context, listen: false).onion.isEmpty &&
|
||||
value.isEmpty &&
|
||||
usePassword) {
|
||||
return AppLocalizations.of(context)!.passwordErrorEmpty;
|
||||
}
|
||||
if (Provider.of<ErrorHandler>(context).deleteProfileError == true) {
|
||||
|
|
|
@ -60,7 +60,9 @@ class _MessageViewState extends State<MessageView> {
|
|||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),Text(Provider.of<ContactInfoState>(context).nickname)]),
|
||||
),
|
||||
Text(Provider.of<ContactInfoState>(context).nickname)
|
||||
]),
|
||||
actions: [
|
||||
//IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings),
|
||||
//IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings),
|
||||
|
|
|
@ -40,8 +40,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
|
|||
// Prevents Android back button from closing the app on the profile manager screen
|
||||
// (which would shutdown connections and all kinds of other expensive to generate things)
|
||||
// TODO pop up a dialogue regarding closing the app?
|
||||
builder: (context, settings, child) =>
|
||||
WillPopScope(
|
||||
builder: (context, settings, child) => WillPopScope(
|
||||
onWillPop: () async {
|
||||
_modalShutdown();
|
||||
return Provider.of<AppState>(context, listen: false).cwtchIsClosing;
|
||||
|
@ -57,10 +56,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
|
|||
width: 32,
|
||||
height: 32,
|
||||
colorBlendMode: BlendMode.dstIn,
|
||||
color: Provider
|
||||
.of<Settings>(context)
|
||||
.theme
|
||||
.backgroundHilightElementColor(),
|
||||
color: Provider.of<Settings>(context).theme.backgroundHilightElementColor(),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
|
|
|
@ -33,7 +33,11 @@ class _ContactRowState extends State<ContactRow> {
|
|||
diameter: 64.0,
|
||||
imagePath: contact.imagePath,
|
||||
maskOut: !contact.isOnline(),
|
||||
border: contact.isOnline() ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor() : contact.isBlocked ? Provider.of<Settings>(context).theme.portraitBlockedBorderColor() : Provider.of<Settings>(context).theme.portraitOfflineBorderColor()),
|
||||
border: contact.isOnline()
|
||||
? Provider.of<Settings>(context).theme.portraitOnlineBorderColor()
|
||||
: contact.isBlocked
|
||||
? Provider.of<Settings>(context).theme.portraitBlockedBorderColor()
|
||||
: Provider.of<Settings>(context).theme.portraitOfflineBorderColor()),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
|
@ -44,8 +48,11 @@ class _ContactRowState extends State<ContactRow> {
|
|||
Text(
|
||||
contact.nickname, //(contact.isInvitation ? "invite " : "non-invite ") + (contact.isBlocked ? "blokt" : "nonblokt"),//
|
||||
|
||||
style: TextStyle(fontSize: Provider.of<Settings>(context).theme.contactOnionTextSize(),
|
||||
color: contact.isBlocked ? Provider.of<Settings>(context).theme.portraitBlockedTextColor() : Provider.of<Settings>(context).theme.mainTextColor()), //Provider.of<FlwtchState>(context).biggerFont,
|
||||
style: TextStyle(
|
||||
fontSize: Provider.of<Settings>(context).theme.contactOnionTextSize(),
|
||||
color: contact.isBlocked
|
||||
? Provider.of<Settings>(context).theme.portraitBlockedTextColor()
|
||||
: Provider.of<Settings>(context).theme.mainTextColor()), //Provider.of<FlwtchState>(context).biggerFont,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
|
@ -60,7 +67,10 @@ class _ContactRowState extends State<ContactRow> {
|
|||
IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
iconSize: 16,
|
||||
icon: Icon(Icons.favorite, color: Provider.of<Settings>(context).theme.mainTextColor(),),
|
||||
icon: Icon(
|
||||
Icons.favorite,
|
||||
color: Provider.of<Settings>(context).theme.mainTextColor(),
|
||||
),
|
||||
tooltip: AppLocalizations.of(context)!.tooltipAcceptContactRequest,
|
||||
onPressed: _btnApprove,
|
||||
),
|
||||
|
|
|
@ -66,9 +66,9 @@ class InvitationBubbleState extends State<InvitationBubble> {
|
|||
return MalformedBubble();
|
||||
}
|
||||
|
||||
var wdgMessage = isGroup && !showGroupInvite ?
|
||||
Text(AppLocalizations.of(context)!.groupInviteSettingsWarning) :
|
||||
fromMe
|
||||
var wdgMessage = isGroup && !showGroupInvite
|
||||
? Text(AppLocalizations.of(context)!.groupInviteSettingsWarning)
|
||||
: fromMe
|
||||
? senderInviteChrome(AppLocalizations.of(context)!.sendAnInvitation,
|
||||
isGroup ? Provider.of<ProfileInfoState>(context).contactList.getContact(Provider.of<MessageState>(context).inviteTarget)!.nickname : Provider.of<MessageState>(context).message, myKey)
|
||||
: (inviteChrome(isGroup ? AppLocalizations.of(context)!.inviteToGroup : AppLocalizations.of(context)!.contactSuggestion, Provider.of<MessageState>(context).inviteNick,
|
||||
|
@ -113,7 +113,8 @@ class InvitationBubbleState extends State<InvitationBubble> {
|
|||
child: Padding(
|
||||
padding: EdgeInsets.all(9.0),
|
||||
child: Wrap(runAlignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.spaceEvenly, runSpacing: 1.0, crossAxisAlignment: WrapCrossAlignment.center, children: [
|
||||
Center(widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(isGroup && !showGroupInvite ? CwtchIcons.enable_experiments : CwtchIcons.send_invite, size: 32))),
|
||||
Center(
|
||||
widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(isGroup && !showGroupInvite ? CwtchIcons.enable_experiments : CwtchIcons.send_invite, size: 32))),
|
||||
Center(
|
||||
widthFactor: 1.0,
|
||||
child: Column(
|
||||
|
|
|
@ -16,7 +16,6 @@ class _MessageListState extends State<MessageList> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext outerContext) {
|
||||
|
||||
bool isP2P = !Provider.of<ContactInfoState>(context).isGroup;
|
||||
bool isGroupAndSyncing = Provider.of<ContactInfoState>(context).isGroup == true && Provider.of<ContactInfoState>(context).status == "Authenticated";
|
||||
bool isGroupAndSynced = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status == "Synced";
|
||||
|
@ -37,9 +36,8 @@ class _MessageListState extends State<MessageList> {
|
|||
child: Container(
|
||||
padding: EdgeInsets.all(5.0),
|
||||
color: Provider.of<Settings>(context).theme.defaultButtonActiveColor(),
|
||||
child: showSyncing ?
|
||||
Text(AppLocalizations.of(context)!.serverNotSynced,
|
||||
textAlign: TextAlign.center)
|
||||
child: showSyncing
|
||||
? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center)
|
||||
: showOfflineWarning
|
||||
? Text(Provider.of<ContactInfoState>(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage,
|
||||
textAlign: TextAlign.center)
|
||||
|
@ -64,7 +62,8 @@ class _MessageListState extends State<MessageList> {
|
|||
image: AssetImage("assets/core/negative_heart_512px.png"),
|
||||
colorFilter: ColorFilter.mode(Provider.of<Settings>(context).theme.hilightElementTextColor(), BlendMode.srcIn))),
|
||||
// Don't load messages for syncing server...
|
||||
child: loadMessages ? ListView.builder(
|
||||
child: loadMessages
|
||||
? ListView.builder(
|
||||
controller: ctrlr1,
|
||||
itemCount: Provider.of<ContactInfoState>(outerContext).totalMessages,
|
||||
reverse: true, // NOTE: There seems to be a bug in flutter that corrects the mouse wheel scroll, but not the drag direction...
|
||||
|
@ -86,7 +85,8 @@ class _MessageListState extends State<MessageList> {
|
|||
return RepaintBoundary(child: MessageRow(key: Provider.of<ContactInfoState>(bcontext).getMessageKey(idx)));
|
||||
});
|
||||
},
|
||||
) : null )))
|
||||
)
|
||||
: null)))
|
||||
])));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,32 +30,18 @@ class _ProfileRowState extends State<ProfileRow> {
|
|||
padding: const EdgeInsets.all(2.0), //border size
|
||||
child: ProfileImage(
|
||||
badgeCount: 0,
|
||||
badgeColor: Provider
|
||||
.of<Settings>(context)
|
||||
.theme
|
||||
.portraitProfileBadgeColor(),
|
||||
badgeTextColor: Provider
|
||||
.of<Settings>(context)
|
||||
.theme
|
||||
.portraitProfileBadgeTextColor(),
|
||||
badgeColor: Provider.of<Settings>(context).theme.portraitProfileBadgeColor(),
|
||||
badgeTextColor: Provider.of<Settings>(context).theme.portraitProfileBadgeTextColor(),
|
||||
diameter: 64.0,
|
||||
imagePath: profile.imagePath,
|
||||
border: profile.isOnline ? Provider
|
||||
.of<Settings>(context)
|
||||
.theme
|
||||
.portraitOnlineBorderColor() : Provider
|
||||
.of<Settings>(context)
|
||||
.theme
|
||||
.portraitOfflineBorderColor())),
|
||||
border: profile.isOnline ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor() : Provider.of<Settings>(context).theme.portraitOfflineBorderColor())),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
profile.nickname,
|
||||
semanticsLabel: profile.nickname,
|
||||
style: Provider
|
||||
.of<FlwtchState>(context)
|
||||
.biggerFont,
|
||||
style: Provider.of<FlwtchState>(context).biggerFont,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
@ -94,8 +80,7 @@ class _ProfileRowState extends State<ProfileRow> {
|
|||
MaterialPageRoute<void>(
|
||||
settings: RouteSettings(name: "conversations"),
|
||||
builder: (BuildContext buildcontext) {
|
||||
return OrientationBuilder(
|
||||
builder: (orientationBuilderContext, orientation) {
|
||||
return OrientationBuilder(builder: (orientationBuilderContext, orientation) {
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<ProfileInfoState>.value(value: profile),
|
||||
|
@ -105,8 +90,7 @@ class _ProfileRowState extends State<ProfileRow> {
|
|||
var appState = Provider.of<AppState>(context);
|
||||
var settings = Provider.of<Settings>(context);
|
||||
return settings.uiColumns(appState.isLandscape(innercontext)).length > 1 ? DoubleColumnView() : ContactsView();
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
},
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue