summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/shemov.cpp b/shemov.cpp
index cd524ff..1b3aca3 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -90,6 +90,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla
connect(mFSWidget->dirModel(), SIGNAL(layoutChanged()), this, SLOT(setFsFree()));
connect(mFSWidget->dirModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(setFsFree()));
connect(this, SIGNAL(configChanged()), mFSWidget->fileView(), SLOT(readConfig()));
+ connect(mFSWidget, SIGNAL(mounted(bool)), this, SLOT(checkMount(bool)));
QWidget *centralWidget = new QWidget;
centralWidget->setLayout(mainLayout);
@@ -332,6 +333,9 @@ void SheMov::createActions(){
mRenameA = new QAction(tr("Rename file..."), this);
mRenameA->setShortcut(tr("CTRL+r"));
connect(mRenameA, SIGNAL(triggered()), mFSWidget, SLOT(renameFile()));
+ mMountDvdA = new QAction(QIcon(":/diaper.png"), tr("(Un)mount DVD drive"), this);
+ mMountDvdA->setCheckable(true);
+ connect(mMountDvdA, SIGNAL(triggered()), mFSWidget, SLOT(dvdMount()));
mConfigA = new QAction(QIcon(":/chastity_belt.png"), tr("Configure..."), this);
connect(mConfigA, SIGNAL(triggered()), this, SLOT(configure()));
@@ -475,6 +479,8 @@ void SheMov::createMenus(){
mRenameMenuA->setMenu(mRenameMenu);
mEditFSMenu->addAction(mRenameMenuA);
mEditFSMenu->addSeparator();
+ mEditFSMenu->addAction(mMountDvdA);
+ mEditFSMenu->addSeparator();
mEditFSMenu->addAction(mConfigA);
mEditFSMenuA = menuBar()->addMenu(mEditFSMenu);
@@ -628,6 +634,8 @@ void SheMov::createToolBar(){
toolBar->addSeparator();
toolBar->addAction(mHoverPicsA);
toolBar->addAction(mHoverArchiveA);
+ toolBar->addSeparator();
+ toolBar->addAction(mMountDvdA);
addToolBar(Qt::LeftToolBarArea, toolBar);
}
@@ -675,6 +683,16 @@ void SheMov::readSettings(){
mHoverPicsA->setChecked(hoverPics);
bool hoverArchive = s.value("ui/hoverarchive").toBool();
mHoverArchiveA->setChecked(hoverArchive);
+ QString dvdMount = s.value("paths/dvdmount").toString();
+ if(dvdMount.isEmpty()){
+ mMountDvdA->setEnabled(false);
+ }else{
+ if(mFSWidget->isMounted()){
+ mMountDvdA->setChecked(true);
+ }else{
+ mMountDvdA->setChecked(false);
+ }
+ }
}
void SheMov::checkConsistency(){
@@ -693,3 +711,7 @@ void SheMov::toggleHoverPics(bool toggled){
s.setValue("ui/hoverpics", toggled);
emit configChanged();
}
+
+void SheMov::checkMount(bool mounted){
+ mMountDvdA->setChecked(mounted);
+}