How can I remove the target directory selection in Qt installer? - linux

I am trying to make an installer on Linux with Qt Installer Framework and I'd like to set a fixed target dir and remove that page from the installer. I've managed to do this with a script and using setDefaultPageVisible. This works but I have to press the next button twice in order to get past it.
Is this a known issue or is there a better way to achieve this?

For the benefit of others, I found a solution. It seems that you need to remove the Introduction page as well as TargetDirectory as there appears to be a duplicate Introduction page otherwise.
function Component()
{
installer.setDefaultPageVisible(QInstaller.Introduction, false);
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
}

You can disable the line edit with currentPage.TargetDirectoryLineEdit.enabled = false;

Related

videojs disable full screen on double click

I want to completely disable full screen functionality.
I removed fullscreen button like this.
videojs('videoPlayer', {
controlBar: {
fullscreenToggle: false
}
});
But on double click it still goes to full screen.
How to disable double click?
Darius Oleskevicius helped me with the answer on videojs github page: https://github.com/videojs/video.js/issues/5604
The current dblclick handler doesn't take into consideration whether fullscreen toggle is disabled. It is on by default and there is currently no settable option to disable it. As of now, you could try and cancel out dblclick listener on tech (see below).
player.ready(function() {
player.tech_.off('dblclick');
});
Also if you use reset function, you have to again remove dblclick event listener.
As of Video.js 7.5.0, there is an an option to turn it off directly
videojs("my-player", {
userActions: {
doubleClick: false
}
});
You can use CSS to initialize the various control-bar objects
to exist or not.
See, for example: https://github.com/videojs/video.js/issues/2507
So, for your case, just use:
<style>
.video-js .vjs-fullscreen-control { display: none; }
</style>
EDIT:
Ok, I figured out what's up with the "double-click" !
I still run all my video pages, using version 5 of videojs.
Version 5.11.9, to be exact.
And, it turns out that double-clicking on a video back then, did NOTHING.
So, bottom line, if you truly 'want to disable 'double-click-to-fullscreen',
it can be done. Just use 5.x, rather than 6.x or 7.x
Having said all that, I now have to consider this a bug in 7.x (and 6.x).
The code inside videojs SHOULD be testing whether the fullscreen-control
exists or not, and if not, the double-click should NOT be going to fullscreen.
The list of versions is here: https://github.com/videojs/video.js/releases
Just I added controlsList="nofullscreen" attribute. But playing the video on click on the center of won't work. So I added onclick="vd.play()" attribute. <video id="vd" src="video.mp4" onclick="vd.play()" disablePictureInPicture controls controlsList="nofullscreen"></video>

Adding RenderWindowControl to tool box

I am trying to use Kitware ActiViz.NET. I have installed it using nuget.
But I can't seem to find RenderWindowControl on the toolbox. I have been trying to add it manually this way:
invoke "Choose Items..."
and in the following dialog click on button "Browse...",
navigate to your ActiViz.NET installation folder, browse to /bin
folder, select "Kitware.VTK.dll".
Click OK.
Now you should see in your ToolBox a new control named RenderWindowControl.
But I get "The file "C:\programfiles\activiz.net 5.8.0 Opensource Eddition\bin\kitware.vtk.DLL" is not valid".
I have tried to add the control in the code rether than the designer,and got this exception:
Could not load file or assembly 'Kitware.VTK, Version=5.8.0.607, Culture=neutral, PublicKeyToken=995c7fb9db2c1b44' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Has anyone had this problem before?
Any ideas?
For the design mode you would need to use the 32Bit version, because VS is running on 32Bit and can only load 32Bit controls.
So you could use for design time the 32Bit version and for build/release switch to the 64bit version.
But you can also add the RenderWindowControl manually.
Of course the designer will be unable to display this, so it would be
necessary to comment it out, before switching to the designer
Open your designer file e.g. Form1.Designer.cs and add the control like
private RenderWindowControl myRenderWindowControl;
private void InitalizeComponent()
{
//all other controls added by the designer
myRenderWindowControl = new RenderWindowControl();
myRenderWindowControl.SetBounds(0,0,640,480);
this.Controls.Add(this.myRenderWindowControl);
}
Adding VTK's RenderWindowControl to WPF is a little more complicated.
Assuming you installed a 64 bit VTK package, the following steps worked for me.
https://learn.microsoft.com/en-us/dotnet/framework/wpf/advanced/walkthrough-hosting-a-windows-forms-control-in-wpf
Add Project References to WindowsFormsIntegration and System.Windows.Forms
Draw a Grid on the Designer Form.
In Properties Dialog, Give it a name, then
Double Click the Loaded event.
In the loaded event handler add the code.
// Create the interop host control.
System.Windows.Forms.Integration.WindowsFormsHost host =
new System.Windows.Forms.Integration.WindowsFormsHost();
myRenderWindowControl = new RenderWindowControl();
myRenderWindowControl.SetBounds(0, 0, 30, 30); // not too big in case it disappears.
// Assign the control as the host control's child.
host.Child = myRenderWindowControl;
this.VTKGrid.Children.Add(host);

How execute code before which the Inno Select language dialog is shown

I need to execute a pascal code before that the Select Setup language Dialog is shown , unfortunately the InitializeSetup event is executed after.
function InitializeSetup(): Boolean; //This event occurs to late
begin
DoSomething();
Result := True;
end;
So it's possible execute a script code before of the Select Setup language Dialog is shown?
I had similar problem, and I thought about different workarounds: style all setup manually, or make inner localization, but they all looked so doomed from the beginning.
Select Setup language Dialog
I have forked issrc, built it locally, and looked at the main.pas of the Setup project. I see the idea behind doing as it is now : people may wanna use {Language} in InitializeSetup, so its called after the AskForLanguage method.
To just check the idea I made small changes to main.pas: call AskForLanguage after CodeRunner inited and InitializeSetup called. I got VCL'ed Select Setup Language dialog, but not all - NON Client Area wasnt VCL'ed:
I've tried to inherit the language form not from the TForm class but from the TSetupForm, or call it in the middle of setup or make other changes - with no result. If anybody know why it's not VCL'ed - tell me please!
Then I read the Custom Window Frame Using DWM article and just made the form border bsNone and got this:
So for now I'm fine with it. That form not styled before many pages of styled setup was so... annoying.
If we wanna do it a right way, I guess all that needs to be done - is moving CodeRunner init before AskForLanguage, and add a custom code function like StyleInit or so. Then all will be happy: {Language} will be available in InitializeSetup and Dialog will be VCL'ed.
No, the function InitializeSetup() is called as first.
All other functions are called later.
Of course you can modify Inno's sources and add custom functions but I think it is not your case.
Why do you need this? Maybe there is solution which can solve your situation, please tell us details.
Another possible solution is using Inno setup Ultra, it has several inprovements, and InitializeLanguageDialog function is one of them. just load style in it. (Also you can freely change language dialog itself that is so nice).

Determining which Visual Studio context menu was selected?

I'm writing a VS2012 add-in, adding a command to Build Explorer context menu (see related question). The command gets added to 2 different context menus:
Build Explorer
Team Explorer, Builds page, My Builds section
When my one callback is called, how do I know which of these it is?
I tried get the focused control (using P/Invoke as this question suggests). However, it gets me a Tabs container for (1), and null for (2). I could try to cast the control to the tabbed container, but that sounds pretty bad...
Any better alternative?
My new/other idea - it is similar to yours:
You should try to monitor which window was activated lastly.
If you create an eventhandler for your command, then you may be able to check which window is active when your command fired. A simple evenent handler for a command:
void cmdEvents_BeforeExecute( string guid, int ID, object customIn, object customOut, ref bool cancelDefault )
{
Window2 teamExplorer = _applicationObject.Windows.Item("Team Explorer") as Window2;
if (_applicationObject.ActiveWindow.Caption == teamExplorer.Caption)
{
//You are called from Team Explorer
}
else
{
//Somewhere else
}
}
And the way you can subscribe:
static _dispCommandEvents_BeforeExecuteEventHandler _myHandler;
static CommandEvents _cmdEvents;
public void OnConnection(...)
{
Command command = ...; // Init your command
int ID = command.ID;
string GUID = command.Guid;
CommandEvents _cmdEvents = _applicationObject.Events.get_CommandEvents(GUID, ID);
_myHandler = new _dispCommandEvents_BeforeExecuteEventHandler(cmdEvents_BeforeExecute);
_cmdEvents.BeforeExecute += _myHandler;
}
You may find a better way to identify the window(s) by GUID. You should keep at least _cmdEvents as static because when it will be desroyed, your event handler could vanish (least for internal commands).
In OnDisconnection you should unsubscribe.
Reworked by the comment, and founded links:
As the menu item is shown every place it seems there is no way to distinct between them from an Add-In, you should add two command and distinct them by their context.
The way instead of converting the Add-In to a VS-Package MZ-Tools HOWTO: Controlling the state of command in a Visual Studio add-in, try MZ-Tools HOWTO: Use the IVsMonitorSelection ... you can also get it from an Add-In.
But:
Neither the AddNamedCommand nor the QueryStatus methods honor the
invisible state: the button that must be invisible ...
remains disabled rather than invisible.
I think this makes it impossible to do it from an Add-In on a suitable way, but maybe you can check the contexts.
Other way you could get further, if you try to migrate your command/menu into a VSPackage and create a custom UIContext for the menu items or find a suitable predefined one. I have no access to a Studio enhanced with Build Explorer so I can't try it.
The following discussion is about custom contexts for vs-packages:
http://davedewinter.com/2008/04/05/dynamic-menu-commands-in-visual-studio-packages-part-3/
Sadly the links are broken from the post, and I can't reach Part 1. and Part 2. which is about the discussion of the problem from the beginning.
But there is no guarantee you can create a context which suits you.
Only context ID I found for Team Explorer is the guidTeamProjectCmdUIContext.
It is placed at vsshilds.h in Visual Studio 2010 SDK, vsshell*.h are also contain several others.
MSDN: Vsct files to define command, menus, ect. from packages.
Condition attribute for items:
http://msdn.microsoft.com/en-us/library/bb491718.aspx
http://msdn.microsoft.com/en-us/library/bb166515.aspx
MSDN: VisibilityItem element for commands and toolbars.
VisibilityItem element determines the static visibility of commands and toolbars.
... After the VSPackage is loaded, Visual Studio expects command visibility to be determined by the VSPackage rather than the VisibilityItem.
And finally about predefined Context Guids:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.uicontextguids80.aspx
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.uicontextguids.aspx

Eclipse RCP: How to configure the Perspective Menu?

I need to have total control of the perspective menu.
I already hacked into the platform to disable the CONTEXT menu:
private void disablePerspectiveToolbarMenu() {
PerspectiveBarManager perspectiveBarManager =
((WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow()).getPerspectiveBar();
if (perspectiveBarManager!=null){
ToolBar toolBar = perspectiveBarManager.getControl();
Listener[] listeners = toolBar.getListeners(SWT.MenuDetect);
if (listeners != null){
for (Listener listener : listeners){
toolBar.removeListener(SWT.MenuDetect, listener);
}
}
}
}
But i need also to control the default contents of the PERSPECTIVE MENU. There is one option that is always present that gives access to a Perspective List Shell. I need to remove that option from the menu.
It's a shame that the perspective menu is totally out of user control. I just need to have the perspectives added to the menu, and nothing more!
Thanks.
There are 3 potential options to get rid of Other:
Set the
org.eclipse.ui.IWorkbenchPreferenceConstants.SHOW_OTHER_IN_PERSPECTIVE_MENU
preference to false in your RCP app. This can be done by including a plugin_customization.ini file with your product definition.
Patch the workbench in your RCP app.
Have a look at
org.eclipse.ui.internal.PerspectiveBarNewContributionItem
and
org.eclipse.ui.actions.ContributionItemFactory.PERSPECTIVES_SHORTLIST
Don't include the default
perspective bar in your RCP app.
Instead, create a perspective bar
using org.eclipse.ui.menus, a
toolbar, and the openPerspective
command.
I did some research and the solution did not work as I expected it. Finally I found my mistake.
To set the property in the plugin_customization.ini I tried:
org.eclipse.ui.IWorkbenchPreferenceConstants.SHOW_OTHER_IN_PERSPECTIVE_MENU=false
but this is not the correct notation!!! Please see the correct solution I added finally to the plugin_customization.xml
org.eclipse.ui/SHOW_OTHER_IN_PERSPECTIVE_MENU=false
So the name of the interface or the class specifying the property ist not part of the notation!

Resources