aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-03-26 15:22:21 -0400
committerKen Moore <moorekou@gmail.com>2015-03-26 15:22:21 -0400
commitf6891cc964fb3f2b1e769be0aa9b24219cac79c1 (patch)
tree6eda92367dc7e22f701b070d14b28ed82163934d /lumina-fm/MainUI.cpp
parentActually move the file/dir copy onto itself check earlier in the procedure, t... (diff)
parentMerge remote-tracking branch 'upstream/master' into fmNumbers (diff)
downloadlumina-f6891cc964fb3f2b1e769be0aa9b24219cac79c1.tar.gz
lumina-f6891cc964fb3f2b1e769be0aa9b24219cac79c1.tar.bz2
lumina-f6891cc964fb3f2b1e769be0aa9b24219cac79c1.zip
Merge pull request #77 from william-os4y/fmNumbers
include some information about the files in the statusbar
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r--lumina-fm/MainUI.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index 9d66bc36..c4b74dbd 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -12,6 +12,8 @@
#define DEBUG 0
MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
+ //for Signal/slot we must register the Typedef of QFileInfoList
+ qRegisterMetaType<QFileInfoList>("QFileInfoList");
ui->setupUi(this);
if(DEBUG){ qDebug() << "Initilization:"; }
//Be careful about the QSettings setup, it must match the lumina-desktop setup
@@ -214,6 +216,10 @@ void MainUI::setupConnections(){
connect(worker, SIGNAL(ImagesAvailable(QStringList)), this, SLOT(AvailablePictures(QStringList)) );
connect(worker, SIGNAL(MultimediaAvailable(QStringList)), this, SLOT(AvailableMultimediaFiles(QStringList)) );
connect(worker, SIGNAL(SnapshotsAvailable(QString, QStringList)), this, SLOT(AvailableBackups(QString, QStringList)) );
+
+ //Background worker class for statusbar
+ connect(this, SIGNAL(Si_AdaptStatusBar(QFileInfoList, QString, QString)), worker, SLOT(createStatusBarMsg(QFileInfoList, QString, QString)) );
+ connect(worker, SIGNAL(Si_DisplayStatusBar(QString)), this, SLOT(DisplayStatusBar(QString)) );
//Action buttons on browser page
connect(ui->tool_act_run, SIGNAL(clicked()), this, SLOT(OpenItem()) );
@@ -447,8 +453,11 @@ void MainUI::setCurrentDir(QString dir){
if(rawdir == olddir){
emit DirChanged(rawdir); //This will be automatically run when a new dir is loaded
}
+ emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), rawdir, tr("Items"));
if(isUserWritable){ ui->label_dir_stats->setText(""); }
- else{ ui->label_dir_stats->setText(tr("Limited Access Directory")); }
+ else{ ui->label_dir_stats->setText(tr("Limited Access Directory"));
+ }
+
ui->tool_addToDir->setVisible(isUserWritable);
ui->tool_addNewFile->setVisible(isUserWritable);
ui->actionUpDir->setEnabled(dir!="/");
@@ -541,6 +550,11 @@ void MainUI::AvailableBackups(QString basedir, QStringList snapdirs){
ui->tool_goToRestore->setVisible(!snapDirs.isEmpty());
}
+void MainUI::DisplayStatusBar(QString msg){
+ qDebug() << "message to show in the status bar:" << msg;
+ ui->statusbar->showMessage(msg);
+}
+
void MainUI::AvailablePictures(QStringList pics){
if(!pics.isEmpty()){
QString citem = ui->combo_image_name->currentText();
@@ -962,6 +976,10 @@ void MainUI::OpenContextMenu(const QPoint &pt){
void MainUI::ItemSelectionChanged(){
//Enable/disable the action buttons
QFileInfoList sel = getSelectedItems();
+ //display info related to files selected.
+ //TO CHECK: impact if filesystem is very slow
+ if (sel.size()>0) worker->createStatusBarMsg(sel, "", tr("Items selected"));
+
ui->tool_act_run->setEnabled(sel.length()==1);
ui->tool_act_runwith->setEnabled(sel.length()==1);
ui->tool_act_rm->setEnabled(!sel.isEmpty() && isUserWritable);
bgstack15