init_browser.m 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: init_browser.m
  4. Version: 1.1
  5. Type: maki/attrib definitions
  6. Date: 27. Jul. 2007 - 13:36
  7. Author: Martin Poehlmann aka Deimos
  8. E-Mail: [email protected]
  9. Internet: www.skinconsortium.com
  10. www.martin.deimos.de.vu
  11. -----------------------------------------------------
  12. Depending Files:
  13. scripts/browser.maki
  14. -----------------------------------------------------
  15. ---------------------------------------------------*/
  16. #ifndef included
  17. #error This script can only be compiled as a #include
  18. #endif
  19. #include "gen_pageguids.m"
  20. #define CUSTOM_PAGE_BROWSER "{0E17DBEA-9398-49e6-AE6F-3AB17D001DF3}"
  21. #define CUSTOM_PAGE_BROWSER_WASEARCH "{180E87DF-C482-41fe-A570-8575C673E1BA}"
  22. #define CUSTOM_PAGE_BROWSER_CONCERTSEARCH "{B8171DB3-ECF6-40c6-9332-DDEA57A8F13E}"
  23. Function initAttribs_browser();
  24. Class ConfigAttribute SearchAttribute;
  25. Function check (string unknown, SearchAttribute compare);
  26. #ifdef BROWSER_SCRIPT
  27. Global list SearchAttributeList;
  28. #endif
  29. #ifndef BROWSER_SCRIPT
  30. #define SearchAttributeList //
  31. #endif
  32. Global ConfigAttribute browser_scr_show_attrib, browser_search_attrib;
  33. Global SearchAttribute browser_search_winamp_mskins_attrib, browser_search_winamp_cskins_attrib, browser_search_winamp_plugins_attrib,
  34. browser_search_winamp_web_attrib, browser_search_wiki_attrib, browser_c_pollstar_attrib, browser_c_bit_attrib,
  35. browser_c_jambase_attrib;
  36. initAttribs_browser()
  37. {
  38. initPages();
  39. ConfigItem custom_page_browser = addConfigSubMenu(optionsmenu_page, "Browser", CUSTOM_PAGE_BROWSER);
  40. browser_search_attrib = custom_page_nonexposed.newAttribute("Onesie browser Quicksearch", "Web Search");
  41. SearchAttributeList = new List;
  42. SearchAttributeList.addItem (custom_page_browser);
  43. browser_search_winamp_web_attrib = custom_page_browser.newAttribute("Web Search", "1");
  44. SearchAttributeList.addItem (browser_search_winamp_web_attrib);
  45. browser_search_wiki_attrib = custom_page_browser.newAttribute("Wikipedia Search", "0");
  46. SearchAttributeList.addItem (browser_search_wiki_attrib);
  47. ConfigItem custom_page_browser_concertsearch = addConfigSubMenu(custom_page_browser, "Concert Search", CUSTOM_PAGE_BROWSER_CONCERTSEARCH);
  48. browser_c_jambase_attrib = custom_page_browser_concertsearch.newAttribute("JamBase", "0");
  49. SearchAttributeList.addItem (browser_c_jambase_attrib);
  50. browser_c_pollstar_attrib = custom_page_browser_concertsearch.newAttribute("Pollstar", "0");
  51. SearchAttributeList.addItem (browser_c_pollstar_attrib);
  52. browser_c_bit_attrib = custom_page_browser_concertsearch.newAttribute("Bandsintown", "0");
  53. SearchAttributeList.addItem (browser_c_bit_attrib);
  54. ConfigItem custom_page_browser_winampsearch = addConfigSubMenu(custom_page_browser, "Winamp Search", CUSTOM_PAGE_BROWSER_WASEARCH);
  55. browser_search_winamp_mskins_attrib = custom_page_browser_winampsearch.newAttribute("Modern Skins", "0");
  56. SearchAttributeList.addItem (browser_search_winamp_mskins_attrib);
  57. browser_search_winamp_cskins_attrib = custom_page_browser_winampsearch.newAttribute("Classic Skins", "0");
  58. SearchAttributeList.addItem (browser_search_winamp_cskins_attrib);
  59. browser_search_winamp_plugins_attrib = custom_page_browser_winampsearch.newAttribute("Plug-ins", "0");
  60. SearchAttributeList.addItem (browser_search_winamp_plugins_attrib);
  61. addMenuSeparator(custom_page_browser);
  62. browser_scr_show_attrib = custom_page_browser.newAttribute("Show Media Monitor", "1");
  63. }
  64. #ifdef MAIN_ATTRIBS_MGR
  65. browser_search_attrib.onDataChanged ()
  66. {
  67. if (attribs_mychange) return;
  68. string dta = getData();
  69. if (dta == "Modern Skins") browser_search_winamp_mskins_attrib.setData("1");
  70. else if (dta == "Classic Skins") browser_search_winamp_plugins_attrib.setData("1");
  71. else if (dta == "Plug-ins") browser_search_winamp_plugins_attrib.setData("1");
  72. else if (dta == "Web Search with Google") browser_search_winamp_web_attrib.setData("1");
  73. else if (dta == "Pollstar") browser_c_pollstar_attrib.setData("1");
  74. else if (dta == "Bands in Town") browser_c_bit_attrib.setData("1");
  75. else if (dta == "JamBase") browser_c_jambase_attrib.setData("1");
  76. else if (dta == "Wikipedia Search") browser_search_wiki_attrib.setData("1");
  77. }
  78. SearchAttribute.onDataChanged()
  79. {
  80. if (attribs_mychange) return;
  81. NOOFF
  82. attribs_mychange = 1;
  83. String s = SearchAttribute.getAttributeName();
  84. check (s, browser_search_winamp_mskins_attrib);
  85. check (s, browser_search_winamp_cskins_attrib);
  86. check (s, browser_search_winamp_plugins_attrib);
  87. check (s, browser_search_winamp_web_attrib);
  88. check (s, browser_c_jambase_attrib);
  89. check (s, browser_c_bit_attrib);
  90. check (s, browser_c_pollstar_attrib);
  91. check (s, browser_search_wiki_attrib);
  92. attribs_mychange = 0;
  93. }
  94. check (String unknown, SearchAttribute compare)
  95. {
  96. if (unknown == compare.getAttributeName())
  97. {
  98. browser_search_attrib.setData(compare.getAttributeName());
  99. }
  100. else
  101. {
  102. compare.setData("0");
  103. }
  104. }
  105. #endif