// Apply button clicked
void mxpanelorientation::on_buttonApply_clicked()
{
    //read in plugin ID's
    if (ui->radioHorizontalPanel->isChecked()) {
        flipToHorizontal();
        system("sleep .5");
    }

    if (ui->radioVerticalPanel->isChecked()) {
        flipToVertical();
        system("sleep .5");
    }

    if (ui->radioDefaultPanel->isChecked()) {
        restoreDefaultPanel();
        system("sleep .5");
        whichPanel();
    }

    if (ui->radioRestoreBackup->isChecked()) {
        restoreBackup();
        system("sleep .5");
        whichPanel();
    }

    if (ui->radioBackupPanel->isChecked()) {
        backupPanel();
        message();
    }

    // reset gui

    setupUiSelections();

}
Esempio n. 2
0
void PlaylistComponent::saveTemporaryTree(bool * const cancelled)
{
    treeWidget_.assertValidTemporaryTree();
    temporaryTree_->nodesChanged();
    if (treeAutoCleanup_)
        temporaryTree_->cleanUp();
    const bool backedUp = makeBackup();

    QtUtilities::Widgets::HandleErrors handleErrors {
        [&] {
            QtUtilities::makePathTo(qItemsFilename_);
            if (temporaryTree_->save(itemsFilename_))
                return QString();
            if (backedUp)
                restoreBackup();
            return savingFailed();
        }
    };
    if (cancelled == nullptr)
        handleErrors.nonBlocking();
    else
        handleErrors.blocking(inputController_, ioError(), cancelled);
}
Esempio n. 3
0
void backupMenu()
{
    int backupSelected = -1;

        long backupCount = 0;
        char** backupNames = getBackupList(&backupCount);
        if (backupCount > 0)
        {
            while (1)
            {
                 backupSelected  = selectBackup(backupNames, backupCount);

                 if (backupSelected == -1)
                 {
                     return;
                 }

                 if (backupSelected < 0 || backupSelected > backupCount - 1)
                 {
                    printf("\nInvalid option!\n\n");
                 }
                 else
                 {
                     break;
                 }
            }

            restoreBackup(backupNames[backupSelected]);
        }
        else
        {
             printf("No backup was found");
        }
        printf("\n");
        system("PAUSE");
}
Esempio n. 4
0
	bool executeBackupCommand(const std::string& command, const std::vector<std::string>& commandArgs)
	{
		try
		{
			if (command == "backups")
			{
				if (backups_.empty())
				{
					std::cout << "No backups" << std::endl;
				}
				else
				{
					std::cout << "Backups:" << std::endl;
					for (Backup& backup : backups_)
					{
						std::cout << backup.name() << std::endl;
					}
				}
			}
			else if (command == "backup")
			{
				if (commandArgs.empty())
				{
					std::cout << "You need specify backup name" << std::endl;
				}
				else
				{
					const std::string& backupName = commandArgs.at(0);

					createBackup(backupName);
				}
			}
			else if (command == "restore")
			{
				if (commandArgs.empty())
				{
					std::cout << "You need specify backup name" << std::endl;
				}
				else
				{
					const std::string& backupName = commandArgs.at(0);

					restoreBackup(backupName);
				}
			}
			else
			{
				return false;
			}
		}
		catch (const AlreadyExistException& e)
		{
			std::cout << "Exception: " << e.what() << std::endl;
		}
		catch (const DoesntExistException& e)
		{
			std::cout << "Exception: " << e.what() << std::endl;
		}
		catch (const std::exception& e)
		{
			std::cout << "Exception: " << e.what() << std::endl;
		}

		return true;
	}