Пример #1
0
void NotifyArea::read_config()
{
	bool clock_visible = true;

	 // read notification icon settings from XML configuration
	XMLPos cfg_pos = g_Globals.get_cfg();

#ifndef __MINGW32__	// SHRestricted() missing in MinGW (as of 29.10.2003)
	if (!g_Globals._SHRestricted || !SHRestricted(REST_HIDECLOCK))
#endif
	{
		if (cfg_pos.go_down("desktopbar")) {
			clock_visible = XMLBoolRef(XMLPos(cfg_pos,"options"), "show-clock", !get_hide_clock_from_registry());
			cfg_pos.back();
		}
	}

	if (cfg_pos.go_down("notify-icons")) {
		XMLPos options(cfg_pos, "options");

		_hide_inactive = XMLBool(options, "hide-inactive", true);	///@todo read default setting from registry
		_show_hidden = XMLBool(options, "show-hidden", false);	///@todo read default setting from registry
		_show_button = XMLBool(options, "show-button", true);

		XMLChildrenFilter icons(cfg_pos, "icon");

		for(XMLChildrenFilter::iterator it=icons.begin(); it!=icons.end(); ++it) {
			const XMLNode& node = **it;

			NotifyIconConfig cfg;

			cfg._name = node.get("name").c_str();
			cfg._tipText = node.get("text").c_str();
			cfg._windowTitle = node.get("window").c_str();
			cfg._modulePath = node.get("module").c_str();
			const string& mode = node.get("show");

			if (mode == "show")
				cfg._mode = NIM_SHOW;
			else if (mode == "hide")
				cfg._mode = NIM_HIDE;
			else //if (mode == "auto")
				cfg._mode = NIM_HIDE;

			_cfg.push_back(cfg);
		}

		cfg_pos.back();
	}

	show_clock(clock_visible);
}
Пример #2
0
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
{
	ExplorerCmd cmd;

	if (g_Globals._hMainWnd) {
		if (IsIconic(g_Globals._hMainWnd))
			ShowWindow(g_Globals._hMainWnd, SW_RESTORE);
		else
			SetForegroundWindow(g_Globals._hMainWnd);

		return;
	}

	g_Globals._prescan_nodes = false;

	XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
	XS_String mdiStr = XMLString(explorer_options, "mdi");

	 // If there isn't yet the "mdi" setting in the configuration, display the MDI/SDI dialog.
	if (mdiStr.empty())
		Dialog::DoModal(IDD_MDI_SDI, WINDOW_CREATOR(MdiSdiDlg), g_Globals._hwndDesktop);

	 // Now read the MDI attribute again and interpret it as boolean value.
	cmd._mdi = XMLBool(explorer_options, "mdi", true);

	cmd._cmdShow = cmdShow;

	 // parse command line options, which may overwrite the MDI flag
	if (lpCmdLine)
		cmd.ParseCmdLine(lpCmdLine);

	 // create main window
	MainFrameBase::Create(cmd);
}