Changeset 6947


Ignore:
Timestamp:
Aug 24, 2013 10:06:48 PM (15 months ago)
Author:
tboeckel
Message:
  • MUIObjects.c, YAM_COg.c, YAM_MA.c, mui/IdentitiesConfigPage.c: moved some hooks to a more appropriate place.
Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MUIObjects.c

    r6933 r6947  
    5757#include "mui/Recipientstring.h" 
    5858 
     59#include "FolderList.h" 
    5960#include "Locale.h" 
    6061#include "MimeTypes.h" 
     
    862863 
    863864/// 
     865/// PO_Text2ListFunc 
     866//  selects the folder as active which is currently in the 'str' 
     867//  object 
     868HOOKPROTONH(PO_Text2List, BOOL, Object *listview, Object *str) 
     869{ 
     870  char *s; 
     871 
     872  ENTER(); 
     873 
     874  // get the currently set string 
     875  s = (char *)xget(str, MUIA_Text_Contents); 
     876 
     877  if(s != NULL && listview != NULL) 
     878  { 
     879    Object *list = (Object *)xget(listview, MUIA_NListview_NList); 
     880 
     881    // now try to find the node and activate it right away 
     882    DoMethod(list, MUIM_NListtree_FindName, MUIV_NListtree_FindName_ListNode_Root, s, MUIV_NListtree_FindName_Flag_Activate); 
     883  } 
     884 
     885  RETURN(TRUE); 
     886  return TRUE; 
     887} 
     888MakeHook(PO_Text2ListHook, PO_Text2List); 
     889 
     890/// 
     891/// PO_List2TextFunc 
     892//  Copies listview selection to text gadget 
     893HOOKPROTONH(PO_List2TextFunc, void, Object *listview, Object *text) 
     894{ 
     895  Object *list; 
     896 
     897  ENTER(); 
     898 
     899  if((list = (Object *)xget(listview, MUIA_NListview_NList)) != NULL && text != NULL) 
     900  { 
     901    struct MUI_NListtree_TreeNode *tn = (struct MUI_NListtree_TreeNode *)xget(list, MUIA_NListtree_Active); 
     902 
     903    if(tn != NULL && tn->tn_User != NULL) 
     904    { 
     905      struct FolderNode *fnode = (struct FolderNode *)tn->tn_User; 
     906      set(text, MUIA_Text_Contents, fnode->folder->Name); 
     907    } 
     908  } 
     909 
     910  LEAVE(); 
     911} 
     912MakeHook(PO_List2TextHook, PO_List2TextFunc); 
     913 
     914/// 
     915/// PO_Window 
     916// Window hook for popup objects 
     917HOOKPROTONH(PO_Window, void, Object *pop, Object *win) 
     918{ 
     919  ENTER(); 
     920 
     921  set(win, MUIA_Window_DefaultObject, pop); 
     922 
     923  LEAVE(); 
     924} 
     925MakeHook(PO_WindowHook, PO_Window); 
     926 
     927/// 
    864928/// GetMUIString 
    865929// copy the contents of a MUI string object to a string 
  • trunk/src/MUIObjects.h

    r6933 r6947  
    6060extern struct Hook PO_MimeTypeListOpenHook; 
    6161extern struct Hook PO_MimeTypeListCloseHook; 
     62extern struct Hook PO_Text2ListHook; 
     63extern struct Hook PO_List2TextHook; 
     64extern struct Hook PO_WindowHook; 
    6265 
    6366struct MimeTypeCloseObjects 
  • trunk/src/YAM_COg.c

    r6942 r6947  
    136136 
    137137/*** Hooks ***/ 
    138 /// PO_Text2ListFunc 
    139 //  selects the folder as active which is currently in the 'str' 
    140 //  object 
    141 HOOKPROTONH(PO_Text2List, BOOL, Object *listview, Object *str) 
    142 { 
    143   char *s; 
    144  
    145   ENTER(); 
    146  
    147   // get the currently set string 
    148   s = (char *)xget(str, MUIA_Text_Contents); 
    149  
    150   if(s != NULL && listview != NULL) 
    151   { 
    152     Object *list = (Object *)xget(listview, MUIA_NListview_NList); 
    153  
    154     // now try to find the node and activate it right away 
    155     DoMethod(list, MUIM_NListtree_FindName, MUIV_NListtree_FindName_ListNode_Root, s, MUIV_NListtree_FindName_Flag_Activate); 
    156   } 
    157  
    158   RETURN(TRUE); 
    159   return TRUE; 
    160 } 
    161 MakeHook(PO_Text2ListHook, PO_Text2List); 
    162  
    163 /// 
    164 /// PO_List2TextFunc 
    165 //  Copies listview selection to text gadget 
    166 HOOKPROTONH(PO_List2TextFunc, void, Object *listview, Object *text) 
    167 { 
    168   Object *list; 
    169  
    170   ENTER(); 
    171  
    172   if((list = (Object *)xget(listview, MUIA_NListview_NList)) != NULL && text != NULL) 
    173   { 
    174     struct MUI_NListtree_TreeNode *tn = (struct MUI_NListtree_TreeNode *)xget(list, MUIA_NListtree_Active); 
    175  
    176     if(tn != NULL && tn->tn_User != NULL) 
    177     { 
    178       struct FolderNode *fnode = (struct FolderNode *)tn->tn_User; 
    179       set(text, MUIA_Text_Contents, fnode->folder->Name); 
    180     } 
    181   } 
    182  
    183   LEAVE(); 
    184 } 
    185 MakeHook(PO_List2TextHook, PO_List2TextFunc); 
    186  
    187 /// 
    188138/// CO_PlaySoundFunc 
    189139//  Plays sound file referred by the string gadget 
  • trunk/src/YAM_MA.c

    r6893 r6947  
    36483648 
    36493649/*** Hooks ***/ 
    3650 /// PO_Window 
    3651 /*** PO_Window - Window hook for popup objects ***/ 
    3652 HOOKPROTONH(PO_Window, void, Object *pop, Object *win) 
    3653 { 
    3654   ENTER(); 
    3655  
    3656   set(win, MUIA_Window_DefaultObject, pop); 
    3657  
    3658   LEAVE(); 
    3659 } 
    3660 MakeHook(PO_WindowHook, PO_Window); 
    3661  
    3662 /// 
    36633650/// MA_DelKey 
    36643651//  User pressed DEL key 
  • trunk/src/YAM_config.h

    r6946 r6947  
    368368// external hooks 
    369369extern struct Hook CO_PlaySoundHook; 
    370 extern struct Hook PO_Text2ListHook; 
    371 extern struct Hook PO_List2TextHook; 
    372370extern struct Hook CO_OpenHook; 
    373371extern struct Hook CO_RemoteToggleHook; 
  • trunk/src/YAM_main.h

    r6892 r6947  
    357357extern struct Hook MA_RescanIndexHook; 
    358358extern struct Hook MA_SendHook; 
    359 extern struct Hook PO_WindowHook; 
    360359extern struct Hook MA_PopNowHook; 
    361360 
  • trunk/src/mui/IdentitiesConfigPage.c

    r6929 r6947  
    4242 
    4343#include "MailServers.h" 
     44#include "MUIObjects.h" 
    4445#include "Signature.h" 
    4546#include "UserIdentity.h" 
Note: See TracChangeset for help on using the changeset viewer.