mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
revert(chatlog): "add action "Go to current date""
This reverts commit 2a9648d12c2f71efa8f9722f1c0fa6e39e701c47.
This commit is contained in:
parent
8c3f3199ef
commit
5efb0ba020
@ -204,15 +204,6 @@ std::vector<IChatLog::DateChatLogIdxPair> ChatHistory::getDateIdxs(const QDate&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t ChatHistory::size() const
|
|
||||||
{
|
|
||||||
if (canUseHistory()) {
|
|
||||||
return history->getNumMessagesForFriend(f.getPublicKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
return sessionChatLog.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChatHistory::onFileUpdated(const ToxPk& sender, const ToxFile& file)
|
void ChatHistory::onFileUpdated(const ToxPk& sender, const ToxFile& file)
|
||||||
{
|
{
|
||||||
if (canUseHistory()) {
|
if (canUseHistory()) {
|
||||||
|
@ -42,7 +42,6 @@ public:
|
|||||||
ChatLogIdx getFirstIdx() const override;
|
ChatLogIdx getFirstIdx() const override;
|
||||||
ChatLogIdx getNextIdx() const override;
|
ChatLogIdx getNextIdx() const override;
|
||||||
std::vector<DateChatLogIdxPair> getDateIdxs(const QDate& startDate, size_t maxDates) const override;
|
std::vector<DateChatLogIdxPair> getDateIdxs(const QDate& startDate, size_t maxDates) const override;
|
||||||
std::size_t size() const override;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onFileUpdated(const ToxPk& sender, const ToxFile& file);
|
void onFileUpdated(const ToxPk& sender, const ToxFile& file);
|
||||||
|
@ -138,8 +138,6 @@ public:
|
|||||||
virtual std::vector<DateChatLogIdxPair> getDateIdxs(const QDate& startDate,
|
virtual std::vector<DateChatLogIdxPair> getDateIdxs(const QDate& startDate,
|
||||||
size_t maxDates) const = 0;
|
size_t maxDates) const = 0;
|
||||||
|
|
||||||
virtual std::size_t size() const = 0;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void itemUpdated(ChatLogIdx idx);
|
void itemUpdated(ChatLogIdx idx);
|
||||||
};
|
};
|
||||||
|
@ -289,11 +289,6 @@ std::vector<IChatLog::DateChatLogIdxPair> SessionChatLog::getDateIdxs(const QDat
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t SessionChatLog::size() const
|
|
||||||
{
|
|
||||||
return items.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SessionChatLog::insertCompleteMessageAtIdx(ChatLogIdx idx, const ToxPk& sender, const QString& senderName,
|
void SessionChatLog::insertCompleteMessageAtIdx(ChatLogIdx idx, const ToxPk& sender, const QString& senderName,
|
||||||
const ChatLogMessage& message)
|
const ChatLogMessage& message)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,6 @@ public:
|
|||||||
ChatLogIdx getFirstIdx() const override;
|
ChatLogIdx getFirstIdx() const override;
|
||||||
ChatLogIdx getNextIdx() const override;
|
ChatLogIdx getNextIdx() const override;
|
||||||
std::vector<DateChatLogIdxPair> getDateIdxs(const QDate& startDate, size_t maxDates) const override;
|
std::vector<DateChatLogIdxPair> getDateIdxs(const QDate& startDate, size_t maxDates) const override;
|
||||||
std::size_t size() const override;
|
|
||||||
|
|
||||||
void insertCompleteMessageAtIdx(ChatLogIdx idx, const ToxPk& sender, const QString& senderName,
|
void insertCompleteMessageAtIdx(ChatLogIdx idx, const ToxPk& sender, const QString& senderName,
|
||||||
const ChatLogMessage& message);
|
const ChatLogMessage& message);
|
||||||
|
@ -326,13 +326,6 @@ GenericChatForm::GenericChatForm(const Contact* contact, IChatLog& chatLog,
|
|||||||
quoteAction = menu.addAction(QIcon(), QString(), this, SLOT(quoteSelectedText()),
|
quoteAction = menu.addAction(QIcon(), QString(), this, SLOT(quoteSelectedText()),
|
||||||
QKeySequence(Qt::ALT + Qt::Key_Q));
|
QKeySequence(Qt::ALT + Qt::Key_Q));
|
||||||
addAction(quoteAction);
|
addAction(quoteAction);
|
||||||
|
|
||||||
menu.addSeparator();
|
|
||||||
|
|
||||||
goCurrentDateAction = menu.addAction(QIcon(), QString(), this, SLOT(goToCurrentDate()),
|
|
||||||
QKeySequence(Qt::CTRL + Qt::Key_G));
|
|
||||||
addAction(goCurrentDateAction);
|
|
||||||
|
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|
||||||
searchAction = menu.addAction(QIcon(), QString(), this, SLOT(searchFormShow()),
|
searchAction = menu.addAction(QIcon(), QString(), this, SLOT(searchFormShow()),
|
||||||
@ -1005,16 +998,6 @@ void GenericChatForm::renderMessages(ChatLogIdx begin, ChatLogIdx end,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericChatForm::goToCurrentDate()
|
|
||||||
{
|
|
||||||
chatWidget->clear();
|
|
||||||
messages.clear();
|
|
||||||
auto end = ChatLogIdx(chatLog.size() - 1);
|
|
||||||
auto begin = end.get() > 100 ? ChatLogIdx(end.get() - 100) : ChatLogIdx(0);
|
|
||||||
|
|
||||||
renderMessages(begin, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GenericChatForm::loadHistoryLower()
|
void GenericChatForm::loadHistoryLower()
|
||||||
{
|
{
|
||||||
auto end = messages.begin()->first;
|
auto end = messages.begin()->first;
|
||||||
@ -1066,7 +1049,6 @@ void GenericChatForm::retranslateUi()
|
|||||||
quoteAction->setText(tr("Quote selected text"));
|
quoteAction->setText(tr("Quote selected text"));
|
||||||
copyLinkAction->setText(tr("Copy link address"));
|
copyLinkAction->setText(tr("Copy link address"));
|
||||||
searchAction->setText(tr("Search in text"));
|
searchAction->setText(tr("Search in text"));
|
||||||
goCurrentDateAction->setText(tr("Go to current date"));
|
|
||||||
loadHistoryAction->setText(tr("Load chat history..."));
|
loadHistoryAction->setText(tr("Load chat history..."));
|
||||||
exportChatAction->setText(tr("Export to file"));
|
exportChatAction->setText(tr("Export to file"));
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,6 @@ protected slots:
|
|||||||
void renderMessage(ChatLogIdx idx);
|
void renderMessage(ChatLogIdx idx);
|
||||||
void renderMessages(ChatLogIdx begin, ChatLogIdx end,
|
void renderMessages(ChatLogIdx begin, ChatLogIdx end,
|
||||||
std::function<void(void)> onCompletion = std::function<void(void)>());
|
std::function<void(void)> onCompletion = std::function<void(void)>());
|
||||||
void goToCurrentDate();
|
|
||||||
|
|
||||||
void loadHistoryLower();
|
void loadHistoryLower();
|
||||||
void loadHistoryUpper();
|
void loadHistoryUpper();
|
||||||
@ -166,7 +165,6 @@ protected:
|
|||||||
QAction* searchAction;
|
QAction* searchAction;
|
||||||
QAction* loadHistoryAction;
|
QAction* loadHistoryAction;
|
||||||
QAction* exportChatAction;
|
QAction* exportChatAction;
|
||||||
QAction* goCurrentDateAction;
|
|
||||||
|
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user