@@ -26,6 +26,11 @@ sysadm_tray::sysadm_tray() : QSystemTrayIcon(){
26
26
iconTimer = new QTimer (this );
27
27
iconTimer->setInterval (1500 ); // 1.5 seconds
28
28
connect (iconTimer, SIGNAL (timeout ()), this , SLOT (UpdateIcon ()) );
29
+ msgTimer = new QTimer (this );
30
+ msgTimer->setInterval (300 ); // ~1/3 seconds
31
+ msgTimer->setSingleShot (true );
32
+ connect (msgTimer, SIGNAL (timeout ()), this , SLOT (updateMessageMenu ()) );
33
+
29
34
// Load any CORES
30
35
updateCoreList ();
31
36
@@ -246,15 +251,17 @@ void sysadm_tray::ShowMessage(HostMessage msg){
246
251
}
247
252
// Now update the user-viewable menu's
248
253
if (refreshlist){
249
- QTimer::singleShot (10 ,this , SLOT (updateMessageMenu ()) );
254
+ msgTimer->start ();
255
+ // QTimer::singleShot(10,this, SLOT(updateMessageMenu()) );
250
256
}
251
257
}
252
258
253
259
void sysadm_tray::ClearMessage (QString host, QString msg_id){
254
260
// qDebug() << "Clear Message:" << host << msg_id;
255
261
if (MESSAGES.contains (host+" /" +msg_id)){
256
262
MESSAGES.remove (host+" /" +msg_id);
257
- QTimer::singleShot (10 ,this , SLOT (updateMessageMenu ()) );
263
+ msgTimer->start ();
264
+ // QTimer::singleShot(10,this, SLOT(updateMessageMenu()) );
258
265
}
259
266
}
260
267
@@ -271,11 +278,11 @@ void sysadm_tray::MessageTriggered(QAction *act){
271
278
MESSAGES.insert (keys[i],msg);
272
279
}
273
280
}
274
- QTimer::singleShot ( 10 , this , SLOT ( updateMessageMenu ()) );
281
+ msgTimer-> start ( );
275
282
}else if (MESSAGES.contains (act->whatsThis ())){
276
283
// Open the designated host
277
284
HostMessage msg = MESSAGES[act->whatsThis ()];
278
- QTimer::singleShot ( 10 , this , SLOT ( updateMessageMenu ()) );
285
+ msgTimer-> start ( );
279
286
if (act->whatsThis ().section (" /" ,-1 )==" updates" ){ OpenCore (msg.host_id , " page_updates" ); }
280
287
else if (act->whatsThis ().section (" /" ,-1 )==" pkg" ){ OpenCore (msg.host_id , " page_pkg" ); }
281
288
else if (act->whatsThis ().count (" /" )==2 ){ OpenCore (msg.host_id , " page_" +act->whatsThis ().section (" /" ,1 ,1 )); } // Life Preserver Message
@@ -304,6 +311,7 @@ void sysadm_tray::updateMessageMenu(){
304
311
}else if ( acts[i]->whatsThis ()!=" clearall" && !acts[i]->whatsThis ().isEmpty () ) {
305
312
// qDebug() << " - Remove Action";
306
313
msgMenu->removeAction (acts[i]);
314
+ acts[i]->deleteLater ();
307
315
}
308
316
}
309
317
// Now add in any new messages
0 commit comments