aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2016-09-16 19:38:14 +0000
committerWeblate <noreply@weblate.org>2016-09-16 19:38:14 +0000
commit8be77a80c4430b85dae569923c3efc6ed2384472 (patch)
treea972234c061667fcd01fb2d76220567af1abe34f /src-qt5/desktop-utils/lumina-fm/MainUI.cpp
parentTranslated using Weblate (lumina_DESKTOP@fa (generated)) (diff)
parentAdd syntax highlighting for "shell" files (.sh) (diff)
downloadlumina-8be77a80c4430b85dae569923c3efc6ed2384472.tar.gz
lumina-8be77a80c4430b85dae569923c3efc6ed2384472.tar.bz2
lumina-8be77a80c4430b85dae569923c3efc6ed2384472.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm/MainUI.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-fm/MainUI.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
index ea176846..abe14c0d 100644
--- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
@@ -8,6 +8,8 @@
#include "ui_MainUI.h"
#include <QFileInfo>
+#include "gitCompat.h"
+#include "gitWizard.h"
#define DEBUG 0
@@ -21,6 +23,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
ui->setupUi(this);
+ ui->menuGit->setVisible( GIT::isAvailable() );
if(DEBUG){ qDebug() << "Initilization:"; }
settings = new QSettings( QSettings::UserScope, "lumina-desktop", "lumina-fm", this);
@@ -230,6 +233,10 @@ void MainUI::setupIcons(){
ui->actionManage_Bookmarks->setIcon( LXDG::findIcon("bookmarks-organize","") );
ui->actionAdd_Bookmark->setIcon( LXDG::findIcon("bookmark-new","") );
+ //GIT menu
+ ui->actionRepo_Status->setIcon( LXDG::findIcon("git","document-edit-verify") );
+ ui->actionClone_Repository->setIcon( LXDG::findIcon("git","download") );
+
// External Devices menu
ui->actionScan->setIcon( LXDG::findIcon("system-search","") );
}
@@ -606,6 +613,26 @@ void MainUI::CreateBookMark(){
RebuildBookmarksMenu();
}
+//Git Menu options
+void MainUI::on_menuGit_aboutToShow(){
+ QString dir = FindActiveBrowser()->currentDir();
+ bool inrepo = GIT::isRepo(dir);
+ ui->actionRepo_Status->setEnabled( inrepo );
+ ui->actionClone_Repository->setEnabled( !inrepo );
+}
+
+void MainUI::on_actionRepo_Status_triggered(){
+ QString status = GIT::status( FindActiveBrowser()->currentDir() );
+ QMessageBox::information(this, tr("Git Repository Status"), status);
+}
+
+void MainUI::on_actionClone_Repository_triggered(){
+ GitWizard *dlg = new GitWizard(this);
+ dlg->setWorkingDir( FindActiveBrowser()->currentDir() );
+ dlg->show();
+}
+
+
void MainUI::tabChanged(int tab){
if(tab<0){ tab = tabBar->currentIndex(); }
if(tab < 0){ return; }
bgstack15