Пример #1
0
void g_import_layout(HWND wnd)
{
	pfc::string8 path;
	if (uGetOpenFileName(wnd, "Columns UI Layout (*.fcl)|*.fcl|All Files (*.*)|*.*", 0, "fcl", "Import from", NULL, path, FALSE))
	{
		g_import_layout(wnd, path, false);
	}
}
Пример #2
0
	virtual result on_token(const char * token)
			{
		reset();
		if (!stricmp_utf8_partial(token,"/columnsui:"))
		{
			const char * ptr = strchr(token,':')+1;
			if (!stricmp_utf8(ptr,"help") || !stricmp_utf8(ptr,"?"))
			{
				HWND parent = core_api::get_main_window();
				if (parent) static_api_ptr_t<ui_control>()->activate();//SetActiveWindow(parent);
				uMessageBox(parent,g_help_text,"Columns UI commandline help",0);
				return RESULT_PROCESSED;
			}
			else if (!stricmp_utf8_partial(ptr,"import:"))
			{
				ptr += 7;
				if (*ptr && *ptr =='\"') ptr++;
				unsigned len = strlen(ptr);
				const char * end = strchr(ptr, '\"');
				if (end) len = end-ptr;

				pfc::string8 path(ptr, len);

				HWND parent = core_api::get_main_window();
				if (parent) static_api_ptr_t<ui_control>()->activate();
				if (uMessageBox(parent,uStringPrintf("Are you sure you want to import the %s configuration? Your current configuration will be lost.",pfc::string_filename(path).get_ptr()),"Import configuration?",MB_YESNO) == IDYES)
				{
					pfc::string_extension ext(path);
					if (!stricmp_utf8("fcl", ext))
						g_import_layout(core_api::get_main_window(), path);
					else if (!stricmp_utf8("fcs", ext))
						g_import(path);
				}
				return RESULT_PROCESSED;
			}
			/*else if (!stricmp_utf8_partial(ptr,"export:"))
			{
				ptr += 7;
				if (*ptr && *ptr =='\"') ptr++;
				unsigned len = strlen(ptr);
				const char * end = strchr(ptr, '\"');
				if (end) len = end-ptr;

				pfc::string8 path(ptr, len);
				g_export(path);

				return RESULT_PROCESSED;
			}*/
		}
		return RESULT_NOT_OURS;
	}