CUBA Platform Is it possible to prevent tabs to be opened more than once? - cuba-platform

I am trying to prevent certain "cuba"tabs from opening more than once. Is it possible to stop an Edit-Screen to open, if it already is opened in another tab?
Thank you

Yes,
You can control the behavior of a screen being opened multiple time via the controller annotation MultipleOpen. See: https://files.cuba-platform.com/javadoc/cuba/7.2/com/haulmont/cuba/gui/screen/MultipleOpen.html
For Editors this is not defined to my best knowledge, because there it normally means that multiple instances of the screen show details for multiple records.
But even this you can probably programmatically prevent inside the main screen / the editor itself.

Related

Setting for SSMS to start with same pinned tabs as a previous session?

I can't find where this is possible. There's a similar setting in SSMSBoost but it's not saving the pinned tabs I created in this session.
Sometimes when the program crashes, it asks if I want to save what I have open, but it looks like it's asking to save each tab individually which isn't exactly what I'm talking about.
I'm just looking for many open tabs I have pinned and set in a specific order, to open up that way on my next startup. Possible?
Thanks!

Disable certain suggestions in PhpStorm search

I’m not sure what are these called:
I mean the Show code with my wire stats, Show Memory indicator, etc..
Basically, I’m mostly interested so this autocomplete menu would only show files, or at the very least would prioritise files. How can this be achieved?
I’m in version 2022.2.1.
That popup is called Search Everywhere and you are on an "All" tab that includes combined results from Classes, Files, Symbols, Actions etc.
Either manually switch to the desired tab (using a mouse or by hitting Tab needed number of times) or invoke this popup for the desired search from the start. For that just use the shortcut for Navigate | File... (Ctrl + Shift + N here on Windows keymap).
https://www.jetbrains.com/help/idea/searching-everywhere.html
Found the solution.
These things are called Actions, and the can be disabled in menu that appears after clicking the small funnel icon in the top right:
I tested, these changes seem to 'survive' a restart.
Yes, at the moment it is remembered only during the session.
https://youtrack.jetbrains.com/issue/IDEA-229285 -- watch this ticket (star/vote/comment) to get notified about any progress.
(P.S. The same happens with Find in Files popup (IDEA-143972) and a few others similar popups as well)

Set focus to child window in PyGtk

I am writing a simple application in python using PyGObject and glade. The application has a main window and a functional window (Generate logs, also a Window object) which opens up on clicking a menu item.
The Generate logs window is supposed to:
Show options to generate log for a particular date
Be minimizable and should close automatically when the task is complete (OR)
Be able to be closed manually if the user wishes so
The problem is, once I show up the Generate logs window, I am directly able to select the main window as well. Then, I can go to the menu and bring up as many Generate logs windows as I want.
I have tried several options (Is Focus, setting up main window as Transient parent etc) but nothing worked. How can I fix this?
First you say PyGTK, then you say PyGObject, this are 2 different things. I'm going to answer for PyGTK (my sources are from GTK+ 2 docs) since it's in the title and maybe people looking for that will end up here. But never fear, because for this question, the answer is practically (I think exactly) the same for both.
What I understand is that you want you "Generate log" window to be modal. That means other windows can't be used while your modal window is up, just like a Dialog window. Also you should set the main window to be the parent of your modal window, since this helps the OS Window Manager i.e. keep the dialog on top of the main window.
Yo can do both of this things directly from Glade (if you've created both windows in the same project, not always the case) selecting the Modal atribute to True and the Transient for Window attribute to your main window, in the General Properties section of your Generate log window.
Also you can do it programmatically using the set_modal() and the set_transient_for(parent_window) method of your child window.
Let's say your parent window is called main_window and the child window is generate_log_window, then you can do it like this:
generate_log_window.set_modal(gtk.TRUE)
generate_log_window.set_transient_for(main_window)
If you want it to show center top of your main window, do this
generate_log_window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
To your second point, the ability to minimize can be set from Glade.
Sources:
GTK+ 2 GtkWindow reference set_modal
GTK+ 2 GtkWindow reference set_transient_for
PyGTK FAQ: How do I get my windows to show up where I want
PyGTK FAQ: How do I make a dialog block the whole application, so the user is forced to answer it?
create several windows (see your other post).
Upload them in init
Show them with "signals" in glade using "show" and "hide"
class GUIxxxx
#...
def action1(self, widget, data=None):
self.window1.show()
def action2(self, widget, data=None):
# do something here
self.window1.hide()

Prevent other windows from receiving focus in Cocoa

How can I prevent other windows within my application from receiving focus? I want to bring a loading window to the front and let it do its thing, but I don't want the user to be able to interact with the other windows in the app.
I could simply hide the other windows in the app, but that feels kind of jarring for users to have their windows just suddenly disappear. At the same time, I can't let the user continue interacting with the other windows during a load since the load will be updating data on every window (synchronization problems would occur). I can add additional locking mechanisms, but I'd rather not if it is as simple as forcing a single window to stay on top and remain in focus.
Thanks!
Look into modal windows.
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/WinPanel/Concepts/UsingModalWindows.html
You can make a whole window or panel run in application-modal fashion,
using the application’s normal event loop machinery but restricting
input to the modal window or panel. Modal operation is useful for
windows and panels that require the user’s attention before an action
can proceed. Examples include error messages and warnings, as well as
operations that require input, such as open dialogs, or dialogs that
apply to multiple windows.

Dojo dialog nesting

can a dojo dialog bring up another dojo dialog?
dojo 1.3 only supports one modal dialog at a time, so while, yes, one dialog can open another, closing the second destroys the modality of the first.
This happens because dojo.Dialog uses a single global underlay object that provides screen between the dialog and anything else on the page. You can make it work if you're wiling to create your own underlay for each dialog and manage the z-indexes yourself.
I understand this will be rectified in 1.4.
Yes, a dialog can open another dialog, but then you'd have two dialogs displayed -- they aren't modal between each other.
Since this is not the behavior I desire I've worked around this by creating my own handler -- it first checks for an open dialog, and if it finds one, closes it (and places it on a stack) before opening a new dialog. When it closes one it looks at the stack and re-opens dialogs lower on the stack.
Multiple dialogs can be opened prior to Dojo 1.4, but there are problems with accessibility in that case (tabIndex is handled wrong) - so if you need your app to be accessible and support mutliple dialogs., you need to upgrade to Dojo 1.4 when it comes out.
yes you are able to do it in dojo 1.6 and all above versions