void XDesktopContainer::saveState() { //save each of the icons for(unsigned int i = 0; i < iconList.size(); i++) saveIcon(iconList[i]); //general config saves DesktopConfig * dConfig = dynamic_cast<DesktopConfig *>(config); dConfig->saveLockState(locked); }
void XDesktopContainer::exeCurrentAction(XIcon * icon) { if (actionConfig->getReload()->isOccuring(currentAction)){ app->restartIdesk(); } if (actionConfig->getLock()->isOccuring(currentAction)) { toggleLock(); DesktopConfig * dConfig = dynamic_cast<DesktopConfig *>(config); dConfig->saveLockState(locked); } if (icon) //make sure icon is not NULL { if (actionConfig->getDrag()->isOccuring(currentAction) && !isLocked() && !icon->isDragging() ) //only start drag if not already occuring icon->dragButtonPress(event); else if (actionConfig->getEndDrag()->isOccuring(currentAction)) icon->dragButtonRelease(event); for (int i = 0; i < icon->getCommandArray().size() && i < actionConfig->getExecuteActions().size(); i++) if (actionConfig->getExecuteAction(i)->isOccuring(currentAction)){ #ifdef HAVE_STARTUP_NOTIFICATION if (sn_display != NULL) { sn_context = sn_launcher_context_new (sn_display, DefaultScreen (display)); if ((sn_context != NULL) && !sn_launcher_context_get_initiated (sn_context)) { sn_launcher_context_set_name (sn_context, icon->getCommand(i).c_str()); sn_launcher_context_set_description (sn_context, icon->getCommand(i).c_str()); sn_launcher_context_set_binary_name (sn_context, icon->getCommand(i).c_str()); sn_launcher_context_set_icon_name(sn_context, icon->getCommand(i).c_str()); sn_launcher_context_initiate (sn_context, icon->getCommand(i).c_str(), icon->getCommand(i).c_str(), event.xproperty.time); } } #endif /*HAVE_STARTUP_NOTIFICATION */ runCommand(icon->getCommand(i)); } } }