I am trying to overload the CFiledialog class to add functionalities as per my need. I am not getting the solution for restricting user from changing folder in certain situation as mentioned below.
When user is attempting to change folder.
I need to check if there any folder is selected or not?
If selected I need to check, if any of the selected folder is containing the desired file or not?
If the selected folder is having the desired file, then in such case I want to disable the change folder functionality.
I have tried to override virtual void OnFolderChange(); function, but call to this function comes after the folder is already changed.
Any suggestion will be greatly appreciated!
Thanks
I overridden the default handler for IDOK(ie Open button). Same as explained in the article in the link below.
http://www.codeguru.com/cpp/controls/toolbar/miscellaneous/article.php/c5497/Adding-Toolbar-button-in-CFileDialog.htm
Related
I have built the chromiumembedded cefsimple project successfully with visual studio. I need to know whether I could implement a custom header bar instead of below.
Eg: with a separate favicon and Title being set as a custom manner .. etc.
Your kind help is really appreciated.
Thank You !
If you are based on CefSimple, take a look at simple_handler_win.cpp. In SimpleHandler::OnTitleChange(), you can set the window title to what you want, instead of what CefSimple wants by changing the SetWindowText() call. This will appear shortly after launch, replacing the app name.
To change the app icons, just replace the icons in the projects cefsimple.rc.
If you want to change them dynamically, that will be a bit more work.
Can anybody tell me which .xml file are using for Insert Link button of General Link field in Sitecore 7.2.
I have tried to update below files but all are not affecting -
Sitecore.Shell.Application.Dialogs.InternalLink-InternalLink.xml
Sitecore.Shell.Application.Dialogs.InsertLink-InsertLink.xml
Sitecore.Shell.Application.Buckets - BucketInternalLink.xml
Sitecore.Shell.Application.Buckets - InsertLink.xml
I think under Buckets folder files are using in case of General Link field with Search
I have tried for all
If I am updating other files like
Sitecore.Shell.Application.Dialogs.ExternalLink - ExternalLink.xml
then it's showing updates in Sitecore but in case of insert link no one files are working.
Thanks in advance
check out my blogpost about fixing the internal link. It might prove difficult to extend but it is possible. At least I have been able to override the class and pass the preLoadPath.
http://reinoudvandalen.nl/blog/fixing-sitecore-7-internal-link-with-speak/
In Sitecore 7.2 the XML Insert Link Dialog is replaced by the new SPEAK UI Dialog. The actual url of the insert link dialog is located on
http://[yourdomain]/sitecore/client/applications/dialogs/InsertLinkViaTreeDialog
The actual file is located in the core database under: /sitecore/client/Applications/Dialogs/InsertLinkViaTreeDialog.
From there you can navigate to the appropriate renderings and modify them (which might affect other windows.
If you want to enable the old style InsertLink that uses the InsertLink.xml you can disable it from /App_Config/Include/Sitecore.Speak.config and remove the following line:
<override dialogUrl="/sitecore/shell/Applications/Dialogs/Internal%20link.aspx" with="/sitecore/client/applications/dialogs/InsertLinkViaTreeDialog" />
I have a QFileDialog prompting the user to select a directory. I am running QT version 4.3.5. I do not have the option of upgrading either.
I want the user to only be able to choose directories that contain two files with specific names. Something along the lines of disabling the "Choose" button if it does not contain these two specific files.
The searching I have done has only led me to ways of filtering the results, which is not what I want to do since the user needs to be able to browse all directories and all sub directories. If a directory is selected, then the check should be made to disable/enable the "Choose" button based on the above criteria.
Like I said, the only half close solutions I have found are explained in this thread QFileDialog for directories that have certain content
or this thread qfiledialog - Filtering Folders?
Both of those half solutions to my question require the use of QFileSystemModel, which wasn't introduced until QT 4.4.
How can I enable/disable the "Choose" button of a QFileDialog with QFileDialog::Directory set as the FileMode based on whether or not the selected/activated directory contains two specific files?
Thanks
You need to copy the file dialog's sources over to your project, modify the name of the class, and start tweaking it. That's the only way, unfortunately.
I have read how to add a contextual menu though registry to all files or files according the extension.
But how can I add a contextual menu that will work ONLY on files of a specific folder (for example on files of folder C:\contmenu)?
Can this be done?
Thanks a lot.
If you're implementing a context menu shell extension, you get the path of the item in your IShellExtInit::Initialize() method. Then you can decide depending on the path whether to add your entries to the context menu or not.
It's not possible to register an extension just for a specific path though.
I am working on the bootstrap application of an installer, and I have a dialogue that the user can open to select a different target directory from the given default. Currently, I'm using the CFolderDialog for that, but for the user to select a folder that doesn't yet exist, he has to create the folder first. Once the user has specified the directory, I want to be able to delete it so that, when I launch the installer, it can create the folder itself such that it gets flagged for uninstall. Also, if the user cancels out of my bootstrap application at any time, I don't want any unwanted folders lying around from when the user mucked around in the folder browser. The problem that I'm having is that, if I try to remove the folder that the user created while browsing for a new target folder, I get a sharing violation error. (I compare the directory's creation time with what the system time was at the time the dialogue was launched to make sure that it's OK for me to delete the directory.)
What I need is either a way to get around that sharing violation or another standard dialogue that doesn't involve the user having to create a new directory in order to specify it just because it doesn't yet exist.
Edit: When I originally posted this, I forgot that the folder dialogue that I'm using is actually the XFolder Dialog on the Code Project site. While it does let the user browse for a directory, it's not as intuitive as folder browser dialogues that I've seen in installers in the past. What I'd really want is something where the user can browse to the folder in which their new folder is to go and then simply append the new folder to the path in the dialogue's edit box without having to create the new folder.
Update As the XFolder dialogue is a customization of the standard Open File dialogue which uses a template, it does not work on Vista or newer OSs. Because of this, I must abandon use of this for something else. I'm still looking for a solution here. If someone can show me how to set the initial directory (as opposed to the root directory) when using SHBrowseForFolder(), I'd be willing to use that as my solution.
For your purpose, it would probably make sense to let the user select a base directory, e.g. "C:\Program Files" (creating one in the process if so desired) and install into a subdirectory of that (a name which you append to the selected path and let your installer create). Display the combined path after the user has selected the base. This way, the user doesn't feel like he has taken on responsibility for the directory you're creating, but still has a reasonable level of control over the destination.
I have never seen such a dialog window, neither in MFC nor in any other technology. I agree with Shog9, you should provide the user with a way to separate the selection of a base directory and the creation of directories.
You can use SHBrowseForFolder without specifying neither BIF_BROWSEINCLUDEFILES or BIF_NONEWFOLDERBUTTON.