revert: remove protected mode
protected mode is designed for borderless and transparent window. it is not suit for the goal of this fork.
This commit is contained in:
@@ -62,7 +62,6 @@ void ActionManager::setupAction(MainWindow *mainWindow)
|
||||
CREATE_NEW_ACTION(mainWindow, actionCopyFilePath);
|
||||
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionPaste, edit-paste);
|
||||
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionTrash, edit-delete);
|
||||
CREATE_NEW_ACTION(mainWindow, actionToggleProtectMode);
|
||||
CREATE_NEW_ACTION(mainWindow, actionToggleAvoidResetTransform);
|
||||
CREATE_NEW_ACTION(mainWindow, actionSettings);
|
||||
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionHelp, system-help);
|
||||
@@ -104,7 +103,6 @@ void ActionManager::retranslateUi(MainWindow *mainWindow)
|
||||
actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr));
|
||||
actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr));
|
||||
actionTrash->setText(QCoreApplication::translate("MainWindow", "Move to Trash", nullptr));
|
||||
actionToggleProtectMode->setText(QCoreApplication::translate("MainWindow", "Protected mode", nullptr));
|
||||
actionToggleAvoidResetTransform->setText(QCoreApplication::translate("MainWindow", "Keep transformation", "The 'transformation' means the flip/rotation status that currently applied to the image view"));
|
||||
actionSettings->setText(QCoreApplication::translate("MainWindow", "Configure...", nullptr));
|
||||
actionHelp->setText(QCoreApplication::translate("MainWindow", "Help", nullptr));
|
||||
|
||||
@@ -45,7 +45,6 @@ public:
|
||||
QAction *actionCopyFilePath;
|
||||
QAction *actionPaste;
|
||||
QAction *actionTrash;
|
||||
QAction *actionToggleProtectMode;
|
||||
QAction *actionToggleAvoidResetTransform;
|
||||
QAction *actionSettings;
|
||||
QAction *actionHelp;
|
||||
|
||||
@@ -441,10 +441,6 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
|
||||
|
||||
QAction * trash = m_am->actionTrash;
|
||||
|
||||
QAction * protectedMode = m_am->actionToggleProtectMode;
|
||||
protectedMode->setCheckable(true);
|
||||
protectedMode->setChecked(m_protectedMode);
|
||||
|
||||
QAction * avoidResetTransform = m_am->actionToggleAvoidResetTransform;
|
||||
avoidResetTransform->setCheckable(true);
|
||||
avoidResetTransform->setChecked(m_graphicsView->avoidResetTransform());
|
||||
@@ -475,7 +471,6 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
|
||||
menu->addAction(m_am->actionFitByWidth);
|
||||
#endif // 0
|
||||
menu->addSeparator();
|
||||
menu->addAction(protectedMode);
|
||||
menu->addAction(avoidResetTransform);
|
||||
menu->addSeparator();
|
||||
menu->addAction(toggleSettings);
|
||||
@@ -565,12 +560,6 @@ void MainWindow::updateWidgetsPosition()
|
||||
m_gv->move(width() - m_gv->width(), height() - m_gv->height());
|
||||
}
|
||||
|
||||
void MainWindow::toggleProtectedMode()
|
||||
{
|
||||
m_protectedMode = !m_protectedMode;
|
||||
updateGalleryButtonsVisibility();
|
||||
}
|
||||
|
||||
void MainWindow::toggleAvoidResetTransform()
|
||||
{
|
||||
m_graphicsView->setAvoidResetTransform(!m_graphicsView->avoidResetTransform());
|
||||
@@ -596,9 +585,7 @@ bool MainWindow::canPaste() const
|
||||
|
||||
void MainWindow::quitAppAction(bool force)
|
||||
{
|
||||
if (!m_protectedMode || force) {
|
||||
closeWindow();
|
||||
}
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
void MainWindow::toggleFullscreen()
|
||||
@@ -780,11 +767,6 @@ void MainWindow::on_actionAnimationNextFrame_triggered()
|
||||
m_graphicsView->scene()->skipAnimationFrame(1);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionToggleProtectMode_triggered()
|
||||
{
|
||||
toggleProtectedMode();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionToggleAvoidResetTransform_triggered()
|
||||
{
|
||||
toggleAvoidResetTransform();
|
||||
@@ -869,8 +851,8 @@ void MainWindow::updateGalleryButtonsVisibility()
|
||||
{
|
||||
const int galleryFileCount = m_pm->totalCount();
|
||||
const bool loopGallery = Settings::instance()->loopGallery();
|
||||
m_prevButton->setVisible(!m_protectedMode && galleryFileCount > 1);
|
||||
m_nextButton->setVisible(!m_protectedMode && galleryFileCount > 1);
|
||||
m_prevButton->setVisible(galleryFileCount > 1);
|
||||
m_nextButton->setVisible(galleryFileCount > 1);
|
||||
m_prevButton->setEnabled(loopGallery || !m_pm->isFirstIndex());
|
||||
m_nextButton->setEnabled(loopGallery || !m_pm->isLastIndex());
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ protected slots:
|
||||
void centerWindow();
|
||||
void closeWindow();
|
||||
void updateWidgetsPosition();
|
||||
void toggleProtectedMode();
|
||||
void toggleAvoidResetTransform();
|
||||
bool canPaste() const;
|
||||
void quitAppAction(bool force = false);
|
||||
@@ -95,7 +94,6 @@ private slots:
|
||||
void on_actionCopyFilePath_triggered();
|
||||
void on_actionPaste_triggered();
|
||||
void on_actionTrash_triggered();
|
||||
void on_actionToggleProtectMode_triggered();
|
||||
void on_actionToggleAvoidResetTransform_triggered();
|
||||
void on_actionSettings_triggered();
|
||||
void on_actionHelp_triggered();
|
||||
@@ -118,7 +116,6 @@ private:
|
||||
GraphicsView *m_graphicsView;
|
||||
NavigatorView *m_gv;
|
||||
BottomButtonGroup *m_bottomButtonGroup;
|
||||
bool m_protectedMode = false;
|
||||
bool m_clickedOnWindow = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user