diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/Browser.cpp | 4 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp | 6 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/MainUI.cpp | 115 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/MainUI.h | 24 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp | 36 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h | 25 |
6 files changed, 91 insertions, 119 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.cpp b/src-qt5/desktop-utils/lumina-fm/Browser.cpp index 1d57dd8c..adfe6162 100644 --- a/src-qt5/desktop-utils/lumina-fm/Browser.cpp +++ b/src-qt5/desktop-utils/lumina-fm/Browser.cpp @@ -59,7 +59,7 @@ void Browser::loadItem(QString info, Browser *obj){ QByteArray bytes = file.readAll(); file.close(); pix.loadFromData(bytes); - if(bytes.size() > (512*1024) ){ //more than 512 KB + if(pix.width() > 256 || pix.height() > 256 ){ pix = pix.scaled(256,256, Qt::KeepAspectRatio, Qt::SmoothTransformation); } } @@ -117,7 +117,7 @@ void Browser::futureFinished(QString name, QImage icon){ void Browser::loadDirectory(QString dir){ if(dir.isEmpty()){ dir = currentDir; } //reload current directory if(dir.isEmpty()){ return; } //nothing to do - nothing previously loaded - qDebug() << "Load Directory" << dir; + //qDebug() << "Load Directory" << dir; if(currentDir != dir){ //let the main widget know to clear all current items (completely different dir) oldFiles.clear(); emit clearItems(); diff --git a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp index b2ebd476..ec35d521 100644 --- a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp +++ b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp @@ -39,7 +39,7 @@ BrowserWidget::~BrowserWidget(){ void BrowserWidget::changeDirectory(QString dir){ if(BROWSER->currentDirectory()==dir){ return; } //already on this directory - qDebug() << "Change Directory:" << dir << historyList; + //qDebug() << "Change Directory:" << dir << historyList; if( !dir.contains("/.zfs/snapshot/") ){ if(historyList.isEmpty() || !dir.isEmpty()){ historyList << dir; } @@ -49,7 +49,7 @@ void BrowserWidget::changeDirectory(QString dir){ cleaned = cleaned.replace( QRegExp("/\\.zfs/snapshot/(.)+/"), "/" ); if( (historyList.isEmpty() || historyList.last()!=cleaned) && !cleaned.isEmpty() ){ historyList << cleaned; } } - qDebug() << "History:" << historyList; + //qDebug() << "History:" << historyList; emit dirChange(dir); } @@ -364,7 +364,7 @@ void BrowserWidget::itemDataAvailable(QIcon ico, LFileInfo *info){ } void BrowserWidget::itemsLoading(int total){ - qDebug() << "Got number of items loading:" << total; + //qDebug() << "Got number of items loading:" << total; if(listWidget!=0){ listWidget->setWhatsThis( BROWSER->currentDirectory() ); } if(treeWidget!=0){ treeWidget->setWhatsThis(BROWSER->currentDirectory() ); } numItems = total; //save this for later diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp index 73d1420a..ec425dd9 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp @@ -94,7 +94,7 @@ QSize orig = settings->value("preferences/MainWindowSize", QSize()).toSize(); nextTabRShort = new QShortcut( QKeySequence(tr("Shift+Right")), this); togglehiddenfilesShort = new QShortcut( QKeySequence(tr("Ctrl+H")), this); focusDirWidgetShort = new QShortcut( QKeySequence(tr("Ctrl+L")), this); - toggledirtreepaneShort = new QShortcut( QKeySequence(tr("Ctrl+P")), this); + //toggledirtreepaneShort = new QShortcut( QKeySequence(tr("Ctrl+P")), this); //Finish loading the interface workThread->start(); @@ -158,6 +158,7 @@ void MainUI::OpenDirs(QStringList dirs){ connect(DW, SIGNAL(PasteFiles(QString,QStringList)), this, SLOT(PasteFiles(QString, QStringList)) ); connect(DW, SIGNAL(CloseBrowser(QString)), this, SLOT(CloseBrowser(QString)) ); connect(DW, SIGNAL(TabNameChanged(QString,QString)), this, SLOT(TabNameChanged(QString, QString)) ); + connect(DW, SIGNAL(treeWidgetSizeChanged(float)), this, SLOT(treeWidgetWidthChanged(float)) ); //Now create the tab for this //if(radio_view_tabs->isChecked()){ int index = tabBar->addTab( LXDG::findIcon("folder-open",""), dirs[i].section("/",-1) ); @@ -178,11 +179,12 @@ void MainUI::OpenDirs(QStringList dirs){ }*/ //Initialize the widget with the proper settings - DW->setShowDetails(radio_view_details->isChecked()); + DW->setShowDetails(radio_view_details->isChecked()); DW->setThumbnailSize(settings->value("iconsize", 32).toInt()); DW->showHidden( ui->actionView_Hidden_Files->isChecked() ); DW->showThumbnails( ui->actionShow_Thumbnails->isChecked() ); - DW->showDirTreePane( ui->actionView_showDirTreePane->isChecked() ); + //DW->showDirTreePane( ui->actionView_showDirTreePane->isChecked() ); + DW->adjustTreeWidget( settings->value("dirTree_width", 25.0).toFloat() ); //Now load the directory DW->ChangeDir(dirs[i]); //kick off loading the directory info } @@ -256,7 +258,7 @@ void MainUI::setupConnections(){ connect(nextTabRShort, SIGNAL(activated()), this, SLOT( nextTab() ) ); connect(togglehiddenfilesShort, SIGNAL(activated()), this, SLOT( togglehiddenfiles() ) ); connect(focusDirWidgetShort, SIGNAL(activated()), this, SLOT( focusDirWidget() ) ); - connect(toggledirtreepaneShort, SIGNAL(activated()), this, SLOT( toggleDirTreePane() ) ); + //connect(toggledirtreepaneShort, SIGNAL(activated()), this, SLOT( toggleDirTreePane() ) ); } @@ -274,13 +276,13 @@ void MainUI::togglehiddenfiles() on_actionView_Hidden_Files_triggered(); } -void MainUI::toggleDirTreePane() +/*void MainUI::toggleDirTreePane() { //change setChecked to inverse value ui->actionView_Hidden_Files->setChecked( !settings->value("showdirtree", true).toBool() ); // then trigger function on_actionView_showDirTreePane_triggered(); -} +}*/ void MainUI::loadSettings(){ //Note: make sure this is run after all the UI elements are created and connected to slots @@ -289,8 +291,8 @@ void MainUI::loadSettings(){ on_actionView_Hidden_Files_triggered(); //make sure to update the models too ui->actionShow_Thumbnails->setChecked( settings->value("showthumbnails",true).toBool()); on_actionShow_Thumbnails_triggered(); //make sure to update models too - ui->actionView_showDirTreePane->setChecked( settings->value("showdirtree", false).toBool()); - on_actionView_showDirTreePane_triggered(); //make sure to update the models too + //ui->actionView_showDirTreePane->setChecked( settings->value("showdirtree", false).toBool()); + //on_actionView_showDirTreePane_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 @@ -413,7 +415,7 @@ void MainUI::DisplayStatusBar(QString msg){ //qDebug() << "message to show in the status bar:" << msg; ui->statusbar->showMessage(msg); } - + //--------------------- //Menu Actions //--------------------- @@ -445,36 +447,6 @@ void MainUI::on_actionClose_triggered(){ this->close(); } -/*void MainUI::on_actionRename_triggered(){ - DirWidget *dir = FindActiveBrowser(); - if(DEBUG){ qDebug() << "Rename Shortcut Pressed:" << dir << dir->currentDir(); } - if(dir!=0){ QTimer::singleShot(0, dir, SLOT(renameFiles()) ); } -} - -void MainUI::on_actionCut_Selection_triggered(){ - DirWidget *dir = FindActiveBrowser(); - if(DEBUG){ qDebug() << "Cut Shortcut Pressed:" << dir << dir->currentDir(); } - if(dir!=0){ QTimer::singleShot(0, dir, SLOT(cutFiles()) ); } -} - -void MainUI::on_actionCopy_Selection_triggered(){ - DirWidget *dir = FindActiveBrowser(); - if(DEBUG){ qDebug() << "Copy Shortcut Pressed:" << dir << dir->currentDir(); } - if(dir!=0){ QTimer::singleShot(0, dir, SLOT(TryCopySelection()) ); } -} - -void MainUI::on_actionPaste_triggered(){ - DirWidget *dir = FindActiveBrowser(); - if(DEBUG){ qDebug() << "Paste Shortcut Pressed:" << dir << dir->currentDir(); } - if(dir!=0){ QTimer::singleShot(0, dir, SLOT(TryPasteSelection()) ); } -} - -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_actionRefresh_triggered(){ DirWidget *cur = FindActiveBrowser(); if(cur!=0){ cur->refresh(); } @@ -490,20 +462,15 @@ void MainUI::on_actionView_Hidden_Files_triggered(){ } -void MainUI::on_actionView_showDirTreePane_triggered(){ - //worker->showdirtree = ui->actionView_showDirTreePane->isChecked(); - settings->setValue("showdirtree", ui->actionView_showDirTreePane->isChecked()); -//Re-load the current browsers - +void MainUI::treeWidgetWidthChanged(float percent){ + //NOTE: Percent needs to be between 0-75 + if(percent > 75){ percent = 75; } + settings->setValue("dirTree_width", percent); + //Re-load the current browsers + for(int i=0; i<DWLIST.length(); i++){ DWLIST[i]->adjustTreeWidget(percent); } } -/*void MainUI::on_actionShow_Action_Buttons_triggered(){ - bool show = ui->actionShow_Action_Buttons->isChecked(); - settings->setValue("showactions", show); - //for(int i=0; i<DWLIST.length(); i++){ DWLIST[i]->setShowSidebar(show); } -}*/ - void MainUI::on_actionShow_Thumbnails_triggered(){ //Now save this setting for later bool show = ui->actionShow_Thumbnails->isChecked(); @@ -522,7 +489,7 @@ void MainUI::goToBookmark(QAction *act){ }else{ //Find the current directory DirWidget *dir = FindActiveBrowser(); - if(dir!=0){ + if(dir!=0){ dir->ChangeDir(act->whatsThis()); return; } @@ -536,7 +503,7 @@ void MainUI::goToDevice(QAction *act){ RebuildDeviceMenu(); }else{ DirWidget *dir = FindActiveBrowser(); - if(dir!=0){ + if(dir!=0){ dir->ChangeDir(act->whatsThis()); return; } @@ -555,14 +522,14 @@ void MainUI::viewModeChanged(bool active){ for(int i=0; i<DWLIST.length(); i++){ DWLIST[i]->setShowDetails(showDetails); } - + } /*void MainUI::groupModeChanged(bool active){ if(!active){ return; } //on every change, all radio buttons will call this function - only run this once though //bool usetabs = radio_view_tabs->isChecked(); - //if(usetabs){ - //settings->setValue("groupmode","tabs"); + //if(usetabs){ + //settings->setValue("groupmode","tabs"); //Now clean up all the tabs (remove the generic one and add the specific ones) for(int i=0; i<tabBar->count(); i++){ //Remove all the browser tabs @@ -610,7 +577,7 @@ void MainUI::on_actionSmaller_Icons_triggered(){ if(size <= 16){ return; } size -= 16; for(int i=0; i<DWLIST.length(); i++){ DWLIST[i]->setThumbnailSize(size); } - settings->setValue("iconsize", size); + settings->setValue("iconsize", size); } void MainUI::CreateBookMark(){ @@ -666,13 +633,13 @@ void MainUI::tabChanged(int tab){ ui->stackedWidget->setCurrentWidget(ui->page_browser); //if(radio_view_tabs->isChecked()){ for(int i=0; i<DWLIST.length(); i++){ - DWLIST[i]->setVisible(DWLIST[i]->id()==info); + DWLIST[i]->setVisible(DWLIST[i]->id()==info); } /*}else{ //For columns, all widgets need to be visible for(int i=0; i<DWLIST.length(); i++){ - DWLIST[i]->setVisible(true); - } + DWLIST[i]->setVisible(true); + } }*/ } tabBar->setVisible( tabBar->count() > 1 ); @@ -684,7 +651,7 @@ void MainUI::tabClosed(int tab){ QString info = tabBar->tabWhatsThis(tab); if(info=="browser"){ return; } //qDebug() << "Tab Closed:" << info; - if(!info.startsWith("#")){ + if(!info.startsWith("#")){ for(int i=0; i<DWLIST.length(); i++){ if(info == DWLIST[i]->id()){ DWLIST[i]->cleanup(); @@ -711,7 +678,7 @@ void MainUI::prevTab(){ void MainUI::nextTab(){ int cur = tabBar->currentIndex(); if(cur == (tabBar->count()-1) ){ tabBar->setCurrentIndex(0); } - else{ tabBar->setCurrentIndex( cur+1 ); } + else{ tabBar->setCurrentIndex( cur+1 ); } } @@ -763,7 +730,7 @@ void MainUI::OpenImages(LFileInfoList list){ } void MainUI::OpenTerminal(QString dirpath){ - //we use the application defined as the default terminal + //we use the application defined as the default terminal //QSettings sessionsettings( QSettings::UserScope, "LuminaDE","sessionsettings", this); //xterm remains the default QString defTerminal = LXDG::findDefaultAppForMime("application/terminal"); //sessionsettings.value("default-terminal", "xterm").toString(); @@ -825,19 +792,19 @@ void MainUI::PasteFiles(QString dir, QStringList raw){ } if(!dir.endsWith("/")){ dir.append("/"); } for(int i=0; i<raw.length(); i++){ - if(raw[i].startsWith("cut::::")){ + if(raw[i].startsWith("cut::::")){ cut << raw[i].section("::::",1,50); newcut << dir+raw[i].section("::::",1,50).section("/",-1); } - else if(raw[i].startsWith("copy::::")){ - copy << raw[i].section("::::",1,50); + else if(raw[i].startsWith("copy::::")){ + copy << raw[i].section("::::",1,50); newcopy<< dir+raw[i].section("::::",1,50).section("/",-1); } } //bool errs = false; //Perform the copy/move operations //worker->pauseData = true; //pause any info requests - if(!copy.isEmpty()){ + if(!copy.isEmpty()){ qDebug() << "Paste Copy:" << copy << "->" << newcopy; TRAY->StartOperation( TrayUI::COPY, copy, newcopy); /*FODialog dlg(this); @@ -859,7 +826,7 @@ void MainUI::PasteFiles(QString dir, QStringList raw){ //Modify the clipboard appropriately if(!cut.isEmpty()){ //Now clear the clipboard since those old file locations are now invalid - QApplication::clipboard()->clear(); + QApplication::clipboard()->clear(); if(!copy.isEmpty()){ //There were also files copied: save those files back into the clipboard QMimeData *dat = new QMimeData; @@ -920,19 +887,19 @@ void MainUI::RenameFiles(QStringList list){ } void MainUI::RemoveFiles(QStringList list){ - if(list.isEmpty()){ return; } //nothing selected + if(list.isEmpty()){ return; } //nothing selected qDebug() << "Remove Files:" << list; QStringList paths, names; for(int i=0; i<list.length(); i++){ paths << list[i]; names << list[i].section("/",-1); } - + //Verify permanent removal of file/dir QMessageBox dlgQ(QMessageBox::Question, tr("Verify Removal"), tr("WARNING: This will permanently delete the file(s) from the system!")+"\n"+tr("Are you sure you want to continue?"), QMessageBox::Yes | QMessageBox::No, this); dlgQ.setDetailedText(tr("Items to be removed:")+"\n\n"+names.join("\n")); dlgQ.exec(); - if(dlgQ.result() != QMessageBox::Yes){ return; } //cancelled + if(dlgQ.result() != QMessageBox::Yes){ return; } //cancelled //Now remove the file/dir qDebug() << " - Delete: "<<paths; @@ -986,11 +953,11 @@ void MainUI::TrayJobsFinished(){ void MainUI::closeEvent(QCloseEvent *ev){ //See if the tray is active or not first if(TRAY!=0){ - if(TRAY->isVisible() && !waitingToClose){ - this->hide(); - ev->ignore(); + if(TRAY->isVisible() && !waitingToClose){ + this->hide(); + ev->ignore(); waitingToClose = true; - return; + return; } } QMainWindow::closeEvent(ev); //continue normal close routine diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.h b/src-qt5/desktop-utils/lumina-fm/MainUI.h index 84ab5a64..492ba533 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.h @@ -91,18 +91,19 @@ private: bool waitingToClose; QSettings *settings; - QShortcut *nextTabLShort, *nextTabRShort, *togglehiddenfilesShort, *focusDirWidgetShort, *toggledirtreepaneShort; + QShortcut *nextTabLShort, *nextTabRShort, *togglehiddenfilesShort, *focusDirWidgetShort; + //QShortcut *toggledirtreepaneShort; //QCompleter *dirCompleter; //Simplification Functions void setupConnections(); //used during initialization void loadSettings(); //used during initialization - + void RebuildBookmarksMenu(); void RebuildDeviceMenu(); - + DirWidget* FindActiveBrowser(); - + private slots: void slotSingleInstance(QStringList in){ this->show(); @@ -110,9 +111,9 @@ private slots: this->activateWindow(); this->OpenDirs(in); } - + //void slotStartSyncTimer(); - + //Menu Actions void on_actionNew_Window_triggered(); void on_actionNew_Tab_triggered(); @@ -126,9 +127,10 @@ private slots: void on_actionDelete_Selection_triggered();*/ void on_actionRefresh_triggered(); void on_actionView_Hidden_Files_triggered(); - void on_actionView_showDirTreePane_triggered(); + //void on_actionView_showDirTreePane_triggered(); //void on_actionShow_Action_Buttons_triggered(); - void on_actionShow_Thumbnails_triggered(); + void treeWidgetWidthChanged(float percent); + void on_actionShow_Thumbnails_triggered(); void goToBookmark(QAction*); void goToDevice(QAction*); void viewModeChanged(bool); @@ -139,7 +141,7 @@ private slots: //Git Menu options void on_menuGit_aboutToShow(); void on_actionRepo_Status_triggered(); - void on_actionClone_Repository_triggered(); + void on_actionClone_Repository_triggered(); //Tab interactions void tabChanged(int tab = -1); @@ -149,13 +151,13 @@ private slots: //Other Shortcuts void togglehiddenfiles(); - void toggleDirTreePane(); + //void toggleDirTreePane(); void focusDirWidget(); //Backend Info passing //void DirDataAvailable(QString, QString, LFileInfoList); void SnapshotDataAvailable(QString, QString, QStringList); - + //Dir Browser Interactions void OpenPlayer(LFileInfoList); void OpenImages(LFileInfoList); diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp index 6c2d4f35..ab2c023d 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp @@ -16,9 +16,9 @@ #include <QInputDialog> #include <QScrollBar> #include <QSettings> -#include <QtConcurrent/QtConcurrentRun> +#include <QtConcurrent> #include <QFileSystemModel> - +#include <QCompleter> #include <LuminaOS.h> #include <LuminaXDG.h> #include <LUtils.h> @@ -71,7 +71,7 @@ DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new U dirtreeModel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs); // remove extraneous dirs dirtreeModel->setRootPath(folderTreePath); ui->folderViewPane->setModel(dirtreeModel); - ui->splitter->setSizes( QList<int>() << this->width()/3 << 2*this->width()/3); + ui->splitter->setSizes( QList<int>() << this->width()/4 << 3*this->width()/4); ui->folderViewPane->setHeaderHidden(true); ui->folderViewPane->resizeColumnToContents(0); ui->folderViewPane->setColumnHidden(1, true); @@ -83,11 +83,13 @@ DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new U contextMenu = new QMenu(this); cNewMenu = cOpenMenu = cFModMenu = cFViewMenu = cOpenWithMenu = 0; //not created yet connect(contextMenu, SIGNAL(aboutToShow()), this, SLOT(UpdateContextMenu()) ); + connect(ui->splitter, SIGNAL(splitterMoved(int,int)), this, SLOT(splitterMoved()) ); UpdateIcons(); UpdateText(); createShortcuts(); createMenus(); + line_dir->setCompleter(new QCompleter(dirtreeModel, this)); } DirWidget::~DirWidget(){ @@ -112,7 +114,7 @@ void DirWidget::ChangeDir(QString dirpath){ } void DirWidget::setDirCompleter(QCompleter *comp){ - //line_dir->setCompleter(comp); + line_dir->setCompleter(comp); } QString DirWidget::id(){ @@ -131,6 +133,9 @@ void DirWidget::setShowDetails(bool show){ void DirWidget::showHidden(bool show){ BW->showHiddenFiles(show); if(RCBW!=0){ RCBW->showHiddenFiles(show); } + //Also make sure the tree model is showing hidden files as needed + if(show){ dirtreeModel->setFilter(QDir::NoDotAndDotDot | QDir::Hidden | QDir::AllDirs); } + else{ dirtreeModel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs); } } void DirWidget::showThumbnails(bool show){ @@ -148,15 +153,8 @@ void DirWidget::setThumbnailSize(int px){ //==================== // Folder Pane //==================== - -void DirWidget::showDirTreePane(bool show){ - if(show !=showdirtree){ - showdirtree = show; - } -} - -bool DirWidget::showingDirTreePane(){ - return showdirtree; +void DirWidget::adjustTreeWidget(float percent){ + ui->splitter->setSizes( QList<int>() << this->width()*(percent/100.0) << this->width() * ((100.0-percent)/100.0) ); } void DirWidget::on_folderViewPane_clicked(const QModelIndex &index){ @@ -349,6 +347,10 @@ QStringList DirWidget::currentDirFiles(){ // ================= // PRIVATE SLOTS // ================= +void DirWidget::splitterMoved(){ + float percent = (ui->splitter->sizes().first() / ( (float) this->width()) )*100.0; + this->emit treeWidgetSizeChanged(percent); +} //UI BUTTONS void DirWidget::on_tool_zoom_in_clicked(){ @@ -600,17 +602,17 @@ void DirWidget::currentDirectoryChanged(bool widgetonly){ normalbasedir = cur; ui->group_snaps->setVisible(false); emit findSnaps(ID, cur); - qDebug() << "Changed to directory:" << cur; + //qDebug() << "Changed to directory:" << cur; }else{ //Re-assemble the normalbasedir variable (in case moving around within a snapshot) normalbasedir = cur; normalbasedir.replace( QRegExp("\\/\\.zfs\\/snapshot/([^/]+)\\/"), "/" ); - qDebug() << "Changed to snapshot:" << cur << normalbasedir; + //qDebug() << "Changed to snapshot:" << cur << normalbasedir; } ui->actionBack->setEnabled( currentBrowser()->history().length()>1 ); - line_dir->setText(normalbasedir); + line_dir->setText(normalbasedir); emit TabNameChanged(ID, normalbasedir.section("/",-1)); - QModelIndex index = dirtreeModel->index(cur,0); + QModelIndex index = dirtreeModel->index(normalbasedir,0); ui->folderViewPane->setCurrentIndex( index ); ui->folderViewPane->scrollTo(index); } diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h index 20b677d7..284bf337 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h @@ -44,17 +44,16 @@ public: //Information QString id(); QString currentDir(); - QFileSystemModel *dirtreeModel; - QStringList PREFAPPS; + QFileSystemModel *dirtreeModel; + QStringList PREFAPPS; //View Settings void setShowDetails(bool show); void showHidden(bool show); void showThumbnails(bool show); void setThumbnailSize(int px); - void setFocusLineDir(); - void showDirTreePane(bool show); - bool showingDirTreePane(); + void setFocusLineDir(); + void adjustTreeWidget(float percent); //percent between 0-100 @@ -76,7 +75,7 @@ private: QString ID, cBID; //unique ID assigned by the parent, and currently active browser widget QString normalbasedir, snapbasedir, snaprelpath; //for maintaining directory context while moving between snapshots QStringList snapshots, needThumbs, tmpSel; - bool canmodify, showdirtree; + bool canmodify; //The Toolbar and associated items QToolBar *toolbar; @@ -96,7 +95,7 @@ private: BrowserWidget* currentBrowser(); QStringList currentDirFiles(); //all the "files" available within the current dir/browser - QProcess *pExtract; + //QProcess *pExtract; //OpenWithMenu QString fileEXT, filePath; @@ -106,6 +105,7 @@ private: private slots: //UI BUTTONS/Actions + void splitterMoved(); // -- Bottom Action Buttons void on_tool_zoom_in_clicked(); @@ -157,11 +157,11 @@ private slots: void runFiles(); void runWithFiles(); //void attachToNewEmail(); - void autoExtractFiles(); + void autoExtractFiles(); // - Context-specific operations void openInSlideshow(); - void openMultimedia(); + void openMultimedia(); signals: @@ -169,12 +169,13 @@ signals: void OpenDirectories(QStringList); //Directories to open in other tabs/columns void findSnaps(QString, QString); //ID, dirpath (Request snapshot information for a directory) void CloseBrowser(QString); //ID (Request that this browser be closed) + void treeWidgetSizeChanged(float); //percent width //External App/Widget launching void PlayFiles(LFileInfoList); //open in multimedia player void ViewFiles(LFileInfoList); //open in slideshow void LaunchTerminal(QString); //dirpath - + //System Interactions void CutFiles(QStringList); //file selection void CopyFiles(QStringList); //file selection @@ -183,10 +184,10 @@ signals: void RenameFiles(QStringList); //file selection void RemoveFiles(QStringList); //file selection void TabNameChanged(QString, QString); //objID, new tab name - + protected: void mouseReleaseEvent(QMouseEvent *); - + }; #endif |