Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
bf5ae884
Unverified
Commit
bf5ae884
authored
5 years ago
by
Emi Simpson
Browse files
Options
Downloads
Patches
Plain Diff
Make toggle in settings revert between old behavior and new behavior for sorting by unreads
parent
abac4c8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/RoomInfoListItem.cpp
+14
-11
14 additions, 11 deletions
src/RoomInfoListItem.cpp
src/UserSettingsPage.cpp
+7
-7
7 additions, 7 deletions
src/UserSettingsPage.cpp
src/UserSettingsPage.h
+5
-5
5 additions, 5 deletions
src/UserSettingsPage.h
with
26 additions
and
23 deletions
src/RoomInfoListItem.cpp
+
14
−
11
View file @
bf5ae884
...
...
@@ -329,29 +329,32 @@ RoomInfoListItem::updateUnreadMessageCount(int count, int highlightedCount)
update
();
}
enum
NotificationImportance
:
unsigned
short
enum
NotificationImportance
:
short
{
AllEventsRead
=
0
,
NewMinorEvents
=
1
,
NewMessage
=
2
,
NewMentions
=
3
,
Invite
=
4
ImportanceDisabled
=
-
1
,
AllEventsRead
=
0
,
NewMinorEvents
=
1
,
// This is currently unused
NewMessage
=
2
,
NewMentions
=
3
,
Invite
=
4
};
unsigned
short
int
RoomInfoListItem
::
calculateImportance
()
const
{
// Returns the degree of importance of the unread messages in the room.
// If ignoreMinorEvents is set to true in the settings, then
// NewMinorEvents will always be rounded down to AllEventsRead
if
(
isInvite
())
{
// If sorting by importance is disabled in settings, this only ever
// returns ImportanceDisabled
if
(
!
settings
->
isSortByImportanceEnabled
())
{
return
ImportanceDisabled
;
}
else
if
(
isInvite
())
{
return
Invite
;
}
else
if
(
unreadHighlightedMsgCount_
)
{
return
NewMentions
;
}
else
if
(
unreadMsgCount_
)
{
return
NewMessage
;
}
else
if
(
hasUnreadMessages_
&&
!
settings
->
isIgnoreMinorEventsEnabled
())
{
return
NewMinorEvents
;
//
} else if (hasUnreadMessages_ && !settings->isIgnoreMinorEventsEnabled()) {
//
return NewMinorEvents;
}
else
{
return
AllEventsRead
;
}
...
...
This diff is collapsed.
Click to expand it.
src/UserSettingsPage.cpp
+
7
−
7
View file @
bf5ae884
...
...
@@ -58,7 +58,7 @@ UserSettings::load()
isButtonsInTimelineEnabled_
=
settings
.
value
(
"user/timeline/buttons"
,
true
).
toBool
();
isMarkdownEnabled_
=
settings
.
value
(
"user/markdown_enabled"
,
true
).
toBool
();
isTypingNotificationsEnabled_
=
settings
.
value
(
"user/typing_notifications"
,
true
).
toBool
();
ignoreMinorEvents_
=
settings
.
value
(
"user/
minor_events"
,
fals
e
).
toBool
();
sortByImportance_
=
settings
.
value
(
"user/
sort_by_unread"
,
tru
e
).
toBool
();
isReadReceiptsEnabled_
=
settings
.
value
(
"user/read_receipts"
,
true
).
toBool
();
theme_
=
settings
.
value
(
"user/theme"
,
defaultTheme_
).
toString
();
font_
=
settings
.
value
(
"user/font_family"
,
"default"
).
toString
();
...
...
@@ -136,7 +136,7 @@ UserSettings::save()
settings
.
setValue
(
"font_size"
,
baseFontSize_
);
settings
.
setValue
(
"typing_notifications"
,
isTypingNotificationsEnabled_
);
settings
.
setValue
(
"minor_events"
,
ignoreMinorEvents
_
);
settings
.
setValue
(
"minor_events"
,
sortByImportance
_
);
settings
.
setValue
(
"read_receipts"
,
isReadReceiptsEnabled_
);
settings
.
setValue
(
"group_view"
,
isGroupViewEnabled_
);
settings
.
setValue
(
"markdown_enabled"
,
isMarkdownEnabled_
);
...
...
@@ -199,7 +199,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
groupViewToggle_
=
new
Toggle
{
this
};
timelineButtonsToggle_
=
new
Toggle
{
this
};
typingNotifications_
=
new
Toggle
{
this
};
ignoreMinorEvents_
=
new
Toggle
{
this
};
sortByImportance_
=
new
Toggle
{
this
};
readReceipts_
=
new
Toggle
{
this
};
markdownEnabled_
=
new
Toggle
{
this
};
desktopNotifications_
=
new
Toggle
{
this
};
...
...
@@ -303,7 +303,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
boxWrap
(
tr
(
"Group's sidebar"
),
groupViewToggle_
);
boxWrap
(
tr
(
"Show buttons in timeline"
),
timelineButtonsToggle_
);
boxWrap
(
tr
(
"Typing notifications"
),
typingNotifications_
);
boxWrap
(
tr
(
"
Ignore minor events in room list"
),
ignoreMinorEvents
_
);
boxWrap
(
tr
(
"
Sort rooms by unreads"
),
sortByImportance
_
);
formLayout_
->
addRow
(
new
HorizontalLine
{
this
});
boxWrap
(
tr
(
"Read receipts"
),
readReceipts_
);
boxWrap
(
tr
(
"Send messages as Markdown"
),
markdownEnabled_
);
...
...
@@ -405,8 +405,8 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
settings_
->
setTypingNotifications
(
!
isDisabled
);
});
connect
(
ignoreMinorEvents
_
,
&
Toggle
::
toggled
,
this
,
[
this
](
bool
isDisabled
)
{
settings_
->
set
IgnoreMinorEvents
(
!
isDisabled
);
connect
(
sortByImportance
_
,
&
Toggle
::
toggled
,
this
,
[
this
](
bool
isDisabled
)
{
settings_
->
set
SortByImportance
(
!
isDisabled
);
});
connect
(
timelineButtonsToggle_
,
&
Toggle
::
toggled
,
this
,
[
this
](
bool
isDisabled
)
{
...
...
@@ -447,7 +447,7 @@ UserSettingsPage::showEvent(QShowEvent *)
groupViewToggle_
->
setState
(
!
settings_
->
isGroupViewEnabled
());
avatarCircles_
->
setState
(
!
settings_
->
isAvatarCirclesEnabled
());
typingNotifications_
->
setState
(
!
settings_
->
isTypingNotificationsEnabled
());
ignoreMinorEvents
_
->
setState
(
!
settings_
->
is
IgnoreMinorEvents
Enabled
());
sortByImportance
_
->
setState
(
!
settings_
->
is
SortByImportance
Enabled
());
timelineButtonsToggle_
->
setState
(
!
settings_
->
isButtonsInTimelineEnabled
());
readReceipts_
->
setState
(
!
settings_
->
isReadReceiptsEnabled
());
markdownEnabled_
->
setState
(
!
settings_
->
isMarkdownEnabled
());
...
...
This diff is collapsed.
Click to expand it.
src/UserSettingsPage.h
+
5
−
5
View file @
bf5ae884
...
...
@@ -87,9 +87,9 @@ public:
save
();
}
void
set
IgnoreMinorEvents
(
bool
state
)
void
set
SortByImportance
(
bool
state
)
{
ignoreMinorEvents
_
=
state
;
sortByImportance
_
=
state
;
emit
roomSortingChanged
();
}
...
...
@@ -118,7 +118,7 @@ public:
bool
isAvatarCirclesEnabled
()
const
{
return
avatarCircles_
;
}
bool
isMarkdownEnabled
()
const
{
return
isMarkdownEnabled_
;
}
bool
isTypingNotificationsEnabled
()
const
{
return
isTypingNotificationsEnabled_
;
}
bool
is
IgnoreMinorEvents
Enabled
()
const
{
return
ignoreMinorEvents
_
;
}
bool
is
SortByImportance
Enabled
()
const
{
return
sortByImportance
_
;
}
bool
isButtonsInTimelineEnabled
()
const
{
return
isButtonsInTimelineEnabled_
;
}
bool
isReadReceiptsEnabled
()
const
{
return
isReadReceiptsEnabled_
;
}
bool
hasDesktopNotifications
()
const
{
return
hasDesktopNotifications_
;
}
...
...
@@ -142,7 +142,7 @@ private:
bool
isGroupViewEnabled_
;
bool
isMarkdownEnabled_
;
bool
isTypingNotificationsEnabled_
;
bool
ignoreMinorEvents
_
;
bool
sortByImportance
_
;
bool
isButtonsInTimelineEnabled_
;
bool
isReadReceiptsEnabled_
;
bool
hasDesktopNotifications_
;
...
...
@@ -194,7 +194,7 @@ private:
Toggle
*
groupViewToggle_
;
Toggle
*
timelineButtonsToggle_
;
Toggle
*
typingNotifications_
;
Toggle
*
ignoreMinorEvents
_
;
Toggle
*
sortByImportance
_
;
Toggle
*
readReceipts_
;
Toggle
*
markdownEnabled_
;
Toggle
*
desktopNotifications_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment