起步软件技术论坛-X3

 找回密码
 立即注册
搜索
楼主: huixiangtao

【结贴】单独显示一个业务空间时的奇怪问题**

[复制链接]
 楼主| 发表于 2009-5-6 17:24:43 | 显示全部楼层
{ 快捷面板 }
  if (lConfig.ShortcutFuncs <> ShortcutFuncs ) then
    IniFile.WriteString(GetSection, 'ShortcutFuncs', ShortcutFuncs);

  {激活的面板}
  if (lConfig.ActiveDesktopID <> ActiveDesktopID ) then
    IniFile.WriteString(GetSection, 'ActiveDesktopID', ActiveDesktopID);
  { 工作台 }
  if (lConfig.RunFuncs <> RunFuncs ) then
    IniFile.WriteString(GetSection, 'RunFuncs', RunFuncs);

  { 任务相关 }
  if (lConfig.ShowRemindBox <> ShowRemindBox )  then
    IniFile.WriteBool(GetSection, 'ShowRemindBox', ShowRemindBox);
  if (lConfig.RemindTaskOutOfTime <> RemindTaskOutOfTime )  then
    IniFile.WriteBool(GetSection, 'RemindTaskOutOfTime', RemindTaskOutOfTime);
{ 个人运行功能,只对system开放 }
  if (lConfig.DefaultFuncs <> DefaultFuncs )  then
    IniFile.WriteString(GetSection, 'DefaultFuncs', DefaultFuncs);
{ 系统启动时自动运行的服务功能 }
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 17:28:22 | 显示全部楼层
if (lConfig.ServiceFuncs <> ServiceFuncs )  then
    IniFile.WriteString(GetSection, 'ServiceFuncs', ServiceFuncs);
{ 系统运行后在主窗体调运自动运行的功能 }
  if (lConfig.AutoRunFuncs <> AutoRunFuncs )  then
    IniFile.WriteString(GetSection, 'AutoRunFuncs', AutoRunFuncs);
  { 任务提醒方式 }
  if (lConfig.TaskRemindKind <> TaskRemindKind )  then
    IniFile.WriteString(GetSection, 'TaskRemindKind', TaskRemindKind);
  { 提醒刷新任务间隔时间 }
  if (lConfig.CheckRemindTaskTime <> CheckRemindTaskTime )  then
    IniFile.WriteInteger(GetSection, 'CheckRemindTaskTime', CheckRemindTaskTime);
  { 邮箱大小 }
  if (lConfig.MailBoxSize <> MailBoxSize )  then
    IniFile.WriteInteger(GetSection, 'MailBoxSize', MailBoxSize);
  { 自动生成日程间隔时间 }
  if (lConfig.CalendarCreatorTimer <> CalendarCreatorTimer )  then
    IniFile.WriteInteger(GetSection, 'CalendarCreatorTimer', CalendarCreatorTimer);

  if lConfig.Task_ShowDeptFilter <> Task_ShowDeptFilter then
    IniFile.WriteBool(GetSection, 'Task_ShowDeptFilter', Task_ShowDeptFilter);
  if lConfig.Task_UseSuperiorDeptURLs <> Task_UseSuperiorDeptURLs then
    IniFile.WriteBool(GetSection, 'Task_UseSuperiorDeptURLs', Task_UseSuperiorDeptURLs);
  if lConfig.Task_Desktop_IncludeDeptProcess <> Task_Desktop_IncludeDeptProcess then
    IniFile.WriteBool(GetSection, 'Task_Desktop_IncludeDeptProcess', Task_Desktop_IncludeDeptProcess);

  if lConfig.Plan_ShowDeptFilter <> Plan_ShowDeptFilter then
    IniFile.WriteBool(GetSection, 'Plan_ShowDeptFilter', Plan_ShowDeptFilter);

  if lConfig.Project_ShowDeptFilter <> Project_ShowDeptFilter then
    IniFile.WriteBool(GetSection, 'Project_ShowDeptFilter', Project_ShowDeptFilter);

  if lConfig.Doc_IncludeSubordinationAccess <> Doc_IncludeSubordinationAccess then
    IniFile.WriteBool(GetSection, 'Doc_IncludeSubordinationAccess', Doc_IncludeSubordinationAccess);

  if lConfig.RecordSystemLog <> RecordSystemLog then
    IniFile.WriteBool(GetSection, 'RecordSystemLog', RecordSystemLog);
  if lConfig.SystemLogKinds <> SystemLogKinds then
    IniFile.WriteString(GetSection, 'SystemLogKinds', SystemLogKinds);

  if Assigned(FOnSave) then
    FOnSave(Self, IniFile);
end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-6 17:29:25 | 显示全部楼层
{ TConfigChangedNotifyMessage }

constructor TConfigChangedNotifyMessage.Create(AConfig: TBusinessConfig);
begin
  inherited Create(GetName);
  FConfig := AConfig;
end;

static function TConfigChangedNotifyMessage.GetName: string;
begin
  Result := 'Config.Changed.Notify.Message';
end;

{TConfigChangedNotifyMessageHandler }
procedure TConfigChangedNotifyMessageHandler.DoExecute(AMessage: TBizMessage;
  const AParam: THandleParam; var Handled: Boolean);
begin
  if FOnExecute <> nil then
    FOnExecute(Self, AMessage as TConfigChangedNotifyMessage, AParam, Handled);
end;

constructor TConfigChangedNotifyMessageHandler.Create(
  AOnExecute: TConfigChangeOnExecuteEvent);
begin
  inherited Create;
  FOnExecute := AOnExecute;
end;

end.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-7 10:41:11 | 显示全部楼层
期待中~
回复 支持 反对

使用道具 举报

发表于 2009-5-7 11:38:39 | 显示全部楼层
知道怎么回事了,这个虽然你设置了但是他会从系统信息表中去取默认配置,在这里处理不是很合适。
你在标准风格主窗体中根据你的参数在下面的函数中配置一下吧。
procedure TSTANDARDSTYLEMAINFORM.RunAutoRunFuncs;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-7 12:45:59 | 显示全部楼层
procedure TSTANDARDSTYLEMAINFORM.RunAutoRunFuncs;
var
  lAutoRunFuncs: TStrings;
  I: Integer;
begin
  lAutoRunFuncs := TStringList.Create;
  try
    lAutoRunFuncs.Delimiter := ';';
    lAutoRunFuncs.QuoteChar := '''';
    lAutoRunFuncs.DelimitedText := TSettingLib.GetConfig.AutoRunFuncs;
     try
      for I:= 0 to lAutoRunFuncs.Count - 1 do
        RunAutoRunFunc(lAutoRunFuncs[I]);
    except
    end;
  finally
    lAutoRunFuncs.Free;
  end;
end;
这是这个函数的原版,我断点,初始化运行了一下,
lAutoRunFuncs.Count的值是2,
lAutoRunFuncs[0] 是'Biz:\COLLABORATION\TaskRemindFunc.Func'
lAutoRunFuncs[1] 是'Biz:\COLLABORATION\CalendarCreatorFunc.Func' 。
确定是在这个函数中修改吗?,我刚小试了一下,似乎没起作用。
回复 支持 反对

使用道具 举报

发表于 2009-5-7 13:14:38 | 显示全部楼层
哦,应该不是那个,看看这个函数。
procedure TSTANDARDSTYLEMAINFORM.ApplyDesktops;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-7 14:27:37 | 显示全部楼层
procedure TSTANDARDSTYLEMAINFORM.ApplyDesktops;
var
  I: Integer;
  lFuncURL, lParam: string;
  AddFuncs, SL: TStringList;
begin
  AddFuncs := TStringList.Create;
  try
    AddFuncs.Sorted := True;

    SL := TStringList.Create;
    try
      SL.Delimiter := ';';
      SL.QuoteChar := '''';

      SL.DelimitedText := FConfig.RunFuncs;
            for I := 0 to SL.Count - 1 do
      begin
        lFuncURL := SL[I];

        { 功能不需要分配 J := 0; // 干掉警告
        if not TSystemCore.Operator.FuncItems.Find(S, J) then
          Continue; }

        if AddFuncs.IndexOf(lFuncURL) >= 0 then
          Continue;
        AddFuncs.Add(lFuncURL);
        try
          TStringUtils.SplitRunURL(lFuncURL, lFuncURL, lParam);
          AddFunc(lFuncURL, lParam, True);
        except
          on E: Exception do
            TSystemCore.SystemInterface.ShowException(E);
        else
          raise;
        end;
      end;
    finally
      SL.Free;
    end;
  finally
    AddFuncs.Free;
  end;
end;
我设置断点跟踪了一下,发现FConfig.RunFuncs的值是'Biz:\COLLABORATION\CUSTOMDESKTOPFUNC.FUNC;Biz:\COLLABORATION\SCHEDULERFUNC.FUNC';
然后我把SL.DelimitedText := FConfig.RunFuncs;注释了,换成
SL.DelimitedText:='Biz:\COLLABORATION\CUSTOMDESKTOPFUNC.FUNC;Biz:\COLLABORATION\SCHEDULERFUNC.FUNC';  发现一切运行正常。
然后我把上面这句话也注释了,写了一句:
SL.DelimitedText :='Biz:\COLLABORATION\GZTnew.Func;Biz:\COLLABORATION\SCHEDULERFUNC.FUNC';
这时候初始化运行,就报错了,说,我没有运行GZTnew这个功能的权限。
回复 支持 反对

使用道具 举报

发表于 2009-5-7 14:39:21 | 显示全部楼层
那就把这个功能的权限分配给所有的人
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-7 15:17:08 | 显示全部楼层
果然是因为,没有分配功能权限的问题。
我还想问问,之前,我按照你指点的,修改了配置库中的RunFuncs方法所引用的CustomDesktopFunc方法,然后测试运行了一下,这个需求实现了,后来两三天没出问题。
昨天早晨突然一下子,我所做的修改,都不管用了。不知道为什么会这样,之前运行结果是正确的,几天以后就变成错误的了?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-21 16:14 , Processed in 0.040481 second(s), 13 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表