Qt installer framework hide or disable buttons - qt

I want to hide or freeze the back button on a page ( to be more specific, License Agreement Page). I tried editing control.qs with few methods but it doesn't seem to work. Following is one of them
Controller.prototype.LicenseAgreementPageCallback = function()
{
var widget = gui.currentPageWidget();
if (widget != null)
{
widget.BackButton.setVisible(false) ;
}
}

I'm facing a similar problem trying to keep hide the Next button in the Target Directory page under certain conditions.
But your case may be easier:
1) You should use a global boolean variable set to true when you enter the License Agreement page.
2) When you enter the previous page test the value of this global: if true then force a click on the next page (gui.click(buttons.NextButton);).
Yes, it's a dirty workaround ;)

I think you could try what I've proposed here: Qt installer framework: remove radio buttons from uninstaller. Even if it wasn't accepted, that what I used in my installer, so I'm pretty confident it's working!

For the wizard BackButton specifically, it automatically disables itself if there are no pages before the current page a la the Introduction page.
From QtScript this can be accomplished by removing any dynamic pages before the current page with installer.removeWizardPage and disabling all default pages before the current page with installer.setDefaultPageVisible(QInstaller.Introduction, false).

Related

Forcing to Close Chrome Custom Tab

I want to close a chrome Custom Tab with clicking device back button, but it only works when the custom tab has no history for the moment; when there's a remaining history, clicking the device back button only rewinds the custom tab back to a page in its history. Can I force the custom tab to ignore the history at any point and close the custom tab immediately?
I tried different options for the custom tabs such as below, but it appears none helps with my purpose. I would hugely appreciate your idea. Thank you!
customTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
customTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
customTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
My current code is
String url = eacharticle.get("url");
String PACKAGE_NAME = "com.android.chrome";
android.support.customtabs.CustomTabsIntent customTabsIntent = new android.support.customtabs.CustomTabsIntent.Builder().setShowTitle(true).build();
customTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
customTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
customTabsIntent.intent.setData(Uri.parse(url));
java.util.List<android.content.pm.ResolveInfo> resolveInfoList = context.getPackageManager().queryIntentActivities(customTabsIntent.intent, android.content.pm.PackageManager.MATCH_DEFAULT_ONLY);
for (android.content.pm.ResolveInfo resolveInfo : resolveInfoList) {
String packageName = resolveInfo.activityInfo.packageName;
if(PACKAGE_NAME.equals(packageName))
customTabsIntent.intent.setPackage(PACKAGE_NAME); // force use chrome if installed
}
customTabsIntent.launchUrl(context, Uri.parse(url));
I dont think there is currently an option to do this since we cannot override onBackPressed action on chrome custom tabs. Actually it is better to work this way in many use case.

Qt Installer Framework: conditional action based on whether a component was selected for installation

Generally: I need a bool or other hook to determine whether a component has been selected for installation, so that my controlscript.qs (or component-specific installscript.qs) can take the appropriate action.
Specifcally: the Qt installer framework has several default pages for the user to click through. On Windows there is a StartMenuSelection page which allows the user to specify what group (if any) the shortcut to the application should go into in the Windows Start menu.
Start Menu group selection example
One of my components to be installed is an (optional) shortcut in the Start menu. If not selected for install, there will be no shortcut to the installed application in the start menu.
My issue is that the Start Menu group selection page shows up regardless of whether the user has asked for a shortcut in the Start menu. I know how to get rid of it in all cases. But not conditionally on whether a Start menu shortcut is actually being installed.
I have a control script with the following:
function Controller()
{
}
Controller.prototype.StartMenuDirectoryPageCallback = function()
{
// Get the current wizard page
var widget = gui.currentPageWidget();
if (widget != null) {
var component = installer.componentByName("startmenu"); // startmenu is the component name
//if (!component.isSelected){
//if (!component.isSelectedForInstallation){
if (!component.isInstalled){
// I only want this hidden if the user didn't want a start menu link
// Either of the below commands will skip the startMenuSelection page
installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
//gui.clickButton(buttons.NextButton);
}
}
}
But this doesn't work. component.isSelected and component.isSelectedForInstallation always return false, and component.isInstalled always returns true, regardless of if the component was actually selected for installation. Maybe these are the wrong booleans to ask?
Or maybe this is the wrong approach? Essentially, I just need a hook to determine if a component is selected or not.
Just found this link:
https://github.com/danimo/qt-creator/blob/master/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs
Here they use:
component.installed
The isInstalled is a function (http://doc.qt.io/qtinstallerframework/scripting-component.html#isInstalled-method) that's why probably it always returns true.
So probably component.isInstalled() would have worked as well...
Either, installationRequested() would be another possibility to use. This is probably set before actual installation.

CRM Ribbon Workbench - Hide + Button on Sub-Grid

I have a sub grid on a new entity called Issues, the sub grid is for another new entity called Cost Detail.
I have them both loaded into my solution called Issue, and have opened issue in the ribbon workbench.
What I want to do is when you are on the Issue form and can see the sub-grid I want to be able to hide the + button which is displayed. However when I have hidden this button in the ribbon workbench it also hides the add new button in the 'Associated View' therefore no records can be added.
How do I do it so that only the + button on the sub grid is hidden and not the other view?
EDIT:
In order to hide the add button, you either need to take away create privileges to the role that the user is in or you could do a hack(unsupported) like this:
function hideAddButton(){
var addButton = $('#NameOfGrid_addImageButton');
if(addButton.size())
addButton.hide();
else
setTimeout(hideAddButton, 1000);//checks every second to see if the button exists yet
}
and call the hideAddButton function on form load
There is one answer that I found. If you have a field that unique for that entity, then you can do it with a simple javascript code.
Here is steps that you must follow in ribbon workbench:
Right click the button and customise button.
Add an enable rule, in Steps section add an Custom Javascript Rule, that contains your library and function name, please make sure that default is true.
This must be in your javascirpt library :
function hideAddNew(){
if(Xrm.Page.getAttribute("yourField")){
return false;
}
else {
return true;
}
}
Add a command that contains the enable rule we created.
Add the command to button.
That's it. I test it, it is working.

The name 'grbFiltro' does not exist in the current context

i want to assaign value to string a according to radio button selection list....for that i used this code but it showing the error...
"The name 'grbFiltro' does not exist in the current context"
This is my code...
IEnumerable<RadioButton> buttons = grbFiltro.Controls.OfType<RadioButton>() ;
foreach (var Button in buttons)
{
if (Button.Checked)
{
//Do Somethingrb
}
}
what is grbFiltro? i searched in google but no satisfied answer....for me
The question which you have posted is based on winforms and not asp.net, the tag which you have given in your question. In the said question, it is talking about a groupbox (I think) which is not available in asp.net. You can achieve a similar functionality though. Check the following links. What made you copy the code in that link in the first place is what intrigues me though.
http://weblogs.asp.net/kencox/archive/2006/09/14/Creating-a-GroupBox-in-ASP.NET.aspx
GroupBox not in toolbox

XAF: How to minimize ribbon from code in XAF Windows App

I want to minimize the ribbon when user click on particular navigation Item.
For example - when User clicks on Dashboard nav item, I want the ribbon minimized, and automatically "maximized" on others.
How can I do that ?
I've found that I can simple access the ribbon in the ViewController.
So like usual in XAF, override "OnActivated" and do the magic there
protected override void OnActivated()
{
if (Frame.Template != null)
{
((XtraFormTemplateBase)Frame.Template)).RibbonTransformer.Ribbon
.Minimized = View.Id == "TestView;
}
base.OnActivated();
}
I got a couple of errors while accessing Frame.Template being NULL when I'd hit a dashboardview, with many nested ListView in it. Make sure You don't forget to check it :)
They released a hotfix for this bug in Devexpress's version 22.1.4. Today I updated to 22.1.4 while getting this error when there was version 22.1.3 and the error was completely resolved.
NullReferenceException is thrown in the MinimizedRibbonPopupForm.GetSizeWithIndents method when the Classic panel style is used

Resources