Skip to content

Commit

Permalink
Added question message box when opening/importing files
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoveda committed May 3, 2020
1 parent 7a3362f commit 60be0ee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions artellapipe/tools/artellamanager/widgets/artellamanagerwidget.py
Expand Up @@ -23,7 +23,7 @@

import tpDcc as tp
from tpDcc.libs.python import fileio, path as path_utils
from tpDcc.libs.qt.core import base
from tpDcc.libs.qt.core import base, qtutils
from tpDcc.libs.qt.widgets import stack, loading, dividers, buttons, message, lineedit, search, progressbar, toast

import artellapipe
Expand Down Expand Up @@ -1024,10 +1024,14 @@ def _on_open_item_folder(self, item_path):
fileio.open_browser(item_path)

def _on_open_file(self, item_path):
return tp.Dcc.open_file(item_path)
res = qtutils.show_question(self, 'Opening File', 'Are you sure you want to open the file?')
if res == QMessageBox.StandardButton.Yes:
return tp.Dcc.open_file(item_path)

def _on_import_file(self, item_path):
return tp.Dcc.import_file(item_path, force=True)
res = qtutils.show_question(self, 'Importing File', 'Are you sure you want to import the file?')
if res == QMessageBox.StandardButton.Yes:
return tp.Dcc.import_file(item_path, force=True)

def _on_lock_file(self, item, refresh_toolbar=True):
item_path = item.path
Expand Down

0 comments on commit 60be0ee

Please sign in to comment.