Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions lib/usd/ui/editForward/editForwardDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <AdskUsdEditForwardUi/StageEntry.h>
#include <QtCore/QPointer>
#include <QtCore/QTimer>
#include <QtCore/QVariant>
#include <QtWidgets/QVBoxLayout>

#include <vector>
Expand Down Expand Up @@ -79,12 +80,18 @@ struct SelectionObserver : Ufe::Observer
} // namespace

EditForwardDialog::EditForwardDialog(const QString& title, QWidget* parent)
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint)
: QDialog(parent)
{
setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(title);
resize(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stop forcing the size everytime. Via size hint and with the other changes below, keeps the user size

static_cast<int>(MQtUtil::dpiScale(1250.0f)), static_cast<int>(MQtUtil::dpiScale(1000.0f)));
// Maya keys saved window preferences off the object name.
setObjectName("EditForwardConfigDialog");

// Tell Maya to treat this as a Maya-managed window. This is the same
// mechanism Maya uses internally to keep its own dialogs from going behind
// the main window. This should not be combined with other flags.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same fix as in AR 3aa943c

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This should not be combined with other flags." what does this mean?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Per Maya dev guidance these two calls should be applied alone, without combining with any other Qt window flags."

Is what that other commit wrote.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AramAzhari-adsk Do you know specifics?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply as I was OoO. For the record, we are referring to the line after: WindowFlags

This should not be combined
            // with other flags.
            g_assetResolverDialog->setWindowFlags(Qt::Window);

I hope that clears it up.

setWindowFlags(Qt::Window);
setProperty("saveWindowPref", QVariant::fromValue(true));

_forwardWidget = new AdskUsdEditForwardUi::ForwardWidget(this);
_forwardWidget->setSourceLayerDefault(
Expand Down Expand Up @@ -127,6 +134,12 @@ EditForwardDialog::~EditForwardDialog()
}
}

QSize EditForwardDialog::sizeHint() const
{
return QSize(
static_cast<int>(MQtUtil::dpiScale(1250.0f)), static_cast<int>(MQtUtil::dpiScale(1000.0f)));
}

void EditForwardDialog::processNodeAdded(MObject& /*node*/)
{
QTimer::singleShot(0, this, &EditForwardDialog::refreshStages);
Expand Down
3 changes: 3 additions & 0 deletions lib/usd/ui/editForward/editForwardDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <maya/MMessage.h>
#include <ufe/observer.h>

#include <QtCore/QSize>
#include <QtWidgets/QDialog>

#include <memory>
Expand All @@ -46,6 +47,8 @@ class EditForwardDialog
void handleSelectionChanged();
void setActiveStage(PXR_NS::UsdStageRefPtr const& stage);

QSize sizeHint() const override;

private:
void refreshStages();

Expand Down
38 changes: 24 additions & 14 deletions lib/usd/ui/layerEditor/layerEditorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,22 +733,32 @@ void LayerEditorWidget::onSplitterMoved(int pos, int index)
void LayerEditorWidget::openEditForwardDialog()
{
auto* ss = &_sessionState;
if (_editForwardDialog) {
if (!_editForwardDialog) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes here are also bascially the same as what was done in AR 3aa943c

_editForwardDialog = new UsdEditForwardConfig::EditForwardDialog(
StringResources::getAsQString(StringResources::kConfigureEditForwardingTitle),
MQtUtil::mainWindow());
// While the layer editor is open, follow its current stage.
QObject::connect(ss, &SessionState::currentStageChangedSignal, this, [this, ss]() {
if (_editForwardDialog) {
_editForwardDialog->setActiveStage(ss->stage());
}
});
}

// If the dialog was previously minimized, restore it before showing.
if (_editForwardDialog->isMinimized()) {
_editForwardDialog->setWindowState(
(_editForwardDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
}

// Only show() a dialog that is actually hidden. Showing a saveWindowPref
// window re-applies its stored position, which would move an already-open
// dialog away from where the user last dragged it.
if (!_editForwardDialog->isVisible()) {
_editForwardDialog->show();
_editForwardDialog->raise();
_editForwardDialog->activateWindow();
return;
}
_editForwardDialog = new UsdEditForwardConfig::EditForwardDialog(
StringResources::getAsQString(StringResources::kConfigureEditForwardingTitle),
MQtUtil::mainWindow());
// While the layer editor is open, follow its current stage.
QObject::connect(ss, &SessionState::currentStageChangedSignal, this, [this, ss]() {
if (_editForwardDialog) {
_editForwardDialog->setActiveStage(ss->stage());
}
});
_editForwardDialog->show();
_editForwardDialog->raise();
_editForwardDialog->activateWindow();
}

#endif // WANT_ADSK_USD_EDIT_FORWARD_BUILD
Expand Down
4 changes: 2 additions & 2 deletions lib/usd/ui/layerEditor/stringResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const auto kDisplayLayerContentsEmpty { create("kDisplayLayerContentsEmpty",
#ifdef WANT_ADSK_USD_EDIT_FORWARD_BUILD
const auto kToggleEditForwarding { create("kToggleEditForwarding", "Toggle Edit Forwarding") };
const auto kEchoEditForwarding { create("kEchoEditForwarding", "Echo Edit Forwarding in Script Editor") };
const auto kConfigureEditForwarding { create("kConfigureEditForwarding", "Configure Edit Forwarding...") };
const auto kConfigureEditForwardingTitle { create("kConfigureEditForwardingTitle", "Configure Edit Forwarding") };
const auto kConfigureEditForwarding { create("kConfigureEditForwarding", "Edit Forwarding Configuration") };
const auto kConfigureEditForwardingTitle { create("kConfigureEditForwardingTitle", "USD Edit Forwarding Configuration") };
#endif
const auto kDisplayLayerExpandAllValues { create("kDisplayLayerExpandAllValues", "Expand All Values") };
const auto kDisplayLayerExpandAllValuesTooltip { create("kDisplayLayerExpandAllValuesTooltip",
Expand Down
Loading