Logo Search packages:      
Sourcecode: acetoneiso version File versions  Download package

status_mounted.h

//This file is part of AcetoneISO. Copyright 2006,2007,2008,2009 Marco Di Antonio and Fabrizio Di Marco (acetoneiso@gmail.com)
//
//    AcetoneISO is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    AcetoneISO is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with AcetoneISO.  If not, see <http://www.gnu.org/licenses/>.



void acetoneiso::status_mounted()
{


QDir Temp = QDir::temp();
Temp.cd("acetoneiso");
QFile f1(Temp.path() + "/1");
QFile f2(Temp.path() + "/2");
QFile f3(Temp.path() + "/3");
QFile f4(Temp.path() + "/4");
QFile f5(Temp.path() + "/5");
QFile f6(Temp.path() + "/6");
QFile f7(Temp.path() + "/7");
QFile dvd_temp(Temp.path() + "/dvd");

bool isomounted = false;
int countdrives = 0;

if (f1.exists())
{
f1.open(QIODevice::ReadOnly);//lo apro in sola lettura
QByteArray s1 = (f1.readAll());
QString str1 = QString::fromUtf8(s1);
f1.close();
listWidget_2->insertItem(1, str1);
isomounted = true;
countdrives = countdrives + 1;
}
if (f2.exists())
{
f2.open(QIODevice::ReadOnly);//lo apro in sola lettura
QByteArray s2 = (f2.readAll());
QString str2 = QString::fromUtf8(s2);
f2.close();
listWidget_2->insertItem(2, str2);
isomounted = true;
countdrives = countdrives + 1;
}
if (f3.exists())
{
f3.open(QIODevice::ReadOnly);//lo apro in sola lettura
QByteArray s3 = (f3.readAll());
QString str3 = QString::fromUtf8(s3);
f3.close();
listWidget_2->insertItem(3, str3);
isomounted = true;
countdrives = countdrives + 1;
}
if (f4.exists())
{
f4.open(QIODevice::ReadOnly);//lo apro in sola lettura
QByteArray s4 = (f4.readAll());
QString str4 = QString::fromUtf8(s4);
f4.close();
listWidget_2->insertItem(4, str4);
isomounted = true;
countdrives = countdrives + 1;
}
if (f5.exists())
{
f5.open(QIODevice::ReadOnly);//lo apro in sola lettura
QByteArray s5 = (f5.readAll());
QString str5 = QString::fromUtf8(s5);
f5.close();
listWidget_2->insertItem(5, str5);
isomounted = true;
countdrives = countdrives + 1;
}
if (f6.exists())
{
f6.open(QIODevice::ReadOnly);//lo apro in sola lettura
QByteArray s6 = (f6.readAll());
QString str6 = QString::fromUtf8(s6);
f6.close();
listWidget_2->insertItem(6, str6);
isomounted = true;
countdrives = countdrives + 1;
}
if (f7.exists())
{
f7.open(QIODevice::ReadOnly);//lo apro in sola lettura
QByteArray s7 = (f7.readAll());
QString str7 = QString::fromUtf8(s7);
f7.close();
listWidget_2->insertItem(7, str7);
isomounted = true;
countdrives = countdrives + 1;

}
if (dvd_temp.exists())
{
dvd_temp.open(QIODevice::ReadOnly);//lo apro in sola lettura
QString str_dvd = (dvd_temp.readAll());
//label_dvd2->setText(tr("DVD-Movie ") + str_dvd + tr(" mounted"));
//display_cover();
//button_saveCover->setVisible(true);
}

//qDebug() << countdrives;

if (countdrives >= 7){
pushButton->setEnabled(false);
actionMount_Image->setEnabled(false);
pushButton->setText(tr("Reached maximum allowed drives to mount.")); 
}
else{
pushButton->setEnabled(true);
actionMount_Image->setEnabled(true);
pushButton->setText(tr("Mount")); 
}


if (isomounted) {
  
  int size = listWidget_2->selectedItems().size();  
  if (size < 1) {
    pushButton_2->setText(tr("Unmount"));
    actionUnmount_Image->setText(tr("Unmount Image"));
     actionUnmount_Image->setEnabled(false);
    pushButton_2->setEnabled(false);
   return; 
  }  
actionUnmount_Image->setEnabled(true);  
pushButton_2->setEnabled(true);
}
else{
actionUnmount_Image->setEnabled(false);
pushButton_2->setEnabled(false);
pushButton_2->setText(tr("Unmount"));
actionUnmount_Image->setText(tr("Unmount Image"));
}

f1.close();
f2.close();
f3.close();
f4.close();
f5.close();
f6.close();
f7.close();
dvd_temp.close();

} 

Generated by  Doxygen 1.6.0   Back to index