diff options
author | Ken Moore <ken@pcbsd.org> | 2015-03-12 20:50:43 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-03-12 20:50:43 -0400 |
commit | 0864314ca2083ad584323997e1eabc570125d2a1 (patch) | |
tree | af2c529549b5ee78ea49946ff5add5c4eb962d18 /lumina-fm/MainUI.cpp | |
parent | Change the icon used for the "favorite files" button. Now it matches the User... (diff) | |
download | lumina-0864314ca2083ad584323997e1eabc570125d2a1.tar.gz lumina-0864314ca2083ad584323997e1eabc570125d2a1.tar.bz2 lumina-0864314ca2083ad584323997e1eabc570125d2a1.zip |
Add Checksum support for FreeBSD, and tie it into lumina-fm.
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r-- | lumina-fm/MainUI.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index c9b651fa..df5c898a 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -938,6 +938,7 @@ void MainUI::OpenContextMenu(const QPoint &pt){ contextMenu->addAction(LXDG::findIcon("run-build-configure",""), tr("Open With..."), this, SLOT(OpenItemWith()) ); } contextMenu->addAction(LXDG::findIcon("edit-rename",""), tr("Rename"), this, SLOT(RenameItem()) )->setEnabled(info.isWritable()); + contextMenu->addAction(LXDG::findIcon("document-encrypted",""), tr("View Checksums"), this, SLOT(ChecksumItems()) ); contextMenu->addSeparator(); } bool hasSelection = !getSelectedItems().isEmpty(); @@ -1463,8 +1464,25 @@ void MainUI::PasteItems(){ QApplication::clipboard()->setMimeData(dat); } } - ItemSelectionChanged(); - + ItemSelectionChanged(); +} + +void MainUI::ChecksumItems(){ + if(ui->stackedWidget->currentWidget()!=ui->page_browser){ return; } + QFileInfoList sel = getSelectedItems(); + if(sel.isEmpty()){ return; } + QStringList info, files; + for(int i=0; i<sel.length(); i++){ + files << sel[i].absoluteFilePath(); + } + qDebug() << "Run Checksums:" << files; + info = LOS::Checksums(files); + qDebug() << " - Info:" << info; + if(info.isEmpty() || (info.length() != files.length()) ){ return; } + for(int i=0; i<info.length(); i++){ + info[i] = QString("%2\t(%1)").arg(files[i].section("/",-1), info[i]); + } + QMessageBox::information(this, tr("File Checksums"), info.join("\n") ); } void MainUI::resizeEvent(QResizeEvent *event){ |