Skip to content

Commit f4ee107

Browse files
gui: add "Mark Modified" button to resave unedited pack file
1 parent 0a8d203 commit f4ee107

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/gui/Window.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ Window::Window(QWidget* parent)
190190
});
191191
this->addDirAction->setDisabled(true);
192192

193+
this->markModifiedAction = editMenu->addAction(this->style()->standardIcon(QStyle::SP_BrowserReload), tr("Mark Modified"), Qt::CTRL | Qt::Key_M, [this] {
194+
this->markModified(true);
195+
});
196+
this->markModifiedAction->setDisabled(true);
197+
193198
editMenu->addSeparator();
194199
this->setPropertiesAction = editMenu->addAction(this->style()->standardIcon(QStyle::SP_FileDialogContentsView), tr("Properties..."), Qt::CTRL | Qt::Key_P, [this] {
195200
this->setProperties();
@@ -1386,6 +1391,7 @@ void Window::freezeActions(bool freeze, bool freezeCreationActions, bool freezeF
13861391
this->extractAllAction->setDisabled(freeze);
13871392
this->addFileAction->setDisabled(freeze);
13881393
this->addDirAction->setDisabled(freeze);
1394+
this->markModifiedAction->setDisabled(freeze);
13891395
this->setPropertiesAction->setDisabled(freeze);
13901396
this->toolsGeneralMenu->setDisabled(freeze);
13911397
this->toolsVPKMenu->setDisabled(freeze || (!this->packFile || !this->packFile->isInstanceOf<VPK>()));
@@ -1401,6 +1407,7 @@ void Window::freezeModifyActions(bool readOnly) const {
14011407
this->saveAsAction->setDisabled(readOnly);
14021408
this->addFileAction->setDisabled(readOnly);
14031409
this->addDirAction->setDisabled(readOnly);
1410+
this->markModifiedAction->setDisabled(readOnly);
14041411
this->setPropertiesAction->setDisabled(readOnly);
14051412
}
14061413
}

src/gui/Window.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ class Window : public QMainWindow {
158158
QAction* extractAllAction;
159159
QAction* addFileAction;
160160
QAction* addDirAction;
161+
QAction* markModifiedAction;
161162
QAction* setPropertiesAction;
162163
QMenu* toolsGeneralMenu;
163164
QMenu* toolsVPKMenu;

0 commit comments

Comments
 (0)