|
Thats great.. I have been tinkering with an interactive option for the
menu.. It took me a while to figure out how the configure menu is
created, and I figured out a way to dynamically load the css.. I
modified configure.xml (renamed to configure.xml.txt for this post) to
put the new menu items on the configure submenu - load blue, load
silver, load olive etc.. Can you take a peek at it and see if it would be useful or is it not necessary with the new deskband stuff.? It wont hurt my feelings if you say "its junk!'.. Monty Kim Gräsman wrote: Hi Monty, Actually, I think I know a way, but I haven't tested it yet, I didn't want to give anything away :)Apparently there is a callback to deskbands, which I think fires when the Windows theme is changed, so we should be able to match the currently active theme to a lookup table, and adjust the DQSD theme accordingly, one way or another. That'd be a really nice feature... I'm currently struggling with the keyboard handling - I was hoping a custom host would be able to do away with the keyboard hook, but there seems to be some inconsistency in how the taskbar is handling keyboard messages, so I'm not sure it's doable. Kim-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Monty Scroggins Sent: den 5 december 2004 18:12 To: [EMAIL PROTECTED] Subject: Re: [DQSD-Devel] Next-gen? Very cool Kim.. So far so good!.. I like it! Question please - Is there a way we can allow the user to select one of theme css files? Or maybe auto-detect the theme in place and load the associated CSS? The casual user who installs this toolbar but doesnt keep up with the threads will have no idea that there is a color matching color scheme. Also I am not sure the casual user is comfortable finding and copying the css file to implement the scheme.. Monty |
<search function="configureDQSD">
<name>Configure DQSD</name>
<description>
Configure DQSD<br/>
</description>
<link></link>
<category nomenu="true">Configure</category>
<contributor>Brent Beardsley</contributor>
<script><![CDATA[
var CONFIGURE_LOCAL_ALIASES_NAME =
{
en: "Local Aliases..."
};
var CONFIGURE_LOCAL_ALIASES_DESCRIPTION =
{
en: "Edit local aliases"
};
var CONFIGURE_LOCAL_PREFERENCES_NAME =
{
en: "Local Preferences..."
};
var CONFIGURE_LOCAL_PREFERENCES_DESCRIPTION =
{
en: "Edit local preferences"
}
var CONFIGURE_LOCAL_STYLESHEET_NAME =
{
en: "Local Stylesheet..."
}
var CONFIGURE_LOCAL_STYLESHEET_DESCRIPTION =
{
en: "Edit local stylesheet"
}
var CONFIGURE_SYSTEM_ALIASES_NAME =
{
en: "System Aliases..."
};
var CONFIGURE_SYSTEM_ALIASES_DESCRIPTION =
{
en: "Edit system aliases"
};
var CONFIGURE_SYSTEM_PREFERENCES_NAME =
{
en: "System Preferences..."
};
var CONFIGURE_SYSTEM_PREFERENCES_DESCRIPTION =
{
en: "Edit system preferences"
}
var CONFIGURE_RELOAD_DQSD_NAME =
{
en: "Reload..."
};
var CONFIGURE_RELOAD_DQSD_DESCRIPTION =
{
en: "Reload Quick Search Deskbar"
};
var CONFIGURE_RELOAD_DQSD_PROMPT =
{
en: "Are you sure you want to reload the Quick Search Deskbar?"
};
var CONFIGURE_INSTALLED_ADDONS_NAME =
{
en: "Installed Addons"
};
function editSearchFile(strFilename)
{
return editConfigFile(strFilename);
}
function editCSSFile(strFilename)
{
var myEditor = (typeof cssEditorExe != "undefined") ?
cssEditorExe : "notepad";
var install_dir = ".";
if (ensureLauncher())
{
install_dir = DQSDLauncher.InstallationDirectory;
}
var cmd = "\""+myEditor+"\" \""+install_dir+"\\"+strFilename +
"\"";
openDocument(cmd);
return "";
}
function editConfigFile(strFilename)
{
var myEditor = (typeof configureEditorExe != "undefined") ?
configureEditorExe : "notepad";
var install_dir = ".";
if (ensureLauncher())
{
install_dir = DQSDLauncher.InstallationDirectory;
}
var cmd = "\""+myEditor+"\" \""+install_dir+"\\"+strFilename +
"\"";
openDocument(cmd);
return "";
}
function buildConfigureMenu(mb, hmenu)
{
mb.AppendMenuItem( local(CONFIGURE_LOCAL_ALIASES_NAME),
"editConfigFile(\"localaliases.txt\")",
local(CONFIGURE_LOCAL_ALIASES_DESCRIPTION), hmenu);
mb.AppendMenuItem( local(CONFIGURE_LOCAL_PREFERENCES_NAME),
"editConfigFile(\"localprefs.js\")",
local(CONFIGURE_LOCAL_PREFERENCES_DESCRIPTION), hmenu);
mb.AppendMenuItem( local(CONFIGURE_LOCAL_STYLESHEET_NAME),
"editCSSFile(\"localsearch.css\")",
local(CONFIGURE_LOCAL_STYLESHEET_DESCRIPTION), hmenu);
mb.AppendMenuItem( "Load Blue Theme",
"loadcssfile(\"localsearch_blue.css\")", "Load the blue color scheme", hmenu);
mb.AppendMenuItem( "Load Olive Theme",
"loadcssfile(\"localsearch_olive.css\")", "Load the olive color scheme", hmenu);
mb.AppendMenuItem( "Load Silver Theme",
"loadcssfile(\"localsearch_silver.css\")", "Load the silver color scheme",
hmenu);
mb.AppendSeparator(hmenu);
mb.AppendMenuItem( local(CONFIGURE_SYSTEM_ALIASES_NAME),
"editConfigFile(\"aliases.txt\")", local(CONFIGURE_SYSTEM_ALIASES_DESCRIPTION),
hmenu);
mb.AppendMenuItem( local(CONFIGURE_SYSTEM_PREFERENCES_NAME),
"editConfigFile(\"preferences.js\")",
local(CONFIGURE_SYSTEM_PREFERENCES_DESCRIPTION), hmenu);
mb.AppendSeparator(hmenu);
mb.AppendMenuItem( local(CONFIGURE_RELOAD_DQSD_NAME), "if
(confirm('"+local(CONFIGURE_RELOAD_DQSD_PROMPT)+"')) reload();",
local(CONFIGURE_RELOAD_DQSD_DESCRIPTION), hmenu);
ensureLauncher();
var addonFolders =
getFolders(DQSDLauncher.InstallationDirectory+"\\addons\\");
var installedAddons = null;
if (addonFolders != "") {
installedAddons = addonFolders.split('\n');
if (installedAddons.length > 0 && installedAddons[0] ==
".") {
installedAddons = installedAddons.slice(1);
}
} else {
installedAddons = new Array();
}
if (installedAddons.length > 0) {
mb.AppendSeparator(hmenu);
var haddons =
mb.AppendSubMenu(local(CONFIGURE_INSTALLED_ADDONS_NAME)+"
("+installedAddons.length+")", hmenu);
for (var i=0; i < installedAddons.length; i++) {
mb.AppendMenuItem(installedAddons[i], "",
installedAddons[i], haddons);
mb.DisableMenuItem(i, haddons);
}
}
}
function loadcssfile (cssfilename)
{
var install_dir = DQSDLauncher.InstallationDirectory;
link = document.getElementsByTagName( "link" )[ 1 ];
link.href = install_dir+'\\'+cssfilename;
}
function configureDQSD(q)
{
// build the menu
var mb = new ActiveXObject("DQSDTools.MenuBuilder");
if (mb != null) {
// Align the menu with the button
mb.HorizontalAlignment = ( buttonalign == 'left' ? 1 : 2 ); // 1 =
left, 2 = right (default)
var hmenu = 0;
buildConfigureMenu(mb, hmenu);
var fn = mb.Display(document);
if (fn) {
eval(fn);
}
mb = null;
}
}
function configureMenuHook(mb)
{
var confhmenu = mb.InsertSubMenu("Configure", 2);
buildConfigureMenu(mb, confhmenu);
}
registerMenuHook(configureMenuHook);
]]>
</script>
</search>
