Permalink
Browse files

Added popup command.

  • Loading branch information...
1 parent 64e4fbd commit 7a87a60f017d05cbd6740596fa0bbf7693c9a5ea @hluk committed Jul 29, 2012
Showing with 13 additions and 0 deletions.
  1. +1 −0 src/include/scriptable.h
  2. +12 −0 src/scriptable.cpp
View
@@ -85,6 +85,7 @@ public slots:
QScriptValue separator();
void action();
+ void popup();
void exporttab();
void importtab();
View
@@ -57,6 +57,8 @@ const char *const helpString =
" action [ROWS=0...] [PROGRAM [SEPARATOR=\\n]]\n"
" Run PROGRAM on item text in the rows.\n"
" Use %1 in PROGRAM to pass text as argument.\n"
+" popup TITLE MESSAGE [TIME=8000]\n"
+" Show tray popup message for TIME milliseconds.\n"
"\n"
" exporttab FILE_NAME Export items to file.\n"
" importtab FILE_NAME Import items from file.\n"
@@ -569,6 +571,16 @@ void Scriptable::action()
}
}
+void Scriptable::popup()
+{
+ QString title = arg(0);
+ QString message = arg(1);
+ int msec;
+ if ( !toInt(argument(2), msec) )
+ msec = 8000;
+ m_wnd->showMessage(title, message, QSystemTrayIcon::Information, msec);
+}
+
void Scriptable::exporttab()
{
const QString &fileName = arg(0);

0 comments on commit 7a87a60

Please sign in to comment.