Portable mode for windows (#2794)

* Portable mode for windows

* fix start menu in portable mode

* Make gcc an happy puppy

* Clean old installation if we are installing over an old portable mode installation

* Default to Desktop\CockatricePortable

* Settings dialog fixes

* wording
This commit is contained in:
ctrlaltca 2017-07-08 11:22:29 +02:00 committed by GitHub
parent 1565309146
commit 1366e5970e
13 changed files with 217 additions and 86 deletions

View file

@ -130,6 +130,21 @@ GeneralSettingsPage::GeneralSettingsPage()
QPushButton *tokenDatabasePathButton = new QPushButton("...");
connect(tokenDatabasePathButton, SIGNAL(clicked()), this, SLOT(tokenDatabasePathButtonClicked()));
if(settingsCache->getIsPortableBuild())
{
deckPathEdit->setEnabled(false);
replaysPathEdit->setEnabled(false);
picsPathEdit->setEnabled(false);
cardDatabasePathEdit->setEnabled(false);
tokenDatabasePathEdit->setEnabled(false);
deckPathButton->setVisible(false);
replaysPathButton->setVisible(false);
picsPathButton->setVisible(false);
cardDatabasePathButton->setVisible(false);
tokenDatabasePathButton->setVisible(false);
}
QGridLayout *pathsGrid = new QGridLayout;
pathsGrid->addWidget(&deckPathLabel, 0, 0);
pathsGrid->addWidget(deckPathEdit, 0, 1);
@ -273,7 +288,14 @@ void GeneralSettingsPage::retranslateUi()
personalGroupBox->setTitle(tr("Personal settings"));
languageLabel.setText(tr("Language:"));
picDownloadCheckBox.setText(tr("Download card pictures on the fly"));
pathsGroupBox->setTitle(tr("Paths"));
if(settingsCache->getIsPortableBuild())
{
pathsGroupBox->setTitle(tr("Paths (editing disabled in portable mode)"));
} else {
pathsGroupBox->setTitle(tr("Paths"));
}
deckPathLabel.setText(tr("Decks directory:"));
replaysPathLabel.setText(tr("Replays directory:"));
picsPathLabel.setText(tr("Pictures directory:"));