PowerBI-JavaScript: Failed to switch from desktop view to mobile view - powerbi-embedded

To workaround the issue I submitted in separate thread
PowerBI-JavaScript: MobileLandscape layout isn't included in the reports connected from the official samples
I meant to initialize the PowerBI embed with the desktop settings like below.
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: false
}
Then check if MobilePortrait and MobileLandscape layouts are included using the function hasLayout:
If either of them is included, call updateSettings to change the layout from desktop to proper mobile layout
If none are of them is included, keep the desktop layout
However, that appears switch from desktop to mobile layouts isn't supported, the report insist in desktop layout and no error throw, did I miss anything or is this a bug of the PowerBI JS library?
P.S. We're using powerbi-client v2.5.1
Any advice would be much appreciated.

If you'd take a look at (https://github.com/Microsoft/PowerBI-JavaScript/blob/master/src/report.ts#L315), you'd see that there is the URL parameter of isMobile=true added to the embedUrl in the case of mobile layout in the config.
try adding this explicitly in your embedUrl since you're loading the report in desktop and only after that changing to mobile.

Related

How to change language in MB_OKCANCEL buttons text (Windows API) using MessageBoxExW with Python?

I have an application which shows a window with two buttons (Ok and Cancel), I was using it in English, but now I want to show Ok and Cancel button's text in Chinese.
My original code was:
if win32con.IDOK == win32gui.MessageBox(self.hwnd,self.dic.voc["mainwin.quitConfirm"],
self.dic.voc["mainwin.quitConfirmTitle"],
win32con.MB_OKCANCEL):
And now I am trying with MessageBoxExW function, because in the API page says you can use any language in the last parameter (https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messageboxexw).
So now my code is as follows:
lang = win32api.MAKELANGID(4, 2)
if win32con.IDOK ==ctypes.windll.user32.MessageBoxExW(self.hwnd,self.dic.voc["mainwin.quitConfirm"], self.dic.voc["mainwin.quitConfirmTitle"], win32con.MB_YESNO, lang):
But it continues showing the text buttons in English, not in Chinese, I have also set in my computer, in Region and Language, Chinese(Simplified, PRC) in 'Formats' and in 'System Locale'.
And my script is encoded as 'UTF-8'.
When I run this,
locale.getdefaultlocale(["LANGUAGE"])
I obtain,
('zh_CN', 'cp936')
I would appreciate very much any help or clue. Thank you very much.
If you are using Windows 10, you need to install a language pack in Windows for the specified language.
It does NOT have to be the default displayed language, but it needs to be in the installed language packs.
Thank you very much for your help!
In the end I could installed the language package I needed using an app called Vistalizator, because I don't have MUI as I am using Windows 7 Professional (and I couldn't installed it via Microsoft Updates). You only need this app and the language package for the Windows version you are using; you can download both from the same page (https://www.froggie.sk/es/details.html).
In the app you select the downloaded exe file which contains the language package, you change to Express mode and follow the app steps.
At last I can see the text buttons in the language I need and using the MessageBoxExW function, it works! I'm really grateful for your help.

How to create a custom theme for QtCreator

I would like to create and share a free Qt app for easy creation of custom QtCreator themes. My problem though is not the creation of the app itself, but the format of the *.creatortheme file.
I have made a copy of the flat.creatortheme found under Tools\QtCreator\share\qtcreator\themes and since I can't find the names of the variables documented anywhere, I used the trial-and-error approach in order to figure out the meaning of the variables. For the most of them I've succeeded. However for the ones starting with Timeline_ and VcsBase_ I can't see any change in the visual appearence for my setup of the IDE (Qt 5.10.0, MSVC 2017, Windows 7).
So if I make that just for myself, that would be enough, but since I would like to share the app with the rest of you, I think I should cover those values as well.
Does anyone have an experience with this?
Any help will be appreciated.
In the source code of Qt Creator those are listed in the Color enum of the Theme class:
...
/* Timeline Library */
Timeline_TextColor,
Timeline_BackgroundColor1,
Timeline_BackgroundColor2,
Timeline_DividerColor,
Timeline_HighlightColor,
Timeline_PanelBackgroundColor,
Timeline_PanelHeaderColor,
Timeline_HandleColor,
Timeline_RangeColor,
/* VcsBase Plugin */
VcsBase_FileStatusUnknown_TextColor,
VcsBase_FileAdded_TextColor,
VcsBase_FileModified_TextColor,
VcsBase_FileDeleted_TextColor,
VcsBase_FileRenamed_TextColor,
VcsBase_FileUnmerged_TextColor,
...
According to the comments, they are used by the Timeline Library and the VcsBase Plugin.

Websphere Liberty seems to override System Property TransformerFactory set via jvm.options

I am trying to migrate a legacy app that is using camel/cxf (offers some web services that include transformations) to Websphere Liberty 16.0.0.03 (IBM JRE 1.8). Tests are failing because the app uses extensions functions. I tried to disable secure processing as described here.
This change has no effect. That's why I try to switch to Saxon Implementation globally by setting System Property "javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl" in jvm.options config file. Again - this does not work.
While debugging I can see, that com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator$2 is overriding the Property with com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl during Server start. I can see a method "PluginGenerator.revertTransformerFactoryIfNeccessary" in the stack that seems to trigger the change. Afterwards all FactoryFinder.find() will return the non-Saxon implementation.
Can anyone suggest how to either disable secure-processing successfully
or
a way to successfully set a custom TransformerFactory?
BTW: It seems to me like these 2 are bugs - do I report these as regular PMR?
EDIT: possible workaround
As result of the helpful suggestions I added an '#WebListener' that will sets the System Property within the constructor (setting it in contextInitialized is too late as stylesheets seem to be compiled during application start and thus processing fails tests). I bundle this a "patch-jar" with the legacy app.
The Liberty web container plugin generator will only override the xml transformer factory if the IBM JDK is being used.
While the web container performs plugin generation using the IBM JDK, it will swap to an alternate transformer factory, and then reset to the IBM JDK default of which is com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl.
I think it is worth opening a PMR here. The PluginGenerator should not assume that it started with the default xml transformer factory, and should instead save off the value of javax.xml.transform.TransformerFactory and then restore it after plugin generation has completed.
Temp workaround:
Since the PluginGenerator only swaps the XML transformer factory if you're running on the IBM JDK, you could change to an alternate JDK until your PMR gets resolved.
I agree that this is a bug. The official route for reporting problems is a PMR, but there is enough here for us to understand the problem and fix it through our beta program. If you want to get an iFix on a released version of the product (rather than waiting for it to come out via the beta program) then you will need to raise a PMR.

Override nVidia's 3D settings override

My application depends on Antialising - Mode being set to the default Application-controlled. It seems, since nVidia made it (way to) easy to override what an application would attempt to use, a disturbing percentage of users (roughly 1-2%) use non-default settings and then either (1) request support tickets, or (2) allege the application is poorly coded, when things go wrong.
Is there a way to detect or override whether the user is using nVidia's control panel to override settings? This is causing a customer support nightmare for me...
In general: Having user-settings in the driver and letting the apps overide those settings any time would render the user-settings pretty pointless, wouldn't it? Any app would instantly decide what is best on behalf of the user.
That said: https://developer.nvidia.com/nvapi
Looking at NvApiDriverSettings.h I can spot a lot of AA related things:
AA_BEHAVIOR_FLAGS_ID = 0x10ECDB82,
AA_MODE_METHOD_ID = 0x10D773D2,
From what I have read in the docs you might generate an app-profile on the fly. You might have a problem with overriding things the user has set in the profile, but I don't know if that is the case.
I personally would not override any settings done by the user but instead display a warning that the user is running the app with unsupported settings (and thus invalidating his eventual "support tickets"). And, obviously, you have to do that with ATI and at least INTEL gpu-drivers as well.

QML Qt openUrlExternally

I've just discovered strange behavior when using this code
Qt.openUrlExternally(someurl);
I would like to let my users open facebook sharer url,
but I cannot use this code, as it does nothing.
Tested on S60 5th and Symbian^3 devices (C5, C7, 5230, N8)
So please tell me (if you know)
1) Is there any BUG about this component/behavior ? (I searched and didn't found anything)
2) How can i make C++ component to do the same thing ?` (If it is solution)
Thanks
Edit
I found example for creating C++ components with methods accessible to QML, right here: http://doc.qt.io/qt-4.8/qt-declarative-cppextensions-referenceexamples-methods-example.html
Final Edit
Discussion led to making a bug report, could be found on : https://bugreports.qt.io/browse/QTBUG-19201
Thanks everybody
Qt.openUrlExternally("http://www.stackoverflow.com/"); opens the native browser for me.
The only problem I have found with it is, if the browser is already running on the handset (in the background), it will not be brought in to the foreground, and therefore looks as though it has had no effect.
Try adding this to your .pro file
# Needed for bringing browser from background to foreground using QDesktopServices: https://bugreports.qt.io/browse/QTBUG-8336
TARGET.CAPABILITY += SwEvent
And it should bring the browser to the foreground.