Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#99: Make Edit window modeless #1168

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

giannicic
Copy link

This commit adds a new action group under the "Options" menu item that
changes the mode to present the insert/edit document/function edit
window.
The options are:

  • Modal: the edit window is show in a modal dialog, this is the default
    mode
  • Modeless: the edit dialog will be modeless.
  • Tabbed: the edit will be made with a mongo shell script in a new tab

The edit was tested on a Windows 10 x64 machine
See https://github.com/paralect/robomongo/issues/99

This commit adds a new action group under the "Options" menu item that
changes the mode to present the insert/edit document/function edit
window.
The options are:
- Modal: the edit window is show in a modal dialog, this is the default
mode
- Modeless: the edit dialog will be modeless.
- Tabbed: the edit will be made with a mongo shell script  in a new tab

The edit was tested on a Windows 10 x64 machine
See https://github.com/paralect/robomongo/issues/99
@simsekgokhan
Copy link
Collaborator

H @giannicic , thanks a lot for your contribution. Sorry for getting back to you so late, we were snowed under with releasing new Robomongo with SSL support.

We plan to include your contribution and some others in our next release (planing to release in a week).

But, I am having errors while building your commits.
Starting from first error, I do not see function "functionTextEditorAddAccepted" declared in ExplorerDatabaseCategoryTreeItem.h which exists in ExplorerDatabaseCategoryTreeItem.cpp.

Can you double check your commits? or let me know if I am missing something.

Warm Regards from Robomongo Team.

...
Build FAILED.

"C:\gsimsek\robomongo\build\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\gsimsek\robomongo\build\Release\src\robomongo\robomongo.vcxproj" (default target) (6) ->
(ClCompile target) ->
  c:\gsimsek\robomongo-shell\src\third_party\mozjs-38\include\js/Utility.h(135): warning C4996: 'st
rdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdu
p. See online help for details. (C:\gsimsek\robomongo\src\robomongo\core\engine\ScriptEngine.cpp) [
C:\gsimsek\robomongo\build\Release\src\robomongo\robomongo.vcxproj]


"C:\gsimsek\robomongo\build\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\gsimsek\robomongo\build\Release\src\robomongo\robomongo.vcxproj" (default target) (6) ->
(ClCompile target) ->
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerDatabaseCategoryTreeItem.cpp(255)
: error C2039: 'functionTextEditorAddAccepted' : is not a member of 'Robomongo::ExplorerDatabaseCat
egoryTreeItem' [C:\gsimsek\robomongo\build\Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerDatabaseCategoryTreeItem.cpp(257)
: error C2248: 'Robomongo::ExplorerDatabaseCategoryTreeItem::databaseItem' : cannot access private
member declared in class 'Robomongo::ExplorerDatabaseCategoryTreeItem' [C:\gsimsek\robomongo\build\
Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerDatabaseCategoryTreeItem.cpp(257)
: error C2352: 'Robomongo::ExplorerDatabaseCategoryTreeItem::databaseItem' : illegal call of non-st
atic member function [C:\gsimsek\robomongo\build\Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerDatabaseCategoryTreeItem.cpp(260)
: error C2248: 'QObject::sender' : cannot access protected member declared in class 'QObject' [C:\g
simsek\robomongo\build\Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerDatabaseCategoryTreeItem.cpp(260)
: error C2352: 'QObject::sender' : illegal call of non-static member function [C:\gsimsek\robomongo
\build\Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(98): error C
2039: 'functionTextEditorEditAccepted' : is not a member of 'Robomongo::ExplorerFunctionTreeItem' [
C:\gsimsek\robomongo\build\Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(100): error
C2248: 'QObject::sender' : cannot access protected member declared in class 'QObject' [C:\gsimsek\r
obomongo\build\Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(100): error
C2352: 'QObject::sender' : illegal call of non-static member function [C:\gsimsek\robomongo\build\R
elease\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(102): error
C2065: '_database' : undeclared identifier [C:\gsimsek\robomongo\build\Release\src\robomongo\robomo
ngo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(102): error
C2227: left of '->updateFunction' must point to class/struct/union/generic type [C:\gsimsek\robomon
go\build\Release\src\robomongo\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(102): error
C2065: '_function' : undeclared identifier [C:\gsimsek\robomongo\build\Release\src\robomongo\robomo
ngo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(102): error
C2228: left of '.name' must have class/struct/union [C:\gsimsek\robomongo\build\Release\src\robomon
go\robomongo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(105): error
C2065: '_database' : undeclared identifier [C:\gsimsek\robomongo\build\Release\src\robomongo\robomo
ngo.vcxproj]
  C:\gsimsek\robomongo\src\robomongo\gui\widgets\explorer\ExplorerFunctionTreeItem.cpp(105): error
C2227: left of '->loadFunctions' must point to class/struct/union/generic type [C:\gsimsek\robomong
o\build\Release\src\robomongo\robomongo.vcxproj]

    1 Warning(s)
    14 Error(s)

Time Elapsed 00:01:36.32

@giannicic
Copy link
Author

Hi @simsekgokhan ,

Seems that there are some files not committed in my Git Client.
I'll make a check and commit again.

fix missed function edit accept declaration
@giannicic
Copy link
Author

Should be ok now.

@simsekgokhan
Copy link
Collaborator

Hi @giannicic ,

I just had time to review, I have to say it looks great, three different modes for edit document sounds amazing : ) And this time I had no problem to compile.

First issue I noticed is when you open two edit window, first edit window saves it correctly but the second one has no effect. Is this a design intend or expected behavior? I think they should both save correctly.

fix multiple edit windows
@giannicic
Copy link
Author

Hi @simsekgokhan ,
Indeed was not expected :)
I didn't notice that the edit dialogs was managed by the Notifierclass that got disposed and reinstantiated each time an insert or update occurs. I've moved that class upper inside the OutputItemContentWidget class and now It seems working. For the edit function feature there was a similar issue, I've moved the dialog logic up to the ExplorerDatabaseCategoryTreeItemclass as well.

If this change goes well I suggest to change in the future the logic of the Edit/Insert dialogs in order to move its logic all inside a single class that is globally available in the application instead of having multiple dialogs managed inside each item or widget that needs it.

Fix: delete _notifier object when window gets closed.
@giannicic
Copy link
Author

@simsekgokhan
is there something wrong with the PR?
Should I do a rebase or something?
Thanks

@simsekgokhan
Copy link
Collaborator

Hi @giannicic , sorry for the delay and thanks for the reminder.
Little bit snowed under with some critical features lately, latest one is to make MongoDB 3.4 support available ASAP. Probably, we will look at this after 3.4.
Best Regards.

@FXschwartz
Copy link

@simsekgokhan Is this something that could still be implemented. It's a feature that would be amazing to have.

@FXschwartz
Copy link

FXschwartz commented Feb 15, 2019

Hi @simsekgokhan ,

I know things get busy and I would love to help out if I could, but is this something even remotely on the roadmap?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants