//---------------------------------------------------------------------------- // HRESULT CAnchoAddonService::getActiveWebBrowser(LPUNKNOWN* pUnkWebBrowser) { CComPtr<IWebBrowser2> pWebBrowser; HRESULT hr = FindActiveBrowser(&pWebBrowser); if (FAILED(hr)) { return hr; } return pWebBrowser->QueryInterface(IID_IUnknown, (void**) pUnkWebBrowser); }
void MainUI::goToDevice(QAction *act){ if(act==ui->actionScan){ RebuildDeviceMenu(); }else{ DirWidget *dir = FindActiveBrowser(); if(dir!=0){ dir->ChangeDir(act->whatsThis()); return; } //If no current dir could be found - open a new tab/column OpenDirs(QStringList() << act->whatsThis() ); } }
void MainUI::goToBookmark(QAction *act){ if(act==ui->actionManage_Bookmarks){ BMMDialog dlg(this); dlg.loadSettings(settings); dlg.exec(); RebuildBookmarksMenu(); }else{ //Find the current directory DirWidget *dir = FindActiveBrowser(); if(dir!=0){ dir->ChangeDir(act->whatsThis()); return; } //If no current dir could be found - open a new tab/column OpenDirs(QStringList() << act->whatsThis() ); } }
void MainUI::CreateBookMark(){ QString dir = FindActiveBrowser()->currentDir(); bool ok = false; QString name = QInputDialog::getText(this, tr("New Bookmark"), tr("Name:"), QLineEdit::Normal, dir, \ &ok, 0, Qt::ImhFormattedNumbersOnly | Qt::ImhUppercaseOnly | Qt::ImhLowercaseOnly); if(!ok || name.isEmpty()){ return; } //cancelled QStringList BM = settings->value("bookmarks",QStringList()).toStringList(); if(BM.filter(name+"::::").length() >0){ QMessageBox::warning(this, tr("Invalid Name"), tr("This bookmark name already exists. Please choose another.") ); QTimer::singleShot(0,this, SLOT(on_actionBookMark_triggered())); return; } BM.append(name+"::::"+dir); BM.sort(); //sort alphabetically by name settings->setValue("bookmarks", BM); //Now rebuild the bookmarks menu RebuildBookmarksMenu(); }
void MainUI::on_actionRefresh_triggered(){ DirWidget *cur = FindActiveBrowser(); if(cur!=0){ cur->refresh(); } }
void MainUI::on_actionDelete_Selection_triggered(){ DirWidget *dir = FindActiveBrowser(); if(DEBUG){ qDebug() << "Delete Shortcut Pressed:" << dir << dir->currentDir(); } if(dir!=0){ QTimer::singleShot(0, dir, SLOT(TryDeleteSelection()) ); } }
void MainUI::on_actionSearch_triggered(){ DirWidget *dir = FindActiveBrowser(); if(dir==0){ return; } QProcess::startDetached("lumina-search -dir \""+dir->currentDir()+"\""); }