summaryrefslogtreecommitdiff
path: root/plugins/Watrack/popup/pop_opt.inc
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 18:43:29 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 18:43:29 +0000
commit864081102a5f252415f41950b3039a896b4ae9c5 (patch)
treec6b764651e9dd1f8f53b98eab05f16ba4a492a79 /plugins/Watrack/popup/pop_opt.inc
parentdb5149b48346c417e18add5702a9dfe7f6e28dd0 (diff)
Awkwars's plugins - welcome to our trunk
git-svn-id: http://svn.miranda-ng.org/main/trunk@1822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/popup/pop_opt.inc')
-rw-r--r--plugins/Watrack/popup/pop_opt.inc81
1 files changed, 81 insertions, 0 deletions
diff --git a/plugins/Watrack/popup/pop_opt.inc b/plugins/Watrack/popup/pop_opt.inc
new file mode 100644
index 0000000000..591063923e
--- /dev/null
+++ b/plugins/Watrack/popup/pop_opt.inc
@@ -0,0 +1,81 @@
+{Popup options saving-loading}
+
+const
+ defPopupTitle = 'Now listening to';
+ defPopupText = '%artist% - %title%';
+ defAltPopupTitle = 'Now ?ifgreater(%width%,0,watching,listening to)';
+ defAltPopupText = '%artist% - %title%'#13#10'?iflonger(%album%,0, (from "%album%"),)';
+const
+ opt_ModStatus :PAnsiChar = 'module/popups';
+
+ opt_PopUpFile :PAnsiChar = 'popup/file';
+ opt_PopUpAction :PAnsiChar = 'popup/action';
+ opt_PopUpFore :PAnsiChar = 'popup/fore';
+ opt_PopUpBack :PAnsiChar = 'popup/back';
+ opt_PopUpPause :PAnsiChar = 'popup/time';
+ opt_PopUpDelay :PAnsiChar = 'popup/delay';
+ opt_PopUpColor :PAnsiChar = 'popup/color';
+ opt_ByRequest :PAnsiChar = 'popup/byrequest';
+ opt_PopTitle :PAnsiChar = 'popup/poptitle';
+ opt_PopText :PAnsiChar = 'popup/poptext';
+ opt_PopUpButtons:PAnsiChar = 'popup/usebuttons';
+
+ spref = 'strings/';
+
+function GetModStatus:integer;
+begin
+ result:=DBReadByte(0,PluginShort,opt_ModStatus,1);
+end;
+
+procedure SetModStatus(stat:integer);
+begin
+ DBWriteByte(0,PluginShort,opt_ModStatus,stat);
+end;
+
+procedure loadpopup;
+var
+ def1,def2:pWideChar;
+begin
+ PopUpButtons:=DBReadByte (0,PluginShort,opt_PopUpButtons,BST_CHECKED);
+ PopUpFile :=DBReadByte (0,PluginShort,opt_PopUpFile ,BST_CHECKED);
+ PopUpPause :=DBReadByte (0,PluginShort,opt_PopUpPause ,0);
+ PopUpDelay :=DBReadByte (0,PluginShort,opt_PopUpDelay ,0);
+ PopUpAction :=DBReadWord (0,PluginShort,opt_PopUpAction ,0);
+ PopUpColor :=DBReadByte (0,PluginShort,opt_PopUpColor ,0);
+ PopUpFore :=DBReadDWord(0,PluginShort,opt_PopUpFore ,GetSysColor(COLOR_BTNTEXT));
+ PopUpBack :=DBReadDWord(0,PluginShort,opt_PopUpBack ,GetSysColor(COLOR_BTNFACE));
+ PopRequest :=DBReadByte (0,PluginShort,opt_ByRequest ,BST_UNCHECKED);
+ if isVarsInstalled then
+ begin
+ def1:=defAltPopupTitle;
+ def2:=defAltPopupText;
+ end
+ else
+ begin
+ def1:=defPopupTitle;
+ def2:=defPopupText;
+ end;
+ PopTitle:=DBReadUnicode(0,PluginShort,opt_PopTitle,def1);
+ PopText :=DBReadUnicode(0,PluginShort,opt_PopText ,def2);
+end;
+
+procedure savepopup;
+begin
+ DBWriteByte (0,PluginShort,opt_PopUpButtons,PopUpButtons);
+ DBWriteByte (0,PluginShort,opt_PopUpFile ,PopUpFile);
+ DBWriteByte (0,PluginShort,opt_PopUpPause ,PopUpPause);
+ DBWriteByte (0,PluginShort,opt_PopUpDelay ,PopUpDelay);
+ DBWriteWord (0,PluginShort,opt_PopUpAction ,PopUpAction);
+ DBWriteByte (0,PluginShort,opt_PopUpColor ,PopUpColor);
+ DBWriteDWord (0,PluginShort,opt_PopUpFore ,PopUpFore);
+ DBWriteDWord (0,PluginShort,opt_PopUpBack ,PopUpBack);
+ DBWriteByte (0,PluginShort,opt_ByRequest ,PopRequest);
+ DBWriteUnicode(0,PluginShort,opt_PopTitle,PopTitle);
+ DBWriteUnicode(0,PluginShort,opt_PopText ,PopText);
+end;
+
+procedure freepopup;
+begin
+ mFreeMem(PopTitle);
+ mFreeMem(PopText);
+end;