Skip to content

Commit

Permalink
Merge pull request #119 from SingularSound/Issue108
Browse files Browse the repository at this point in the history
Issue108
  • Loading branch information
iajrz committed Oct 6, 2020
2 parents 5ecce45 + ed3006e commit 4fb58b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 1 addition & 4 deletions BBManagerLean/src/beatspanel/partcolumnwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,6 @@ void PartColumnWidget::slotMainAPUpdated(){

void PartColumnWidget::parentAPBoxStatusChanged(int sigNum, bool hasMain)
{
QVariant labelVatiant = modelIndex().data();
QString label = labelVatiant.toString();

for(int i = 0; i < mp_BeatFileItems->size();i++){
if(justInserted && i == mp_BeatFileItems->size()-1){
//if this fill was recently inserted to this part should reset beat->m_playAt
Expand All @@ -795,7 +792,7 @@ void PartColumnWidget::parentAPBoxStatusChanged(int sigNum, bool hasMain)
mp_BeatFileItems->at(i)->parentAPBoxStatusChanged(sigNum, hasMain);
MIDIPARSER_TrackType trackType = (MIDIPARSER_TrackType)model()->index(modelIndex().row(), AbstractTreeItem::TRACK_TYPE, modelIndex().parent()).data().toInt();
if(trackType != DRUM_FILL){
updateAPText(label.contains("Main") && modelIndex().siblingAtRow(2).model()->rowCount(modelIndex().siblingAtRow(2)) > 0,false,trackType == OUTRO_FILL,sigNum,i);
updateAPText(trackType == MAIN_DRUM_LOOP && modelIndex().siblingAtRow(2).model()->rowCount(modelIndex().siblingAtRow(2)) > 0,false,trackType == OUTRO_FILL,sigNum,i);
}
mp_BeatFileItems->at(i)->setAsNew(false);
}
Expand Down
11 changes: 8 additions & 3 deletions BBManagerLean/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1940,12 +1940,17 @@ bool MainWindow::slotOpenPrj(const QString& default_path)
// 4 - refresh change model
createBeatsModels(projectFileName);
refreshMenus();

qDebug() <<mp_MasterWorkspace->userLibrary()->libProjects()->dir().absolutePath()<<mp_MasterWorkspace->userLibrary()->libProjects()->currentPath();
if (save && QMessageBox::Yes == QMessageBox::question(this, tr("Open Project"), tr("It looks like you are loading a project directly from your SD card.\n\n"
"We highly recommend to save a copy of it on your computer - as this will not only serve as backup in case your SD card gets lost or damaged, "
"but having a copy will also help you work more efficiently in the future, and you will be able to create backup SD cards to keep with you when travelling.\n\n"
"Save a copy of your project now?")/*.arg(mp_fileMenu->title().replace("&", "")).arg(mp_savePrjAs->text().replace("&", ""))*/)) {
slotSavePrjAs();
}else if(mp_MasterWorkspace->userLibrary()->libProjects()->dir().absolutePath() != mp_MasterWorkspace->userLibrary()->libProjects()->currentPath() && QMessageBox::Yes == QMessageBox::question(this, tr("Open Project"), tr("It looks like you are loading a project from a personal directory.\n\n"
"We highly recommend to save a copy of it in the workspace (default) directory."
"It will help you work more efficiently in the future.\n\n"
"Save a copy of your project now?"))){
slotSavePrjAs();
}
return true;
}
Expand Down Expand Up @@ -1982,7 +1987,7 @@ void MainWindow::slotSavePrjAs()
QString defaultFileName = mp_beatsModel->projectFileFI().fileName().replace(QRegularExpression("[ \\\"/<|>:*_?]+"), "_");
// remove extension
defaultFileName = QFileInfo(defaultFileName).baseName();
QDir defaultDir(mp_MasterWorkspace->userLibrary()->libProjects()->currentPath());
QDir defaultDir(mp_MasterWorkspace->userLibrary()->libProjects()->dir().absolutePath());
QFileInfo defaultFI(defaultDir.absoluteFilePath(defaultFileName));

QFileDialog dlg(
Expand All @@ -1991,7 +1996,7 @@ void MainWindow::slotSavePrjAs()
nullptr,
BMFILES_SAVE_PROJECT_DIALOG_FILTER);
dlg.setAcceptMode(QFileDialog::AcceptSave);
dlg.setDirectory(mp_MasterWorkspace->userLibrary()->libProjects()->currentPath());
dlg.setDirectory(mp_MasterWorkspace->userLibrary()->libProjects()->dir().absolutePath());
QString last_dir = defaultFI.absolutePath();
connect(&dlg, &FileDialog::directoryEntered, [&dlg, &last_dir](const QString& name) {
if (!BeatsProjectModel::isProjectFolder(name)) {
Expand Down
Binary file modified Release.zip
Binary file not shown.

0 comments on commit 4fb58b9

Please sign in to comment.