Skip to content

Commit

Permalink
Merge pull request #1351 from scribblemaniac/the-button
Browse files Browse the repository at this point in the history
Add an action to open Pencil2D's temporary directory
  • Loading branch information
scribblemaniac authored May 15, 2020
2 parents 616617b + 6309bb3 commit c13aa62
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
10 changes: 10 additions & 0 deletions app/src/actioncommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,16 @@ void ActionCommands::checkForUpdates()
dialog.exec();
}

// This action is a temporary measure until we have an automated recover mechanism in place
void ActionCommands::openTemporaryDirectory()
{
int ret = QMessageBox::warning(mParent, tr("Warning"), tr("The temporary directory is meant to be used only by Pencil2D. Do not modify it unless you know what you are doing."), QMessageBox::Cancel, QMessageBox::Ok);
if (ret == QMessageBox::Ok)
{
QDesktopServices::openUrl(QUrl::fromLocalFile(QDir::temp().filePath("Pencil2D")));
}
}

void ActionCommands::about()
{
AboutDialog* aboutBox = new AboutDialog(mParent);
Expand Down
1 change: 1 addition & 0 deletions app/src/actioncommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class ActionCommands : public QObject
void discord();
void reportbug();
void checkForUpdates();
void openTemporaryDirectory();
void about();

private:
Expand Down
1 change: 1 addition & 0 deletions app/src/mainwindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ void MainWindow2::createMenus()
connect(ui->actionDiscord, &QAction::triggered, mCommands, &ActionCommands::discord);
connect(ui->actionCheck_for_Updates, &QAction::triggered, mCommands, &ActionCommands::checkForUpdates);
connect(ui->actionReport_Bug, &QAction::triggered, mCommands, &ActionCommands::reportbug);
connect(ui->actionOpen_Temporary_Directory, &QAction::triggered, mCommands, &ActionCommands::openTemporaryDirectory);
connect(ui->actionAbout, &QAction::triggered, mCommands, &ActionCommands::about);

//--- Menus ---
Expand Down
14 changes: 10 additions & 4 deletions app/ui/mainwindow2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>831</width>
<height>600</height>
</rect>
</property>
Expand Down Expand Up @@ -48,8 +48,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>19</height>
<width>831</width>
<height>41</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
Expand Down Expand Up @@ -254,6 +254,7 @@
<addaction name="separator"/>
<addaction name="actionCheck_for_Updates"/>
<addaction name="actionReport_Bug"/>
<addaction name="actionOpen_Temporary_Directory"/>
<addaction name="separator"/>
<addaction name="actionAbout"/>
</widget>
Expand Down Expand Up @@ -1022,7 +1023,7 @@
<action name="actionImport_MovieAudio">
<property name="text">
<string>Movie Audio...</string>
</property>
</property>
</action>
<action name="actionImport_Append_Palette">
<property name="text">
Expand Down Expand Up @@ -1080,6 +1081,11 @@
<string>Onion Skins</string>
</property>
</action>
<action name="actionOpen_Temporary_Directory">
<property name="text">
<string>Open Temporary Directory</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down

0 comments on commit c13aa62

Please sign in to comment.