aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-02-23 13:08:33 -0500
committerKen Moore <ken@pcbsd.org>2015-02-23 13:08:33 -0500
commitc65a4f358f20f3709d1ebc4e9d2f7931252a50e8 (patch)
tree89e92babda9ce245fe8565029b527105704e41eb /lumina-fm/MainUI.cpp
parentUpdate the ROADMAP to 1.0.0-Release (diff)
downloadlumina-c65a4f358f20f3709d1ebc4e9d2f7931252a50e8.tar.gz
lumina-c65a4f358f20f3709d1ebc4e9d2f7931252a50e8.tar.bz2
lumina-c65a4f358f20f3709d1ebc4e9d2f7931252a50e8.zip
Add an option in lumina-fm to enable/disable loading file thumbnails.
NOTE: This option does not retroactively remove thumbnails that have already been loaded - it only prevents loading thumbnails in new directories.
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r--lumina-fm/MainUI.cpp64
1 files changed, 62 insertions, 2 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index 1b01a855..76b0d7d4 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -282,9 +282,11 @@ void MainUI::loadSettings(){
//Note: make sure this is run after all the UI elements are created and connected to slots
// but before the first directory gets loaded
ui->actionView_Hidden_Files->setChecked( settings->value("showhidden", false).toBool() );
- on_actionView_Hidden_Files_triggered(); //make sure to update the models too
+ on_actionView_Hidden_Files_triggered(); //make sure to update the models too
ui->actionShow_Action_Buttons->setChecked(settings->value("showactions", true).toBool() );
- on_actionShow_Action_Buttons_triggered(); //make sure to update the UI
+ on_actionShow_Action_Buttons_triggered(); //make sure to update the UI
+ ui->actionShow_Thumbnails->setChecked( settings->value("showthumbnails", true).toBool() );
+ iconProv->showthumbnails = ui->actionShow_Thumbnails->isChecked();
QString view = settings->value("viewmode","details").toString();
if(view=="icons"){ radio_view_icons->setChecked(true); }
else if(view=="list"){ radio_view_list->setChecked(true); }
@@ -417,6 +419,7 @@ void MainUI::setCurrentDir(QString dir){
//Update the directory viewer and update the line edit
keepFocus = !currentDir->hasFocus();
currentDir->setWhatsThis(dir); //save the full path internally
+ fsmod->setRootPath(rawdir);
if(radio_view_details->isChecked()){
ui->tree_dir_view->setRootIndex(fsmod->index(dir));
ui->tree_dir_view->selectionModel()->clearSelection();
@@ -469,6 +472,40 @@ QFileInfoList MainUI::getSelectedItems(){
return out;
}
+/*QModelIndexList MainUI::getVisibleItems(){
+ QModelIndexList out;
+ if(radio_view_details->isChecked()){
+ QModelIndex index = ui->tree_dir_view->indexAt(QPoint(0,0));
+ while( index.isValid()){
+ if(index.column()!=0){
+ //move on - multiple index's per row when we only need one
+ }else if(ui->tree_dir_view->viewport()->rect().contains( ui->tree_dir_view->visualRect(index) ) ){
+ //index within the viewport - add it to the list
+ out << index;
+ }else{
+ break; //index not in the viewport
+ }
+ index = ui->tree_dir_view->indexBelow(index); //go to the next
+ if(out.contains(index)){ break; } //end of the list
+ }
+
+ }else{
+ QModelIndex index = ui->list_dir_view->indexAt(QPoint(0,0));
+ while( index.isValid()){
+ if(ui->list_dir_view->viewport()->rect().contains( ui->list_dir_view->visualRect(index) ) ){
+ //index within the viewport - add it to the list
+ out << index;
+ }else{
+ break; //index not in the viewport
+ }
+ index = ui->list_dir_view->indexBelow(index); //go to the next
+ if(out.contains(index)){ break; } //end of the list
+ }
+
+ }
+ return out;
+}*/
+
//==============
// PRIVATE SLOTS
//==============
@@ -646,6 +683,18 @@ void MainUI::on_actionShow_Action_Buttons_triggered(){
ui->group_actions->setVisible(ui->actionShow_Action_Buttons->isChecked());
settings->setValue("showactions", ui->actionShow_Action_Buttons->isChecked());
}
+
+void MainUI::on_actionShow_Thumbnails_triggered(){
+ //Now save this setting for later
+ settings->setValue("showthumbnails", ui->actionShow_Thumbnails->isChecked());
+ //Set the value in the icon provider
+ iconProv->showthumbnails = ui->actionShow_Thumbnails->isChecked();
+ //Now make sure the filesystem model knows to re-load the image data
+ fsmod->revert();
+ //Re-load the view widget
+ setCurrentDir(getCurrentDir());
+}
+
void MainUI::goToBookmark(QAction *act){
if(act==ui->actionManage_Bookmarks){
BMMDialog dlg(this);
@@ -759,6 +808,17 @@ void MainUI::reloadDirectory(){
setCurrentDir( getCurrentDir() );
}
+/*void MainUI::viewportChanged(){
+ if( !ui->actionsShow_Thumbnails->isChecked()){ return; }
+ QModelIndexList list = getVisibleItems();
+ for(int i=0; i<list.length(); i++){
+ if( !ui->actionsShow_Thumbnails->isChecked()){ return; } //break out as necessary
+ if( imgFilter.contains("*."+fsmod->filePath(list[i]).section("/",-1).section(".",-1).toLower()){
+ fmod->
+ }
+ }
+}*/
+
void MainUI::currentDirectoryLoaded(){
//The directory was just loaded: refresh the action buttons as neccesary
ui->tool_goToPlayer->setVisible(false);
bgstack15