Skip to content

Commit

Permalink
fix: prevent quiting if systemtray available and used in old QT versions
Browse files Browse the repository at this point in the history
  • Loading branch information
keshavbhatt committed May 29, 2023
1 parent 9c7179b commit ad03cfd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ void MainWindow::resizeFix() {
}

void MainWindow::closeEvent(QCloseEvent *event) {
QMainWindow::closeEvent(event);

m_settings.setValue("geometry", saveGeometry());

Expand All @@ -342,6 +341,14 @@ void MainWindow::closeEvent(QCloseEvent *event) {
m_settingsWidget->quickResultCheckBoxChecked());

m_trayManager->updateMenu(false);

if (QSystemTrayIcon::isSystemTrayAvailable()) {
this->hide();
event->ignore();
return;
}

QMainWindow::closeEvent(event);
}

void MainWindow::resizeEvent(QResizeEvent *event) {
Expand Down

3 comments on commit ad03cfd

@vishu-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to increase characher limit for glate application.It support only 5000 characters.

@keshavbhatt
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to increase characher limit for glate application.It support only 5000 characters.

The API that powers Glate (Google translate API) support only 5000 characters in one request. Hence it is not possible.
We can achieve it by making multiple requests. Break the content into batches and stitch them together later.

@vishu-3
Copy link

@vishu-3 vishu-3 commented on ad03cfd Jun 20, 2024 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.