Skip to content

Commit

Permalink
Display last login time on "User Accounts" dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
CoBC authored and bear101 committed Oct 18, 2024
1 parent f6f19c5 commit cea8278
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
TeamTalk
----------------------------------------------

Version 5.17.1, unreleased
Version 5.18, unreleased
Default Qt Client
- Media tab in main window for controlling media file streaming
- Support "{username}" variable for majority of TTS and status events related to user action
Expand All @@ -11,6 +11,7 @@ Default Qt Client
- All byte sizes converted to local format
- Option to use TeamTalk Sound Output device for default sound event playback mode
- Option to choose bitween text or emoji for user and channel info in channel list
- Last login time display in "User Accounts" dialog
- Fixed gender changed from female to male when migrating to 5.17 release
- Fixed sound events disabled when migrating to 5.17 release
- Fixed language not set at first start
Expand Down
2 changes: 2 additions & 0 deletions Client/qtTeamTalk/useraccountdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ UserAccountDlg::UserAccountDlg(UserAccountDlgType type, const UserAccount& usera
this->setAccessibleDescription(tr("Add User on Server"));
ui->typeComboBox->setCurrentIndex(ui->typeComboBox->findData(USERTYPE_DEFAULT));
ui->lastEditLabel->setVisible(false);
ui->lastLoginLabel->setVisible(false);
ui->typeComboBox->setFocus();
break;
case USER_UPDATE :
Expand Down Expand Up @@ -369,6 +370,7 @@ void UserAccountDlg::showUserAccount(const UserAccount& useraccount)
ui->noteEdit->setPlainText(_Q(useraccount.szNote));
ui->channelComboBox->lineEdit()->setText(_Q(useraccount.szInitChannel));
ui->lastEditLabel->setText(tr("Last edited: %1").arg(getFormattedDateTime(_Q(useraccount.szLastModified), "yyyy/MM/dd hh:mm")));
ui->lastLoginLabel->setText(tr("Last login: %1").arg(getFormattedDateTime(_Q(useraccount.szLastLoginTime), "yyyy/MM/dd hh:mm")));

updateUserRights(useraccount);

Expand Down
10 changes: 10 additions & 0 deletions Client/qtTeamTalk/useraccountdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="lastLoginLabel">
<property name="text">
<string/>
</property>
<property name="focusPolicy">
<set>Qt::StrongFocus</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
3 changes: 3 additions & 0 deletions Client/qtTeamTalk/useraccountsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ QVariant UserAccountsModel::headerData(int section, Qt::Orientation orientation,
case COLUMN_INDEX_NOTE: return tr("Note");
case COLUMN_INDEX_CHANNEL: return tr("Channel");
case COLUMN_INDEX_MODIFIED : return tr("Modified");
case COLUMN_INDEX_LASTLOGIN : return tr("Last Login");
}
}
return QVariant();
Expand Down Expand Up @@ -76,6 +77,8 @@ QVariant UserAccountsModel::data(const QModelIndex & index, int role /*= Qt::Dis
return _Q(m_users[index.row()].szInitChannel);
case COLUMN_INDEX_MODIFIED :
return getFormattedDateTime(_Q(m_users[index.row()].szLastModified), "yyyy/MM/dd hh:mm");
case COLUMN_INDEX_LASTLOGIN :
return getFormattedDateTime(_Q(m_users[index.row()].szLastLoginTime), "yyyy/MM/dd hh:mm");
}
break;
case Qt::AccessibleTextRole:
Expand Down
1 change: 1 addition & 0 deletions Client/qtTeamTalk/useraccountsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ enum
COLUMN_INDEX_NOTE,
COLUMN_INDEX_CHANNEL,
COLUMN_INDEX_MODIFIED,
COLUMN_INDEX_LASTLOGIN,
COLUMN_COUNT_USERACCOUNTS,
};

Expand Down

0 comments on commit cea8278

Please sign in to comment.