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:09 +0000
committerWeblate <noreply@weblate.org>2016-09-16 19:38:09 +0000
commit531690a5121ed0393127eaa7506e57ae5097c338 (patch)
treea4a1eb081ea417d0bdc768d2cabc50d91770f319 /src-qt5/desktop-utils/lumina-fm/MainUI.cpp
parentTranslated using Weblate (lumina_CONFIG@fa (generated)) (diff)
parentAdd syntax highlighting for "shell" files (.sh) (diff)
downloadlumina-531690a5121ed0393127eaa7506e57ae5097c338.tar.gz
lumina-531690a5121ed0393127eaa7506e57ae5097c338.tar.bz2
lumina-531690a5121ed0393127eaa7506e57ae5097c338.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