// ===================== // PRIVATE SLOTS // ===================== void LDesktop::UpdateMenu(){ qDebug() << " - Update Menu"; deskMenu->clear(); //Add in the system applications menu deskMenu->addAction(LXDG::findIcon("utilities-terminal",""), tr("Terminal"), this, SLOT(SystemTerminal()) ); deskMenu->addMenu( LSession::applicationMenu() ); deskMenu->addSeparator(); deskMenu->addMenu( LSession::settingsMenu() ); //Now add the system quit options deskMenu->addSeparator(); deskMenu->addAction(LXDG::findIcon("system-log-out",""), tr("Log Out"), this, SLOT(SystemLogout()) ); }
void LDesktop::UpdateMenu(bool fast){ if(DEBUG){ qDebug() << " - Update Menu:" << desktopnumber; } //Put a label at the top int num = LSession::handle()->XCB->CurrentWorkspace(); //LX11::GetCurrentDesktop(); if(DEBUG){ qDebug() << "Found workspace number:" << num; } if(num < 0){ workspacelabel->setText( "<b>"+tr("Lumina Desktop")+"</b>"); } else{ workspacelabel->setText( "<b>"+QString(tr("Workspace %1")).arg(QString::number(num+1))+"</b>"); } if(fast && usewinmenu){ UpdateWinMenu(); } if(fast){ return; } //already done deskMenu->clear(); //clear it for refresh deskMenu->addAction(wkspaceact); deskMenu->addSeparator(); //Now load the user's menu setup and fill the menu QStringList items = settings->value("menu/itemlist", QStringList()<< "terminal" << "filemanager" <<"applications" << "line" << "settings" ).toStringList(); usewinmenu=false; for(int i=0; i<items.length(); i++){ if(items[i]=="terminal"){ deskMenu->addAction(LXDG::findIcon("utilities-terminal",""), tr("Terminal"), this, SLOT(SystemTerminal()) ); } else if(items[i]=="filemanager"){ deskMenu->addAction( LXDG::findIcon("Insight-FileManager",""), tr("Browse System"), this, SLOT(SystemFileManager()) ); } else if(items[i]=="applications"){ deskMenu->addMenu( LSession::handle()->applicationMenu() ); } else if(items[i]=="line"){ deskMenu->addSeparator(); } else if(items[i]=="settings"){ deskMenu->addMenu( LSession::handle()->settingsMenu() ); } else if(items[i]=="windowlist"){ deskMenu->addMenu( winMenu); usewinmenu=true;} else if(items[i].startsWith("app::::") && items[i].endsWith(".desktop")){ //Custom *.desktop application QString file = items[i].section("::::",1,1).simplified(); bool ok = false; XDGDesktop xdgf = LXDG::loadDesktopFile(file, ok); if(ok){ deskMenu->addAction( LXDG::findIcon(xdgf.icon,""), xdgf.name)->setWhatsThis(file); }else{ qDebug() << "Could not load application file:" << file; } } } //Now add the system quit options deskMenu->addSeparator(); if(!desktoplocked){ deskMenu->addAction(LXDG::findIcon("document-encrypt",""),tr("Lock Desktop"), this, SLOT(ToggleDesktopLock()) ); deskMenu->addAction(LXDG::findIcon("snap-orthogonal",""),tr("Snap Plugins to Grid"), this, SLOT(AlignDesktopPlugins()) ); }else{ deskMenu->addAction(LXDG::findIcon("document-decrypt",""),tr("Unlock Desktop"), this, SLOT(ToggleDesktopLock()) ); } deskMenu->addSeparator(); deskMenu->addAction(LXDG::findIcon("system-log-out",""), tr("Log Out"), this, SLOT(SystemLogout()) ); }
void LDesktop::UpdateMenu(){ qDebug() << " - Update Menu:" << desktopnumber; deskMenu->clear(); //Put a label at the top int num = LX11::GetCurrentDesktop(); qDebug() << "Found desktop number:" << num; if(num < 0){ workspacelabel->setText( "<b>"+tr("Lumina Desktop")+"</b>"); } else{ workspacelabel->setText( "<b>"+QString(tr("Workspace %1")).arg(QString::number(num+1))+"</b>"); } deskMenu->addAction(wkspaceact); deskMenu->addSeparator(); //Add in the system applications menu deskMenu->addAction(LXDG::findIcon("utilities-terminal",""), tr("Terminal"), this, SLOT(SystemTerminal()) ); deskMenu->addMenu( LSession::applicationMenu() ); deskMenu->addSeparator(); deskMenu->addMenu( LSession::settingsMenu() ); //Now add the system quit options deskMenu->addSeparator(); deskMenu->addAction(LXDG::findIcon("system-log-out",""), tr("Log Out"), this, SLOT(SystemLogout()) ); }