mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +00:00
Rename Context::isUiAvailable to Context::isUIAvailable
This commit is contained in:
parent
f6be0c3be6
commit
a8577a4273
@ -299,7 +299,7 @@ void CanvasSizeCommand::onExecute(Context* context)
|
||||
const ContextReader reader(context);
|
||||
const Sprite* sprite(reader.sprite());
|
||||
|
||||
if (context->isUiAvailable()) {
|
||||
if (context->isUIAvailable()) {
|
||||
// load the window widget
|
||||
base::UniquePtr<CanvasSizeWindow> window(new CanvasSizeWindow());
|
||||
|
||||
|
@ -424,7 +424,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
|
||||
Sprite* sprite = document->sprite();
|
||||
DocumentPreferences& docPref(Preferences::instance().document(document));
|
||||
|
||||
if (m_useUI && context->isUiAvailable()) {
|
||||
if (m_useUI && context->isUIAvailable()) {
|
||||
ExportSpriteSheetWindow window(document, sprite, docPref);
|
||||
window.openWindowInForeground();
|
||||
if (!window.ok())
|
||||
|
@ -60,7 +60,7 @@ void LoadMaskCommand::onExecute(Context* context)
|
||||
|
||||
std::string filename = m_filename;
|
||||
|
||||
if (context->isUiAvailable()) {
|
||||
if (context->isUIAvailable()) {
|
||||
filename = app::show_file_selector(
|
||||
"Load .msk File", filename, "msk",
|
||||
FileSelectorType::Open);
|
||||
|
@ -108,7 +108,7 @@ void OpenFileCommand::onExecute(Context* context)
|
||||
Console console;
|
||||
|
||||
// interactive
|
||||
if (context->isUiAvailable() && m_filename.empty()) {
|
||||
if (context->isUIAvailable() && m_filename.empty()) {
|
||||
std::string exts = get_readable_extensions();
|
||||
|
||||
// Add backslash as show_file_selector() expected a filename as
|
||||
|
@ -94,7 +94,7 @@ static void save_document_in_background(const Context* context,
|
||||
else if (fop_is_stop(fop)) {
|
||||
const_cast<Document*>(document)->impossibleToBackToSavedState();
|
||||
}
|
||||
else if (context->isUiAvailable()) {
|
||||
else if (context->isUIAvailable()) {
|
||||
App::instance()->getRecentFiles()->addRecentFile(document->filename().c_str());
|
||||
if (mark_as_saved)
|
||||
const_cast<Document*>(document)->markAsSaved();
|
||||
|
@ -208,7 +208,7 @@ void SpriteSizeCommand::onExecute(Context* context)
|
||||
int new_height = (m_height ? m_height: int(sprite->height()*m_scaleY));
|
||||
ResizeMethod resize_method = m_resizeMethod;
|
||||
|
||||
if (context->isUiAvailable()) {
|
||||
if (context->isUIAvailable()) {
|
||||
// load the window widget
|
||||
base::UniquePtr<Window> window(app::load_widget<Window>("sprite_size.xml", "sprite_size"));
|
||||
m_widthPx = app::find_widget<Entry>(window, "width_px");
|
||||
|
@ -38,7 +38,7 @@ Console::Console(Context* ctx)
|
||||
: m_withUI(false)
|
||||
{
|
||||
if (ctx)
|
||||
m_withUI = (ctx->isUiAvailable());
|
||||
m_withUI = (ctx->isUIAvailable());
|
||||
else
|
||||
m_withUI =
|
||||
(App::instance()->isGui() &&
|
||||
|
@ -68,7 +68,7 @@ void Context::executeCommand(Command* command, const Params& params)
|
||||
}
|
||||
|
||||
// TODO move this code to another place (e.g. a Workplace/Tabs widget)
|
||||
if (isUiAvailable())
|
||||
if (isUIAvailable())
|
||||
app_rebuild_documents_tabs();
|
||||
}
|
||||
catch (base::Exception& e) {
|
||||
|
@ -32,7 +32,7 @@ namespace app {
|
||||
public:
|
||||
Context();
|
||||
|
||||
virtual bool isUiAvailable() const { return false; }
|
||||
virtual bool isUIAvailable() const { return false; }
|
||||
virtual bool isRecordingMacro() const { return false; }
|
||||
virtual bool isExecutingMacro() const { return false; }
|
||||
virtual bool isExecutingScript() const { return false; }
|
||||
|
@ -192,7 +192,7 @@ FileOp* fop_to_load_document(Context* context, const char* filename, int flags)
|
||||
}
|
||||
|
||||
/* TODO add a better dialog to edit file-names */
|
||||
if ((flags & FILE_LOAD_SEQUENCE_ASK) && context && context->isUiAvailable()) {
|
||||
if ((flags & FILE_LOAD_SEQUENCE_ASK) && context && context->isUIAvailable()) {
|
||||
/* really want load all files? */
|
||||
if ((fop->seq.filename_list.size() > 1) &&
|
||||
(ui::Alert::show("Notice"
|
||||
@ -325,7 +325,7 @@ FileOp* fop_to_save_document(const Context* context, const Document* document,
|
||||
// Show the confirmation alert
|
||||
if (!warnings.empty()) {
|
||||
// Interative
|
||||
if (context && context->isUiAvailable()) {
|
||||
if (context && context->isUIAvailable()) {
|
||||
warnings += "<<You can use \".ase\" format to keep all this information.";
|
||||
|
||||
std::string title, buttons;
|
||||
|
@ -783,7 +783,7 @@ base::SharedPtr<FormatOptions> GifFormat::onGetFormatOptions(FileOp* fop)
|
||||
gif_options.reset(new GifOptions);
|
||||
|
||||
// Non-interactive mode
|
||||
if (!fop->context || !fop->context->isUiAvailable())
|
||||
if (!fop->context || !fop->context->isUIAvailable())
|
||||
return gif_options;
|
||||
|
||||
try {
|
||||
|
@ -359,7 +359,7 @@ base::SharedPtr<FormatOptions> JpegFormat::onGetFormatOptions(FileOp* fop)
|
||||
jpeg_options.reset(new JpegOptions);
|
||||
|
||||
// Non-interactive mode
|
||||
if (!fop->context || !fop->context->isUiAvailable())
|
||||
if (!fop->context || !fop->context->isUIAvailable())
|
||||
return jpeg_options;
|
||||
|
||||
try {
|
||||
|
@ -55,14 +55,14 @@ UIContext::~UIContext()
|
||||
ASSERT(documents().empty());
|
||||
}
|
||||
|
||||
bool UIContext::isUiAvailable() const
|
||||
bool UIContext::isUIAvailable() const
|
||||
{
|
||||
return App::instance()->isGui();
|
||||
}
|
||||
|
||||
DocumentView* UIContext::activeView() const
|
||||
{
|
||||
if (!isUiAvailable())
|
||||
if (!isUIAvailable())
|
||||
return NULL;
|
||||
|
||||
Workspace* workspace = App::instance()->getMainWindow()->getWorkspace();
|
||||
@ -186,7 +186,7 @@ void UIContext::onRemoveDocument(doc::Document* doc)
|
||||
m_lastSelectedDoc = nullptr;
|
||||
|
||||
// We don't destroy views in batch mode.
|
||||
if (isUiAvailable()) {
|
||||
if (isUIAvailable()) {
|
||||
Workspace* workspace = App::instance()->getMainWindow()->getWorkspace();
|
||||
DocumentViews docViews;
|
||||
|
||||
@ -213,7 +213,7 @@ void UIContext::onGetActiveSite(Site* site) const
|
||||
view->getSite(site);
|
||||
}
|
||||
// Default/dummy site (maybe for batch/command line mode)
|
||||
else if (!isUiAvailable()) {
|
||||
else if (!isUIAvailable()) {
|
||||
if (Document* doc = m_lastSelectedDoc) {
|
||||
site->document(doc);
|
||||
site->sprite(doc->sprite());
|
||||
|
@ -25,7 +25,7 @@ namespace app {
|
||||
UIContext();
|
||||
virtual ~UIContext();
|
||||
|
||||
bool isUiAvailable() const override;
|
||||
bool isUIAvailable() const override;
|
||||
|
||||
DocumentView* activeView() const;
|
||||
void setActiveView(DocumentView* documentView);
|
||||
|
Loading…
x
Reference in New Issue
Block a user